Client bandwidth optimization, for montage and monitor view

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
maron
Posts: 18
Joined: Sun Feb 15, 2004 12:08 pm

Client bandwidth optimization, for montage and monitor view

Post by maron »

Hi!

I am setting up zoneminder where there will be potentially many clients streaming images. I felt that the bandwidth spent when a monitor is idle was unneccessary. This is a hardcoded version of what I will later hopefully have time to add properly (as a configurable option) and send a patch.

Actually very simple, just changed line 1118 in zm_monitor.cpp, the old version is commented out

Code: Select all

//if ( (frame_mod == 1) || ((frame_count%frame_mod) == 0) )
if ( ((shared_data->state == ALARM || shared_data->state == ALERT ) && 
         ((frame_mod == 1) || ((frame_count%frame_mod) == 0))) ||
    frame_count%50 == 0 )
What this does is that it only streams every 50th frame (as I said badly hardcoded) to the client, unless the monitor is in ALERT or ALARM mode, then it streams as it did before. In my tests the bandwidth usage on the client side was reduced by somewhere around 10-50 times, but it depends on activity .... In my setup this makes the montage show a new image every 2 seconds (I'm using mozilla) or 0.5 fps while in Idle mode, as soon as an alert or alarm mode is entered it immediately streams as much as possible. With 8 cameras in montage view this makes a huge difference.

Without promising a time, I am going to make this better and get it in as a configurable option, as well as an idle fps setting, just didn't have the time to dive into all the code today. I will send a patch when finished.
Post Reply