Dahua url snapshot problem

Casama

n3wb
Apr 9, 2018
2
1
Hello,
I have Dahua camara model DH-IPC-HFW1320SN-W-0280B.

My problem is when I try to get an snapshot in C# application,
using URL:

because I get the 401 error (Unauthorized).

I already try with this ways:
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?1
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?0
http://xxx:xxx@192.168.1.201/cgi-bin/snapshot.cgi?loginuse=xxx&loginpas=xxx

When I try in firefox with user and pass included in the URL, the camera still ask for user and pass. I think this maybe can be the error in C# application.

I need the URL including user and pass thats works

Thanks in advance
 
  • Like
Reactions: Iurii
can you try
Code:
http://login:password@CAM-IP/cgi-bin/snapshot.cgi
 
Thanks for your answer 0blar, but still the same 401 error.

Dou you have any other idea? Thanks again
 
can you ping your cam on your network ?
what is the codec you use for streaming ?
 
Last edited:
Hello,
I have Dahua camara model DH-IPC-HFW1320SN-W-0280B.

My problem is when I try to get an snapshot in C# application,
using URL:

because I get the 401 error (Unauthorized).

I already try with this ways:
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?1
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?0
http://xxx:xxx@192.168.1.201/cgi-bin/snapshot.cgi?loginuse=xxx&loginpas=xxx

When I try in firefox with user and pass included in the URL, the camera still ask for user and pass. I think this maybe can be the error in C# application.

I need the URL including user and pass thats works

Thanks in advance


Greetings. I have the same problem dahua dh-ipc-hfw1230sp camera - I can’t get a snapshot, it requires a password ...
I tried the options:
http://192.168.1.108/cgi-bin/snapshot.cgi?username=admin&password=admin

http://192.168.1.108/cgi-bin/snapshot.cgi?u=admin&p=admin

http://192.168.1.108/cgi-bin/snapshot.cgi?loginuse=admin&loginpas=admin


I check in IE, after the request, the password request window pops up ...

Also tried
http://admin:admin@192.168.1.108/cgi-bin/snapshot.cgi?1
Error: Error Invalid Authority!
http://admin:admin@192.168.1.108/cgi-bin/snapshot.cgi?0
Error: Error Invalid Authority!

How can I immediately register a username and password in the URL?
 
Hello,
I have Dahua camara model DH-IPC-HFW1320SN-W-0280B.

My problem is when I try to get an snapshot in C# application,
using URL:

because I get the 401 error (Unauthorized).

I already try with this ways:
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?1
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?0
http://xxx:xxx@192.168.1.201/cgi-bin/snapshot.cgi?loginuse=xxx&loginpas=xxx

When I try in firefox with user and pass included in the URL, the camera still ask for user and pass. I think this maybe can be the error in C# application.

I need the URL including user and pass thats works

Thanks in advance


Maybe use a curl library, check out Go3Team PHP examples that use curl() in post #43...
libcurl - overview
how to get a snapshot using php for dahua SD49225T-HN
 
Last edited:
You need to use digest authentication, e.g. with curl:

curl --digest --user username:password -O 'http://192.168.xx.yy/onvifsnapshot/media_service/snapshot?channel=1&subtype=1'

Thank you! I've been struggling with this for more than an hour.


worked in a browser, albeit asking for a password, and every other method I'd tried to pass the user/pass did not work.

Your method worked. Thanks again!