3
I'm creating video from the images which have different sizes and orientations. Actually, I need to do video slides' animations based on the image orientation (aspect ratio). So, let's say I have 4 images with the following sizes:
1.jpg 1280x1600 ( Top to bottom )
2.jpg 1280x1600 ( Bottom to Top )
3.jpg 1280x1600 ( Top to bottom )
4.jpg 1280x1280 ( No effect )
Here is the FFmpeg command which I'm running
ffmpeg -y -r 25 \
-loop 1 -t 5 -i 1.jpg \
-loop 1 -t 5 -i 2.jpg \
-loop 1 -t 5 -i 3.jpg \
-loop 1 -t 5 -i 4.jpg \
-i audio.mp3 \
-filter_complex " \
[0]crop=1280:1280:ow:((ih-oh)/5)*t,format=yuva444p,fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+0/TB[f0];
[1]crop=1280:1280:ow:(ih-oh)-((ih-oh)*t/5),format=yuva444p,fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+4/TB[f1];
[2]crop=1280:1280:ow:((ih-oh)/5)*t,format=yuva444p,fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+8/TB[f2];
[3]fade=d=1:t=in:alpha=1,setpts=PTS-STARTPTS+12/TB[f3];
[0][f0]overlay[bg1];[bg1][f1]overlay[bg2];[bg2][f2]overlay[bg3];[bg3][f3]overlay,format=yuv420p[v]" -map "[v]" -map 4:a -b:v 4000k -movflags +faststart -t 20 -s 1280x1280 out.mp4
Please have a look at the first seconds of the video
So, the crossfade, crop and the effect are working but as you can see, it keeps an unnecessary section at the bottom of the video. All other animations are shown in the above section
Not sure, but seems it's keeping the first image height (1600)? Looking forward to any suggestion to fix this issue
Seems that
xfade
is a new filter? I was needed to update theffmpeg
and it works perfectly. The animations up / down via crop and about 20 fade options. Saved my day. Thank you! – ArmKh – 2020-02-04T05:46:07.7702@ArmKh Yes, it is less than a week old. – llogan – 2020-02-04T18:22:42.710