Unable to open Video File in Python using OpenCV -


i have installed opencv in windows 7 (32 bit) , put cv2.pyd file in python modules directory , working fine except opening of video file {i have tried 5-6 different kind of extensions nothing helping} code::

import numpy np import cv2 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() 

the line cap.isopened() returns false {i tried providing absolute path video file} return false please can please me why line returning false

i have found solution there file present in c:\opencv\sources\3rdparty\ffmpeg\opencv_ffmpeg.dll copy , paste file python base directory c:\python\opencv_ffmpeg.dll , rename file version of opencv using in case v3.0.0 have rename c:\python\opencv_ffmpeg300.dll if system x64 add _64 @ end c:\python\opencv_ffmpeg300_64.dll


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -