Closed SWSpratlin closed 1 week ago
this lib is fully tested JDK8 and x86 Linux, windows and armv7. so for later aar64 and etc, this lib is not tested. on other side, the vl4j bridj .... native code are out of date because of JDK new features. so use OPENCV driver which uses javacv is strongly recommended.
thanks
I just saw on the documentation that V4L4J was the preferred driver for Raspberry Pi, so I wanted to go through that channel. I can give a shot to OpenCV, but will that cause issues with the Pi hardware?
Returning to this issue, as its running into trouble with the 4+ versions of openCV/
I think there's an issue with how the videoio.VideoCapture class is being called in the JavaCvDriver class, this is only present in the snapshot versions on maven, will try to build on my own from source
Closing this issue as resolved. Will open another potentially.
Issue comes from the JavaCVDriver class. Needs updating in the import statements to reflect changes in javacpp, javacv, and opencv from bytedeco.
I don't know how to submit a push/pull request so I'll detail my solution.
VideoCapture and VideoInput classes need an update to their import statments in the JavaCVDriver class
import org.bytedeco.opencv.opencv_videoio.VideoCapture;
import org.bytedeco.videoinput.videoInput;
works for me.
I was in fact wrong, that did not work for me.
The real solution for me was quite different. Context: Running Debian Bookworm on a Raspberry Pi 5. Java 17, Maven installed, Pi Cam Module 3.
The solution that worked for me was the following:
libcamerasrc
is installed as part of GStreamer. Check this with gst-inspect-1.0 libcamerasrc
if you get your camera's properties, move on. final Element source
to the following: final Element source = ElementFactory.make("libcamerasrc", "libcamerasrc0")
. Next change source.set()
to the following: source.set("name", name);
open()
add .append("framerate={whatever you want your framerate to be}/1");
to the end of the other .append()
statement. Right before .toString();
save the file.mvn clean package
on the the driver-gst1
directory. .jar
file to your project, however you add local jars to your project. webcam.getDefault();
to use libcamera
This SHOULD work, but will likely need troubleshooting on other Pi systems with different packages installed than I currently have. This setup is currently stable for 12+ hour runs.
This was a long, involved process. Since Pi switched away from the framework that they used to use for their cameras (/dev/video0, etc.
), you need to adjust your driver files manually to fix these problems.
Using the V4L4J Driver, I consistently run into a "NoSuchFieldException: usr_paths"
I think it has something to do with loading the "loadLibraryFromJar" method, but I'm not experienced enough to really troubleshoot that. Seems like the "usr_paths" isn't getting created properly, potentially because of permissions, but I'm not totally sure.
Using an ArduCam module, conencted with the ribbon cable. I can get picture from it with
libcamera-hello
but not withv4l2-ctl
Any help would be appreciated.