я просто использую этот код, основанный на оверлейном видео и вставляю видео фоновое зацикливание с помощью ffmpeg
ffmpeg -i main.mp4
-vf "movie=bg.mp4:loop=200,hue=s=0[bg];
[in]setpts=PTS/2,scale=iw/2:-1,pad=iw+20:ih+20:10:10:color=yellow[m];
[bg][m]overlay=shortest=1:x=(W-w)/2:y=(H-h)/2"
-af "atempo=2.0,volume=1.5" -c:v libx264 completed.mkv
но я получаю много уронившихся кадров:
frame= 578 fps= 14 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=499 speed=
frame= 578 fps= 13 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=525 speed=0.448
frame= 578 fps= 13 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=553 speed=0.443x
Past duration 0.999992 too large
frame= 579 fps= 13 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=577 speed=0.438x
frame= 579 fps= 13 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=609 speed=0.433x
frame= 579 fps= 13 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=637 speed=0.428x
frame= 579 fps= 13 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=670 speed=0.423x
frame= 579 fps= 13 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=701 speed=0.418x
frame= 579 fps= 12 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=728 speed=0.414x
frame= 579 fps= 12 q=24.0 size= 30585kB time=00:00:19.24 bitrate=13019.6kbits/s dup=0 drop=756 speed=0.409x
frame= 579 fps= 12 q=-1.0 Lsize= 35007kB time=00:00:19.29 bitrate=14863.5kbits/s dup=0 drop=783 speed=0.406x