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

raspberry pi with jdk1.8.0 not working #153

Open
ronak1919 opened this issue Oct 29, 2013 · 27 comments
Open

raspberry pi with jdk1.8.0 not working #153

ronak1919 opened this issue Oct 29, 2013 · 27 comments

Comments

@ronak1919
Copy link

root@raspberrypi:~/dist# /opt/jdk1.8.0/bin/java -jar ARM_webcam.jar

Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedL                                                                                        ibraries600503131313538213/libbridj.so which might have disabled stack guard. Th                                                                                        e VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>',                                                                                         or link it with '-z noexecstack'.
1
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.NoClassDefFoundError: ch/qos/logback/core/pattern/color/BlackComposite                                                                                        Converter
        at ch.qos.logback.classic.PatternLayout.<clinit>(PatternLayout.java:134)
        at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayo                                                                                        utEncoder.java:24)
        at ch.qos.logback.classic.BasicConfigurator.configure(BasicConfigurator.                                                                                        java:50)
        at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInit                                                                                        ializer.java:150)
        at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
        at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55                                                                                        )
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        at com.github.sarxos.webcam.Webcam.<clinit>(Webcam.java:38)
        at raspberrypicamera.RaspberryPiCamera$1.run(RaspberryPiCamera.java:71)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.pattern.color.B                                                                                        lackCompositeConverter
        at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:353)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 14 more
Oct 29, 2013 9:06:44 AM org.bridj.BridJ log
INFO: Not enough args for null OpenIMAJGrabber.startSession(int, int, double)
Exception in thread "Thread-2" com.github.sarxos.webcam.WebcamException: Cannot                                                                                         execute task
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(Webc                                                                                        amProcessor.java:52)
        at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java                                                                                        :112)
        at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:35)
        at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(WebcamOpenTask.ja                                                                                        va:20)
        at com.github.sarxos.webcam.Webcam.open(Webcam.java:177)
        at com.github.sarxos.webcam.Webcam.open(Webcam.java:144)
        at raspberrypicamera.RaspberryPiCamera$1.run(RaspberryPiCamera.java:75)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NullPointerException
        at org.bridj.Pointer.getPeer(Pointer.java:1538)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSess                                                                                        ion(Native Method)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice.open(WebcamDe                                                                                        faultDevice.java:221)
        at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(WebcamOpenTask.                                                                                        java:38)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamPr                                                                                        ocessor.java:61)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.                                                                                        java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor                                                                                        .java:617)
        ... 1 more

Thanks,
Ronak Patel

@sarxos
Copy link
Owner

sarxos commented Oct 29, 2013

Hi,

Thank you for the report.

ClassNotFound exceptions are caused by missing or incompatible JARs, but I'm not sure about this NPE on

Can you please provide more details?

  • What Webcam Capture version is used,
  • What operating system,
  • What arch (64- or 32-bit, armhf or armel),

Please use the newest binaries (with dependencies):

webcam-capture-0.3.10-RC6-dist.zip

Please also repeat the failing scenario with debug mode enabled - check this page to see how to configure it. This page contains 6 points, please make sure to not skip any of them. This should give us some better insight into what is happening under the hood of application runtime.

@ronak1919
Copy link
Author

I am using webcam-capture-0.3.10-RC5-dist version

@sarxos
Copy link
Owner

sarxos commented Oct 29, 2013

Some more info on the operating system? I see it's Raspberry Pi, but running Arch Linux or Raspbian?

As I remember correctly RC5 does not contain fix for library autoextraction on ARM. Please use RC6 instead. I suppose that you are also using BridJ 0.6.2, can you please switch to BridJ 0.7-SNAPSHOT? It can be found in ZIP assembly linked in my previous post.

@ronak1919
Copy link
Author

I am using Raspbian(2013-09-10-wheezy-raspbian)

With version webcam-capture-0.3.10-RC6-dist.zip give below error:

root@raspberrypi:~/distee/opt/jdk1.8.0/bin/java -Djava.library.path=/root/dist -jar JavaApplication129.jar
1
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries4667304991414230342/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "Thread-1" 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:122)
        at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:38)
        at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(WebcamOpenTask.java:20)
        at com.github.sarxos.webcam.Webcam.open(Webcam.java:189)
        at com.github.sarxos.webcam.Webcam.open(Webcam.java:149)
        at raspberrypicamera.RaspberryPiCamera$1.run(RaspberryPiCamera.java:70)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NullPointerException
        at org.bridj.Pointer.getPeer(Pointer.java:1531)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(Native Method)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice.open(WebcamDefaultDevice.java:253)
        at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(WebcamOpenTask.java:38)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        ... 1 more

@ronak1919
Copy link
Author

Its working perfectly with openJDK7.
It only problem with java8

@sarxos
Copy link
Owner

sarxos commented Oct 29, 2013

That's really strange... I was asking details because I'm running it on JDK8 on my RasPi and never noticed such issue.

