-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Comments
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?
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. |
I am using webcam-capture-0.3.10-RC5-dist version |
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. |
I am using Raspbian(2013-09-10-wheezy-raspbian) With version webcam-capture-0.3.10-RC6-dist.zip give below error:
|
Its working perfectly with openJDK7. |
That's really strange... I was asking details because I'm running it on JDK8 on my RasPi and never noticed such issue.
My example simply takes one picture and store it in JPG file:
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: |
I guess that the very hot clue here is this warning from Java VM:
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. |
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, |
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: |
I am getting this error:
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 |
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?
Seems like it was never extracted and this was a bug existing before 0.3.10-RC6. |
I recall downloading the newest version of this API at the date i posted the bug report. I can try rebuilding sometime |
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? |
Hi, Here some sys Infos:
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:
|
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 Thanks, On Fri, Dec 20, 2013 at 11:48 AM, Mirki [email protected] wrote:
|
Hi. I'm using already the latest Version of Webcam Capture..It's 0.3.10-RC6 |
I Updated now the libv4lconvert and the issue getting better :-) This is now my new Exception
|
Hi, If you had outdated
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. |
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? |
If cross-compiling for BeagleBoard, install ARM toolchain and Lib C apt-get update Thanks, |
installed gcc-arm-linux-gnueabihf libc6-dev-armhf-cross still same error I'm running Ubuntu 12.04 ARM |
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.. |
Could you please provide me the code to do the workaround? thanks... |
This is my code: it's a simple modification of yours. Sorry for some of the Dutch logging text. 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
|
First step: j an@Ubuntu-One:~$ sudo apt-get install fswebcam Second step: Third step: Fourth step: Fith step:
You need 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();
}
} |
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 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();
}
} |
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. |
Thanks,
Ronak Patel
The text was updated successfully, but these errors were encountered: