带有渐隐和渐隐的ffmpeg叠加图像 [英] ffmpeg overlay image with fade in and fade out

查看:108
本文介绍了带有渐隐和渐隐的ffmpeg叠加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个PNG叠加在视频上,并且效果很好,现在我希望以前工作的png只显示一定的时间,然后淡入淡出.

So I had a PNG overlay a video, and this was working perfectly, now I want the same png that worked previously only show for a certain duration, and have it fade in and fade out.

但是我的新命令没有图像,而在过去它有图像.

But my new command just has no image, where in the past it had the image.

能否请您提供帮助,也许我只是尝试不正确.

Can you please assist, maybe I am just attempting it incorrectly.

ffmpeg.exe -i "20180523152257.mp4" -i "20180523152257.mp4.png" -filter_complex "[1:v]format=rgba,fade=in:st=1:d=3:alpha=1,fade=out:st=6:d=3:alpha=1 [ovr]; [0][ovr] overlay" -codec:a copy "OUT.mp4"

推荐答案

使用

ffmpeg -i "20180523152257.mp4" -loop 1 -t 9 -i "20180523152257.mp4.png" ...

ffmpeg将单个图像视为一帧视频,但是对于动画效果,您需要足够的帧来应用效果. loop 选项告诉ffmpeg无限重复图像,而 -t 9 将其限制为9秒,即淡出结束.

A single image is treated by ffmpeg as a video of one frame, but for animated effects, you need enough frames to apply the effect. The loop option tells ffmpeg to repeat the image indefinitely and -t 9 limits it to 9 seconds which is when the fade out ends.

这篇关于带有渐隐和渐隐的ffmpeg叠加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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