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

Does not Work on RaspberryPi 4B+. Driver problem or not? #858

Open GeorgiG9 opened 2 years ago

GeorgiG9 commented 2 years ago

Hi all I am trying to use the WebcamCapture plugin for ImageJ, which is based on the Webcam Capture library.

I am trying to use it on Raspberry Pi 4B+ 4Gb with the Raspberry Pi camera and not with a USB camera connected to the Pi. I have tried on Ubuntu and Rasbian 32, but I get an error on both OS.

Here is the exception that I get running on Ubuntu for Raspberri:

(Fiji Is Just) ImageJ 2.3.0/1.53q; Java 1.8.0_312 [64-bit]; Linux 5.13.0-1008-raspi; 147MB of 400MB (36%)

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:118) at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:692) at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:755) at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:732) at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:710) at IJ_webcam_plugin.run(IJ_webcam_plugin.java:63) at ij.IJ.runUserPlugIn(IJ.java:243) at ij.IJ.runUserPlugIn(IJ.java:258) at ij.IJ.runPlugIn(IJ.java:204) at ij.Executer.runCommand(Executer.java:152) at ij.Executer.run(Executer.java:70) at java.lang.Thread.run(Thread.java:748) Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:110) ... 11 more Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:57) at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:120) at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:35) at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDriver.java:46) at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:118) at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:35) at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:25) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ... 1 more Caused by: java.lang.UnsatisfiedLinkError: org.bridj.Platform.sizeOf_ptrdiff_t()I at org.bridj.Platform.sizeOf_ptrdiff_t(Native Method) at org.bridj.Platform.(Platform.java:235) at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:59) at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56) at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66) ... 3 more

My question is, is this still the problem with the driver (as explained here) or not? Under readme is written that if I want to run it on the Raspberry, I need to replace version 0.6.2 of BridJ JAR by the 0.6.3-SNAPSHOT or newer bridj-0.7-20140918. So I have done this, but I still have the error.

Here is another driver that can be used for the Raspberry.

So did someone lately succeed in running it on the Raspberry?

As I do not have knowledge in Java, I am not sure how I can change the drivers in the plugin WebcamCapture for ImageJ, and I am not sure if this is the solution to my problem.

Here is the error that I get in the ImageJ software: Screenshot from 2022-04-03 12-02-52

Screenshot from 2022-04-03 12-02-58

I really appreciate any help you can provide. Best regards Georgi

shinobisoft commented 2 years ago

From what I'm seeing at a glance... You're trying to load 64 bit webcam-capture on a 32 bit OS. I'm not familiar with Raspberry Pi CPU architecture unfortunately.

To my knowledge, this has always been troublesome on Raspberry Pi and MacOS.

Note that this library is designed to get images from USB and IP cameras.