FFMPEG-在视频中添加暂停

时间:2017-03-09 09:06:24

标签: ffmpeg

是否可以使用ffmpeg在视频文件中添加多个暂停?例如:我想从第5秒开始添加3秒的暂停,然后从第17秒开始暂停8秒。音频文件同步不是问题,只需按指定的间隔暂停。 感谢。

2 个答案:

答案 0 :(得分:0)

将循环过滤器与时间轴编辑结合使用'启用'参数。 应该允许你制作一个过滤器,它可以循环一个帧3秒,但只有在输出时间戳介于3到5秒之间时才会启用。

https://ffmpeg.org/ffmpeg-filters.html#loop

https://ffmpeg.org/ffmpeg-filters.html#Timeline-editing

答案 1 :(得分:0)

如果我之前的回答不起作用,您可能需要剪切源视频,然后将其覆盖在空白画布上。使用-filter_complex参数传入您构造的过滤器图。

https://ffmpeg.org/ffmpeg-filters.html

the 'color' filter will give you a blank canvas with a 5 second duration
the 'trim' filter will allow you to get a stream containing only the first 3 seconds
the 'overlay' filter will allow you to overlay the first 3 seconds of footage onto the blank canvas repeating the last frame

这将为您提供第一个场景

the 'concat' filter will allow you to join the scenes together

you can also use 'select' (see ffmpeg timeline editing)
to exclude the first 3 seconds of the source video for the second scene.
(You may need to import the same source video file twice
 so you can reference it as [0:v] to make the first scene 
 and [1:v] to make the second scene in the filtergraph if you run into problems.)
相关问题