0

这是交易,我正在尝试将我的 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 Professional
Open CV 2.4.4
Codeblocks 13.12
USB 2.0 webcam 640x480 at 30fps, 50 Hz and all standard。

4

1 回答 1

0

尝试连接另一个视频流 android 应用程序。我使用智能网络摄像头。打开它

cap.open("http://192.168.1.13:8080/?x.mjpg);
于 2014-11-24T13:45:40.840 回答