WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jmburton2001 on October 11, 2018, 10:37:39 AM

Title: Extract image from localhost server
Post by: jmburton2001 on October 11, 2018, 10:37:39 AM
Trying to follow -> How do I ask a good question?

Search, and research

I have searched the tech database, the forums, Google, reviewed the localhost markup, the camera vendor's (Hikvision) site, and other camera support forums  for the past few days and haven't found a solution that I can get to work.

Be specific

I have a webserver on localhost that serves up a jpg image of my surveillance cameras (https://i.imgur.com/kUuPZkV.png) from a single document named "camsonly.htm". I believe these images are created on the fly and don't actually exist on the server. At least I can't find them or the "image" directory that it points to. I have found that I can right-click anywhere in the area outlined in red and "Save Image As..." and it will save a jpg snapshot at that point in time. If I do it again and overwrite the previous image, it's updated to the current image. I have no way of grabbing the "Index?time=12345" files.

This image is updated (depending on the FPS to the browser) many times per second. I'd like to grab this image once or twice a second and display it in a box or a dialog like this. (https://i.imgur.com/8tomM8Z.png)

Back in the old days it was possible to access the camera feeds directly via http://CameraIP:port/index.htm?user=user&pw=password but now they use RTSP streams (which I know nothing about).

I'd like to grab this jpg and loop it with the current image so that it imitates the actual administrative console with "moving" images. When a button is pressed, it will do something. Maybe one of the buttons can be "Cameras OFF" that provides an overlay that shows a "signal lost" (https://i.imgur.com/VSruCBo.png) image. And the other button could be "Cameras ON" that continues the looping process with current images?

Make it relevant to others

I have a teenager that feels like they're under constant surveillance and I understand that. What they don't understand is that our server performs not only home security functions but real-time on and offsite backups among other things.  Their solution has been to remove cables from the cameras and/or the PoE switches, turn off the server, unplug it from the wall, the list goes on... When they do these things we lose the benefit of having these things. If someone breaks in, we have no evidence, no alerts, no phone calls or texts, etc. If the house burns down hopefully the server was able to transport our updated data offsite. Sometimes it's days before we find out the system's been tampered with and takes more days to track down what's been disabled, unplugged, etc.

I've offered to set an on/off schedule so that they will automatically go off and come back on but they won't agree on any times or days. I want to build something that will give them the illusion of control without having them continue to destroy or disable things.

Keep an open mind

Mind wide open! Thank you in advance for your insights!
Title: Re: Extract image from localhost server
Post by: JTaylor on October 11, 2018, 04:36:42 PM
Apologies if I didn't read your post closely enough but I think if you search for

    snapshot server slisten

in the TechDatabase it will put you on the right track.

Jim
Title: Re: Extract image from localhost server
Post by: jmburton2001 on October 12, 2018, 08:54:08 AM
Hi Jim!

Thank you for your reply and pointing me to that article. It's much appreciated!!!

Have a great weekend!
Title: Re: Extract image from localhost server
Post by: kdmoyers on October 18, 2018, 04:31:03 AM
I'm a week late, but reading this now, I don't think the snapshot server is quite what OP is looking for.

OP: I'm curious: when that screen is showing in your browser, what does the page HTML look like?  Perhaps something could be figured out by examining that.  If it's possible, could you post it here?

-K
Title: Re: Extract image from localhost server
Post by: JTaylor on October 18, 2018, 07:18:40 AM
I know, finding the source of the image would be the ideal but OP indicated he had no success on that front.   Another idea would be to use the WinInet extender and see if one could save the file from the link in the web page.   Not sure if it would work but something to try.

Jim
Title: Re: Extract image from localhost server
Post by: jmburton2001 on October 23, 2018, 10:47:46 AM
Thanks to kdmoyers and JTaylor for your replies!  ;D

Since this was a time sensitive project (and meant to prevent future arguments) I ended up going a totally different route. After reviewing the html and the way the server was presenting images, it just wasn't feasible to extract them. The easier route was to display the actual live feeds and then create an overlay that applied the "NO SIGNAL" image.

After that it was coding timers, error checking, and event logging. So far WinBatch has (once again) saved the day!