cv2安装&import cv2 之后,cv2.VideoCapture(mp4)返回False

1. http://opencv.org/opencv-3-3.html
下载opencv

下载完成后直接安装即可,安装路径默认C:\opencv;

将opencv中的C:\opencv\build\python\2.7\x64下的cv2.pyd移动到python安装目录下的Lib\site-packages

测试

打开命令行,输入 > python

输入 import cv2

如果没有反应,证明载入成功

 

2>>   cv2载入之后

cv2.VideoCapture(“*.mp4”)   //一直返回False

问题是python目录下没有处理mpeg的dll文件

C:\opencv\build\bin\opencv_ffmpeg330_64.dll   将此文件复制到 python27/文件夹下

问题解决

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.