New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pausing a frame on the Montage page does not reduce the server load. #3976
Comments
Your images show that the stream has stopped, which is good. Your top output shows that the bulk of your cpu is taken up by zmc. This is likely the case even if you aren't watching at all. Stopping the streams isn't really about saving cpu... zms jpeg encoding can take a fair amount, but generally is way less than zmc. |
1 screenshot - stream has stopped
|
Nor should it. zmc is the capture/decode process. Nothing to do with streaming. |
Wait, are you using decode=ondemand? Thing is zms is still running, so potentially still "viewing" As discussed in forums, we may need to use CMD_QUIT instead of CMD_STOP. |
Yes, sorry I forgot to mention this.
I understand. The WEB_L_VIEWING_TIMEOUT setting only affects bandwidth. CMD_QUIT - for some reason stops the broadcast and immediately starts it again. P.s. WEB_L_VIDEO_MAXFPS - also does NOT affect the server load? I didn't notice any impact. P.s.2 I’m looking for a solution so that on the Montage page it would be possible to display streams from 20-30 5-8Mp cameras with a resolution of, for example, 240x135px or 10-15 cameras with a resolution of 480x270px with low FPS (1-5) |
Very strange, but ZMC loading does not depend on "scale" and does not depend on "fps". After all, the lower the output resolution, the less work the processor has to do. |
I know that try to view a 4k stream puts serious load on zms. I think you aren't looking close enough. |
Yes. You are decoding h264 or h265 to a 4k yuv420p image. Then converting that to rgba, Then copying that to /dev/shm/zmc.mmap (That all happens in zmc.) That yuv420 to rgba is really bad. We are working to get rid of it. However you are still doing a ton of work to do the decoding. If you want this all to not happen, then you need to look into using rtsp2web or janus to do the viewing. |
Ok.
I know about Janus, but it has problems with broadcast stability
Why 4k? if you need to display 268151px, then you need to decode from 4k to 268151px, and then encode 268*151px, and not 4K. Or am I wrong? |
I tried to decode video like this: This is even faster: To display video on the screen, I think 1920x1080 and FPS=5 will be enough. At the same time, the decoding speed from 4K should increase several times. |
We do not support altering the frame rate of decoding, except for only doing keyframes. Our experiments in the past have shown it to not work, but maybe we were doing something wrong. |
Stream from camera h264 4k is decoded to 4k or 1080p yuv420p? |
Depends on what you have for size on the Source tab. It's not actually the decoding that takes so much cpu, it's the translation to rgba and copying around in memory, so reducing to 1080p saves a lot. |
Got it. I'll experiment with this setting |
This only affects ZMS loading, but ZMC is still heavily loaded. |
@connortechnology |
Yes, gets decoded to 4k res yuv420p. I'm not aware of a way to tell ffmpeg to do anything different. But then we convert that image to rgba, for which we use the capture resolution. |
Where is this code located? |
I don't think there is anything that can be done about that. Other than not decode it at all, which is what we are looking to do with webrtc/websockets and h265web.js. Where we can do better is to not transcode it to RGBA which takes up 4x the space and takes more cpu than decoding. @webgeek1234 and I are working on it. |
Ok, I got it. |
The decoder setup is in zm_ffmpeg_camera.cpp. The actual calls that do the decoding and transcoding are in zm_monit.cpp in ::Decode. The actual heavy lifting is done in zm_image.cpp. |
Describe Your Environment
ZoneMinder 1.37.58
PLAY on Montage page
PAUSE on Montage page
Console Page (Everything is fine)
The text was updated successfully, but these errors were encountered: