Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All black image on OSX #27

Open
salamanders opened this issue Jun 28, 2024 · 2 comments
Open

All black image on OSX #27

salamanders opened this issue Jun 28, 2024 · 2 comments

Comments

@salamanders
Copy link

I'm trying for the first time on OSX, and getting an all-black image. Macbook M1 Pro, Sonoma (14.5)

// Mac OSX
Webcam.setDriver(NativeDriver())
Webcam.getWebcams().forEach { webcam ->
    println(webcam)
    println(" ${webcam.viewSizes.joinToString { "${it.size.width}x${it.size.height}" }}")
}
val webcam = Webcam.getDefault()
webcam.open()
repeat(20) {
   // warm up, or allow auto-levels
    webcam.image
}
val img = webcam.image
println("Image: ${img.width}x${img.height}")
ImageIO.write(img, "PNG", File("hello-world.png"))
webcam.close()

Build with

    implementation("com.github.sarxos:webcam-capture:0.3.13-SNAPSHOT")
    implementation("org.slf4j:slf4j-api:2.0.12")
    implementation("org.slf4j:slf4j-simple:2.0.13")

    // Getting it working on Mac OSX
    implementation("io.github.eduramiba:webcam-capture-driver-native:1.0.0")
@slawalata
Copy link

I get same result in M1 Sonoma. I get a blank image.

    implementation("com.github.sarxos:webcam-capture:0.3.13-SNAPSHOT")
    implementation("io.github.eduramiba:webcam-capture-driver-native:1.0.0")

@eduramiba
Copy link
Owner

Not sure what can be wrong, does the readme example work correctly? https://github.com/eduramiba/webcam-capture-driver-native?tab=readme-ov-file#simple-example-with-javafx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants