Webcam Access using Java and Maven

After lots of implementations on JMF,OpenCV and JavaCV i came across “Webcam Capture” a Generic Webcam Java Utility which has the capability of maven dependency management which is the best part i have seen. Following are the core features of the api.

Core Features

Simple and thread-safe API – write only few lines of code and start capturing images.Work standalone – no additional software has to be installed to use it.System independent – it will run without problems on most widely used operating systems – Windows (2k/XP/Vista/7, both 32- and 64-bit), Linux (x86, x64 and 32-bit ARM) and Mac OS X.Built-in video driver – default built-in video grabber is provided, so you don’t need to install any additional software (such as JMF, etc).Implementation independent – write your code once and don’t care which capture framework you will be using in future (LTI-CIVIL, JMF, QTJ, etc).Automated resources management – you do not have to remember to deallocate resources used by your capturing device, library will always do that for you (while VM has been closed gracefully).Motion detector – build in motion detector makes it easy to implement motion detecting features.Available in Maven Central – it is available in Maven Central so your project can be deployed there too.Re-streamer – simple JPEG/MJPEG re-streamer is build in, just run it and enjoy hosting your live stream.Swing ready – contains Swing component to display images, together with painter API and thread-safe API which prevents Swing EDT from blocking issues when using camera.

How To Start

Webcam Capture is avilable in Maven Central, so if you can add its dependency to your project if you are using one of the dependency manager like Maven add the following code to your pom.xml file.