CPU usage when idle

Forum for questions and support relating to 1.33.x development only.
Post Reply
Posts: 1
Joined: Fri Nov 15, 2019 5:08 pm

CPU usage when idle

Post by Neuer_User » Fri Nov 15, 2019 5:22 pm


I was looking for a solution to store video streams from my video cams in case an external event is triggered (external motion detection). I found Zoneminder and gave it a try. Install was on Debian 10 via the tutorial on Zoneminder docs. As a test I used two Xiaomi 1080p home cameras with additional rtsp server enabled.

I configured the monitors in ZM as "nodect", no still recording and video recording as "Passthrough" (as the video stream is a H264 stream). The idea was that the system should be pretty idle, when not recording or not using the web interface for live streams.

Strangely, I am getting about 20% CPU usage per cam I defined that way. Even when only on the Console tab (so no live stream visible). No recording was triggered (as no external trigger was defined) and there was no disk activity. So, with two cams defined, I already had a 40-50% CPU usage in idle state.

I am wondering, if I misconfigured something. The system is a pretty low powered system, indeed. But it should be doing nothing at that time. I would expect only very little CPU load then and, when I trigger recording, the CPU load should be slightly higher, but not much (as I am using Passthrough). I would also expect a higher load when live streaming on the web interface or watching recorded video.

Any help is much appreciated. Also, if ZM is not the right solution for my use case, I'd be happy if you could point me to a more suitable solution.



Posts: 2
Joined: Sat Dec 07, 2019 5:16 am

Re: CPU usage when idle

Post by harborbv » Sat Dec 07, 2019 5:44 am

I'm in the same boat.

Unfortunately, it seems that's how ZoneMinder is designed. It appears that it decodes the video stream even if you set the monitor to record mode and select H264 passthrough (despite what a non-hardcore/new ZM user would think it would do): viewtopic.php?t=27436#p106838

As another user put it in that thread:
so even if it's doing absolutely nothing that requires processing the video, it's still decoding it. For monitor it shouldn't need to do anything, and for record it should only have to write the h.264 stream to disk without decompressing or transcoding it. It seems an odd architecture decision to have everything completely dependent on decoded video streams, if someone could explain that would be handy so at least I knew why ZoneMinder worked this way.
And I completely agree with this thinking.
I was so happy to discover ZM when I started to look into open source NVR software, but now I'm not so sure, it just doesn't make sense to me and seems to be an odd design choice.

Would appreciate maintainers' comment on this. Is it in the core or the ZM design philosophy or is it something that maintainers would be receptive to change in future versions? I would be willing to contribute if such changes have a chance to be accepted and if it doesn't require rewriting much of the existing codebase.

Posts: 1147
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: CPU usage when idle

Post by rockedge » Mon Dec 09, 2019 3:27 am

the stream handling and encoding / pass through is due to be completely overhauled for v 1.35 reducing CPU loads significantly.

ZoneMinder is old and most of the core was written over 10 years ago and since has been continuously improved in performance and capabilities. At this time there is only one core ZM developer, and another working on non-core ZM components and 3rd party integration.
So major changes to the code take time, unless of course you join the team and begin to implement some of these ideas into usable code.

I know any serious contributions to the coding and development of ZoneMinder will be greatly appreciated.
Join the discussion at https://zoneminder-chat.slack.com

zmc will probably be depreciated in the near future

Posts: 2
Joined: Sat Dec 07, 2019 5:16 am

Re: CPU usage when idle

Post by harborbv » Sun Dec 15, 2019 1:02 am

Thank you for the answer, it helps. I'll check the slack workspace.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests