title: How to overlay 2 videos at different time over another video in single ffmpeg command?
body: <p>Using ffmpeg command line I want to overlay 2 different videos on top of another (main video) at different time for different duration. I have successfully overlayed 1 video over the main video at specific time and for specific duration using following command:</p>
  
  <pre><code>ffmpeg -i main.mp4 -i first.mp4 \
  -filter_complex "[1:v]setpts=PTS-32/TB[a]; \
                   [0:v][a]overlay=enable=gte(t\,5):eof_action=pass[out]; \
                   [1] scale=480:270 [over]; [0][over] overlay=400:400" \
  -map [out] -map 0:a \
  -c:v libx264 -crf 18 -pix_fmt yuv420p \
  -c:a copy \
  output.mp4
  </code></pre>
  
  <p>How can i modify the same command to apply the same operations on two secondary videos at the same time?</p>