sarxos / webcam-capture

The goal of this project is to allow integrated or USB-connected webcams to be accessed directly from Java. Using provided libraries users are able to read camera images and detect motion. Main project consist of several sub projects - the root one, which contains required classes, build-in webcam driver compatible with Windows, Linux and Mac OS, which can stream images as fast as your camera can serve them (up to 50 FPS). Main project can be used standalone, but user is able to replace build-in driver with different one - such as OpenIMAJ, GStreamer, V4L4j, JMF, LTI-CIVIL, FMJ, etc.
http://webcam-capture.sarxos.pl
MIT License
2.27k stars 1.11k forks source link

PS3 Eye not working #401

Open gregkotsaftis opened 9 years ago

gregkotsaftis commented 9 years ago

I only have a PS3 Eye in my Windows 7 PC. Althought the cam is working in Windows, a simple java test reports:

13/10/2015 21:39:27,189  INFO com.github.sarxos.webcam.Webcam.getDriver():971 - WebcamDefaultDriver capture driver will be used
13/10/2015 21:39:27,326  WARN com.github.sarxos.webcam.Webcam.getDefault():887 - No webcam has been detected!

The code used is:

try
{
    Webcam webcam = Webcam.getDefault();
    if( webcam!=null )
    {
        if( webcam.open() )
        {
            ImageIO.write(webcam.getImage(), "PNG", new File("webcam-hello-world.png"));
        }
        else
        {
            System.err.println("---Webcam not opened!");
        }
    }
    else
    {
        System.err.println("---No webcam found!");
    }
}
catch(Exception ex)
{
    ex.printStackTrace();
}

My classpath includes webcam-capture-0.3.10.jar and bridj-0.6.2.jar, is there something wrong with the code or PS3 Eye is not supported?

sarxos commented 9 years ago

Hi @gregkotsaftis,

I suppose that PS3 Eye camera is not UVC-compliant. I googled a little bit and haven't found any confirmation for it to be UVC-compliant but several posts allows me to conclude that it really isn't. For example it does not work on Ubuntu and you need to have dedicated driver for it. That means it does not work on the UVC drivers which are build-in. Same for Apple's Mac - you need special driver to run it. Seems like Windows need dedicated driver as well (maybe not in recent days - on modern systems it may be build in).

gregkotsaftis commented 9 years ago

I have bought Sony CL-Eye driver, and the cam works in Windows. I do not know if the driver is a UVC-compliant or not. Still, I tried the same example in an Acer laptop and I got this exception:

HD WebCam 0
com.github.sarxos.webcam.WebcamException: Cannot start native grabber!
    at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice.open(WebcamDefaultDevice.java:330)
    at ...blah...
phrack commented 8 years ago

My project has had no problems using the PS3eye on Linux (Ubuntu and Arch), but it doesn't work on Windows unless the application is launched from Java Web Start. We have no idea why the latter case works because it seems like it shouldn't work under any circumstance.

On another note, we don't really like the PS3eye for computer vision applications because it's very sensitive to light conditions and gets more "noise" than your average webcam.

PS. It doesn't work on Mac under any circumstance.

sarxos commented 8 years ago

Hi @gregkotsaftis, @phrack,

Computer vision on Linux machines is pretty straightforward - there is a libv4l2 middleware that resolves compatibility and connectivity issues for us, and all you need to do is to take the v4l api and use it. On Windows there are much more tricks & caveats (e.g. no locking, sharing capture graph between processes), but the fact that PS3eye is working in Java Web Start and not in normal Java application is completely surprising for me!

Is this the one you are talking about?

http://allegro.pl/kamera-sony-eye-tv-ps3-move-nowa-sklep-tanio-i5749465007.html

Can you please confirm, so I can buy this camera and test it by myself (unfortunately I cannot check on Mac, I do not own one)? Or did you switch to other webcam that is working well?

phrack commented 8 years ago

Yea, for reference here it is on Amazon:

http://www.amazon.com/PlayStation-Eye-3/dp/B000VTQ3LU/ref=sr_1_1?ie=UTF8&qid=1446468927&sr=8-1&keywords=ps3eye

Everything works better on Linux. We tend to have to fight Windows a little and Mac a lot.

I primarily just use the MS Lifecam HD-3000 because it works well on Linux, Mac, and Windows. The PS3eye is a pain even when it does work because it's so sensitive to lighting conditions.

sarxos commented 8 years ago

Ok, will purchase it and perform some tests in regards to API working in Web Start and not in classic app. This may be interesting. Any other PS3Eye issues are most likely caused by lack of the UVC support or just partial support.

sarxos commented 8 years ago

Ok, I have PS3 Eye. It works really nice on my Ubuntu. Now I need to test it on Windows. Will keep you informed.

salocinx commented 8 years ago

Hi sarxos. Any news regarding ps eye on windows? It is not recognized by your lib, but I really need to use the PS Eye 3 for my project and I would love to use your webcam lib too :-)