動画のフレームサイズを取得する

2019/07/04

Python2.7.6, OpenCV3.0

import cv2

cap = cv2.videoCapture('video.avi')

width = cap.get(cv2.CAP_PROP_FRAME_WIDTH)
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)
size = (width,height)

print(size)