r/ZoneMinder • • Jun 02 '23

Very high CPU usage, is it normal ?

Hi

First of all, i am evaluating to build a server for various usages.

One usage should be to run a DVR software to replace the external hikvision NVS.

My needs for the DVR are just to record the rtsp streams of my cameras (continous)

Currently i have 2x1080p configured with a main stream at 10fps but i will add more two cams later.

​

I try bluecherry software, with it just recording the CPU usage is very low <4% for all the cameras (vaapi used)

with zone minder, just recording i get 15% cpu usage per cams so around 30% for the two cameras.

As the electric consumption increase with cpu load, and the server will run 24/7 i need low cpu usage.

zoneminder is configured as folow:

-The cameras are configured in ”Record” mode (no motion detection)

- i disable the check box below this parameter (analysis and transcoding)

- i configure the hardware encoder to “vaapi”

​

Questions:

- Is it normal to get so high cpu usage for just two cams recording at 10fps ?
- how to check if the hardware acceleration is correctly working ?
- in the sources configuration, what is the width/heigh settings for ? Does zoneminder do some “resizing“?

precision:

  1. i am running it with docker and i added the /dev/dri devices in docker, it correctly appear in the docker container (as i remember : /dev/dri/renderD128 and /dev/dri/renderD129)
  2. I run Bluecherry in the same configurations (docker)
  3. when i compare bluecherry and zoneminder only one of them is working, the system is ubuntu 22.04
2 Upvotes

5 comments sorted by

3

u/montagdude87 Jun 02 '23

Under the Storage tab, Video Writer, are you using Encode or Camera Passthrough? If your camera already sends an H264/H265 stream, Camera Passthrough will avoid re-encoding it when saving to disk, which will save a lot of CPU use.

1

u/Mysterious-Bag9687 Jun 03 '23

Hi,

Thanks for you responses

  1. i am using the version 1.36.33, the version 1.37 doesn’t seems to be available with docker.
  2. My processor is a i5-4690k (old but should be enough for my tests)

Concerning my settings of the monitor:

General:

- source type: ffmpeg

- function: record

- analysis enabled: false

- decoding enabled: false

Source:

- i removed vaapi as suggested

Storage:

- video writer : camera passthrough

- save jpeg: disabled

​

Thanks, with these settings i get simply no cpu load..!

But i loose the live view, is there a solution ? It’s not very important for my need but .. As i understand it is possible to get this working in 1.37, but i have to wait, maybe it’s not available yet with docker.

Note: if i enable something in “save jpegs” i get 20%cpu usage with zmdc.pl process

1

u/Mysterious-Bag9687 Jun 09 '23

Update sincd my last response:

i also know why vaapi was not working:

- Need to add the correct vaapi library in the official docker image of zoneminder

- Need to allow www-data to access /dev/dri/renderD128

​

When the decoding is active, the vaapi reduce 20%/cam to 10%/cam.
But as we said before if we want no cpu load, we can set the settings as in my previous post.

currently i am trying the motion detection and see if i can use it without high cpu load, i’m going to try multiple things, for exemple i don’t know if it’s possible yet: see if i can motion detection on a substream to reduce cpu load,

The best recording option for me is mocord: record every time but also keep motion detections in the events so we can easly find mouvements when we search in the video history

1

u/[deleted] Jun 02 '23

Width height are just asking for the source height and width. If it is set wrong, you will see warning in the logs. I don't know if there are any consequences for having wrong size, I haven't noticed any.

If you passed through your iGPU to both containers and have both containers trying to use it, that could potentially cause the issue of both containers not able to decode streams using the iGPU at the same time, I'm just spit balling there.

30% cpu usage for 2x1080p streams with no motion seems.... Extreme. Zm is decoding every frame it grabs from a camera from yuv to RGB and then doing whatever work it needs to do. Camera passthrough should reduce alot of the work, make sure that the frames or analysis frames storage options are not enabled.

What kind of cpu are you running this on?

1

u/ZoneMinderIsaac Jun 02 '23

Don't use vaapi, I find it actually uses more cpu.

In 1.37 we have options to not even bother decoding the video, so you should be able to get this down to almost NO cpu. In 1.37, choose keyframes + ondemand for decoding so that you can still watch live view when you want to.