'Python cv2 to capture mov video metadata

I read the following post Getting video properties with Python without calling external software and How can I identify a video format in Python3? and Extract metadata from a Video/Image since my goal is to read my *.mov video file metadata. My cv2 version is 3.4.3 and I'm using the code as recommended in those discussions:

import cv2
vid = cv2.VideoCapture( 'test.mov')
height = vid.get(cv2.CAP_PROP_FRAME_HEIGHT) # always 0 in Linux python3
width  = vid.get(cv2.CAP_PROP_FRAME_WIDTH)  # always 0 in Linux python3
print ("opencv: height:{} width:{}".format( height, width))

However, both height and width are equal to 0. This cannot be possible. What am I doing wrong? Thanks



Solution 1:[1]

Replace .mov by .MOV and it should work. vid = cv2.VideoCapture( 'test.MOV')

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 fisakhan