title: ffmpeg concatenate 3 videos with crossfade
body: <p>Im trying to join 3 videos together with a crossfade effect.</p>
  
  <p>I can get this working for 2 videos (sourced from stackoverflow but cant find the link): </p>
  
  <pre><code>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
  </code></pre>
  
  <p>But cant work out how to make this work for 3 videos.</p>
  
  <p>I don't need any audio. Any ideas?</p>
  
  <p>Cheers,</p>