For some reason, VideoCapture can open a video but then can't read it. cap.read() keeps returning false. When I take VideoCapture from the webcam, there is no issue. I'm using the master branch with python on a mac (El Capitan)
import numpy as np
import cv2
cap = cv2.VideoCapture('blogilates.mp4')
while(cap.isOpened()):
ret, frame = cap.read()
print ret
cv2.imshow('frame', frame)
if (cv2.waitKey(1) & 0xFF == ord('q')):
break
cap.release()
cv2.destroyAllWindows()
↧