You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library allows you to use your build-in or external webcam directly from Java. It's designed to abstract commonly used camera features and support multiple capturing farmeworks.
3
+
This library allows you to use your build-in or external webcam directly from Java. It's designed to abstract commonly used camera features and support various capturing farmeworks.
Assume situation when your code depends on some capturing framework, but suddenly you have to drop it and use different, maybe newer one (e.g. replace archaic JMF with newest GStreamer). By doing this you will have to rewrite significant piece of your code because these frameworks are completely differend and not compatible at all. This is where Webcam Capture API comes to save the world - it was created to remove the burden of such situations so you do not have to rewrite your code never again, but instead you can simply switch the driver class to different one.
12
+
9
13
## Features
10
14
11
-
1. Simple, thread-safe and non-blocking API,
12
-
2. No additional software required,
13
-
3. Supports multiple platforms (Windows, Linux, Mac OS, etc) and various architectures (32-bit, 64-bit, ARM),
14
-
4. Get images from build-in or USB-connected PC webcams,
15
-
5. Get images from IP / network cameras (as MJPEG or JPEG),
16
-
6. Offers ready to use motion detector,
17
-
7. All required JARs Available in Maven Central,
18
-
8. Offers possibility to expose images as MJPEG stream,
19
-
9. It is available as Maven dependency or standalone ZIP binary (with all dependencies included),
20
-
10. Swing component to display video feed from camera,
21
-
11. Swing component to choose camera (drop down),
22
-
12. Multiple capturing frameworks are supported:
15
+
* Simple, thread-safe and non-blocking API,
16
+
* No additional software required,
17
+
* Supports multiple platforms (Windows, Linux, Mac OS, etc) and various architectures (32-bit, 64-bit, ARM),
18
+
* Get images from build-in or USB-connected PC webcams,
19
+
* Get images from IP / network cameras (as MJPEG or JPEG),
20
+
* Offers ready to use motion detector,
21
+
* All required JARs Available in Maven Central,
22
+
* Offers possibility to expose images as MJPEG stream,
23
+
* It is available as Maven dependency or standalone ZIP binary (with all dependencies included),
24
+
* Swing component to display video feed from camera,
*[Java Media Framework (JMF)](http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html),
@@ -29,6 +33,10 @@ This library allows you to use your build-in or external webcam directly from Ja
29
33
*[GStreamer](http://gstreamer.freedesktop.org/) (0.10.x only) via [gstreamer-java](https://code.google.com/p/gstreamer-java/)
30
34
* MJPEG IP Cameras,
31
35
36
+
The latest stable version is: **```0.3.10```**
37
+
38
+
The latest development version is: **```0.3.11-SNAPSHOT```**
39
+
32
40
## Raspberry PI
33
41
34
42
_(and other ARM devices)_
@@ -142,29 +150,29 @@ And here are some more advanced examples, few with quite fancy GUI.
142
150
143
151
## Capture Drivers
144
152
145
-
Imagine situation when you depend on some framework, but suddenly have to drop it and use different one (e.g. replace archaic JMF with newest GStreamer). By doing this one have to rewrite significant piece of code because new framework is completely incompatible with previous one. Here Webcam Capture API comes to help you! This library has been created to remove the burden of situation when you would like to write your application with intention to replace capturing framework somewhere in the future.
146
-
147
-
Webcam Capture API defined ```WebcamDriver``` interface which has been already implemented in several _capturing drivers_ build on top of well-known frameworks used to work with multimedia and cameras. Complete list can be found below.
153
+
Webcam Capture API defines ```WebcamDriver``` interface which has been already implemented in several _capturing drivers_ build on top of well-known frameworks used to work with multimedia and cameras. Complete list can be found below.
148
154
149
-
By default, Webcam Capture library uses default driver which consists of small, refined part of awesome [OpenIMAJ](http://sourceforge.net/p/openimaj/home/OpenIMAJ/) framework wrapped in thread-safe container which allows it to be used in multithreaded applications. However there are more ready-to-use drivers which can be used as a replacement or addition to the default one. By utilizing those drivers Webcam Capture can be extended with various new features (e.g. IP camera support).
155
+
By default (if other driver is not specified) library uses **default driver** which consists of small, refined part of awesome [OpenIMAJ](http://sourceforge.net/p/openimaj/home/OpenIMAJ/) framework wrapped in thread-safe container. However, there are more ready-to-use drivers which can be used as a replacement or addition to the default one. By utilizing those drivers Webcam Capture can be extended with various new features (e.g. IP camera support).
If no other driver is specified, the default driver will be used. It consists of small, refined part of awesome [OpenIMAJ][] framework wrapped in thread-safe container.
201
+
202
+
### IP Camera Driver
203
+
204
+
This capture driver gives possibility to access IP camera devices and handle images in form of JPEG pictures or MJPEG streams.
More details and binaries download can be found on dedicated [webcam-capture-driver-ipcam](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-ipcam) page.
223
+
224
+
### Fswebcam Driver
225
+
226
+
This capture driver gives possibility to use CLI tool called ```fswebcam``` (written by Philip Heron) to access UVC devices connected to the computer. It works only on *nix and requires tool to be installed on the environment where driver is used.
More details on how to use, how to install ```fswebcam``` and where binaries can be downloaed, can be found on dedicated [webcam-capture-driver-fswebcam](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-fswebcam) page.
245
+
246
+
### GStreamer Driver
247
+
248
+
This capture driver gives possibility to use
249
+
[GStreamer][] to access UVC camera devices connected to computer. It works on Windows and Linux only.
More details on how to use, how to install GStreamer and where binaries can be downloaded, can be found on dedicated [webcam-capture-driver-gstreamer](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-gstreamer) page.
268
+
269
+
### OpenIMAJ Driver
270
+
271
+
This capture driver gives possibility to use [OpenIMAJ][] to access UVC camera devices connected to the computer.
More details on how to use it and where binaries can be downloaded, can be found on dedicated [webcam-capture-driver-openimaj](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-openimaj) page.
290
+
291
+
### V4L4j Driver
292
+
293
+
This is capture driver which uses [V4L4j][] project to access UVC camera devices. It works on Linux only and it seems like it is most suitable for use on Raspberry Pi.
More details on how to use it and where necessary binaries can be downloaded, can be found on dedicated [webcam-capture-driver-v4l4j](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-v4l4j) page.
312
+
313
+
### JMF Driver
314
+
315
+
This is capture driver which uses [JMF][] (Java Media Framework) to access UVC webcam devices. The JMF needs to be installed and configured on the PC before this driver can be used. It can also be used alternatively with the [FMJ][] project.
More details on how to use it, install, and where necessary binaries can be downloaded, can be found on dedicated [webcam-capture-driver-jmf](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-jmf) page.
334
+
335
+
### LTI-CIVIL Driver
336
+
337
+
This is capture driver designed to leverage capabilities of [LTI-CIVIL](http://sourceforge.net/projects/lti-civil/) project (by Larson Technologies Inc.) and use it to access wide range of UVC devices. It works on 32-bit architectures only.
More details on how to use it, and where necessary binaries can be downloaded, can be found on dedicated [webcam-capture-driver-lti-civil](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-lti-civil) page.
356
+
357
+
### VLCj Driver
358
+
359
+
This is capture driver which uses [VLCj][] library from [Caprica Software Limited](http://www.capricasoftware.co.uk/) to gain access to the UVC camera device.
More details on how to use it, how to install, and where necessary binaries can be downloaded, can be found on dedicated [webcam-capture-driver-vlcj](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-vlcj) page.
378
+
379
+
### JavaCV Driver
380
+
381
+
This is capture driver which uses [JavaCV][] binding for [OpenCV][] to gain access to the UVC camera device.
More details on how to use it, how to install, and where necessary binaries can be downloaded, can be found on dedicated [webcam-capture-driver-javacv](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-javacv) page.
400
+
401
+
### FFmpeg CLI Driver
402
+
403
+
This is capture driver which uses ```ffmpeg```[CLI][] tool from [FFmpeg][] to access UVC camera device. It works on Linux only.
More details on how to use it, how to install, and where necessary binaries can be downloaded, can be found on dedicated [webcam-capture-driver-ffmpeg-cli](https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-drivers/driver-ffmpeg-cli) page.
422
+
423
+
189
424
## History
190
425
191
426
I initially started working on Webcam Capture as a simple proof-of-concept after I read [Andrew Davison](http://fivedots.coe.psu.ac.th/~ad/)'s fantastic book entitled [Killer Game Programming](http://www.amazon.com/Killer-Game-Programming-Andrew-Davison/dp/0596007302/ref=sr_1_1?s=books&ie=UTF8&qid=1360352393&sr=1-1&keywords=killer+game+programming) (which is also available [online](http://fivedots.coe.psu.ac.th/~ad/jg/)). Thank you Andrew! Later I found that there is a complete mess in Java APIs allowing you to capture images from webcams. Once you choose specific API you cannot change it without modifying large parts of the code. I decided to change this situation and write general purpose wrapper for various different APIs (like JMF, OpenCV, OpenIMAJ, LTI-CIVIL, VLC). In such a way, Webcam Capture as we know it today, was brought to life. Today you can change underlying frameworks just by replacing webcam driver (one line code change). If there is no driver for particular framework, it's very easy to write it yourself.
@@ -200,4 +435,4 @@ The above copyright notice and this permission notice shall be included in all c
200
435
201
436
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0 commit comments