craigmiranda / sjmi

Skinny Java Media Interface - a Java library for Webcams / Video Devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SJMI

Skinny Java Media Interface - a Java interface for Video Devices

SJMI is a Java library which allows Java to access Video Devices ("webcams" and suchlike) attached to the system. It has been designed to provide basic functionality and ease of use. It weighs under 100kb, give or take (excluding the JVM and VC++ runtimes).

Functionality:

  • Identify video devices & properties thereof
  • Select video device & set video format (resolution, etc)
  • Stream and capture to Java BufferedImage(s)
  • Adjust brightness, white balance, focus, etc. (where available)
  • Video Format support for RGB24 & YUY2
    • Overridable functions to implement new video formats (ie. NV12, MPG)

Pending functionality:

  • Mac & Linux sub-libraries
  • JavaDoc
  • Video formats NV12 & MPG
  • "Still pin" image/photo capture (1, see below)
  • USB3.0 devices

Possible functionality (3):

  • Multiple device support
  • Audio device support

Misc:

  • SJMI sub-library written in C++ accessed via JNI
    • hence depends on the VC++ 2015-2019 Redistributables
  • SJMI sub-library depends on shared "sub-sub-libraries", part of the Microsoft Media Foundation ("MMF") (3)
  • It includes half an implementation of MMF CaptureEngine for still/photo capture (3)

Requirements:

Testing:

  • Minimal (in progress, as at Nov2020)
  • Four seperate Windows 10 machines w/ integrated cameras
  • One external USB2.0 Microscope camera

Alternatives:

  • https://github.com/sarxos/webcam-capture - I liked this one. Nice and simple, but it (using OpenImaj) didn't pick up a particular USB2.0 camera that I needed (and which was picked up by the Win10 Camera app.) I still don't understand what the problem was there. And, To be honest, whether this solution resolves that problem remains to be proved.
  • https://github.com/gstreamer-java - Lots of functionality, but more than I needed or wanted. I struggled to deploy it for simple video capture, with less than 40mb of dependencies.

Notes:

(1) Currently image capture is taken from the conventional video stream. Some devices, apparently, have "still pin" functionality, but none of mine seem to.

(2) Windows, for some reason, has at least four methods for video capture.

The SJMI sub-library uses the what I'd call the IMFSourceReader method

(3) I personally, currently have no use for these features, so don't count on them appearing soon by my hand. Though, I don't believe they would be a huge effort.

(4) I simply haven't bothered to try compiling a 32-bit version.

(5) SJMI offers error catching for this issue and allows the developer to provide an error message.

About

Skinny Java Media Interface - a Java library for Webcams / Video Devices

License:GNU General Public License v3.0


Languages

Language:C++ 55.9%Language:Java 39.8%Language:C 4.2%Language:Batchfile 0.1%