pi@raspberrypi ~ $ uname -a
Linux raspberrypi.sarxos.pl 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l GNU/Linux
pi@raspberrypi ~ $ java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b36e)
Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)

My example simply takes one picture and store it in JPG file:

pi@raspberrypi ~ $ java -jar webcam-capture-example-onejar-0.3.10-SNAPSHOT.jar 
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
pi@raspberrypi ~ $ ls -la | grep -i jpg
-rw-r--r-- 1 pi   pi      2049 Oct 29 10:48 1383043729583.jpg

Can you please download this JAR and run it on your Pi? This is exactly the same JAR I executed a minute ago to give you above info:

http://sarxos.pl/download/webcam-capture-example-onejar-0.3.10-SNAPSHOT.jar

Complete source code for this example can be found here:

https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-examples/webcam-capture-onejar

@sarxos
Copy link
Owner

sarxos commented Oct 29, 2013

I guess that the very hot clue here is this warning from Java VM:

Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries4667304991414230342/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.

But I will be honest with you - I see it first time in my life and have no idea why it is appearing.

You can extract libbridj.so from BridJ JAR and experiment/play with it a little bit. If you drop it to e.g. /usr/lib, it will be taken instead of the one from extracted directory. In the meantime I will go to expand my knowledge and try to understand what the warning says.

@ronak1919
Copy link
Author

I think i install v4l4j with openJKD7, that y program work with openJKD7 perfectly ,

I was playing with libbridj.so last few hours but still same result,
But i don't understand y it work with openJKD7 and not work with java8?
Still i am working on it...

@sarxos
Copy link
Owner

sarxos commented Oct 29, 2013

One guy on StackOverflow had this issue when compiling with jdk5 or jdk6 and then running it on jdk7. Seems like guys from Ruby had this issue as well, but also on jdk7.

You can try report this issue in nativelibs4java where BridJ is being developed. Maybe someone who is more familiar with native code will be able to give us some more clues.

As a W/A you can try to use different capture driver, but please note that I'm not sure if they are working fine on ARM devices:

@petterroea
Copy link

I am getting this error:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries8396528791264541542/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading OpenIMAJGrabber : OpenIMAJGrabber: cannot open shared object file: No such file or directory
java.io.FileNotFoundException: Library 'OpenIMAJGrabber' was not found in path '[null, ., /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/local/games, /usr/games, /usr/java/packages/lib/arm, /lib, /usr/lib, /usr/lib/jvm/jdk-7-oracle-armhf/jre/lib/arm, /usr/lib/jvm/jdk-7-oracle-armhf/jre/bin, /lib/arm-linux-gnueabi, /usr/lib/arm-linux-gnueabi, /usr/lib32, /lib32, /usr/lib, /lib, /usr/local/lib]'
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:972)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:948)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:555)
    at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:700)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:936)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:829)
    at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:249)
    at org.bridj.BridJ.initialize(BridJ.java:1021)
    at org.bridj.NativeObject.<init>(NativeObject.java:49)
    at org.bridj.StructObject.<init>(StructObject.java:44)
    at org.bridj.cpp.CPPObject.<init>(CPPObject.java:53)
    at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
    at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
    at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
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:118)
    at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:675)
    at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:738)
    at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:715)
    at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:693)
    at com.petterroea.timelapser.Timelapser.run(Timelapser.java:51)
    at java.lang.Thread.run(Thread.java:724)
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:188)
    at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:110)
    ... 6 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:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    ... 1 more
Caused by: java.lang.RuntimeException: Failed to allocate new instance of type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
    at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:739)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:936)
    at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:829)
    at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:249)
    at org.bridj.BridJ.initialize(BridJ.java:1021)
    at org.bridj.NativeObject.<init>(NativeObject.java:49)
    at org.bridj.StructObject.<init>(StructObject.java:44)
    at org.bridj.cpp.CPPObject.<init>(CPPObject.java:53)
    at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
    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
Caused by: java.io.FileNotFoundException: Library 'OpenIMAJGrabber' was not found in path '[null, ., /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/local/games, /usr/games, /usr/java/packages/lib/arm, /lib, /usr/lib, /usr/lib/jvm/jdk-7-oracle-armhf/jre/lib/arm, /usr/lib/jvm/jdk-7-oracle-armhf/jre/bin, /lib/arm-linux-gnueabi, /usr/lib/arm-linux-gnueabi, /usr/lib32, /lib32, /usr/lib, /lib, /usr/local/lib]'
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:972)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:948)
    at org.bridj.BridJ.getNativeLibrary(BridJ.java:555)
    at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:700)
    ... 13 more

Using latest Raspbian. Would be great to have a fix.

