Python check for corrupted video file (catch OpenCV error)
问题 I'm searching for a way to check if a video file is corrupted. I'm using cv2 (OpenCV for python) to load the video. If the video file is corrupt, I would like to skip the file and move on to the next one. I found this stackoverflow question and therefore tried this: try: vid = cv2.VideoCapture(corrupt_video_file) except cv2.error as e: print(e) except: print('error') but I still receive the following error: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1b2d000] moov atom not found Unable to stop the stream: