如何用ffmpeg褪色两个图像 [英] how to fade two images with ffmpeg

查看:187
本文介绍了如何用ffmpeg褪色两个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个图像,我想在它们之间创建一个简单的衰落过渡。



我还希望最终的输出是一系列图像而不是视频?
所以如果褪色过渡是10帧长,我希望输出是10个图像的序列。



如何使用ffmpeg来实现?

解决方案

请参阅 混合视频过滤器

  ffmpeg -loop 1 -i input0.png -loop 1 -i input1.png -filter_complex[1:v] [0:v] blend = all_expr ='A *(if(gte(T,3),1,T / 3))+ B *(1-(if(g,(T,3),1,T / 3)))'-t 4 frames_%04d.png 
/ pre>

此示例将使 input1.png 的3秒交叉淡入 input0.png



为了交叉淡入淡出/沾到黑色的多张图片,请参阅 ffmpeg 中创建具有淡入/淡出效果的5张影像的视频。


I have two images and I want to create a simple fading transition between them.

I also want the final output to be a sequence of images rather than a video? So if the fading transition was 10 frames long I'd want the output to be a sequence of 10 images.

How can I achieve this with ffmpeg?

解决方案

See the blend video filter:

ffmpeg -loop 1 -i input0.png -loop 1 -i input1.png -filter_complex "[1:v][0:v]blend=all_expr='A*(if(gte(T,3),1,T/3))+B*(1-(if(gte(T,3),1,T/3)))'" -t 4 frames_%04d.png

This example will make a 3 second cross-fade of input1.png over input0.png.

To crossfade/dip-to-black multiple images see Create video with 5 images with fade-in/out effect in ffmpeg.

这篇关于如何用ffmpeg褪色两个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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