direct snapshot link (for web page)

GFM

Getting the hang of it
Joined
Sep 9, 2016
Messages
112
Reaction score
36
Location
Center of Canada
This is what I do with the foscam camera I am using:
http://[domain]:[port]/cgi-bin/CGIProxy.fcgi?usr%3D[username]%26pwd%3D[passwd]%26cmd%3DsnapPicture

Is there similar snapshot access to the Dahua cameras?

Of course using the above string errors out. :) Camera I am dealing with is the IPC-HDW4431C-A.

Tnx..
-G.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
sure, its just basic HTTP auth so this will work:
Code:
http://username:password@host/cgi-bin/snapshot.cgi
 
  • Like
Reactions: GFM

tangent

IPCT Contributor
Joined
May 12, 2016
Messages
4,421
Reaction score
3,655
can a user passwd be imbedded in the string?
If this is a public webpage, anybody that views the source will get the user name and password. On most cams you can ftp a picture to your webhost or you could rig up something server side to retrieve the picture and maybe cache it.
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
newer ones uses digest authorisation. Therefore it seems not to be possible to give the credentials together. I am still searching a similar function for capturing a mjpeg.
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
credentials in URI works fine for digest authentication as long as your client/library is not stupid.

Code:
--2017-01-26 17:32:04--  http://ptz:*password*@192.168.42.28/cgi-bin/snapshot.cgi
Connecting to 192.168.42.28:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to 192.168.42.28:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 435446 (425K) [image/jpeg]
Saving to: ‘snapshot.cgi’

snapshot.cgi        100%[=====================>] 425.24K  --.-KB/s   in 0.06s

2017-01-26 17:32:04 (6.44 MB/s) - ‘snapshot.cgi’ saved [435446/435446]
Firmware from Xmas 2016 on a camera I was one of the first people to buy in November..
 

TVT73

Pulling my weight
Joined
Aug 29, 2016
Messages
406
Reaction score
108
Location
Germany
Not for my ones. hdw4431 and hdw5231 both with latest firmware. Windows Firefox, and on fritzbox.

Dahuas Doku:
3.2Authentication
The Dahua video product supplies two authentication ways: basic authentication and digest authentication. If the http request does not
have “Authorization” , the Dahua video product returns 401, utill the http request has a legal authentication .

For example:

1. When basic authentication, the Dahua video product response:
401 Unauthorized
WWW-Authenticate: Basic realm=”XXXXXX”
Then the client encode the username and password with base64, send the following request:
Authorization: Basic VXZVXZ.

2. When digest authentication, the Dahua video product response:
WWW-Authenticate: Digest realm="DH_00408CA5EA04", nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef9 5ad",
stale=FALSE, qop="auth";
The client calculates the digest using username, password, nonce, realm and URI with MD5, then send the following request:
Authorization: Digest username="admin", realm="DH_00408CA5EA04", nc=00000001,cnonce="0a4f113b",qop="auth"
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef9 5ad",uri="cgi-bin/global.login?userName=admin",
response="65002de02df697e946b750590b44f8bf"
I really don´t understand why i get at home 404 not found, and on my workplace with hdw 4421 i am asked in an popup window for the credentials. Its really fuzzy.
Next thing, at home i cant use onvif connections. This could be another way for capturing. onvif doesn´t work. Maybe because of active easy4ip? Switching of doesn´t help. Which port uses dahua for onvif? 80?
 

nayr

IPCT Contributor
Joined
Jul 16, 2014
Messages
9,329
Reaction score
5,325
Location
Denver, CO
works for me on every single one of my cameras cause thats how Domoticz is pulling snapshots to email me.. from my 3MP 4300S to my Ultra Starlight, just checked all of em and I just updated everything to latest firmware lastnight.

you got any kinda proxy running on your network? I have p2p disabled, might be worth a shot nuking easy4ip
 
Top