How to add a fade in within overlay with FFMPEG ? -
i'm wondering how add option "fade in" in -filter_complex 'overlay'.
the basic overlay
ffmpeg -i movie.mp4 -i image.jpg -c:v libx264 -filter_complex 'overlay=x=main_w-overlay_w-100:y=main_h-overlay_h-100' output.mp4
does image.jpg fade=in should in filter_complex ?
ffmpeg -i movie.mp4 -i image.jpg -c:v libx264 -filter_complex 'fade=in:st=0:d=5:alpha=1, overlay=x=main_w-overlay_w-100:y=main_h-overlay_h-100' output.mp4
thanks lot on construction of -filter_complex parameter !
use
ffmpeg -i movie.mp4 -loop 1 -i image.jpg -filter_complex "[1]format=yuva420p,fade=in:st=0:d=5:alpha=1[i]; [0][i]overlay=w-w-100:h-h-100:shortest=1" -c:v libx264 output.mp4
your fade filter set operate on alpha channel, jpegs don't have alpha, image needs converted pixel format does. also, ffmpeg time-based processor of streams , single image treated 1 frame @ 25 fps, lasting 0.04 s, added loop generate video stream out of it, needed fade take effect.
the overlay filter takes in 2 inputs, assigned pads explicit routing. since image looped indefinitely, shortest added stop overlay when main video ends.
Comments
Post a Comment