FFMPEG:在直播流上的音频和视频之间的同步问题

发布于 2025-01-29 19:30:15 字数 505 浏览 3 评论 0原文

我将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你是年少的欢喜 2025-02-05 19:30:15

我找到了解决方案。在nginx rtmp side上Interleavewait_key应启用指令。

I found the solution. On Nginx RTMP side interleave and wait_key directives should be enabled.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文