This method is 100% guaranteed.
OpenCV, , , 2.4.11. , Python:
>>> from cv2 import __version__
>>> __version__
'2.4.11'
>>>
C:\opencv\build\x86\vc12\bin
opencv_ffmpeg2411.dll
.
, Python ex: C:\Python27
opencv_ffmpeg2411.dll
opencv_ffmpeg2411.dll, opencv , opencv_ffmpeg ( opencv ).dll
Python ,
import numpy as np
import cv2
cap = cv2.VideoCapture('your video')
while True:
ret, frame = cap.read()
if ret == True:
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',gray)
if cv2.waitKey(30) & 0xFF == ord('q'):
break
else:
break
cap.release()
cv2.destroyAllWindows()
, :