(Java version is oracles new Java7 for linux ARM n stuff, see this blogpost: here

@sarxos
Copy link
Owner

sarxos commented Nov 12, 2013

Hi @petterroea

You have similar warning from JVM, but the error seems to be caused by something different. What is the Webcam Capture API you are using?

Caused by: java.io.FileNotFoundException: Library 'OpenIMAJGrabber' was not found

Seems like it was never extracted and this was a bug existing before 0.3.10-RC6.

@petterroea
Copy link

I recall downloading the newest version of this API at the date i posted the bug report. I can try rebuilding sometime

@sarxos
Copy link
Owner

sarxos commented Nov 12, 2013

Ok, 10 days ago 0.3.10-RC6 (it contains the fix) was available for some time already, but could you please ensure?

If this is not the case can you please follow this instruction to provide more verbose debug logs?

@Mirki
Copy link

Mirki commented Dec 20, 2013

Hi,
I've similar issues. I ran your instruction for creation of logging:

Here some sys Infos:

Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)

Source:

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Date;

import javax.imageio.ImageIO;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamMotionDetector;
import com.github.sarxos.webcam.WebcamMotionEvent;
import com.github.sarxos.webcam.WebcamMotionListener;
import com.github.sarxos.webcam.log.*;


public class Spion implements WebcamMotionListener {

    public Spion() {
        WebcamMotionDetector detector = new WebcamMotionDetector(Webcam.getDefault());
        detector.setInterval(500); 
        detector.addMotionListener(this);
        detector.start();
    }

    @Override
    public void motionDetected(WebcamMotionEvent wme) {
        System.out.println("Detected motion I Take now a Photo");
        try {
            this.takePhoto();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

    public void takePhoto() throws IOException 
    {
        String fileName = new Date().getTime() + ".png";
        Webcam webcam = Webcam.getDefault();
        webcam.open();
        BufferedImage image = webcam.getImage();
        ImageIO.write(image, "PNG", new File(fileName));
        System.out.println("Foto mit Filename "+fileName+" abgelegt");

    }


    public static void main(String[] args) throws IOException {
        WebcamLogConfigurator.configure("logback.xml");
        new Spion();
        System.in.read(); 
    }
}

Output:

06:07:48,573 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
06:07:48,575 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
06:07:48,577 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/home/pi/testing/logback.xml]
06:07:49,873 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
06:07:50,055 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeFilter scanning period to 30 seconds
06:07:50,057 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[/home/pi/testing/logback.xml]] every 30 seconds.
06:07:50,057 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
06:07:50,131 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
06:07:50,187 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
06:07:51,770 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
06:07:51,770 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
06:07:51,770 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
06:07:51,783 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
06:07:51,785 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
06:07:51,794 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
06:07:51,831 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5bf734 - Registering current configuration as safe fallback point

