Dahuas lose custom bitrate upon reboot. Any work around?

I was able to replicate this on a IPC-T5442TM-AS on V2.800.0000000.10.R, Build Date: 2019-11-18.
I had my bitrate set at 10240, rebooted under System>Auto Maintain>Manual Reboot. When the camera came back up it was set to 8162. I set the bitrate to 20480, left the camera alone for 2 days, rebooted, came back up as 8162.

settings.JPG
 
WooHoo! Turns out the API command DOES work on the newer firmware. I made a syntax error when testing against the newer firmware. Also, be sure that requested bitrate is in the camera's allowed range or it won't work despite the OK response.

The Dahua custom bitrate amnesia problem can be worked around with a python script.
I have SecuritySpy set to run the script once a day to fix the rate on any cameras that rebooted spontaneously.
Also, I can manually trigger the script if I restart a camera.

PHP sample script is below. Add a new call sequence for each camera. Of course your camera ip for <ip> and desired bitrate for nnnn


import requests
from requests.auth import HTTPDigestAuth

#set bitrate of a camera
url = 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Encode[0].MainFormat[0].Video.BitRate=nnnn'
requests.get(url, auth=HTTPDigestAuth('USERNAME', 'PASSWORD'))

#set bitrate of 2nd camera
url = 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Encode[0].MainFormat[0].Video.BitRate=nnnn'
requests.get(url, auth=HTTPDigestAuth('USERNAME', 'PASSWORD'))

#set bitrate of 3rd camera
url = 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Encode[0].MainFormat[0].Video.BitRate=nnnn'
requests.get(url, auth=HTTPDigestAuth('USERNAME', 'PASSWORD'))
 
Last edited:
WooHoo! Turns out the API command DOES work on the newer firmware. I made a syntax error when testing against the newer firmware. Also, be sure that requested bitrate is in the camera's allowed range or it won't work despite the OK response.

The Dahua custom bitrate amnesia problem can be worked around with a python script.
I have SecuritySpy set to run the script once a day to fix the rate on any cameras that rebooted spontaneously.
Also, I can manually trigger the script if I restart a camera.

PHP sample script is below. Add a new call sequence for each camera. Of course your camera ip for <ip> and desired bitrate for nnnn


import requests
from requests.auth import HTTPDigestAuth

#set bitrate of a camera
url = 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Encode[0].MainFormat[0].Video.BitRate=nnnn'
requests.get(url, auth=HTTPDigestAuth('USERNAME', 'PASSWORD'))

#set bitrate of 2nd camera
url = 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Encode[0].MainFormat[0].Video.BitRate=nnnn'
requests.get(url, auth=HTTPDigestAuth('USERNAME', 'PASSWORD'))

#set bitrate of 3rd camera
url = 'http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Encode[0].MainFormat[0].Video.BitRate=nnnn'
requests.get(url, auth=HTTPDigestAuth('USERNAME', 'PASSWORD'))

Thank you for this! I have a bunch of Dahua cams that would always be a PITA to reset bitrate after taking a power hit. After reading your post, I made a python script and have it executing daily via task scheduler. Works like a charm.
 
  • Like
Reactions: guykuo