我已经访问了 MediaMtx 的官方 github 页面text
docker run --rm -it --network=host aler9/rtsp-simple-server
paths:
proxied:
# url of the source stream, in the format rtsp://user:pass@host:port/path
source: rtsp://original-url
docker run --rm -it --network=host -v $PWD/mediamtx.yml:/mediamtx.yml aler9/rtsp-simple-server
cmd := exec.Command("ffmpeg", "-rtsp_transport", "tcp", "-re", "-i", "rtsp://localhost:8854/proxied", "-c:v", "copy", "-f", "segment", "-segment_time", "300", "-segment_format", "mp4", "-segment_list", "recordings/playlist.m3u8", "-segment_list_entry_prefix", "recordings/", "-nostdin", "recordings/output-%03d.mp4")
我在哪里及时将流存储为 mp4 文件。我尝试将用户身份验证(rtsp://user:pass@host:port/path)添加到 yml 的路径部分,希望这是问题所在
paths:
all:
readUser: user
readPass: userpass
但这似乎没有用。由于我是 RTSP 协议的新手,不知道应该研究哪个方向。希望这总结了我的问题。