Saving a live snapshot as a jpg with a url?

bstreiss

n3wb
Joined
Dec 8, 2019
Messages
9
Reaction score
2
Location
Wa State
I'm wondering if there's an easy way to grab a jpg snapshot of the current camera image with a url? I can pull up an image in the browser with but i need to be able to grab an actual jpg as I'm accessing it via code and saving it to my local file server. So what I'm looking for is something line I'm using a Hikvision Cube camera if it matters, but I forget the exact specs off the top of my head.
 

mememex2

n3wb
Joined
Dec 18, 2019
Messages
6
Reaction score
1
Location
RU
I don't see a problem here. URL is still URL, doesn't matter if it ends with ".jpg" or not. In your code you use something like HttpClient.Get(" ") and you get your JPEG as bytes array. If you saving it somewhere you can name it as you want. What language do you use? If you show code it may help to clarify
 

bstreiss

n3wb
Joined
Dec 8, 2019
Messages
9
Reaction score
2
Location
Wa State
@mememex2 Thanks! I needed that swift kick in the backside to reboot my thinking process. :) Not entirely sure how it ended up working as I changed a few things before it started working, and now when I back those changes out everything still works. Guess it'll be a few more days of troubleshooting as it seems to be the initial contact with the camera that is the issue. I ended up finding a Hikvision document How to Get IPC MJPEG Stream via HTTP Commands that suggested I change my substream type to mjpeg. That combined with changing the way I accessed the image to simple imaage_tag (I'm using Rails 4) in my view seems to work.
 

bstreiss

n3wb
Joined
Dec 8, 2019
Messages
9
Reaction score
2
Location
Wa State
@mememex2 Haven't had any luck after the first initial day. I'm using ruby on rails 4.x on my own Ubuntu server. My camera is on a separate vlan, but I don't think that's the issue as I can ping the camera from the server, and just in case, I've got a firewall rule to allow traffic between the two.

Here's the line of code that I'm using:
<%= image_tag("", alt: "CamView") %>

have also tried
<%= image_tag("", alt: "CamView") %>

I am a bit confused though because when I clicked on the failed image on the web page and click "open link" it has no trouble opening the image.
 
Last edited:

mememex2

n3wb
Joined
Dec 18, 2019
Messages
6
Reaction score
1
Location
RU
@bstreiss , sorry I didn't get any noitifcation about your answer :(
In case if you still struggle with this:
It's impossible to embed credentials into HTML on another website. Browser policy blocks it. You can see that message at developer console. If you see image by clicking link it means you're already logged in to that camera web interface in another window/tab. If you will log off from camera or open your page in private/incognito mode, image won't load.
 
Top