Search code examples
animationvideoffmpegimagemagicktransition

How to use ffmpeg to make a video from one still image with height from 0 to 100% animation,


I want use a still image to make a transparent webm video, this video needs to have the following style:

  1. The image height auto increase from 0 to 100% in specific time.
  2. I don't want scroll effect , what i want is just like the image spread from top to bottom

Below is my demo image:

below is my demo image

This is the effect I want:

this is the effect i want

Black color part represent transparency.


Solution

  • wipedown transition
    1 second transition example

    ffmpeg command for 5 second transition:

    ffmpeg -loop 1 -t 5 -i input.png -filter_complex "drawbox=thickness=fill:color=black[black];[black][0]xfade=transition=wipedown:duration=5" output.webm
    
    • -loop 1 loops image.
    • -t 5 sets image duration to 5 seconds.
    • drawbox=thickness=fill:color=black drawbox filter to make black video from input.
    • xfade=transition=wipedown:duration=5 xfade filter using wipedown transition with a duration of 5 seconds.

    Also see: