Video composition by switching between multiple cameras
I wanted to compose a video from multiple cameras. While stitching I wanted to switch view from one camera to another. Is it possible to do it in OpenCv?
For example I have 3 video paths(videos having same duration) and wanted to create a single video summary by switching between the videos. To start with I have created 3 video capture objects as shown below.
cap0=cv2.VideoCapture(path1)
cap1=cv2.VideoCapture(path2)
cap2=cv2.VideoCapture(path3)
similary, I also created
ret,frame0=cap0.read()
ret,frame1=cap1.read()
ret,frame3=cap2.read()
Now initially I will have frames from that are read by cap0 and passed into VideoWriter object. After some time I wanted to insert frames that are read from path2 from the time where I switched from path 1. like If I wrote frames till 3 sec from path 1,I wanted to insert frames of path 2 from the 4 sec till 6 sec
Now if I switch back again to path1 then I wanted to insert frames from the 7 sec by skipping the frames of path1 from 4sec to 6 sec.
Is there any way doing this like may be skipping the frames or any other alternative