diff --git a/README.en.md b/README.en.md index 96660f5..bb117a3 100644 --- a/README.en.md +++ b/README.en.md @@ -52,7 +52,7 @@ rtsp: rtcpaddr: :8001 readbuffercount: 2048 writebuffercount: 2048 - pullprotocol: 'auto' # auto, tcp, udp + pullprotocol: tcp # auto, tcp, udp ``` :::tip Configuration override publish and subscribe, any section not configured will use global configuration. @@ -65,6 +65,7 @@ Get all RTSP streams ### `rtsp/api/pull?target=[RTSP address]&streamPath=[Stream identity]&save=[0|1|2]` Pull the RTSP to m7s from a remote server -save meaning: 0, do not save; 1, save to pullonstart; 2, save to pullonsub +- save meaning: 0, do not save; 1, save to pullonstart; 2, save to pullonsub +- The RTSP address needs to be urlencoded to prevent special characters from affecting parsing ### `rtsp/api/push?target=[RTSP address]&streamPath=[Stream identity]` Push local streams to remote servers \ No newline at end of file diff --git a/README.md b/README.md index 35c29fe..0bb6882 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ rtsp: rtcpaddr: :8001 readbuffercount: 2048 # 读取缓存队列大小 writebuffercount: 2048 # 写出缓存队列大小 - pullprotocol: 'auto' # auto, tcp, udp + pullprotocol: tcp # auto, tcp, udp ``` :::tip 配置覆盖 publish @@ -63,6 +63,7 @@ subscribe ### `rtsp/api/pull?target=[RTSP地址]&streamPath=[流标识]&save=[0|1|2]` 从远程拉取rtsp到m7s中 -save含义:0、不保存;1、保存到pullonstart;2、保存到pullonsub +- save含义:0、不保存;1、保存到pullonstart;2、保存到pullonsub +- RTSP地址需要进行urlencode 防止其中的特殊字符影响解析 ### `rtsp/api/push?target=[RTSP地址]&streamPath=[流标识]` 将本地的流推送到远端 \ No newline at end of file diff --git a/publisher.go b/publisher.go index 31a5594..81c8bc4 100644 --- a/publisher.go +++ b/publisher.go @@ -1,6 +1,8 @@ package rtsp import ( + "strings" + "github.com/bluenviron/gortsplib/v3/pkg/formats" "github.com/bluenviron/gortsplib/v3/pkg/media" "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" @@ -81,8 +83,7 @@ func (p *RTSPPublisher) SetTracks() error { } p.Tracks[track] = p.AudioTrack default: - rtpMap, _ := forma.Marshal() - rtpMap = strings.ToLower(rtpMap) + rtpMap := strings.ToLower(forma.RTPMap()) if strings.Contains(rtpMap, "pcm") { isMulaw := false if strings.Contains(rtpMap, "pcmu") { @@ -96,7 +97,7 @@ func (p *RTSPPublisher) SetTracks() error { p.Tracks[track] = p.AudioTrack } else { p.Error("unknown format", zap.Any("format", f.String())) - } + } } } }