06:07:52.141 [main] INFO  com.github.sarxos.webcam.Webcam - WebcamDefaultDriver capture driver will be used
06:07:52.227 [webcam-discovery-service] DEBUG c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
Dec 20, 2013 6:07:52 AM org.bridj.BridJ log
INFO: Embedded resource paths for library 'bridj': [org/bridj/v0_7_0/lib/linux_armhf/libbridj.so, org/bridj/v0_7_0/lib/linux_armhf/bridj.so, org/bridj/v0_7_0/lib/linux_armhf/libbridj.jnilib, org/bridj/lib/linux_armhf/libbridj.so, org/bridj/lib/linux_armhf/bridj.so, org/bridj/lib/linux_armhf/libbridj.jnilib, lib/linux_armhf/libbridj.so, lib/linux_armhf/bridj.so, lib/linux_armhf/libbridj.jnilib, libs/linux_armhf/libbridj.so, libs/linux_armhf/bridj.so, libs/linux_armhf/libbridj.jnilib]
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Loading library /tmp/BridJExtractedLibraries5993403884817856534/libbridj.so
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries5993403884817856534/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Loaded library /tmp/BridJExtractedLibraries5993403884817856534/libbridj.so
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Calls logs enabled
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Runtime for com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber : org.bridj.cpp.CPPRuntime
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Registering type com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Environment var LD_LIBRARY_PATH = null
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Environment var DYLD_LIBRARY_PATH = null
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Environment var PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Property java.library.path = /usr/java/packages/lib/arm:/lib:/usr/lib
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Property sun.boot.library.path = /usr/lib/jvm/jdk-7-oracle-armhf/jre/lib/arm
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Property gnu.classpath.boot.library.path = null
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Looking for library 'OpenIMAJGrabber' in paths [null, ., /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/java/packages/lib/arm, /lib, /usr/lib, /usr/lib/jvm/jdk-7-oracle-armhf/jre/lib/arm, /usr/lib/jvm/jdk-7-oracle-armhf/jre/bin, /lib/arm-linux-gnueabi, /usr/lib/arm-linux-gnueabi, /usr/lib32, /lib32, /usr/lib, /lib, /usr/local/lib]
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Embedded resource paths for library 'OpenIMAJGrabber': [com/github/sarxos/webcam/ds/buildin/lib/linux_armhf/libOpenIMAJGrabber.so, com/github/sarxos/webcam/ds/buildin/lib/linux_armhf/OpenIMAJGrabber.so, com/github/sarxos/webcam/ds/buildin/lib/linux_armhf/libOpenIMAJGrabber.jnilib, org/bridj/v0_7_0/lib/linux_armhf/libOpenIMAJGrabber.so, org/bridj/v0_7_0/lib/linux_armhf/OpenIMAJGrabber.so, org/bridj/v0_7_0/lib/linux_armhf/libOpenIMAJGrabber.jnilib, org/bridj/lib/linux_armhf/libOpenIMAJGrabber.so, org/bridj/lib/linux_armhf/OpenIMAJGrabber.so, org/bridj/lib/linux_armhf/libOpenIMAJGrabber.jnilib, lib/linux_armhf/libOpenIMAJGrabber.so, lib/linux_armhf/OpenIMAJGrabber.so, lib/linux_armhf/libOpenIMAJGrabber.jnilib, libs/linux_armhf/libOpenIMAJGrabber.so, libs/linux_armhf/OpenIMAJGrabber.so, libs/linux_armhf/libOpenIMAJGrabber.jnilib]
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native org.bridj.Pointer<java.lang.Byte> com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getImage() cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native org.bridj.Pointer<com.github.sarxos.webcam.ds.buildin.natives.DeviceList> com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getVideoDevices() cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native int com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.nextFrame() cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native void com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.setTimeout(int) cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native boolean com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(int,int,double) cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native boolean com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(int,int,double,org.bridj.Pointer<com.github.sarxos.webcam.ds.buildin.natives.Device>) cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native void com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.stopSession() cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native int com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getWidth() cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native int com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getHeight() cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.CRuntime.register(CRuntime.java:449)
        at org.bridj.CRuntime.register(CRuntime.java:344)
        at org.bridj.BridJ.register(BridJ.java:363)
        at org.bridj.BridJ.register(BridJ.java:203)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:60)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Registering type org.bridj.cpp.CPPObject
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Registering type org.bridj.StructObject
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Registering type org.bridj.NativeObject
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: // size = 0, alignment = -1
struct class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber {
}
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Runtime for org.bridj.TimeT : org.bridj.CRuntime
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.TimeT
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.TimeT$timeval_customizer
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.StructCustomizer
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.TimeT$timeval
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.AbstractIntegral
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type java.lang.Number
# BridJ: dlopen error when loading /tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so : libv4l2.so.0: cannot open shared object file: No such file or directory
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
        at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
        at org.bridj.BridJ.initialize(BridJ.java:1117)
        at org.bridj.NativeObject.<init>(NativeObject.java:50)
        at org.bridj.StructObject.<init>(StructObject.java:46)
        at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
Exception in thread "main" 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:123)
        at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:706)
        at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:769)
        at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:746)
        at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:724)
        at Spion.<init>(Spion.java:18)
        at Spion.main(Spion.java:50)
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:188)
        at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:115)
        ... 6 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:122)
        at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:38)
        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:36)
        at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.RuntimeException: Failed to allocate new instance of type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
        at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:806)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
        at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
        at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
        at org.bridj.BridJ.initialize(BridJ.java:1117)
        at org.bridj.NativeObject.<init>(NativeObject.java:50)
        at org.bridj.StructObject.<init>(StructObject.java:46)
        at org.bridj.cpp.CPPObject.<init>(CPPObject.java:55)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
        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
Caused by: java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
        at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
        at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
        ... 13 more

@ronak1919
Copy link
Author

Hi, I think you are using different version of OpenIMAJGrabber and BridJ,

you can solved this issue using same version of both,

try to Download latest version of
webcam-capture-x.x.x-RC6-dist.ziphttp://repo.sarxos.pl/maven2/com/github/sarxos/webcam-capture/0.3.10-RC6/webcam-capture-0.3.10-RC6-dist.zip
and use latest OpenIMAJGrabber and BridJ.

Thanks,
Ronak Patel

On Fri, Dec 20, 2013 at 11:48 AM, Mirki [email protected] wrote:

Hi,
I've similar issues. I ran your instruction for creation of logging:

Here some sys Infos:

Linux raspberrypi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l
GNU/Linux

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)

Source:
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Date;

import javax.imageio.ImageIO;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamMotionDetector;
import com.github.sarxos.webcam.WebcamMotionEvent;
import com.github.sarxos.webcam.WebcamMotionListener;
import com.github.sarxos.webcam.log.*;

