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.
Raspberry Pi 3B : Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/libs6762512599666073353/libvideo.so: libjpeg.so.8: cannot open shared object file: No such file or directory #701
Hello sarxos..
I have problem while connecting USB webcam on Raspbian
OS : 2018-11-13-raspbian-stretch
JRE on Raspbian : OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
Hardware : Raspberry Pi 3B + USB Logitech C170 for testing
Coding using JDK 7 update 80 with netbeans 8.1 on windows 10
Library :
bridj-0.7.0.jar
slf4j-api-1.7.2.jar
slf4j-simple-1.7.25.jar
v4l4j-0.9.1-r507.jar
webcam-capture-0.3.12.jar
webcam-capture-driver-v4l4j-0.3.12.jar
(i add them all because i don't know where library that work with raspbian (arm device))
Error:
sudo java -jar /home/pi/SvrFiles/RaspberryCamera.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/libs6762512599666073353/libvideo.so: libjpeg.so.8: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.github.sarxos.v4l4j.NativeUtils.loadLibraryFromJar(NativeUtils.java:98)
at com.github.sarxos.v4l4j.V4L4J.init(V4L4J.java:50)
at com.github.sarxos.webcam.ds.v4l4j.V4l4jDriver.(V4l4jDriver.java:33)
at raspberrycamera.WebcamAccess.(WebcamAccess.java:11)
at raspberrycamera.t.(t.java:23)
at raspberrycamera.RaspberryCamera.main(RaspberryCamera.java:18)
public class WebcamAccess {
public WebcamAccess() {
Webcam.setDriver(new V4l4jDriver());
}
private boolean opened=false;
private Webcam wc=null;
public boolean open(){
try{
wc=Webcam.getDefault();
wc.setViewSize(new Dimension(640,480));
opened=wc.open();
}catch(Exception e){}
return opened;
}
public BufferedImage getImage(){
if(opened)return wc.getImage();
else return open()?wc.getImage():null;
}
public void close(){
wc.close();
wc=null;
opened=false;
}
}
Note : This code work fine on windows without set driver "Webcam.setDriver(new V4l4jDriver());"
Hello sarxos.. I have problem while connecting USB webcam on Raspbian
OS : 2018-11-13-raspbian-stretch JRE on Raspbian : OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13) Hardware : Raspberry Pi 3B + USB Logitech C170 for testing
Coding using JDK 7 update 80 with netbeans 8.1 on windows 10
Library :
Error: sudo java -jar /home/pi/SvrFiles/RaspberryCamera.jar Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/libs6762512599666073353/libvideo.so: libjpeg.so.8: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at com.github.sarxos.v4l4j.NativeUtils.loadLibraryFromJar(NativeUtils.java:98) at com.github.sarxos.v4l4j.V4L4J.init(V4L4J.java:50) at com.github.sarxos.webcam.ds.v4l4j.V4l4jDriver.(V4l4jDriver.java:33)
at raspberrycamera.WebcamAccess.(WebcamAccess.java:11)
at raspberrycamera.t.(t.java:23)
at raspberrycamera.RaspberryCamera.main(RaspberryCamera.java:18)
My Code : package raspberrycamera;
import com.github.sarxos.webcam.Webcam; import com.github.sarxos.webcam.ds.v4l4j.V4l4jDriver; import java.awt.Dimension; import java.awt.image.BufferedImage;
public class WebcamAccess { public WebcamAccess() { Webcam.setDriver(new V4l4jDriver()); }
private boolean opened=false; private Webcam wc=null; public boolean open(){ try{ wc=Webcam.getDefault(); wc.setViewSize(new Dimension(640,480)); opened=wc.open(); }catch(Exception e){} return opened; } public BufferedImage getImage(){ if(opened)return wc.getImage(); else return open()?wc.getImage():null; } public void close(){ wc.close(); wc=null; opened=false; } } Note : This code work fine on windows without set driver "Webcam.setDriver(new V4l4jDriver());"
Any suggestion? Thank you...