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.27k stars 1.11k forks source link

Webcam.getWebcams() return empty list on macOS #753

Open bot437 opened 4 years ago

bot437 commented 4 years ago

If use com.github.sarxos.webcam.ds.openimaj.OpenImajDriver:

Exception in thread "Thread-0" com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
  at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:124)
  at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:893)
  at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:866)
  at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:845)
  at com.example.test.Main$1.run(Main.java:358)
Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
  at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
  at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
  at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:116)
  ... 4 more
Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task
  at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:72)
  at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:140)
  at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:46)
  at com.github.sarxos.webcam.ds.openimaj.OpenImajDriver$GetDevicesTask.getDevices(OpenImajDriver.java:47)
  at com.github.sarxos.webcam.ds.openimaj.OpenImajDriver.getDevices(OpenImajDriver.java:67)
  at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36)
  at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)
  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.UnsatisfiedLinkError: org.openimaj.video.capture.OpenIMAJGrabber.getVideoDevices()Lorg/bridj/Pointer;
  at org.openimaj.video.capture.OpenIMAJGrabber.getVideoDevices(Native Method)
  at org.openimaj.video.capture.VideoCapture.getVideoDevices(VideoCapture.java:221)
  at com.github.sarxos.webcam.ds.openimaj.OpenImajDriver$GetDevicesTask.handle(OpenImajDriver.java:58)
  at com.github.sarxos.webcam.WebcamProcessor$AtomicProcesso
satispande commented 4 years ago

@sarxos can you please guide on this?