I'm trying to create a video from a set of images, adding texts to each image that slide from one side to the center ( one left to right, another right to left ), with fading between each videos ( not between text but between video ).
Actually I have this code that generare a simple video, with text sliding and fade:
ffmpeg -y \ -loop 1 -t 10 -i img001.jpg \ -loop 1 -t 10 -i img002.jpg \ -filter_complex \ "\ [0:v]\ drawtext=fontfile='IndieFlower.ttf':enable='between(t,0,5)':\ text='Caption 1 Scena 1':\ fontsize=60:fontcolor=white:\ x=t*300*lte(t*300\,(w-text_w)/2)+(w-text_w)/2*gt(t*300\,(w-text_w)/2):y=h-line_h-10:\ shadowx=3:shadowy=3:shadowcolor=black:\ boxborderw=10:box=1:[email protected],\ drawtext=fontfile='IndieFlower.ttf':enable='between(t,5,10)':\ text='Caption 2 Scena 1':\ fontsize=60:fontcolor=white:\ x=(w-(t-5)*500)*gt(w-(t-5)*500\,(w-text_w)/2)+(w-text_w)/2*lte(w-(t-5)*500\,(w-text_w)/2):y=h-line_h-10:\ shadowx=3:shadowy=3:shadowcolor=black:\ boxborderw=10:box=1:[email protected]\ [final1];\ [1:v]\ fade=t=in:st=0:d=1,\ drawtext=fontfile='IndieFlower.ttf':enable='between(t,0,5)':\ text='Caption 1 Scena 2':\ fontsize=60:fontcolor=red:\ x=t*300*lte(t*300\,(w-text_w)/2)+(w-text_w)/2*gt(t*300\,(w-text_w)/2):y=h-line_h-10:\ shadowx=3:shadowy=3:shadowcolor=white:\ boxborderw=10:box=1:[email protected],\ drawtext=fontfile='IndieFlower.ttf':enable='between(t,5,10)':\ text='Caption 2 Scena 2':\ fontsize=60:fontcolor=red:\ x=(w-(t-5)*500)*gt(w-(t-5)*500\,(w-text_w)/2)+(w-text_w)/2*lte(w-(t-5)*500\,(w-text_w)/2):y=h-line_h-10:\ shadowx=3:shadowy=3:shadowcolor=white:\ boxborderw=10:box=1:[email protected]\ [final2];\ [final1][final2]concat[final] " \ -pix_fmt yuvj422p -t 20 -map '[final]' o.mp4 It works well, but now, I'd like to add a zoompan effect to both of the images; so I change the code as follow:
[0:v]\ format=yuvj422p, scale=iw*10:ih*10,\ zoompan=z='min(zoom+0.0015,1.5)':d=500:x='iw/2-(iw/zoom/2)':y='ih/2 (ih/zoom/2)':s=640x480,\ drawtext=fontfile='IndieFlower.ttf':enable='between(t,0,5)':\ ... [1:v]\ format=yuvj422p, scale=iw*10:ih*10, \ zoompan=z='min(zoom+0.0015,1.5)':d=500:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':s=640x480,\ fade=t=in:st=0:d=1,\ ... but this does not work; in the final video there is only the first "video", with the zoompan, the second video does not appear at all!
What I'm doing wrong? I'd like to create a simple zoompan between two video.