ffmpeg将播放图像添加到缩略图输出 [英] ffmpeg adding play image to thumbnail output

查看:243
本文介绍了ffmpeg将播放图像添加到缩略图输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  [设置每个文件主选项time_off开始时间偏移] 
|| [开始时间偏移量]
|| || [设置输入视频文件选项]
|| || || [这里的视频文件名]
|| || || || [将视频选项设置为要录制的视频帧数]
|| || || || || [请求第一帧]
|| || || || || || [拍摄的视频帧的名称]
|| || || || || || ||
\ / \ / \ / \ / \ / \ / \ /
ffmpeg -ss 0 -i vidfile.mp4 -vframes 1 frame.png

现在正如我上面所说,这个命令在制作我的MP3视频的第一帧的缩略图时很正常。但是,我需要在新创建的帧图像的顶部放置一个播放按钮的叠加图像。



是否有另一个命令,我可以告诉它覆盖frame.png顶部的另一个图像?



我想覆盖在框架顶部的图像看起来像这样(透明的PNG):





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

解决方案

这个命令应该为你做这个工作:

  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



<有关详细信息,请参阅重叠式视频过滤器文档


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!

解决方案

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.

这篇关于ffmpeg将播放图像添加到缩略图输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