简体   繁体   中英

Opencv java IP camera mjpg stream

I am trying to grab images from a IP cam for image processing using opencv java. The stream is in mjpg format and I am using opencv's VideoCapture to try to retrieve a image. I can grab a image from my webcam using videocapture but when I try to open a IP cam it will never open. I can also view test stream here . I tried searching around for an answer but none pf them seem to work. I am on windows 7 with opencv 2.4.9. This is the code I am trying to get to work.

System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
VideoCapture vc = new VideoCapture();
vc.open("http://construction.sfhs.com/mjpg/video.mjpg");
Thread.sleep(100);
while(true) {
    System.out.println(vc.isOpened());
    Thread.sleep(100);
}

It just outputs false

I had the same problem. Try adding "opencv_ffmpeg249.dll" to the folder of your program.

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