📅  最后修改于: 2022-03-11 14:47:16.788000             🧑  作者: Mango
import cv2
vcap = cv2.VideoCapture('video.avi') # 0=camera
if vcap.isOpened():
# get vcap property
width = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH) # float `width`
height = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT) # float `height`
# or
width = vcap.get(3) # float `width`
height = vcap.get(4) # float `height`
# it gives me 0.0 :/
fps = vcap.get(cv2.cv.CV_CAP_PROP_FPS)