Combine video files with different start times

Hi @Pj1098

Here is a list of tutorials about VideoCapture and VideoWriter.

Recipe:
1- Open both videos with VideoCapture (one VideoCapture for each video)
2- Analyse duration, frame rate, whatever you need
3- Move to the frame where you want to start consuming de video
4- Create a VideoWriter for your output video file

in a loop:
1- Read one frame from each VideoCapture, you will have two Mat (two images)
2- Combine both images into a new one in the way you like it more, don’t change its size in successive frames
3- Write it to the VideoWriter

At the end, close all. The final video will be silent, no sound.

1 Like