Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

your VideoCapture either did not open, or you reached the end of the movie

please:

  • check cap.isOpened()

  • and the ret value in: ret,frame = cap.read()


if any of it returns False, you have to handle that condition. (i.e. break out of the loop)

your VideoCapture either did not open, or you reached the end of the moviemovie. anyway, your image is invalid

please:

  • check cap.isOpened()

  • and the ret value in: ret,frame = cap.read()


if any of it returns False, you have to handle that condition. (i.e. break out of the loop)