sarxos / webcam-capture

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.
http://webcam-capture.sarxos.pl
MIT License
2.28k stars 1.11k forks source link

Java 9 #586

Open trauchhaupt opened 7 years ago

trauchhaupt commented 7 years ago

Running with Java 9 does not work, as

sarxos commented 6 years ago

Hi @trauchhaupt, thank you for reporting this, but I'm afraid I can't move forward with Java 9 before fix for BridJ is available. I would love to take a look at this on my own, but with current workload on my head I have no time to play with bugs :( I'm sure, however, that Olivier (BridJ owner) will love to see pull request with a fix for this issue :)

msgilligan commented 5 years ago

BridJ is looking like it is unmaintained. Are there any plans to migrate to something newer or that is maintained?

msgilligan commented 5 years ago

So, to be clear Java 9+ will work if webcam-capture is loaded on the classpath. (At least that what I'm seeing in my basic testing.) This issue is about library loading not working when using the Java Platform Module System. Right?

msgilligan commented 5 years ago

So, unmerged BridJ PR #103 seems to fix the problem for me.

I forked BridJ and created a https://jitpack.io build using the msgilligan-master branch. I have successfully used to build and run webcam-capture on JDK 11/12 in a modular app.

Here are the relevant bits of my build.gradle:

repositories {
    maven { url 'https://oss.sonatype.org/content/groups/public' }
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation "com.github.msgilligan:BridJ:msgilligan-master-SNAPSHOT"

    implementation ("com.github.sarxos:webcam-capture:0.3.12") {
       // The exclude is necessary so we don't have 2 versions of the same packages
        exclude group: 'com.nativelibs4java', module: 'bridj'
    }
}
msgilligan commented 5 years ago

@sarxos -- let's make a fork/release of the patch to BridJ! Are you game?

msgilligan commented 5 years ago

OK, I've created a fork of BridJ in the ConsensusJ organization:

https://github.com/ConsensusJ/BridJ

This (in the consensusj-master branch) has PR #103 and also pulls in essential build configuration from what was previously a parent POM. It can be accessed through jitpack.io, but I can push it to a Bintray maven repo after a little more testing.

doct0rX commented 1 year ago

any answer regarding this issue till now? I'm trying to use the library in modular gradle application and it seems it doesn't support JPMS yet.

Vampire commented 5 months ago

Finally my PR to BridJ was merged, now they "just" need to do a release.