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

webcam does not work now #164

Closed
elainejo21 opened this issue Dec 2, 2013 · 11 comments
Closed

webcam does not work now #164

elainejo21 opened this issue Dec 2, 2013 · 11 comments

Comments

@elainejo21
Copy link

receives this error:

Exception in thread "main" java.lang.RuntimeException: java.io.EOFException
    at com.github.sarxos.webcam.WebcamLock.read(WebcamLock.java:202)
    at com.github.sarxos.webcam.WebcamLock.isLocked(WebcamLock.java:279)
    at com.github.sarxos.webcam.WebcamLock.lock(WebcamLock.java:223)
    at com.github.sarxos.webcam.Webcam.open(Webcam.java:181)
    at com.github.sarxos.webcam.Webcam.open(Webcam.java:147)
    at Webpic.main(Webpic.java:21)
Caused by: java.io.EOFException
    at java.io.DataInputStream.readFully(DataInputStream.java:180)
    at java.io.DataInputStream.readLong(DataInputStream.java:399)
    at com.github.sarxos.webcam.WebcamLock.read(WebcamLock.java:200)
    ... 5 more
@elainejo21
Copy link
Author

this is the code:

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

import javax.imageio.ImageIO;

import com.github.sarxos.webcam.Webcam;


/**
 * Example of how to take single picture.
 * 
 * @author Bartosz Firyn (SarXos)
 */
public class Webpic {

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

                // get default webcam and open it
                Webcam webcam = Webcam.getDefault();

                webcam.open();

                // get image
                BufferedImage image = webcam.getImage();

                // save image to PNG file
                ImageIO.write(image, "PNG", new File("test.png"));
        }
}

@sarxos
Copy link
Owner

sarxos commented Dec 2, 2013

Hi @elainejo21

Please provide more details:

  • What Webcam Capture version is used,
  • What OS.

@elainejo21
Copy link
Author

os- win 7 then webcam-capture-0.3.10-RC4.jar

@elainejo21
Copy link
Author

then i have slf4j-api-1.7.2.jar, bridj-0.7-20130703.103049-42.jar, slf4j-simple- api-1.7.2.jar

this works fine for a month but since this morning, it did not work and receive the error above

@sarxos
Copy link
Owner

sarxos commented Dec 2, 2013

@elainejo21

Please upgrade to 0.3.10-RC6 since this bug has been already reported in #131 and fixed about 4 months ago in 0.3.10-RC5.

If for some reason you don't wont to upgrade (don't worry, RC6 is fully compatible with RC4 since there was only bug fixes implemented in the middle), you can go to your TEMP directory and remove all files starting with .webcam-lock-*. But please note that, if you not upgrade, this problem will most probably happen again!

@sarxos sarxos closed this as completed Dec 2, 2013
@elainejo21
Copy link
Author

but i will use the same code?

@sarxos
Copy link
Owner

sarxos commented Dec 2, 2013

Yes. Only JAR must be updated to newer one.

@elainejo21
Copy link
Author

it works now! you are so great! thanks :)

@sarxos
Copy link
Owner

sarxos commented Dec 2, 2013

You're welcome :)

@ketansnadar
Copy link

from where shall i download webcam-capture-0.3.10-RC6.jar

@sarxos
Copy link
Owner

sarxos commented Jun 28, 2014

The newest one is 0.3.10-RC7 and you can find it here (webcam-capture-0.3.10-RC7-dist.zip). However, if you still want to use RC6, the you can find it here, but please note that there were many fixes introduced in RC7.

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

No branches or pull requests

3 participants