public class Spion implements WebcamMotionListener {

public Spion() {
WebcamMotionDetector detector = new WebcamMotionDetector(Webcam.getDefault());
detector.setInterval(500);
detector.addMotionListener(this);
detector.start();
}

@OverRide
public void motionDetected(WebcamMotionEvent wme) {
System.out.println("Detected motion I Take now a Photo");
try {
this.takePhoto();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

public void takePhoto() throws IOException
{
String fileName = new Date().getTime() + ".png";
Webcam webcam = Webcam.getDefault();
webcam.open();
BufferedImage image = webcam.getImage();
ImageIO.write(image, "PNG", new File(fileName));
System.out.println("Foto mit Filename "+fileName+" abgelegt");

}

public static void main(String[] args) throws IOException {
WebcamLogConfigurator.configure("logback.xml");
new Spion();
System.in.read();
}

}

Output:
06:07:48,573 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Could NOT find resource [logback.groovy]
06:07:48,575 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Could NOT find resource [logback-test.xml]
06:07:48,577 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Found resource [logback.xml] at [file:/home/pi/testing/logback.xml]
06:07:49,873 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute
not set
06:07:50,055 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - Setting
ReconfigureOnChangeFilter scanning period to 30 seconds
06:07:50,057 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} -
Will scan for changes in [[/home/pi/testing/logback.xml]] every 30 seconds.
06:07:50,057 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - Adding
ReconfigureOnChangeFilter as a turbo filter
06:07:50,131 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
06:07:50,187 |-INFO in ch.qos.logback.core.joran.action.AppenderAction -
Naming appender as [STDOUT]
06:07:51,770 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This
appender no longer admits a layout as a sub-component, set an encoder
instead.
06:07:51,770 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To
ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
06:07:51,770 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See
also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
06:07:51,783 |-INFO in
ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of
ROOT logger to DEBUG
06:07:51,785 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction

  • Attaching appender named [STDOUT] to Logger[ROOT]
    06:07:51,794 |-INFO in
    ch.qos.logback.classic.joran.action.ConfigurationAction - End of
    configuration.
    06:07:51,831 |-INFO in
    ch.qos.logback.classic.joran.JoranConfigurator@5bf734 - Registering
    current configuration as safe fallback point

06:07:52.141 [main] INFO com.github.sarxos.webcam.Webcam -
WebcamDefaultDriver capture driver will be used
06:07:52.227 [webcam-discovery-service] DEBUG
c.g.s.w.d.b.WebcamDefaultDriver - Searching devices
Dec 20, 2013 6:07:52 AM org.bridj.BridJ log
INFO: Embedded resource paths for library 'bridj':
[org/bridj/v0_7_0/lib/linux_armhf/libbridj.so,
org/bridj/v0_7_0/lib/linux_armhf/bridj.so,
org/bridj/v0_7_0/lib/linux_armhf/libbridj.jnilib,
org/bridj/lib/linux_armhf/libbridj.so, org/bridj/lib/linux_armhf/bridj.so,
org/bridj/lib/linux_armhf/libbridj.jnilib, lib/linux_armhf/libbridj.so,
lib/linux_armhf/bridj.so, lib/linux_armhf/libbridj.jnilib,
libs/linux_armhf/libbridj.so, libs/linux_armhf/bridj.so,
libs/linux_armhf/libbridj.jnilib]
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Loading library
/tmp/BridJExtractedLibraries5993403884817856534/libbridj.so
Java HotSpot(TM) Client VM warning: You have loaded library
/tmp/BridJExtractedLibraries5993403884817856534/libbridj.so which might
have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c ', or
link it with '-z noexecstack'.
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Loaded library
/tmp/BridJExtractedLibraries5993403884817856534/libbridj.so
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Calls logs enabled
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Runtime for
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber :
org.bridj.cpp.CPPRuntime
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Registering type
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Environment var LD_LIBRARY_PATH = null
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Environment var DYLD_LIBRARY_PATH = null
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Environment var PATH =
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Property java.library.path = /usr/java/packages/lib/arm:/lib:/usr/lib
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Property sun.boot.library.path =
/usr/lib/jvm/jdk-7-oracle-armhf/jre/lib/arm
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Property gnu.classpath.boot.library.path = null
Dec 20, 2013 6:07:53 AM org.bridj.BridJ log
INFO: Looking for library 'OpenIMAJGrabber' in paths [null, .,
/usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin,
/usr/java/packages/lib/arm, /lib, /usr/lib,
/usr/lib/jvm/jdk-7-oracle-armhf/jre/lib/arm,
/usr/lib/jvm/jdk-7-oracle-armhf/jre/bin, /lib/arm-linux-gnueabi,
/usr/lib/arm-linux-gnueabi, /usr/lib32, /lib32, /usr/lib, /lib,
/usr/local/lib]
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Embedded resource paths for library 'OpenIMAJGrabber':
[com/github/sarxos/webcam/ds/buildin/lib/linux_armhf/libOpenIMAJGrabber.so,
com/github/sarxos/webcam/ds/buildin/lib/linux_armhf/OpenIMAJGrabber.so,
com/github/sarxos/webcam/ds/buildin/lib/linux_armhf/libOpenIMAJGrabber.jnilib,
org/bridj/v0_7_0/lib/linux_armhf/libOpenIMAJGrabber.so,
org/bridj/v0_7_0/lib/linux_armhf/OpenIMAJGrabber.so,
org/bridj/v0_7_0/lib/linux_armhf/libOpenIMAJGrabber.jnilib,
org/bridj/lib/linux_armhf/libOpenIMAJGrabber.so,
org/bridj/lib/linux_armhf/OpenIMAJGrabber.so,
org/bridj/lib/linux_armhf/libOpenIMAJGrabber.jnilib,
lib/linux_armhf/libOpenIMAJGrabber.so, lib/linux_armhf/OpenIMAJGrabber.so,
lib/linux_armhf/libOpenIMAJGrabber.jnilib,
libs/linux_armhf/libOpenIMAJGrabber.so,
libs/linux_armhf/OpenIMAJGrabber.so,
libs/linux_armhf/libOpenIMAJGrabber.jnilib]
BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory BridJ:
dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native org.bridj.Pointer
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getImage()
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native org.bridj.Pointer
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getVideoDevices()
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native int
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.nextFrame()
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native void
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.setTimeout(int)
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native boolean
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(int,int,double)
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native boolean
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(int,int,double,org.bridj.Pointer)
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native void
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.stopSession()
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native int
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getWidth()
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Method public native int
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.getHeight()
cannot be mapped : java.lang.RuntimeException: Library 'OpenIMAJGrabber'
was not loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.CRuntime.register(CRuntime.java:449)
at org.bridj.CRuntime.register(CRuntime.java:344)
at org.bridj.BridJ.register(BridJ.java:363)
at org.bridj.BridJ.register(BridJ.java:203)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:60)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Registering type org.bridj.cpp.CPPObject
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Registering type org.bridj.StructObject
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: Registering type org.bridj.NativeObject
Dec 20, 2013 6:07:54 AM org.bridj.BridJ log
INFO: // size = 0, alignment = -1
struct class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber {
}
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Runtime for org.bridj.TimeT : org.bridj.CRuntime
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.TimeT
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.TimeT$timeval_customizer
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.StructCustomizer
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.TimeT$timeval
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type org.bridj.AbstractIntegral
Dec 20, 2013 6:07:55 AM org.bridj.BridJ log
INFO: Registering type java.lang.Number
BridJ: dlopen error when loading
/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so :
libv4l2.so.0: cannot open shared object file: No such file or directory

