Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I tested it and I removed else break condition.

#/usr/bin/env python35
#OpenCV 3.4.1

import cv2
import numpy as np

cap = cv2.VideoCapture('../video/road.avi')  
if (cap.isOpened()== False):
    print("Error opening video stream or file")

while(cap.isOpened()):
    ret, frame = cap.read()
    if ret == True:
        cv2.imshow('Frame',frame)
    if cv2.waitKey(25) & 0xFF == ord('q'):
        break     

cap.release()
cv2.destroyAllWindows()