4
如题阅读Python中的视频,但能,我不能用下面的代码来读取视频使用VideoCapture在python:总是被印刷OpenCV的VideoCapture不能VS11
v = 'C:\\test.mp4'
import cv2
cap = cv2.VideoCapture(v)
if cap.isOpened():
print "Finally"
else:
print "BOOM"
热潮。 叹息
而在VS11,下面的代码工作:
#include "stdafx.h"
#include <opencv2\highgui\highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char* argv[])
{
string v = "C:\\test.mp4";
VideoCapture cap;
cap.open(v);
if (cap.isOpened()) {
cout << "Yes!" << endl;
} else {
cout << "BOOM" << endl;
}
return 0;
}
我意识到人们在等多项解决方案,但没有为我工作。 我在C下列DLL:\ Python27和C:\ Python27 \的DLL,以及在PATH
- opencv_ffmpeg.dll
- opencv_ffmpeg_64.dll
- opencv_ffmpeg_245_64.dll
- opencv_ffmpeg_245。 dll
我不知道还没有做什么。
请帮帮我。非常感谢你。