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

doesnt work on raspberry #375

Closed
ghost opened this issue Aug 6, 2015 · 6 comments
Closed

doesnt work on raspberry #375

ghost opened this issue Aug 6, 2015 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 6, 2015

see here -> http://stackoverflow.com/questions/31844531/library-webcam-capture-by-sarxos-not-working-on-raspberry

@sarxos
Copy link
Owner

sarxos commented Aug 6, 2015

Hi @kolonka,

People did experience problems with Raspberry Pi in the past using default driver. The solution in your case may be replacing driver by a different one, e.g. webcam-capture-driver-v4l4j which seems to be the most stable on RasPi.

The JARs you have to include in your classpath:

The webcam-capture-driver-v4l4j is only for Linux and for now it is compiled for x64 and armhf architectures. In case of x32 or armel you will have to compile it on your own so please verify what arch your RasPi is - either armel or armhf.

The code:

static {
    Webcam.setDriver(new V4l4jDriver()); // set driver to be used
}

public static void main(String[] args) {
    JFrame frame = new JFrame("V4L4J Webcam Capture Driver Demo");
    frame.add(new WebcamPanel(Webcam.getDefault()));
    frame.pack();
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

@ghost
Copy link
Author

ghost commented Aug 6, 2015

i am using standard raspbian from https://www.raspberrypi.org/downloads/
when i test your code, i get noclassdeffounderror ...webcamdriver
caused byclassnotfoundexception ... webcamdriver

sth is still wrong

i imported the following libs:

birdj-0.7.0
slf4j-api-1.7.2
v4I4j-0.9.1-r507
webcam-capture-0.3.10
webcam-capture-driver-v4I4j-0.3.11-20150713.101304

@sarxos
Copy link
Owner

sarxos commented Aug 6, 2015

You need these JARs:

  • slf4j-api-1.7.2
  • v4I4j-0.9.1-r507
  • webcam-capture-0.3.10
  • webcam-capture-driver-v4I4j-0.3.11-20150713.101304

Please provide detailed exception. The "noclassdeffounderror" or "byclassnotfoundexception" are meaningless without the class names.

@sarxos
Copy link
Owner

sarxos commented Aug 6, 2015

@ghost
Copy link
Author

ghost commented Aug 6, 2015

ah.. i run the wrong artifact, its taking pictures now... but there is a fail with your logger:

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.

i solved this last time by adding another slf4j library

@sarxos
Copy link
Owner

sarxos commented Aug 7, 2015

Indeed, this warning tells you that SLF4J has no binding added to the classpath. You can either use slf4j-simple or some more sophisticated one like Logback which is my favourite one.

I haven't added binding to the classpath on purpose because most people does not need it and I had reports in the past about making logs less verbose (now you can control verbosity on your own through the logger configuration).

I'm glad the issue is resolved. In case of any additional issues please do not hesitate creating new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant