前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python27+Opencv3 Vid

Python27+Opencv3 Vid

作者头像
py3study
发布2020-01-03 12:22:35
5230
发布2020-01-03 12:22:35
举报
文章被收录于专栏:python3python3

最近在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

wKiom1fYtxGwdBmjAABQt7kvC9w403.png-wh_50
wKiom1fYtxGwdBmjAABQt7kvC9w403.png-wh_50
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-09-24 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档