zmc process uses too much cpu for only one monitor

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
alexeil
Posts: 11
Joined: Mon Feb 21, 2022 7:31 am

zmc process uses too much cpu for only one monitor

Post by alexeil »

I have one monitor with Source Type Ffmpeg configured.
top shows about 30% CPU usage by zmc process when Monitor in Modect mode and about 20% in Nodect mode. zmc consume this level cpu constantly not only when motion detected. When i disable this Monitor (set Function to None) zmc consumes almost nothing.
I suppose this because Zoneminder does not use hardware acceleration for camera video stream. When i check system gpu usage with intel_gpu_top it shows no gpu usage at all.

1) How to troubleshoot why this happened?
2) Is zoneminder supports hw acceleration for video stream decoding?
I tried set in Monitor config:
DecoderHWAccelName to vaapi and qsv
DecoderHWAccelDevice /dev/dri/renderD128
but nothing changed.
3) Are there any logs to check is hardware acceleration used for video stream decoding?
dougmccrary
Posts: 1271
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: zmc process uses too much cpu for only one monitor

Post by dougmccrary »

but nothing changed.
Did you either restart zm or reboot?
How many cores on this machine?
What is the camera sending and how is zm configured for it?
alexeil
Posts: 11
Joined: Mon Feb 21, 2022 7:31 am

Re: zmc process uses too much cpu for only one monitor

Post by alexeil »

Did you either restart zm or reboot?
Yes i did.
How many cores on this machine?
4 cores
What is the camera sending and how is zm configured for it?
I have attached screenshots from Monitor settings.
Attachments
Снимок экрана 2024-05-29 104953.png
Снимок экрана 2024-05-29 104953.png (265.55 KiB) Viewed 600 times
Снимок экрана 2024-05-29 105007.png
Снимок экрана 2024-05-29 105007.png (173.19 KiB) Viewed 600 times
Снимок экрана 2024-05-29 105026.png
Снимок экрана 2024-05-29 105026.png (131.35 KiB) Viewed 600 times
alexeil
Posts: 11
Joined: Mon Feb 21, 2022 7:31 am

Re: zmc process uses too much cpu for only one monitor

Post by alexeil »

more screenshots
Attachments
Снимок экрана 2024-05-29 105042.png
Снимок экрана 2024-05-29 105042.png (146.31 KiB) Viewed 598 times
Снимок экрана 2024-05-29 105540.png
Снимок экрана 2024-05-29 105540.png (111.28 KiB) Viewed 598 times
Снимок экрана 2024-05-29 105553.png
Снимок экрана 2024-05-29 105553.png (141.83 KiB) Viewed 598 times
dougmccrary
Posts: 1271
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: zmc process uses too much cpu for only one monitor

Post by dougmccrary »

Nothing screams at me there...may as well forget HWaccel for now. Last I heard and tried it, wasn't much help.
If you put that camera address in VLC, what does it report for the codec? 720 x 1280?
alexeil
Posts: 11
Joined: Mon Feb 21, 2022 7:31 am

Re: zmc process uses too much cpu for only one monitor

Post by alexeil »

This graph shows how zmc process consumes CPU during last 2 days:
Attachments
Снимок экрана 2024-05-31 165107.png
Снимок экрана 2024-05-31 165107.png (200.08 KiB) Viewed 533 times
alexeil
Posts: 11
Joined: Mon Feb 21, 2022 7:31 am

Re: zmc process uses too much cpu for only one monitor

Post by alexeil »

From the ZoneMiner wiki:
Where is ffmpeg in Zoneminder?
See: viewtopic.php?t=32450

We only use the ffmpeg executable when generating thumbnails and still frame images from the saved mp4.

For encoding, we use the LIBRARIES so, you would need to alter the LD_LIBRARY_PATH.

encoding works fine on my old nvidia hardware using standard ubuntu packages. Or at least it did the last time I checked.

hwaccel should be of great benefit in ENCODING. It is not useful for decoding at this time.
Not a word about how ZoneMinder DECODE video stream from camera.
Does it use ffmpeg for decoding?
Do i need any config to enable harware acceleration for deconding?
Why source type has name Ffmpeg if it does not use ffmpeg executable???
alexeil
Posts: 11
Joined: Mon Feb 21, 2022 7:31 am

Re: zmc process uses too much cpu for only one monitor

Post by alexeil »

dougmccrary wrote: Wed May 29, 2024 11:17 pm If you put that camera address in VLC, what does it report for the codec? 720 x 1280?
It shows the codec is h264 MPEG-4 AVC part 10, 1280 x 720:
Camera_Stream_VLC_Codec_Info.png
Camera_Stream_VLC_Codec_Info.png (53.96 KiB) Viewed 333 times
dougmccrary
Posts: 1271
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: zmc process uses too much cpu for only one monitor

Post by dougmccrary »

you could go to the camera's settings, and cut the framerate times .5 or even .1
alexeil
Posts: 11
Joined: Mon Feb 21, 2022 7:31 am

Re: zmc process uses too much cpu for only one monitor

Post by alexeil »

dougmccrary wrote: Sat Jun 08, 2024 7:10 am go to the camera's settings, and cut the framerate
Yes it is reduce cpu usage as following:
Снимок экрана 2024-06-08 182552.png
Снимок экрана 2024-06-08 182552.png (106.76 KiB) Viewed 304 times
But the cost is video quality. 5fps video is horrible. It is not what i really want.
Post Reply