java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded
successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
at org.bridj.BridJ.initialize(BridJ.java:1117)
at org.bridj.NativeObject.(NativeObject.java:50)
at org.bridj.StructObject.(StructObject.java:46)
at org.bridj.cpp.CPPObject.(CPPObject.java:55)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:64)

at
com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at
com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Exception in thread "main" 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:123)
at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:706)
at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:769)
at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:746)
at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:724)
at Spion.(Spion.java:18)
at Spion.main(Spion.java:50)

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:188)
at
com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:115)

... 6 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:122)
at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:38)

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:36)
at
com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

Caused by: java.lang.RuntimeException: Failed to allocate new instance of
type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber
at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:806)
at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1016)
at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:898)
at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:270)
at org.bridj.BridJ.initialize(BridJ.java:1117)
at org.bridj.NativeObject.(NativeObject.java:50)
at org.bridj.StructObject.(StructObject.java:46)
at org.bridj.cpp.CPPObject.(CPPObject.java:55)
at
com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:64)

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
Caused by: java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not
loaded successfully from file
'/tmp/BridJExtractedLibraries5993403884817856534/OpenIMAJGrabber.so'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1061)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:1038)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:607)
at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:765)
... 13 more


Reply to this email directly or view it on GitHubhttps://github.com//issues/153#issuecomment-30991074
.

@Mirki
Copy link

Mirki commented Dec 20, 2013

Hi. I'm using already the latest Version of Webcam Capture..It's 0.3.10-RC6

@Mirki
Copy link

Mirki commented Dec 20, 2013

I Updated now the libv4lconvert and the issue getting better :-)

This is now my new Exception

16:50:29.071 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Opening webcam device Hercules Dualpix Exchange /dev/video0
16:50:29.075 [atomic-processor-1] DEBUG c.g.s.w.d.b.WebcamDefaultDevice - Webcam device /dev/video0 starting session, size java.awt.Dimension[width=176,height=144]
16:50:29.085 [main] DEBUG com.github.sarxos.webcam.WebcamLock - Unlock Webcam Hercules Dualpix Exchange /dev/video0
16:50:29.089 [webcam-lock-[Hercules Dualpix Exchange /dev/video0]] DEBUG com.github.sarxos.webcam.WebcamLock - Lock updater has been interrupted
Exception in thread "main" 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:122)
        at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:38)
        at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(WebcamOpenTask.java:20)
        at com.github.sarxos.webcam.Webcam.open(Webcam.java:189)
        at com.github.sarxos.webcam.Webcam.open(Webcam.java:149)
        at com.github.sarxos.webcam.WebcamMotionDetector.start(WebcamMotionDetector.java:260)
        at Spion.<init>(Spion.java:21)
        at Spion.main(Spion.java:50)
