You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`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!
You would have to use some sort of JPEG parser. This functionality is not included in the library. This library is merely a HTTP wrapper around the API and only returns unparsed/raw JPEG.
You can use GStreamer or OpenCV to access the stream over RTSP, here's an example: https://github.com/hypothermic/FoscamViewer (it's quite an old project and isn't supported anymore but I think it's a good example).
You would have to use some sort of JPEG parser. This functionality is not included in the library. This library is merely a HTTP wrapper around the API and only returns unparsed/raw JPEG.
You can use GStreamer or OpenCV to access the stream over RTSP, here's an example: https://github.com/hypothermic/FoscamViewer (it's quite an old project and isn't supported anymore but I think it's a good example).
............................................................................................................................................................
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-RELEASEThere is something wrong with the snapPicture() bytes
Q)
How to convert snapPicture() to a viewable BufferedImage in the application itself.
Is there any way to access the live video itself?
Thanks! Please help. Have been stuck on this since 2 days
The text was updated successfully, but these errors were encountered: