Ask Your Question

Revision history [back]

but @MarcinRosol said that source code is https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video (Play video from file ) and it is checked in this source code. @MarcinRosol did you copy exactly source code?

cap = cv2.VideoCapture('vtest.avi')

while(cap.isOpened()):
    ret, frame = cap.read()

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

but @MarcinRosol said that source code is https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video (Play video from file ) and it is checked in this source code. @MarcinRosol did you copy exactly source code?

cap = cv2.VideoCapture('vtest.avi')

while(cap.isOpened()):
    ret, frame = cap.read()

    if ret==True:
        gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
    else:
          print ('cannot read frame')    

    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()
click to hide/show revision 3
No.3 Revision

updated 2018-05-11 14:17:19 -0600

berak gravatar image

but @MarcinRosol said that source code is https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video (Play video from file ) and it is checked in this source code. @MarcinRosol did you copy exactly source code?

cap = cv2.VideoCapture('vtest.avi')

while(cap.isOpened()):
    ret, frame = cap.read()

    if ret==True:
        gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
    else:
          print ('cannot read frame') frame')
         break

    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()
click to hide/show revision 4
No.4 Revision

updated 2018-05-11 14:33:18 -0600

berak gravatar image

but @MarcinRosol said that source code is https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video (Play video from file ) and it is checked in this source code. @MarcinRosol did you copy exactly source code?

cap = cv2.VideoCapture('vtest.avi')

while(cap.isOpened()):
    ret, frame = cap.read()

    if ret==True:
        gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
    else:
ret==False:
          print ('cannot read frame')
          break

    gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()