Как исправить ошибку с IP камерой в Java с OpenCV?

Я хочу получить видео с IP камеры на андройде , но вылетает ошибка помогите пожалуйста

public class Main {
static {System.loadLibrary(Core.NATIVE_LIBRARY_NAME);}
public static void main(String[] args) {
    JFrame window = new JFrame();
    JLabel screen = new JLabel();
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setVisible(true);


    VideoCapture camera = new VideoCapture("http://192.168.31.101:8080/video");
    Mat frame = new Mat();
    MatOfByte buf = new MatOfByte();
    ImageIcon ic;


    while (camera.grab()){
        camera.read(frame);

        Imgcodecs.imencode(".png",frame,buf);

        ic = new ImageIcon(buf.toArray());
        screen.setIcon(ic);
        window.setContentPane(screen);
        window.pack();

    }
    camera.release();
    window.dispatchEvent(new WindowEvent(window , WindowEvent.WINDOW_CLOSING));

}

}

[ERROR:[email protected]] global C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\videoio\src\cap.cpp (166) cv::VideoCapture::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.5) C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): http://192.168.31.101:8080/video in function 'cv::icvExtractPattern'


Ответы (0 шт):