how to fade two images with ffmpeg

11,441

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.

Share:
11,441
steve
Author by

steve

Updated on June 22, 2022

Comments

  • steve
    steve about 2 years

    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?

  • 2vision2
    2vision2 over 10 years
    How to do the same effect for multiple images? Say I need to create a video with 3 images and need to apply this transition between the images
  • 2vision2
    2vision2 over 10 years
    superuser.com/questions/730062/ffmpeg-fade-between-images have posted a question regarding this.
  • 2vision2
    2vision2 over 10 years
    Any ideas for fade out between multiple images?
  • Sunil Chaudhary
    Sunil Chaudhary over 8 years
    error Invalid file index 1 in filtergraph description making vedio from sequence of images any help pls