I have to run from 8 to 17 commands on a video to add some overlay texts and overlay images.
My problem is that actually I'm using a complex solution: I take the original video, I add some text, I take the output, I add more text, I take the output, I add an image, ... and so on.
The process is really slow and it takes around 20 minutes to add everything to a 2 minutes video (1-2 minutes for each iteration).
Those are some examples of my commands. Is there a way to concatenate them all to a single one?
Add one row of text between two timestamps
-i "video.mp4" -filter_complex "[0]split[base][text];[text]drawtext=fontfile=Arial.ttf:text='Some text':fontcolor=white:fontsize=32:box=1: boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2 - 15,format=yuva444p,fade=t=in:st=6:d=2:alpha=1,fade=t=out:st=19:d=2:alpha=1[subtitles]; [base][subtitles]overlay" output_text1.mp4
Add another row of text between the same two timestamps
-i "output_text1.mp4" -filter_complex "[0]split[base][text];[text]drawtext=fontfile=Arial.ttf:text='some more text':fontcolor=white:fontsize=32:box=1: boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2 + 15,format=yuva444p,fade=t=in:st=6:d=2:alpha=1,fade=t=out:st=19:d=2:alpha=1[subtitles]; [base][subtitles]overlay" output_text2.mp4
Add the first image overlay after the text with some effects
-i "output_text2.mp4" -loop 1 -t 1 -i "1.png" -filter_complex "[1:v]format=yuva422p,scale=1115x1980,setsar=1/1,pad=1.5*iw:1.5*ih:(ow-iw)/2:(oh-ih)/2:color=black@0,zoompan=z='min(zoom+0.0005,1.5)':s=223x396:d=475:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',fade=in:st=22:d=3.8:alpha=1,fade=out:st=37:d=3.8:alpha=1[im];[0][im]overlay=(main_w-overlay_w)/2:(main_h - overlay_h)/2:shortest=1" -pix_fmt yuv420p -c:a copy output_0.mp4
Add the second image overlay after the first with some effects
-i "output_0.mp4" -loop 1 -t 1 -i "2.jpg" -filter_complex "[1:v]format=yuva422p,scale=1490x1965,setsar=1/1,pad=1.5*iw:1.5*ih:(ow-iw)/2:(oh-ih)/2:color=black@0,zoompan=z='min(zoom+0.0005,1.5)':s=298x393:d=475:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)',fade=in:st=41:d=3.8:alpha=1,fade=out:st=56:d=3.8:alpha=1[im];[0][im]overlay=(main_w-overlay_w)/2:(main_h - overlay_h)/2:shortest=1" -pix_fmt yuv420p -c:a copy output_1.mp4
Is there a way to concat all those commands? Or is there a guideline to respect to concat various commands?
Thanks!