In [1]:
import cv2
In [2]:
cap = cv2.VideoCapture('data/temp/sample_video.mp4')
print(type(cap))
In [3]:
print(cap.isOpened())
In [4]:
print(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
In [5]:
print(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
In [6]:
print(cap.get(cv2.CAP_PROP_FPS))
In [7]:
print(cap.get(cv2.CAP_PROP_FRAME_COUNT))
In [8]:
print(cap.get(cv2.CAP_PROP_FRAME_COUNT) / cap.get(cv2.CAP_PROP_FPS))
In [9]:
print(cap.set(cv2.CAP_PROP_FRAME_WIDTH, 320))
In [10]:
print(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
In [11]:
print(cap.get(cv2.CAP_PROP_POS_FRAMES))
In [12]:
print(cap.set(cv2.CAP_PROP_POS_FRAMES, 100))
In [13]:
print(cap.get(cv2.CAP_PROP_POS_FRAMES))