1 | initial version |
you will have to check the ret
value inside your loop, like this:
while(cap.isOpened()):
ret, frame = cap.read()
if not ret: # the movie's over, we can go home.
break
2 | No.2 Revision |
you will have to check the ret
value inside your loop, like this:
while(cap.isOpened()):
ret, frame = cap.read()
if not ret: # the movie's over, we can go home.
break
(if the video finished, there are no more frames to retrive, and VideoCapture returns empty (None) frames. if you throw those at cvtColor or such, you will get this error msg)
3 | No.3 Revision |
you will have to check the ret
value inside your loop, like this:
while(cap.isOpened()):
ret, frame = cap.read()
if not ret: # the movie's over, we can go home.
break
(if the video finished, there are no more frames to retrive, retrieve, and VideoCapture returns empty (None) frames.
if you throw those at cvtColor or such, you will get this error msg)