【发布时间】:2014-11-24 21:51:37
【问题描述】:
这是交易,我正在尝试将我的 S3 连接为网络摄像头,使用适用于 android 的 IP WebCam 应用程序,然后在软件中制作一个 IP 网络摄像头,通常地址是 http://192.168.1.XX:8080/greet.html 可能最后两位数会更改,网页给我这样的选项和信息:
"Here is the list of IP Webcam service URLs:
http://192.168.1.XX:8080/video is the MJPEG URL."
我使用的代码是这样的:
include "opencv2/highgui/highgui.hpp
include "opencv2/imgproc/imgproc.hpp
using namespace cv;
int main(){
VideoCapture cap("http://192.168.1.XX:8080/video.mjpg"); // connect to an ip-cam ( might need some additional dummy param like: '?type=mjpeg' at the end
while(cap.isOpened()){
Mat frame;
if (!cap.read(frame))
break;
imshow("lalala",frame);
int k = waitKey(10);
if ( k==27 )
break;
}
return 0;
}
所以 IP 网络摄像头应用程序识别出一个连接,但没有任何图像......然后它说:
warning: Error opening file <../../modules/highgui/src/cap_ffmpeg_imp
Cannot open the web cam
Process returned -1 <0xFFFFFFF> execution time: 37.259 s
Press any key to continue.
我正在使用:
Windows 7 专业版
打开简历 2.4.4
代码块 13.12
USB 2.0 网络摄像头 640x480,30fps、50 Hz 和所有标准。
【问题讨论】:
标签: c++ opencv ip ip-camera webcam-capture