Enable/Disable Privacy Masking using the Dahua HTTP API

Buttan Butt

Getting the hang of it
Joined
Jun 4, 2017
Messages
86
Reaction score
56
Location
Sweden yeah!
Hello there!

I'm struggeling to find out if it's possible to Enable/Disable Privacy Masking by using the Dahua HTTP API.

I've tried but until now, I still haven't figured out if it's possible. @nayr made a posting about Switching Dahua Day/Night Profile via IPC HTTP API that has been really helpful. But I still haven't solved this.

Please let me know if you have any idea how to solve this ... Is it even possible? It can be done in the Web GUI but I need to automate this task using the HTTP API.

Cheers!
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,673
Reaction score
14,017
Location
USA
Hmm, I don't see anything about the privacy masks either. It isn't impossible to use the undocumented internal API that the web GUI uses, but it is rather painful since you have to log in, do your thing, log out, etc, and it is a lot more complicated than just sending one request.
 

Buttan Butt

Getting the hang of it
Joined
Jun 4, 2017
Messages
86
Reaction score
56
Location
Sweden yeah!
Hmm, I don't see anything about the privacy masks either. It isn't impossible to use the undocumented internal API that the web GUI uses, but it is rather painful since you have to log in, do your thing, log out, etc, and it is a lot more complicated than just sending one request.
Thanks. I tried to "spy" on what my browser sent but i failed.
 

adamg

Pulling my weight
Joined
Sep 19, 2017
Messages
250
Reaction score
129
Easy money guys.

For region block 0: (there are also Covers[1], Covers[2], and Covers[3] on my camera)
turn on block 0
http://[IP]/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[0].EncodeBlend=true
turn off block 0
http://[IP]/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[0].EncodeBlend=false

Check current settings with:
http://[IP]/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget

Add the username/password into the URL if you don't want to have to manually fill in the popup credential request.
 

Buttan Butt

Getting the hang of it
Joined
Jun 4, 2017
Messages
86
Reaction score
56
Location
Sweden yeah!
Easy money guys.

For region block 0: (there are also Covers[1], Covers[2], and Covers[3] on my camera)
turn on block 0
http://[IP]/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[0].EncodeBlend=true
turn off block 0
http://[IP]/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[0].EncodeBlend=false

Check current settings with:
http://[IP]/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget

Add the username/password into the URL if you don't want to have to manually fill in the popup credential request.
Thank you @adamg

It works very well!
 

camkeke

n3wb
Joined
Feb 19, 2020
Messages
15
Reaction score
6
Location
USA
This does not seem to work with a PTZ camera (supports mosaic and "color lump"). Do you know what's the right target instead of the videoWidget?
 

camkeke

n3wb
Joined
Feb 19, 2020
Messages
15
Reaction score
6
Location
USA
Got it! For the 2.x API:

/cgi-bin/configManager.cgi?action=setConfig&PrivacyMasking[0][1].Enable=false
To retrieve the config and see how many slots are present: /cgi-bin/configManager.cgi?action=getConfig&name=PrivacyMasking

The neat thing is that you can deactivate/activate WITHOUT removing the masks. You cannot do this in the UI, at least in mine. Hope this helps!
 
Top