This is my video
This is the script to find fps:
import cv2
if __name__ == '__main__' :
video = cv2.VideoCapture("test.mp4");
# Find OpenCV version
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
if int(major_ver) < 3 :
fps = video.get(cv2.cv.CV_CAP_PROP_FPS)
print "Frames per second using video.get(cv2.cv.CV_CAP_PROP_FPS): {0}".format(fps)
else :
fps = video.get(cv2.CAP_PROP_FPS)
print "Frames per second using video.get(cv2.CAP_PROP_FPS) : {0}".format(fps)
video.release();
This is the output of the script for this video:
Frames per second using video.get(cv2.CAP_PROP_FPS) : 0.0
Why is it returning 0.0? The FPS is 14.0
video.isOpened()
) – ParticularizeFalse
. Why is that? – Soakvideo.open("test.mp4")
try, to put the full path just in case... if not try another video (to discard a codec problem) – Particularizepip-install python-opencv
, it worked like a charm. – Soak