Подключил андроид IP камеру с помощью приложения,
import java.awt.event.WindowEvent;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfByte;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.videoio.VideoCapture;
import javax.swing.*;
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.setSize(900,900);
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));
}
}
, но выдает ошибку
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): 192.168.31.101:8080
, как же подключить ее ?