cdrev February 2016
FFmpeg - Overlay one video onto another video?
I understand that this is a very open ended question. I have done some initial reading into FFmpeg, but now require some guidance.
- I have a video
- I would like to overlay another video on top of
- The result should be a single video (
Thanks - C.
- Backend is Go/Ruby. Open to using a new language.
- The audio from the first video should be kept.
- Setting the interval at which the overlay starts would be great.
ffmpeg -i input.mov -i overlay.mov -filter_complex "[0:0][1:0]overlay[out]" -shortest -map [out] -map 0:1 -pix_fmt yuv420p -c:a copy -c:v libx264 -crf 18 output.mov
This nearly works, however:
- Overlay is cut short even though the two videos (
overlay.mov) are the same length.
- I cannot start the overlay at any interval apart from
Mulvya February 2016
If you just want a ffmpeg command, try
ffmpeg -i input.mov -i overlay.mov \
-filter_complex "[1:v]setpts=PTS-10/TB[a]; \
-map [out] -map 0:a \
-c:v libx264 -crf 18 -pix_fmt yuv420p \
-c:a copy \
This starts the overlay at 5 seconds with the overlaid video start point being
Asked in February 2016
Viewed 1,790 times
Answered 1 times
Leave an answer
Quote of the day: live life