I recently setup opencv 3.0 for python on my ubuntu pc using the following tutorial http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/
So I ran the following code to get the number of frames of an mp4 video
import cv2 cap = cv2.VideoCapture('vid.mp4') length = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) print length
Strangely I get "-1" as output for "length". The video does infact load and I get accurate values for
so its a wonder why frame count doesn't work. Please Help.