FFMPEG:在直播流上的音频和视频之间的同步问题
我将NGINX RTMP用作RTMP服务器和FFMPEG作为实时流的客户端。当我使用以下命令将RTMP服务器连接到RTMP服务器时,我将获得一个输出文件,该输出文件包含慢速运动近5秒。但是声音还可以。
ffmpeg -re -i rtmp://somertmp -c copy -f flv rtmp://a.rtmp.youtube.com/live2/sometoken -f flv output.mp4
如前一个示例所示,我将流传递到YouTube,同时我得到了一个副本。 YouTube不会显示缓慢的动作,但是当我使用ffplay
打开文件时,我可以看到有问题的帧。
我想修复这些缓慢的动作,并使其与ffmpeg同步,或者如果不可能,我想告诉FFMPEG将这些慢帧与音频频道一起剪切,因此视频和音频将同步。
几天来,我试图找到解决这个问题的解决方案,但不幸的是,我做不到。任何帮助将不胜感激。
I am using NGINX RTMP as an RTMP server and FFMPEG as a client for live stream. When I connect to the RTMP server with the following command, I get an output file that contains slow motion for almost 5 seconds. But the sound is OK.
ffmpeg -re -i rtmp://somertmp -c copy -f flv rtmp://a.rtmp.youtube.com/live2/sometoken -f flv output.mp4
As the preceding example shows, I deliver the stream to youtube and at the same time, I get a copy. Youtube does not show slow motions but when I open the file with ffplay
I can see the problematic frames.
I want to fix these slow motions and make it synced with audio with ffmpeg or if not possible I want to tell ffmpeg to cut those slow frames along with audio channel so video and audio would be synced.
For days, I am trying to find a solution for this problem but unfortunately, I could not. Any help will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案。在nginx rtmp side上
Interleave
和wait_key
应启用指令。I found the solution. On Nginx RTMP side
interleave
andwait_key
directives should be enabled.