diff --git a/README.md b/README.md index ed3fe1a..97b7462 100644 --- a/README.md +++ b/README.md @@ -41,16 +41,24 @@ ffplay rtsp://localhost/live/test ```yaml rtsp: publish: - pubaudio: true - pubvideo: true - kickexist: false - publishtimeout: 10 - waitclosetimeout: 0 + pubaudio: true # 是否发布音频流 + pubvideo: true # 是否发布视频流 + kickexist: false # 剔出已经存在的发布者,用于顶替原有发布者 + publishtimeout: 10s # 发布流默认过期时间,超过该时间发布者没有恢复流将被删除 + delayclosetimeout: 0 # 自动关闭触发后延迟的时间(期间内如果有新的订阅则取消触发关闭),0为关闭该功能,保持连接。 + waitclosetimeout: 0 # 发布者断开后等待时间,超过该时间发布者没有恢复流将被删除,0为关闭该功能,由订阅者决定是否删除 + buffertime: 0 # 缓存时间,用于时光回溯,0为关闭缓存 subscribe: - subaudio: true - subvideo: true - iframeonly: false - waittimeout: 10 + subaudio: true # 是否订阅音频流 + subvideo: true # 是否订阅视频流 + subaudioargname: ats # 订阅音频轨道参数名 + subvideoargname: vts # 订阅视频轨道参数名 + subdataargname: dts # 订阅数据轨道参数名 + subaudiotracks: [] # 订阅音频轨道名称列表 + subvideotracks: [] # 订阅视频轨道名称列表 + submode: 0 # 订阅模式,0为跳帧追赶模式,1为不追赶(多用于录制),2为时光回溯模式 + iframeonly: false # 只订阅关键帧 + waittimeout: 10s # 等待发布者的超时时间,用于订阅尚未发布的流 pull: repull: 0 pullonstart: {} diff --git a/publisher.go b/publisher.go index 69229f0..d4bfe57 100644 --- a/publisher.go +++ b/publisher.go @@ -49,7 +49,7 @@ func (p *RTSPPublisher) SetTracks() error { vt.WriteSliceBytes(f.PPS) } case *format.MPEG4Audio: - at := NewAAC(p.Stream, f.PayloadType()) + at := NewAAC(p.Stream, f.PayloadType(), uint32(f.ClockRate())) p.Tracks[track] = at at.SizeLength = f.SizeLength if f.Config.Type == mpeg4audio.ObjectTypeAACLC {