This question already has an answer here:
Im trying to join 3 videos together with a crossfade effect.
I can get this working for 2 videos (sourced from stackoverflow but cant find the link):
ffmpeg -y -i part1.mp4 -i part2.mp4 -f lavfi -i color=black:s=1920x1080 -filter_complex \
"[0:v]format=pix_fmts=yuva420p,fade=t=out:st=10:d=1:alpha=1,setpts=PTS-STARTPTS[va0]; \
[1:v]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+10/TB[va1]; \
[2:v]trim=duration=20[over]; \
[over][va0]overlay[over1]; \
[over1][va1]overlay=format=yuv420[outv]" \
-vcodec libx264 -map [outv] merged.mp4
But cant work out how to make this work for 3 videos.
I don't need any audio. Any ideas?
Cheers,
ffmpeg-concat is the easiest way to accomplish what you want and allows you to use a bunch of sexy OpenGL transitions, with the default being crossfade.
ffmpeg-gl-transition is a more complicated custom ffmpeg filter which allows you to use GLSL to smoothly transition between two video streams. This filter is significantly easier to use and customize than the alternatives listed here.
ok so im not sure if this is the best way to do this but i got it working: