def combine_video():
ccap = cv2.VideoCapture(video_file1)
tcap = cv2.VideoCapture(video_file2)
width = 1920
height = 2160
out = cv2.VideoWriter('./' + processed_folder + '/combined' + '.mp4', cv2.VideoWriter_fourcc(*'mp4v'), 30, (int(width),int(height)))
while ccap.isOpened():
ret, img = ccap.read()
tret,timg = tcap.read()
if ret == True and tret == True:
timg = cv2.copyMakeBorder(timg,30,30,280,280,cv2.BORDER_CONSTANT,value=0)
vis = np.concatenate((img,timg),axis = 0)
print('write video')
out.write(vis)
else:
break
if cv2.waitKey(1) & 0xFF == ord('q'):
break