Playing Video From File
Video playback from file is similar to capturing video from camera. For this operation, only the video file name and the camera directory should be changed. Also, cv2.waitKey () is used when viewing the frame.
capture = cv2.VideoCapture('testvideo.avi')
ret, frame = capture.read()
if cv2.waitKey(1) & 0xFF == ord('e'):