I am reading an avi file usinh python 2.7 and opencv2.4.I am using windows 10.My sample code is
import numpy as np
import cv2
cap = cv2.VideoCapture(\'videos
Well I am guessing the capture is not open. That's why your program ends instantly when you use while(cap.isOpened()):.
As stated in this doc it happens that the capture is not implicitly opened when created.
Sometimes, cap may not have initialized the capture. In that case, this code shows error. You can check whether it is initialized or not by the method cap.isOpened(). If it is True, OK. Otherwise open it using cap.open().
Try to explicitly open the capture like so :
cap = cv2.VideoCapture('videos/wa.avi')
cap.open();
while(cap.isOpened()):
...
If this does not work you will have to check for the video file path.