Smooth events, but choppy live view.

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
lubod
Posts: 3
Joined: Sat Jan 15, 2022 2:41 pm

Smooth events, but choppy live view.

Post by lubod »

Hello everyone,

I am pretty new to ZoneMinder and currently setting up a server for recording 4 HikVision DS-2CD1343G0-I 4mp cameras.
The server is a X8SIE Supermicro quad-core x3440 XEON machine with 16GB of ram, SSD sata3 drive on a 1000mbps network.
Zoneminder version is 1.34.23 installed via apt-get on a clean Debian 11 Bullseye.
Accessing the camera via rtsp://user:pass@192.168.1.64:554/Streaming/Channels/101

At first I got choppy events and choppy live feed. After trying out different configuration options I managed to guess that "H264 camera passthrough" mode was the key to getting events to record and playback smoothly. I currently have only one camera attached working at 2560x1440 and streaming at 20fps. All events are played in a nice-looking player with playback options, volume control, progress bar and playback speed selector. Great!

The problem is that I cannot get the same quality for the live view. When opening live view it says it is getting around 20fps from the camera, the resolution looks fine, but the stream is choppy. Definitely nowhere near 20fps. A few seconds behind (which is ok) but skipping a lot of frames. It does not look like a player, no volume control, no full screen button, just video window playing a few frames per second. Zoneminder bandwidth setting is set to High, so the stream should not lowered in quality due to bandwidth reasons.

Meanwhile the server load is around 2 (50%) and memory usage is below 1G, so there should be no CPU or RAM bottleneck. However I still think the load is getting way too high for simply recording just one camera. Here is top overview:
top - 17:03:38 up 3 days, 5:21, 1 user, load average: 2.34, 2.27, 2.04
Tasks: 118 total, 4 running, 114 sleeping, 0 stopped, 0 zombie
%Cpu(s): 95.4 us, 3.0 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 1.7 si, 0.0 st
MiB Mem : 16001.1 total, 174.9 free, 926.2 used, 14900.0 buff/cache
MiB Swap: 16367.0 total, 16362.0 free, 5.0 used. 14588.4 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
33969 www-data 20 0 610724 431308 162756 R 44.7 2.6 1681:46 zma
33965 www-data 20 0 430968 236056 168300 R 31.1 1.4 918:31.67 zmc
84203 www-data 20 0 418816 174784 165160 R 21.5 1.1 1:24.42 nph-zms


Iotop reports around 100k/s activity on the SSD drive, so it is barely being used.

How do I get the live view to play smoothly like the events do?
Perhaps the solution to the first problem will also solve the high CPU load?
Any advice?

Regards,
LuboD
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Smooth events, but choppy live view.

Post by dougmccrary »

See what happens if you reduce the frame rate from the camera. Also what functions are set?
lubod
Posts: 3
Joined: Sat Jan 15, 2022 2:41 pm

Re: Smooth events, but choppy live view.

Post by lubod »

I tried lowering FPS from the camera to 10. Still choppy. Perhaps even more choppier, maybe because of the choppy nature of 10fps ;)

My settings are pretty much close to the default ones. Here they are:

Name Monitor-4
Notes
Server None
Source Type Ffmpeg
Function Monitor Enabled
Linked Monitors (?) Select Some Options
Groups Select Some Options
Analysis FPS
Maximum FPS (?)
Alarm Maximum FPS (?)
Reference Image Blend %ge 1.5625%
Alarm Reference Image Blend %ge 1.5625%
Triggers None available
Source Path rtsp://user:pass@10.3.1.201:554/Streaming/Channels/101
Method?) TCP
Options (?)
DecoderHWAccelName (?)
DecoderHWAccelDevice (?)
Target colorspace 32 bit colour
Capture Resolution (pixels) 2560 1440 Custom
Preserve Aspect Ratio unchecked
Orientation Normal
Deinterlacing Disabled

Storage Area Default
Save JPEGs Disabled
Video Writer H264 Camera Passthrough
Optional Encoder Parameters (?)
# Lines beginning with # are a comment
# For changing quality, use the crf option
# 1 is best, 51 is worst quality
#crf=23
Whether to store the audio stream when saving an event. checked

Image Buffer Size (frames) 10
Warmup Frames 0
Pre Event Image Count 0
Post Event Image Count 0
Stream Replay Image Buffer 0
Alarm Frame Count 1

Event Prefix Event-
Section length 600 seconds
MinSectionlength 30 seconds
Frame Skip 0 frames
Motion Frame Skip 0 frames
Analysis Update Delay 0 seconds
FPS Report Interval 100 frames
Default Rate 1x
Default Scale Scale to Fit
Default Method For Live View MP4
Signal Check Points 0
Signal Check Colour
Web Colour
Embed EXIF data into image (?) unchecked
dougmccrary
Posts: 1172
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Smooth events, but choppy live view.

Post by dougmccrary »

I suppose you tried mjpeg or auto for live view?
lubod
Posts: 3
Joined: Sat Jan 15, 2022 2:41 pm

Re: Smooth events, but choppy live view.

Post by lubod »

dougmccrary wrote: Tue Jan 18, 2022 12:00 am I suppose you tried mjpeg or auto for live view?
I tried all 3 options.. . Auto, mp4 or mjpeg - no change in results.
Post Reply