Get jpeg image from camera for web-page

Ouch

n3wb
Joined
Nov 24, 2015
Messages
19
Reaction score
6
Hi all, I have a small Lan hosted web-page which displays preview images from various webcams I have. The problem is I can't seem to get a still from my Hikvision DS-2CD2432 camera.

The accepted url for getting a stream or image seems to be http://user:pass@[ip.address]/streaming/channels/101/picture

However the user:pass@ bit seems to have been quietly dropped from chrome.

Is there any other way I can do this?

thanks
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,424
Reaction score
3,659
However the
Code:
user:pass@
bit seems to have been quietly dropped from chrome.
Chrome isn't the problem
Code:
user:pass@
works fine for me in chrome.
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
16,775
Reaction score
39,036
Location
Alabama
Hi all, I have a small Lan hosted web-page which displays preview images from various webcams I have. The problem is I can't seem to get a still from my Hikvision DS-2CD2432 camera.

The accepted url for getting a stream or image seems to be http://user:pass@[ip.address]/streaming/channels/101/picture
You're wanting stream or image from cam not via NVR correct? Does the "101" imply channel 1 from NVR, stream 01 (main)?

If so try just "1" like this: http://user:pass@[camip.address]/streaming/channels/1/picture

Add http port after cam ip if not 80 like this: http://user:pass@[camip.address]:http-port/streaming/channels/1/picture
 

Ouch

n3wb
Joined
Nov 24, 2015
Messages
19
Reaction score
6
changing to channel 1 makes no difference :(

I figured the chrome thing by looking at the inbuilt inspection/console, which flagged up a warning:

Code:
[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. `https://user:pass@host/`) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.
what is odd, is if I change the url of the image to not include the user:pass bit, I get a broken link, with the console suggesting authentication is a problem (error 401 i think), then click the image, which is a link to a full screen mjpeg stream with the following url:

Code:
http://user:pass@[ip.address]/Streaming/Channels/1/preview
the link works fine, and if I go back, the preview image then works, as if that chrome instance has then been authenticated. Thus I'm sure it's an authentication problem, and chrome is maybe being contrary about it.

For further clarity/context/confusion, here is the actual html, which shows a broken image until you click on the link and then go back:

Code:
<A href ="http://user:pass@192.168.1.203/Streaming/Channels/1/preview"><img src="http://192.168.1.203/Streaming/Channels/1/picture" width="420" height="237"></A>
<BR>
 

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,424
Reaction score
3,659
changing to channel 1 makes no difference :(

I figured the chrome thing by looking at the inbuilt inspection/console, which flagged up a warning:

Code:
[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. `https://user:pass@host/`) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details.
what is odd, is if I change the url of the image to not include the user:pass bit, I get a broken link, with the console suggesting authentication is a problem (error 401 i think), then click the image, which is a link to a full screen mjpeg stream with the following url:

Code:
http://user:pass@[ip.address]/Streaming/Channels/1/preview
the link works fine, and if I go back, the preview image then works, as if that chrome instance has then been authenticated. Thus I'm sure it's an authentication problem, and chrome is maybe being contrary about it.

For further clarity/context/confusion, here is the actual html, which shows a broken image until you click on the link and then go back:

Code:
<A href ="http://user:pass@192.168.1.203/Streaming/Channels/1/preview"><img src="http://192.168.1.203/Streaming/Channels/1/picture" width="420" height="237"></A>
<BR>
Sorry, I wasn't paying attention to the fact that you're using this in html. That may not work.
and to borrow an example from wikipedia,
Code:
http://www.google.com:search@evil.com/
@ auth works if you type it into the address bar, but I don't think it works on hrefs
 
Top