Search code examples
videoffmpegtranscoding

Combining zoompan slideshow with watermark overlay in FFMPEG


I've created a slideshow from a series of images with this

ffmpeg -i img%d.jpg -vf zoompan=d=(7+1)/1:s=6144x3072:fps=1,framerate=25:interp_start=0:interp_end=255:scene=100 -c:v mpeg4 -q:v 2 out.mp4

I have a semi-transparent watermark (inx.png) that I am applying for the first 3 seconds, but currenly using a separate command in FFMPEG:

ffmpeg -i 6144out.mp4 -loop 1 -i inx.png -filter_complex "[1:v]format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y)'[foo]; [foo]fade=out:st=3:d=1:alpha=1[bar], [0:v][bar]overlay" -vcodec libx264 output2.mp4

Is there a way to combine the two?


Solution

  • Use

    ffmpeg -i img%d.jpg -loop 1 -i inx.png -filter_complex "[0]zoompan=d=(7+1)/1:s=6144x3072:fps=1,framerate=25:interp_start=0:interp_end=255:scene=100[v];[1]format=argb,colorchannelmixer=aa=0.5,fade=out:st=3:d=1:alpha=1[bar];[v][bar]overlay=shortest=1" -c:v libx264 output2.mp4