Caused by: java.lang.NullPointerException
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(Native Method)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice.open(WebcamDefaultDevice.java:253)
        at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(WebcamOpenTask.java:38)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)

@sarxos
Copy link
Owner

sarxos commented Dec 23, 2013

Hi,

If you had outdated libv4lconvert please also make sure to upgrade these ones:

$ readelf -d OpenIMAJGrabber.so
Dynamic section at offset 0x3cb8 contains 30 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [libv4l2.so.0]
 0x00000001 (NEEDED)                     Shared library: [libv4lconvert.so.0]
 0x00000001 (NEEDED)                     Shared library: [libjpeg.so.8]
...

If you have the same error after you upgraded above libraries, please follow this instruction for how to enable debug logs (especially step 6). After you execute your app in such a way, the output will be much more verbose and may reveal us some mysteries.

@johngamarra
Copy link

Hi, I'm having this exact problem with a BeagleBoard-xM running oracle jdk 7 update 51, already tried a lot of workarounds, but I'm still getting NullPointerException... someone can help me?

@ronak1919
Copy link
Author

If cross-compiling for BeagleBoard, install ARM toolchain and Lib C
headers:

apt-get update
apt-get install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross

Thanks,
Ronak Patel

@johngamarra
Copy link

installed gcc-arm-linux-gnueabihf libc6-dev-armhf-cross

still same error

I'm running Ubuntu 12.04 ARM

@JanJansen47
Copy link

I WAS using this solution on my PI with the same OS (latest) , java 8 jdk and .. RC5 versions as mentioned here . It is running nicely but it is not stable. It dies after serveral hours taking photo's. In fact this was exactly the same behavior as with the v4lvj solution I tried earlier. To be clear I have no issues with current supplies to the webcam's. I'm now using a temp workaround. I simply call fswebcam from within java. This is now running for several days but that is of course no guarantee..

@johngamarra
Copy link

Could you please provide me the code to do the workaround? thanks...

@JanJansen47
Copy link

This is my code: it's a simple modification of yours. Sorry for some of the Dutch logging text.
I develop with Eclipse (Buildpath below) and export a runnable tar. The lib's are extracted in the JAR. This tar runs great on my Ubuntu and not reliable (some hours only) on the PI.

Did some experiments more with one webcam. I'm getting the impression the webcam's I'm using contribute to the problem. The JPEG of some cam's is not okay according fswebcam. Some of the leading JPEG bytes raise a problem.

By the way; I was working on the Hadamard transformations and sub sequent coding to reduce image data 30 years ago. One image took ONE Night to transform and transform back.

