FFmpeg - 从 rtsp 服务器流式传输到 rtmp 服务器 - 丢失包
我正在尝试使用 FFmpeg 将视频从 rtsp 服务器流式传输到 rtmp 服务器。 尝试了我的命令的多个参数:
ffmpeg.exe -re -i "rtsp://10.65.28.251:11442/video/live" -pix_fmt yuv420p -codec:v libx264 -tune animation -preset fast -crf 23 -maxrate 4M -bufsize 8M -f flv "rtmp://10.65.58.21:1935/rec/XB"
ffmpeg.exe -re -i "rtsp://10.65.28.251:11442/video/live" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f flv "rtmp://10.65.52.131:1935/rec/XB
如图所示,我丢失了很多包。我对 FFmpeg 还很陌生,所以我很确定我以某种方式弄乱了参数。
我的目标是在 rtmp 上获得最低 30fps 的视频,并尽可能减少丢失的包。如果需要的话,降低视频质量就可以了。
知道我做错了什么吗?
谢谢!
I'm trying to stream a video from a rtsp server to a rtmp one using FFmpeg.
Tried multiple arguments for my command :
ffmpeg.exe -re -i "rtsp://10.65.28.251:11442/video/live" -pix_fmt yuv420p -codec:v libx264 -tune animation -preset fast -crf 23 -maxrate 4M -bufsize 8M -f flv "rtmp://10.65.58.21:1935/rec/XB"
ffmpeg.exe -re -i "rtsp://10.65.28.251:11442/video/live" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f flv "rtmp://10.65.52.131:1935/rec/XB
I'm loosing a lot of packages as seen in the picture. I'm pretty new to FFmpeg so I'm pretty sure I'm messing up the parameters somehow.
My goal is to get a video on rtmp with min 30fps and as least lost packages as possible. If needed a downsize of the video quality would be fine.
Any idea what I'm doing wrong?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 kesh 上面指出的那样,删除 -re 会产生很大的不同。我最终得到了这个命令,它在 30 fps 下保持了相当好的质量。
As kesh pointed above removing -re made a big difference. I ended up with this command which holds pretty good quality at 30fps.
您正在通过 UDP 拉取 RTSP 流。
尝试 'ffmpeg -rtsp_flags Preferred_tcp -rtsp_transport tcp -i rtsp://some_rtsp_url' 强制通过 TCP 拉取 rtsp 流
You are pulling RTSP stream over UDP.
try 'ffmpeg -rtsp_flags prefer_tcp -rtsp_transport tcp -i rtsp://some_rtsp_url' to force pull rtsp streams over TCP