Delayed video overlay using FFmpeg

Solution 1:

To do this, you need the latest FFmpeg version (2.2). So you should run a command like

ffmpeg -i sample1.mp4 -i sample2.mp4 -filter_complex "[0:v]setpts=PTS-STARTPTS[v0];[1:v]setpts=PTS-STARTPTS+7/TB[v1];[v0][v1]overlay=eof_action=pass[out1]" -map [out1]  /tmp/final.mp4

The trick is to set PTS for the second video to +7 seconds (PTS-STARTPTS+7/TB) and then just overlay the two streams.