ffmpeg adding play image to thumbnail output [dupl

2019-04-15 07:19发布

问题:

This question already has an answer here:

  • How to add transparent watermark in center of a video with ffmpeg? 1 answer

Hey all I am currently able to get a thumbnail capture from my MP4 video by doing the following command line:

       [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

Now as I said above, this command works just fine in producing a thumbnail of the first frame of my MP3 video. However, I am needing to place an overlay image of a "play" button on top of that newly created frame image.

Is there another command that i can tell it to overlay another image on top of frame.png?

The image I would like to overlay on top of the frame looks like this (a transparent PNG):

Any help would be great! Thanks!

回答1:

This command should do the job for you:

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

Refer the overlay video filter documentation for more details.