Extremely low monitor FPS

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
kklouzal
Posts: 2
Joined: Tue Jul 28, 2020 3:24 pm

Extremely low monitor FPS

Post by kklouzal »

I have 3 cameras setup in monitor mode.
When viewing montage the cameras FPS is extremely variable.
I will notice the timestamp on each live feed is extremely erratic, sometimes pausing for 3-4 seconds then quickly snapping to the current time, or taking only a split second to jump forward 3-4 seconds on the timestamp.
The logs constantly flood with warnings such as these:
2020-07-28 03:18:19 zms_m3 1221 WAR Frame send time 3806 msec too slow, throttling maxfps to 2.63 zm_monitorstream.cpp 4 30
2020-07-28 03:18:19 zms_m2 1220 WAR Frame send time 749 msec too slow, throttling maxfps to 2.63 zm_monitorstream.cpp 4 30
2020-07-28 03:18:18 zms_m1 1219 WAR Frame send time 4042 msec too slow, throttling maxfps to 2.63 zm_monitorstream.cpp 4 30
In each camera I have them configured to output at 1080p 12fps. These are HikVision DS-2CD2643G1-IZS cameras.
I have ZoneMinder running on an Ubuntu Server 20.04 Virtual Machine which is hosted on a Windows 10 Pro rack server utilizing an Intel Xeon E3 1285 V6 Processor, 16GB ram, and 1TB Samsung NVME SSD. The virtual machine is allotted 10GB of ram and 6 processor cores. It is currently the only thing this machine is being used for. The server also has a Chelsio T5 10GBE Low Latency network adapter for connectivity to the local 10gbit network.

Can anyone tell me why the FPS is so irregular and erratic? What can I do to increase performance?

The following commands were used to install ZoneMinder onto a fresh Ubuntu install:

Code: Select all

sudo -i
echo "tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,mode=1777 0 0" | tee -a /etc/fstab
echo "net.ipv4.tcp_window_scaling=1" | tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_reordering=3" | tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_low_latency=1" | tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_sack=0" | tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_timestamps=0" | tee -a /etc/sysctl.conf
echo "net.ipv4.tcp_fastopen=1" | tee -a /etc/sysctl.conf
add-apt-repository ppa:iconnor/zoneminder-1.34
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt install -y apache2
systemctl enable apache2
ufw allow http
chown www-data:www-data /var/www/html/ -R
apt install -y mariadb-server
systemctl enable mariadb
apt install -y php php-mysql libapache2-mod-php
a2enmod php7.4
systemctl restart apache2
a2dismod php7.4
apt install -y php-fpm
a2enmod proxy_fcgi setenvif
a2enconf php7.4-fpm
systemctl restart apache2
apt install -y software-properties-common
apt install -y zoneminder
mysql_secure_installation
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enconf zoneminder
a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
chown -R www-data:www-data /usr/share/zoneminder/
Any other sysctl that can tune performance?
ZoneMinder Monitor Configuration (all other options default):
Source Type: Ffmpeg
Function: Monitor
Reference Image Blend %ge: 12.5% (Outdoor)
Source Path: rtsp://USER:PASS@192.168.1.241/Streaming/Channels/101/
Capture Resolution: 720P
Save JPEGs: Disabled
Video Writer: H264 Camera Passthrough
Image Buffer Size: 25
I would REALLY like to make ZoneMinder work, but i need a stable fps here. I really don't want to be forced below 12fps and 1080P. Ultimately I would like to use the full available camera resolution and 15fps. My cameras are also outputting h.265 if that makes any difference being as there is no option for 265 passthrough.

I really appreciate any help, thank you kindly!
bbunge
Posts: 2979
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Extremely low monitor FPS

Post by bbunge »

First off I am not a fan of running Zoneminder on a VM server. Others have done it with success, so I am told. I still feel that you can do better on an old PC. My current production system is on an old quad core i7 with a 120 GB SSD for the OS and a 1TB conventional HD for event storage. Have several systems like this in the area that work very well.

You are using a Ubuntu server install? If not you may want to do a minimal install (https://help.ubuntu.com/community/Insta ... /MinimalCD or https://askubuntu.com/questions/1233746 ... o-20-04lts) without the extra stuff that comes with the server install or desktop.

Don't know where you got those install instructions. Recommend you check these out for your next install (as you have a VM you can just blow the old one away or set up another as a test) https://wiki.zoneminder.com/Ubuntu_Serv ... ell_script

As for the camera, if you are going to use 720P in Zoneminder set the cams to 720P. You stated they were set to 1080P. Check the camera key frame interval. For a start make it shorter than it is now. If your recorded image is good I would not get worried about a variable frame rate. I have cams that slow down when the light level drops but they still record events
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Extremely low monitor FPS

Post by SteveGilvarry »

Use htop or something to monitor the zmc and zma processes see if VM CPU is getting hammered, nothing else will struggle in that setup.
h265 will require more CPU effort to decode, and you are not getting the space saving if not using passthrough (main reason it was not in passthrough was browsers didn't support it for playback). If you can, try putting the camera to h264 and using passthrough. It will still decode and use cpu, but might have an easier time with h264.
And then monitor CPU to see if it makes a difference.

Also don't use any of the FPS options in ZM, control it at the camera only.

I have an E5-2630 v3 with 4 core VM (ESX) running 5 cameras, 2 of which are 4MP@20fps so it won't be VM.

Interested in what you find, none of my cameras are h265 at this stage, but I am looking at one. I was also checking Nvidia GPU support for h265 decode so maybe I am also buying a Pascal/Turing one of them.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Post Reply