ffmpeg将播放图像添加到缩略图输出

时间:2014-08-26 04:45:24

标签: image video image-processing ffmpeg video-processing

嘿,我现在可以通过执行以下命令行从我的MP4视频中获取缩略图:

       [Sets Per-file main options time_off start time offset]
       || [The # of start time offsets]
       || || [Sets input video file option]
       || || ||   [Video file name here]
       || || ||   ||         [Sets video option to # of video frames to record]        
       || || ||   ||         ||     [Asking for the first frame]
       || || ||   ||         ||     ||  [Name of the captured video frame]
       || || ||   ||         ||     ||  ||
       \/ \/ \/   \/         \/     \/  \/
ffmpeg -ss 0 -i vidfile.mp4 -vframes 1 frame.png

正如我上面所说,这个命令可以很好地生成我的MP3视频第一帧的缩略图。但是,我需要在新创建的帧图像的顶部放置一个“播放”按钮的叠加图像。

是否有另一个命令,我可以告诉它在frame.png上面叠加另一个图像?

我想叠加在画面顶部的图像看起来像这样(透明的PNG):

enter image description here

任何帮助都会很棒!谢谢!

1 个答案:

答案 0 :(得分:6)

此命令应该为您完成任务:

ffmpeg -ss 30 -i movie.mp4 -i play.png -filter_complex \
"[0:v][1:v]overlay=main_w/2-overlay_w/2:main_h/2-overlay_h/2" \
-vframes 1 output.png

有关详细信息,请参阅the overlay video filter documentation