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.
 
Hi all, I'm running 2 x DH-IPC-HDW3867EM & 1 x DH-IPC-PDW3849 on a DHI-NVR4104HS-P-AI NVR and if I restart the cameras, my bitrate (not a custom one) gets reduced from max available 10240 to 3072 & from H.264H to H.265. Is there a fix for this other than running a script? I mean this is 2025 now.
 
My two 4K-X bullets do it, none of my other cameras do. It’s a FW thing.
That model has an Andy FW that fixes it, but having deployed it on another 4K-X it made the oversharpness and artifacts even worse, so I live with it and reset that one camera when I have a power outage or reboot the NVR
 
  • Like
Reactions: JDreaming