Skip to content

Unable to retrieve snapPicture jpeg even on following the exact recommended steps #3

Description

@swapnill93
                              `Foscam camera = new Foscam(ip.add.here, 88, username, password);
                                System.out.println("CHECKING.." + camera.getName());
				String ret = camera.snapPicture();
				FileOutputStream fout = new FileOutputStream("testfoscam.jpg");
				byte[] rawBytes = ret.getBytes();
				
				fout.write( rawBytes , 0, rawBytes.length );
				fout.close();`

............................................................................................................................................................
OUTPUT>
CHECKING..FI9800P
............................................................................................................................................................
The output shows name of the camera . But the file foscam.jpg "can not be opened" since its damaged.
Also, I tried retrieving the picture as bufferedImage but it came out as null. The ImageIO can not decipher the bytes!


Maven:

foscamlib-mvn-repo https://raw.github.com/hypothermic/foscamapi/mvn-repo/ nl.hypothermic foscamlib 1.08-RELEASE

There is something wrong with the snapPicture() bytes
Q)

  1. How to convert snapPicture() to a viewable BufferedImage in the application itself.

  2. Is there any way to access the live video itself?

Thanks! Please help. Have been stuck on this since 2 days

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions