简体   繁体   中英

OpenCV cannot stream IP camera

I'm using the below code to access an IP camera, but I keep getting an error. If I change ip address to "1" which is a USB connected webcam, everything works fine, but streaming from URL doesn't work. I can access the camera from browser without any issues. I'm using OpenCV v3.1.

    public static void main(String[] args) {
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

    VideoCapture ip_cam = new VideoCapture();

    ip_cam.open("http://192.168.1.9:8080/video?x.mjpeg");

    if (!ip_cam.isOpened())
    {
        System.out.print("Error");
        return;
    }

    System.out.println("Success");

    ip_cam.release();
}

问题是我使用的OpenCV版本,尽管它是最新版本,但仍然存在从URL流传输的问题,v2.4.9可以正常工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM