I am using an ffmpeg complex filter to:
- turn a number of images into a slideshow
- scale the slideshow to 1/6th of its original size
- loop the slideshow infinitely
- set the looping slideshow as a picture-in-picture over another looping video
then add audio from another file which determines the maximum length of the final video.
Everything is working except step 3.
Here is my code (broken down into individual lines):
ffmpeg -y
-loop 1 -t 5.5 -i /uploads/2021/07/slide04-scaled.jpg
-loop 1 -t 5.5 -i /uploads/2021/07/Slide05-scaled.jpg
-loop 1 -t 5.5 -i /uploads/2021/07/Slide06-scaled.jpg
-i /slowwmo-videos/intro.mp4
-i /uploads/2021/07/busy_bees_01.mp3
-filter_complex
"
[1]fade=d=0.5:t=in:alpha=1,setpts=PTS-STARTPTS+5/TB[a1];
[2]fade=d=0.5:t=in:alpha=1,setpts=PTS-STARTPTS+10/TB[a2];
[0][a1]overlay[b2];
[b2][a2]overlay[slides];
[slides]loop=loop=-1,scale=iw/6:ih/6,format=yuv420p,fps=fps=25[pip];
[3][pip]overlay=W-w-100:200[v]
"
-map [v]:v:0 -map 4:a:0 -vcodec libx264 -profile:v main -video_track_timescale 25000 -pix_fmt yuv420p -s 1280x720 -acodec aac -af aresample=44100 -shortest /slowwmo-videos/busy_bees/7494.ts