FOLLOW US
4dots Software CODE HELP BLOG

How to make various slide video transitions with ffmpeg

To make a slide left video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=x='if(gte(w-t*(1/effectDurationInSeconds)*w,0),w-t*(1/effectDurationInSeconds)*w,0)':
y=0[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds

To make a slide right video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=x='if(lte(-w+t*w/effectDurationInSeconds,0),-w+t*w/effectDurationInSeconds,0)'
:y=0[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds

To make a slide to top video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=y='if(gte(h-t*(1/effectDurationInSeconds)*h,0),h-t*(1/effectDurationInSeconds)*h,0)'
:x=0[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds

To make a slide to bottom video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=x=0:y='if(lte(-h+t*h/effectDurationInSeconds,0),-h+t*h/effectDurationInSeconds,
0)'[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds

To make a slide to top left video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=y='if(gte(h-t*(1/effectDurationInSeconds)*h,0),h-t*(1/effectDurationInSeconds)*h,0)'
:x='if(gte(w-t*(1/effectDurationInSeconds)*w,0),w-t*(1/effectDurationInSeconds)*w,0)'[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds

To make a slide to top right video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=y='if(gte(h-t*(1/effectDurationInSeconds)*h,0),h-t*(1/effectDurationInSeconds)*h,0)'
:x='if(lte(-w+t*w/effectDurationInSeconds,0),-w+t*w/effectDurationInSeconds,0)'[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds

To make a slide to bottom left video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=x='if(gte(w-t*(1/effectDurationInSeconds)*w,0),w-t*(1/effectDurationInSeconds)*w,0)'
:y='if(lte(-h+t*h/effectDurationInSeconds,0),-h+t*h/effectDurationInSeconds,0)'[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds

To make a slide to bottom right video transition :

	
ffmpeg.exe -loop 1 -t effectDurationInSeconds -i firstImage.jpg -loop 1 -t effectDurationInSeconds -i secondImage.jpg
-filter_complex "[0:v][1:v]overlay=x='if(lte(-w+t*w/effectDurationInSeconds,0),-w+t*w/effectDurationInSeconds,0)'
:y='if(lte(-h+t*h/effectDurationInSeconds,0),-h+t*h/effectDurationInSeconds,0)'[out]" -map "[out]" -y outvideo.mp4

effectDurationInSeconds : duration of the effect in seconds