I’m writing some Python3 code to analyze uploaded video’s, but I’m unsure how to determine if the video is progressive or interlaced. It’s probably somewhere in one of the cv2.CAP_PROP_....
properties, but I’m not sure which one. How can I detect if the video is progressive or interlaced?
cam: cv2.VideoCapture = cv2.VideoCapture(filename)
if cam.isOpened():
video_codec: str = cam.get(cv2.CAP_PROP_FOURCC)
video_fps: int = cam.get(cv2.CAP_PROP_FPS)
video_height: int = cam.get(cv2.CAP_PROP_FRAME_HEIGHT)
video_width: int = cam.get(cv2.CAP_PROP_FRAME_WIDTH)
total_frames: int = cam.get(cv2.CAP_PROP_FRAME_COUNT)
length: int = int(total_frames / video_fps)
audio_samplerate: int = cam.get(cv2.CAP_PROP_AUDIO_SAMPLES_PER_SECOND)
audio_channels: int = cam.get(cv2.CAP_PROP_AUDIO_TOTAL_CHANNELS)