How to merge/mix/overlay multiple videos, with time-shifts?
Example: I'd like to take:
- 4 seconds of
1.mp4
and it should start at 0'10" in the output video - 8 seconds of
2.mp4
and it should start at 0'11" in the output video - 16 seconds of
3.mp4
and it should start at 0'12" in the output video
They will be overlaying/overlapping themselves; example: if 1.mp4
is 400x400, 2.mp4
is 200x200, and 3.mp4
is 100x100 pixels, then at 0'12" we will see the 3 videos at the same time, overlapping each other.
ffmpeg -t 4 -i 1.mp4
-t 8 -i 2.mp4
-t 16 -i 3.mp4
-filter_complex [0][1][2]overlay[out]
-map [out]
out.mp4 -y
I see there is a overlay
t
parameter, but how to specify a different starting-timestamp for each video?
It seems we cannot use -itsoffset
for multiple sources at the same time: https://trac.ffmpeg.org/ticket/1349