使用 FFMPEG 将音频(带有偏移量)添加到视频
我有一个 10 分钟的视频和一个 50 分钟的音频 mp3。 视频从音频第 500 秒开始。 使用 FFMPEG,如何将音频添加到视频中,但指定500 秒音频偏移(以便它们同步)?
编辑:
在此页面的底部,它建议如何指定一个偏移量。
$ ffmpeg -i video_source -itsoffet delay -i audio_source -map 0:x -map 1:y .......
但是,当我应用它时,它仍然从头开始播放音频。
I have a 10 minute video and a 50 minute audio mp3.
The video starts at 500 seconds into the audio.
Using FFMPEG, how can I add the the audio to the video but specify a 500 seconds audio offset (So that they sync up)?
EDIT:
Down the bottom of this page it suggests how to specify an offset.
$ ffmpeg -i video_source -itsoffet delay -i audio_source -map 0:x -map 1:y .......
However, when I apply this, it still starts the audio from the start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
8 年后,
-itsoffset
确实起作用了。正如您的链接页面中所示:
请注意,您放置了
-itsoffset
在您想要延迟的输入之前切换,在这种情况下,input_2
将被延迟。因此,如果视频稍后开始,您可以在视频输入之前添加
-itsoffset 00:08:20
。We are 8 years later, and the
-itsoffset
does work.Exactly as in your linked page:
Note that you place the
-itsoffset
switch before the input you want to delay, in this caseinput_2
will be delayed.So in your case that the video starts later, you would add
-itsoffset 00:08:20
before the video input.我也无法让音频正确偏移,一些搜索表明
-itsoffset
当前为 损坏。您可以尝试在旧版本的 ffmpeg 崩溃之前获取/编译它(这听起来不太有趣)。
或者,您可以使用 sox 之类的内容填充音频,并添加必要的静音,然后组合:
I couldn't get audio to offset properly either, and some searching suggests that
-itsoffset
is currently broken.You could try and get/compile an old version of ffmpeg before it broke (which doesn't sound like much fun).
Alternately, you could pad your audio with the necessary silence using something like sox and then combine: