Open tresf opened 7 years ago
Note - definitely do not use as is. :-) Has a lot of rough edges regarding error checking and probably a minor memory leak or two since it has to use BridJ to interact with the C libuvc
library. Speaking of which, the JAR used is generated from the openpnp/libuvc4j project. No idea what the licensing is there, so proceed with caution.
@dsanders11, FYI, libuvc4j
appears to be a direct JNA port of a BSD project which makes it LGPL 2.1 compatible. 👍
@tresf, FYI, I've abandoned this in favor of using DirectShow to control webcams (Windows only). Using libuvc
proved to be unstable because it needed to open the USB device to do its thing. This worked in basic testing, but in actual use trying to use libuvc
while a browser was showing the video stream caused problems - feed would go dark, controls acted buggy, etc.
It's not clear if these problems are inherent to using UVC, or if the libuvc
implementation is heavy handed. There's another project, libwebcam
which has a control program uvcdynctrl
that might be a better option. I went with libuvc
because libuvc4j
already existed. Using uvcdynctrl
to change settings while the browser is running hasn't had any issues in my experience (and was my original test), so libwebcam
might use an approach for changing the settings that doesn't need to take full control of the USB device and break sharing. Clearly that ability exists since I can use it on Windows with the same webcams.
Quoting @dsanders11:
Note, this feature may eventually be superseded by #63.