The code
import cv
capture = cv.CaptureFromFile("a.avi")
while True:
frame = cv.QueryFrame(capture)
cv.ShowImage("a',frame)
Shows the same initial frame from the video repeatedly (QueryFrame is not advancing the video and grabbing the next frame). It works fine if the video is captured from a webcam.
Any ideas?
I see the same mistakes over and over again, so this is probably the last time I’ll address them. Hopefully people will start using the search box in the future and dig a little deeper.
Call
cv.WaitKey()after displaying the frame. If don’t have a delay between displaying the frames some problems could happen. I believe this the problem.Code defensively: if you are calling a function/method that can fail, believe in Murphy, and add the appropriate check to verify it doesn’t: