Python27+Opencv3 Vid
最近在win10 X64部署了Python27 win32 + Opencv3的环境,具体过程记录于其他博文。
进行图片的相关操作等均正常,但是在操作视频时,出现了问题。具体如下
代码:
Cap = cv2.VideoCapture('******')
#判断是否正常开启
print Cap.isOpened()
1、*********为*.avi文件,打印返回FALSE
2、*********为摄像头,打印返回FALSE
处理:
1、搜索良久,stackoverflow已有大神给出解决方法
http://stackoverflow.com/questions/11699298/opencv-2-4-videocapture-not-working-on-windows
Add C:\OpenCV\3rdparty\ffmpeg\
to the Windows PATH environment variable or copy opencv_ffmpeg.dll
from that directory to C:\Python27\
or to a directory that is in the PATH.
拷贝dll文件或者将ffmpeg加入系统变量,试了下,not worked!
2、同一帖子下,有其他人回复如下:
first tried copying, then changing the Path environment of windows.. it didn't work until i changed the name to opencv_ffmpeg245.dll for my openCV version 2.4.5 and python 2.7. (notice **245.dll is from opencv version 2.4.5)
修改dll文件名,加上对应opencv版本号,试了下,not worked!
3、在往下看,又有大神回复解决方式:
I had the same issue with python 2.7 and opencv 2.4.10. I copied the opencv_ffmpeg2410_64.dll file from C:\Applications\opencv\build\x64\vc10\bin into the python path (mine is at C:\Users\mohammad\Anaconda) and it was solved!
其他opencv路径中已有带版本号的对应dll文件,拷贝之,worked!
比如我的该dll文件路径:C:\opencv\build\x86\vc12\bin\opencv_ffmpeg300.dll
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341