1 | initial version |
you need an array of videocaptures then, not a single one.
#
#step 1, set up the captures:
#
caps = []
videoList=glob.glob(r'C:\Users\chaitanya\Desktop\Thesis\*.avi')
for path in videoList:
cap = cv2.VideoCapture(path)
if not cap.isOpened():
print "error opening ", path
else:
caps.append(cap)
#
#step 2, iterate through videoframes, collect images, and stitch them
#
while True:
frames = [] # frames for one timestep
for cap in caps:
ret,frame=cap.read()
if not ret:
return # game over
frames.append(frame)
# stitch a new frame from frames
# append to output video