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

IPCam Utility: Program Waits Forever #205

Closed
ozymaxx opened this issue Apr 16, 2014 · 1 comment
Closed

IPCam Utility: Program Waits Forever #205

ozymaxx opened this issue Apr 16, 2014 · 1 comment

Comments

@ozymaxx
Copy link

ozymaxx commented Apr 16, 2014

Hi, i'm trying to connect to an IPCam using your library, which seems fine but the following code segment waits us forever to connect to the IPCam, i cannot get any clue about the status of the connection.

The erroneous code is derived from the example code I found on your website, given below:

        IpCamDevice ipcam = new B7210("B7210", "114.32.216.24");
        ipcam.setAuth(new IpCamAuth("demo", "demo"));
        ipcam.setSize(B7210.SIZE_QVGA);

        IpCamDriver driver = new IpCamDriver();
        driver.register(ipcam);

        Webcam.setDriver(driver);

        WebcamPanel panel = new WebcamPanel(Webcam.getDefault());
        panel.setFPS(0.5); // 1 frame per 2 seconds

        JFrame f = new JFrame("Night Tree Somewhere");
        f.add(panel);
        f.pack();
        f.setVisible(true);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Then, I modified the first line, and I wrote the following code, which includes the problem I describe at the beginning of the post.

            IpCamDevice ipcam = new IpCamDevice("asfsrsghyjtuy",       
            "http://139.179.202.29/", IpCamMode.PUSH, new IpCamAuth( "admin", "") );

    IpCamDriver driver = new IpCamDriver();
    driver.register(ipcam);

    Webcam.setDriver(driver);

    WebcamPanel panel = new WebcamPanel(Webcam.getDefault());

    JFrame f = new JFrame("Night Tree Somewhere");
    f.add(panel);
    f.pack();
    f.setVisible(true);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Thanks in advance, for your help :)

@sarxos
Copy link
Owner

sarxos commented Apr 17, 2014

Hi,

The image from your camera is exposed by the following URL:

http://139.179.202.29/videostream.cgi

So your code should rather be:

String uri = "http://139.179.202.29/videostream.cgi";
IpCamDevice ipcam = new IpCamDevice("asfsrsghyjtuy", uri, IpCamMode.PUSH, new IpCamAuth("admin", ""));

This is why the image is not loading. However, I found a bug with the basic authenticator which seems to be problematic here as well, so even if you fix the code, it will not work as long as there is authentication required. But no worries :) You can use this JAR in exchange of the v0.3.10-RC6 IP camera driver you are using currently. The bug I described is already fixed here:

https://oss.sonatype.org/content/repositories/snapshots/com/github/sarxos/webcam-capture-driver-ipcam/0.3.10-SNAPSHOT/webcam-capture-driver-ipcam-0.3.10-20140417.133214-18.jar

And here is the view from your camera:

removeme

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

2 participants