import cv2 ifile = 'test.mp4' vid = cv2.VideoCapture(ifile) if vid.isOpened(): ret, frame = vid.read() if ret: print('Success') else: print('Fail') else: print('N/A') vid.release()