ffmpeg has a feature to overlay image on top of the video with fade-in and fade-out. It also able to combine with alpha value, so its interaction could be more smoother.

ffmpeg -f lavfi -i color=color=black -loop 1 -i logo.png -filter_complex "\
[1:0] format=rgba,fade=in:st=0:d=3:alpha=1,fade=out:st=6:d=3:alpha=1 [ovr];\
[0:0][ovr] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2\
" -t 10 -y out.gif

format=rgba - use RGB format with alpha channel for transparency

fade=in:st=0:d=3:alpha=1,fade=out:st=6:d=3:alpha=1 - fade in starting at 0s for 3s with alpha, fade out starting at 6s for 3s with alpha.

overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2 - overlay centered on source

  • No labels