-
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
Unable to get Webcam Capture to work on Raspberry Pi (lock problem, SIGSEGV crash, camera not detected) #327
Comments
UPDATE I enabled the camera in raspi-config and ran it again and got the following result.
So I ran the suggested command
And then I got this result
|
Actually just figured it out.... Apologies for posting but thought I'd through my solution up anyway. Added fswebcam as a driver, downloaded it here http://mvnrepository.com/artifact/com.github.sarxos/webcam-capture-driver-fswebcam/0.3.10 and then added the jar to my library then added this code above the main method static { |
Hi @FrLukeDuke, The https://github.com/sarxos/webcam-capture/wiki/How-To-Configure-Raspberry-Pi In regards to your issue - unfortunately In regards to this:
It seems like this is some permission issue or the file is in use by another process. This exception is being thrown when Java is not able to write to file in |
I had trouble when trying to use the V4l4jDriver. Does this need to be installed on the pi aswell for it to work? |
No, you just download the JAR in the same way as with Some dependencies must be installed (usually they already are), if I am correct this should do it:
(note: here I'm using devel, but you can install production) |
Tried that and tried to run with the V4l4jDriver. I'm now getting this error in the terminal
I've no problem with this sl4j error. This comes up when I get a successful run
|
Seems like you have not added JAR with The message from SLF4J is not an error. It's a warning and it tells you that you have not added any logger implementation (e.g. Logback, SLF4J Simple, etc) into the classpath. |
Hi @FrLukeDuke, The "shaded" JAR is a name for a JAR with all necessary classes included inside. E.g. in classpath you have many, sometimes even hundred JARs, which can be repackaged into the single JAR which is later described as "shaded". Instead of deploying these many JARs you can deploy single, shaded JAR. Ok, now back to your problem. I should describe this in more details on the wiki page (this is already fixed) instead of the driver page, but you need to have one more JAR (for V4L4J JAR itself). It can be downloaded from Maven Central: http://search.maven.org/#artifactdetails|com.github.sarxos|v4l4j|0.9.1-r507|jar Just FYI, please take a look at Maven project, I'm using it for many years now and I do not have to bother about JARs and dependencies any more. It's enough to add small XML snippet into |
Much obliged for all your help. I certainly will look into the Maven project. I added the additional JAR and now I'm getting this error. I suspect it may be my webcam?
The Lines In my program which are mentioned in the error are
and line 60 which is the line in my main method which instantiates an instance of the class which my logic is contained within |
Hi @FrLukeDuke, Before stating if this is caused by the webcam or not, lets try to debug things a little bit. Device impl scans all possible formats and prints them to the console in trace level. To make use of this feature you will have to enable logging mechanism. To do that please follow the steps below: Download slf4j-simple-1.7.2.jar and include it in classpath, Add below code in your app static {
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "info");
System.setProperty("org.slf4j.simpleLogger.log.com.github.sarxos.webcam.ds.v4l4j", "trace");
Webcam.setDriver(new V4l4jDriver());
} Example: import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamViewer;
import com.github.sarxos.webcam.ds.v4l4j.V4l4jDriver;
public class V4l4jViewerExample {
static {
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "info");
System.setProperty("org.slf4j.simpleLogger.log.com.github.sarxos.webcam.ds.v4l4j", "trace");
Webcam.setDriver(new V4l4jDriver());
}
public static void main(String[] args) {
new WebcamViewer();
}
} After you run the app, you should see some messages in the console, e.g. in my case this is something like:
In my case it does not support neither RGB24, nor BGR24, nor YUV420. I need to figure out why. |
I did small enhancement in the code to w/a this strange scenario and now, even when format resolution is reported as Can you please try with this fix? You have to download and replace JAR for V4L4J Webcam Capture driver: |
It works! Brilliant! It worked straight away with the addition of the updated JAR. Cant thank enough you for all your help. |
Great :) I'm glad it works! Take care. |
Hello, sarxos, I am trying to run webcam in Odroid c2, I need v4l4j jar for it, the link you gave crashed, can you give alternative jar link please. ([https://oss.sonatype.org/content/repositories/snapshots/com/github/sarxos/webcam-capture-driver-v4l4j/0.3.11-SNAPSHOT/webcam-capture-driver-v4l4j-0.3.11-20150416.101824-7.jar]) |
Trying to execute a jar file compiled with the "How to take picture and save to file" example on a raspbberry pi and am encountering the following error:
Any suggestions of a fix?
Kind Regards
The text was updated successfully, but these errors were encountered: