0

I have to create a video with 5 different images 3 sec for each with the following sequence

  1. Fade Out
  2. Fade In
  3. Zoom
  4. Slide Left
  5. Slide Right

I do not know about sliding filter command and also zooming is not working correctly.

I am using the following command:

ffmpeg \
-loop 1 -t 3 -i img001.png \
-loop 1 -t 1 -i img002.png \
-loop 1 -t 3 -i img003.png \
-loop 1 -t 3 -i img004.png \
-loop 1 -t 3 -i img005.png \
-c:v libx264 \
-filter_complex \
"[0:v]fade=t=out:st=2.5:d=0.5[v0]; \
 [1:v]fade=t=in:st=0:d=0.5,fade=t=out:st=2.5:d=0.5[v1]; \
 [2:v]zoompan=z='zoom+0.001':d=10:s=1200x478[v2]; \
 [3:v]fade=t=in:st=0:d=0.5,fade=t=out:st=2.5:d=0.5[v3]; \
 [4:v]fade=t=in:st=0:d=0.5,fade=t=out:st=2.5:d=0.5[v4]; \
 [v0][v1][v2][v3][v4]concat=n=5:v=1:a=0,format=yuv420p[v]" -map "[v]" out.mp4

1 Answer 1

2

For slides, you need a dynamic overlay, so change to

-loop 1 -t 3 -i img002.png \
-loop 1 -t 9 -i img003.png \
-loop 1 -t 9 -i img004.png \
-loop 1 -t 9 -i img005.png \

and

 [2:v]zoompan=z='zoom+0.001':d=75:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':s=1200x478[v2];
 [v2][3:v]overlay='max(W*(7-2*t)\,0)':(H-h)/2[v3]; \
 [v3][4:v]overlay='min(W*(2*t-14)\,0)':(H-h)/2[v4]; \
 [v0][v1][v4]concat=n=3:v=1:a=0,format=yuv420p[v]" -map "[v]" out.mp4

The overlay for 3:v slides the image in from right in half a second starting at 3 seconds.

The overlay for 4:v slides the image in from left in half a second starting at 6 seconds.

(I removed the fades for the 4th and 5th images)

9
  • 2 problems. 1. Zoom function is flickering, 2 Last one is endless. Commented Mar 18, 2016 at 9:20
  • That's a bug with zooming into center. For #2, add :shortest=1
    – Gyan
    Commented Mar 18, 2016 at 10:13
  • @Mulvya This isn't working for me, can you please check my command, Thanks
    – Nisarg
    Commented Aug 31, 2016 at 11:47
  • The t for one.jpg should be 3, not 1.
    – Gyan
    Commented Aug 31, 2016 at 12:13
  • @Mulvya I tried with 3 but its still not working
    – Nisarg
    Commented Aug 31, 2016 at 12:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .