The goal of this project is to allow integrated or USB-connected webcams to be accessed directly from Java. Using provided libraries users are able to read camera images and detect motion. Main project consist of several sub projects - the root one, which contains required classes, build-in webcam driver compatible with Windows, Linux and Mac OS, which can stream images as fast as your camera can serve them (up to 50 FPS). Main project can be used standalone, but user is able to replace build-in driver with different one - such as OpenIMAJ, GStreamer, V4L4j, JMF, LTI-CIVIL, FMJ, etc.
If an IP camera is registered, then unregistered before close is called, it will not be able to be opened at a later time. Here is example code that will show the problem.
Exception in thread "Thread-4" com.github.sarxos.webcam.WebcamException: IpCam device not open
at com.github.sarxos.webcam.ds.ipcam.IpCamDevice.getImage(IpCamDevice.java:299)
at com.github.sarxos.webcam.ds.ipcam.IpCamDevice.getResolutions(IpCamDevice.java:262)
at com.github.sarxos.webcam.ds.ipcam.IpCamDevice.getResolution(IpCamDevice.java:285)
at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(WebcamOpenTask.java:32)
at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:48)
at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(WebcamOpenTask.java:20)
at com.github.sarxos.webcam.Webcam.open(Webcam.java:271)
at com.github.sarxos.webcam.Webcam.open(Webcam.java:232)
If an IP camera is registered, then unregistered before close is called, it will not be able to be opened at a later time. Here is example code that will show the problem.
Exception in thread "Thread-4" com.github.sarxos.webcam.WebcamException: IpCam device not open at com.github.sarxos.webcam.ds.ipcam.IpCamDevice.getImage(IpCamDevice.java:299) at com.github.sarxos.webcam.ds.ipcam.IpCamDevice.getResolutions(IpCamDevice.java:262) at com.github.sarxos.webcam.ds.ipcam.IpCamDevice.getResolution(IpCamDevice.java:285) at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(WebcamOpenTask.java:32) at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:48) at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(WebcamOpenTask.java:20) at com.github.sarxos.webcam.Webcam.open(Webcam.java:271) at com.github.sarxos.webcam.Webcam.open(Webcam.java:232)