動画のFPSを取得する

2015/11/16

Python2.7.6, OpenCV3.0

import cv2

cap = cv2.videoCapture('video.avi')
fps = cap.get(cv2.CAP_PROP_FPS)

print(fps)


cv2.CAP_PROP_FPSは5です。

Reading and Writing Video — OpenCV 3.0.0-dev documentation
http://docs.opencv.org/3.0-beta/modules/videoio/doc/reading_and_writing_video.html#videocapture-get

画像とビデオの読み込みと書き込み — opencv 2.2 documentation
http://opencv.jp/opencv-2svn/cpp/reading_and_writing_images_and_video.html#cv-videocapture-get