bp2008 / DahuaSunriseSunset

A Windows Service which changes the profile of dahua cameras between Night and Day at each sunset and sunrise.
GNU General Public License v2.0
19 stars 8 forks source link

FPS #9

Open vanpixel opened 2 years ago

vanpixel commented 2 years ago

Hello,

In addition to the existing functionality, it would be really helpful to have a field for FPS (and possibly max bitrate) for day and night modes. Is this something that can be added? I'm happy to fund this modification.

The upside of this functionality is for tourism cameras where color night mode can be greatly enhanced with longer exposure time and lower frame rate. The longer exposure time can be adjusted within the camera's night mode, but the FPS is independent of day and night modes.

Thank you.

bp2008 commented 2 years ago

Dahua cameras automatically reduce frame rate when you use a long exposure. No need to change the encoder setting.

bp2008 commented 2 years ago

(as long as you don't need to change the i-frame interval)

vanpixel commented 2 years ago

I do change the I-frame interval (via the API) to minimize bandwidth impact. Unfortunately the newer models I'm using no longer include the I-frame interval in the GUI.

Maybe a solution that allows an API string to be passed to the camera at sunset/sunrise would be more flexible?

bp2008 commented 2 years ago

The main reason you might want to change i-frame interval is if the stream is taking too long to load at night when the frame rate has dropped. Longer i-frame intervals are actually good for reducing bandwidth usage.

E.g. if during the day you have a 30 FPS frame rate and 60 i-frame interval, you get one i-frame every 2 seconds so the stream should be able to start playing within 2 seconds of a new connection.

But if at night the frame rate drops to 3 FPS, then suddenly it is one i-frame every 20 seconds which could make the stream load very slowly. It all depends on the player you're using.

The i-frame interval disappears if you have enabled Smart Codec.

Yes, a generic mechanism for passing API strings would be very flexible. I just don't want to spend time working on this app anymore. I just use Blue Iris's scheduling functions to send API commands to my cameras these days because it is one fewer service to keep an eye on.

vanpixel commented 2 years ago

I can understand that with 65 repositories, adding features isn't always desirable.

I use Blue Iris for my personal security cameras but for the tourism cameras, those streams are pulled into servers that broadcast them so Blue Iris isn't an option there.

I'll try the smart codec option. I'm not a big fan of the I-Frame updates every 1 or 2 seconds. When you have limited bandwidth, they're noticeable and quite jarring.