Best config for simple setup

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
vanaalten
Posts: 1
Joined: Thu Feb 25, 2021 6:21 pm

Best config for simple setup

Post by vanaalten »

Hi,

My first post here: I'm trying to figure out the best settings for my setup, to achieve high res video storage and low machine load.

Zoneminder system: Intel Core i5-10400, 16GB DDR4 memory, Samsung 860EVO 1TB SSD, running Debian 'stable' with ZoneMinder 1.34.23.
Camera used: Axis M3116-LVE

Motion detection done by the camera itself, so ZoneMinder doesn't need to analyze the images. All I want, basically, is:
  • Console view should provide a direct camera view
  • On a TCP start trigger from the camera, ZoneMinder should save the camera stream to disk until a TCP stop trigger
  • Event viewer should give fast access to the captured video
  • CPU load of the system should be low, because I like a low-power system
I've achieved everything, just not all at once. I've followed the manuals I could find (mostly this one), so right now what I have in the monitor setup screens:
  • General tab, Source Type: Ffmpeg. I'm in doubt between this and 'remote'; I could get both to work but documentation states "This is the recommended source type for most modern ip cameras." as well as "If you camera does speak RTSP then you should change your source type to ffmpeg instead of selecting RTSP here. The Remote -> RTSP method is no longer being maintained and may go away at some point in the future.". However, if my memory is correct I had the lowest server load using 'remote'.
  • General tab, Function: Nodect - because I use external triggers.
  • Source tab, source path: rtsp://UserName:Password@<localIP>:554/axis-media/media.amp . This path works well, also in e.g. VLC.
  • Method: UDP. Works, but what is best here?
  • 32 bit target colorspace, 2688x1512 resolution (camera resolution), no deinterlacing, no preserve aspect ratio, normal orientation
  • storage tab: Save JPEGs is disabled (I want video to be recorded)
  • storage tab: Video writer: H264 Camera Passthrough. So that server doesn't have to do anything but dump to disk.
I think that's basically the main things I've configured and the most correct settings, if I read the manual correct.

But, the result is not what I want:
- Live view in ZoneMinder works, but pretty often ZM cannot handle it and gives a white screen for a few seconds. Image is only updated correctly once every few seconds
- Event view - both the thumbnails as full resolution playback shows the captured event, but *lot* of MPEG artifacts.
- CPU load: 'top' shows process "zmc" on top with ~45% CPU usage. Server is doing close to nothing, so "zmc" is the only hard working process. Why? Zoneminder only needs to wait for a trigger, nothing more, I would think?

Apologies for a long post, but my question: did I enable the right settings to achieve what I want? Any obvious mistakes?
jperkins
Posts: 50
Joined: Sat Jan 23, 2021 11:08 am

Re: Best config for simple setup

Post by jperkins »

vanaalten wrote: Thu Feb 25, 2021 6:57 pm
Motion detection done by the camera itself, so ZoneMinder doesn't need to analyze the images.
You mention a simple setup in your subject line. One way to start out is.

1 use rtsp stream
2. use ZM to do detection
3. set a low resolution on your camera
4. set a low analysis rate on ZM
5. get a working setup.

THEN go back and change things one at a time to see where you get off track and how much cpu time you save

just my 2 cents . good luck
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Best config for simple setup

Post by burger »

vanaalten wrote: Thu Feb 25, 2021 6:57 pm ...
Samsung 860EVO 1TB SSD
...
[*]Method: UDP. Works, but what is best here?
...
[*]32 bit target colorspace, 2688x1512 resolution (camera resolution), no deinterlacing, no preserve aspect ratio, normal orientation
[*]storage tab: Save JPEGs is disabled (I want video to be recorded)
..
- Live view in ZoneMinder works, but pretty often ZM cannot handle it and gives a white screen for a few seconds. Image is only updated correctly once every few seconds
...
- CPU load: 'top' shows process "zmc" on top with ~45% CPU usage. Server is doing close to nothing, so "zmc" is the only hard working process. Why? Zoneminder only needs to wait for a trigger, nothing more, I would think?
A HDD is better than an SSD for video storage. Flash will wear out.

TCP is better, but UDP can resolve some issues with dropouts. Try TCP first. With Axis you probably won't have to worry about this. Some other cameras may (e.g. I have a Honeywell camera that needs UDP or it flashes a blue screen periodically).

Your resolution is high. What is the FPS?

You seem to misunderstand SaveJPEGs. SaveJPEGs will still make a video file. It just will have JPEGs for every frame, which can be exported in avi format via the web console. It is necessary for mjpeg or mpeg4 cameras. Anyways, you are using h264 passthrough, so don't worry about this now. The newer Axis support h264 by default.

If the live view lags, try lowering resolution or FPS on camera website (not on ZM). See if that resolves it. The system might be overloaded. For example, an arm RPI can't do 4K, but a high end x86 server can.

ZMC needs to keep a pre-buffer for events. So it's always recording (I think it's keeps a buffer in /dev/shm), when in Nodect. This way you get a few seconds of footage before the alarm occurs. This may explain the cpu usage. Although ZMC cpu use is typically low. The buffer can be configured in monitor settings.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Post Reply