Are there good articals to understand the support for video devices better in Linux? ( I'm not a programmer but autodidact on Java for embedded systems; I like to understand better.)

Eclipse Buildpath:

Ad said I'm using the latest Oracle v8 , latest OS version and your RC5. And indeed I had to install missing parts, you included in RC5 in the PI directories manually.

Regards

Jan Jansen

import java.awt.Dimension;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

import javax.imageio.ImageIO;

import com.github.sarxos.webcam.Webcam;


/**
*  take single picture for each webcam.
*
*/
public class test {


         private final static Logger logger = Logger.getLogger(test.class.getName());
         private static FileHandler fh = null;

         public static void init(String nom){
             Date datum = new Date(System.currentTimeMillis());     

         try {
         fh=new FileHandler("/home/"+nom+"/Desktop/loggerCAM " + datum + ".log", false);
         } catch ( IOException e) {
         e.printStackTrace();
         }
         Logger l = Logger.getLogger("");
         fh.setFormatter(new SimpleFormatter());
         l.addHandler(fh);
         l.setLevel(Level.CONFIG);
         }



        public static void main(String[] args) {


            String nom = args [0]; // take care the files are in the correct directories (pi or jan)
            test.init(nom);  // Init de logger
            logger.log(Level.INFO, "message  start webcam" + System.currentTimeMillis());

          //final Webcam webcam = Webcam.getDefault();

           // Webcam.setTermSignalHandler(true); //  is a problem.... cannot find  the import.
            final Webcam webcam = Webcam.getWebcams().get(0);

            final Webcam buren = Webcam.getWebcams().get(1);

            if (webcam != null) {
                logger.log(Level.INFO,"Webcam: " + webcam.getName());
            } else {
            logger.log(Level.INFO,"No webcam detected");
            }

            if (buren != null) {
                logger.log(Level.INFO,"Buren: " + buren.getName());
            } else {
            logger.log(Level.INFO,"No webcam detected");
            }





                logger.log(Level.INFO,"Webcam: " + webcam.getName());

                             for (int i = 1; i <10;)           {  

                                 try {
                                      buren.setViewSize(new Dimension(320, 240));
                                      buren.open();
                                     String name = String.format("/home/"+ nom+"/Desktop/buren.jpg"); // volg numer datum weg
                                     logger.log(Level.INFO, "buren voor: " + i );
                                     ImageIO.write(buren.getImage(), "JPG", new File(name));
                                     buren.close();
                                     //System.out.format("File %s has been saved\n", name);
                                     logger.log(Level.INFO, "buren na  : " + i );
                             } catch (IOException t) {
                                     t.printStackTrace();}



                                try {
                                        webcam.setViewSize(new Dimension(320, 240));
                                        webcam.open();
                                        Thread.sleep(60000);
                                        String name = String.format("/home/"+ nom+"/Desktop/webcama.jpg"); // volg numer datum weg
                                        logger.log(Level.INFO, "webcam voor: " + i );
                                        ImageIO.write(webcam.getImage(), "JPG", new File(name));
                                        webcam.close();
                                        //System.out.format("File %s has been saved\n", name);
                                        logger.log(Level.INFO, "webcam na  : " + i );
                                } catch (IOException t) {
                                        t.printStackTrace();} catch (InterruptedException e) {
                                    // TODO Auto-generated catch block
                                    e.printStackTrace();
                                }



                             } 


        }
}

@JanJansen47
Copy link

First step: j an@Ubuntu-One:~$ sudo apt-get install fswebcam
Be sure fswebcam is installed:

Second step:
Make a Java project in Eclipse and use the source under package Shelltest

Third step:
Export the java project as a jar incluiding what is on the class path. In this case only the java JRE version 6. e.g. shelltest.jar

Fourth step:
move the jar to your PI. I put it in /home/pi/Desktop
Create a directory Images is Desktop (To store the images)

Fith step:
run the tar in Desktop:

java -jar shelltest.jar pi &

You need "pi" to tell the raspberry where to put log en images.
You need "&" to avoid to stop the execution of the java program when you log off,

For me this is really a workaround. I try to find a better solution... Although this works.

This program needs TWO webcam's; !!

Good luck.

package Shelltest;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

public class Shell {


    private final static Logger logger = Logger.getLogger(Shell.class.getName());
     private static FileHandler fh = null;

     public static void init(String nom){
         Date datum = new Date(System.currentTimeMillis());  

     try {
     fh=new FileHandler("/home/"+nom+"/Desktop/loggerCAMcommand2cams " + datum + ".log", false);
     } catch ( IOException e) {
     e.printStackTrace();
     }
     Logger l = Logger.getLogger("");
     fh.setFormatter(new SimpleFormatter());
     l.addHandler(fh);
     l.setLevel(Level.CONFIG);
     }


    public static void main(String[] args) throws InterruptedException {

        String nom = args [0]; // take care the files are in the correct directories (pi or jan)
        Shell.init(nom);  // Init de logger
        logger.log(Level.INFO, "message  start webcam" + System.currentTimeMillis());


        Shell obj = new Shell();
        int counter = 0;


        for(counter =1; counter <100; counter++){
        String command = "fswebcam -d /dev/video1 -r 640x480 /home/"+ nom+ "/Desktop/Images/video1"+ counter + ".jpg";
        String output = obj.executeCommand(command);
        Thread.sleep(15000);

        command = "fswebcam -d /dev/video0 -r 640x480 /home/"+ nom+ "/Desktop/Images/video0"+ counter + ".jpg";
        output = obj.executeCommand(command);
        logger.log(Level.INFO, "counter  " + counter);
        Thread.sleep(15000);
        if (counter==50){ counter = 1;}

        }
    }



    private String executeCommand(String command) {

        StringBuffer output = new StringBuffer();

        Process p;
        try {
            p = Runtime.getRuntime().exec(command);
            p.waitFor();
            BufferedReader reader = 
                            new BufferedReader(new InputStreamReader(p.getInputStream()));

                        String line = "";           
            while ((line = reader.readLine())!= null) {
                output.append(line + "\n");
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

        return output.toString();

    }

}

@sarxos
Copy link
Owner

sarxos commented Jan 31, 2014

Hi guys,

I do not have BeagleBoard to perform development, but what I can do to workaround this issue is to create (probably on weekend) separate capture driver which will work as the wrapper for fswebcam binary. The only thing what you will have to do in the code will be to set new driver to be used by Webcam Capture API, example use would be:

public class Example {
  static {
    Webcam.setDriver(new FsWebcamDriver());
  }
  public static void main(String[] args) {
    Webcam w = Webcam.getDefault();
    w.open();
    BufferedImage image = w.getImage(); 
    // etc...
    w.close();
  }
}

@sarxos
Copy link
Owner

sarxos commented Jan 31, 2014

By the way, if you have GStreamer (0.10.x) installed on your BeagleBoard you can use webcam-capture-driver-gstreamer to stream frames from the cameras. It is using gstreaamer-java under the hood.

sarxos added a commit that referenced this issue Feb 26, 2015
refs #286
refs #315
refs #244
refs #219
refs #194
refs #192
refs #189
refs #184
refs #176
refs #153
refs #152
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

6 participants