ZONEMINDER(1)
๐ ZONEMINDER(1) ๐
okay so bestie, this is the manual page for zoneminder โ like, section 1 of the manual, the big one. ZoneMinder is the whole all-in-one security camera situation and this page is the official documentation. pull up a chair, we're doing this properly ๐
โจ NAME โจ
zoneminder โ ZoneMinder Documentation
๐ USER GUIDE ๐
๐ Introduction ๐
Welcome to ZoneMinder, the all-in-one security camera solution for Linux, and it's under the GPL License. no cap.
So here's the tea about commercial "security systems" โ they're often designed as a monitoring system with barely any attention paid to recording quality. and then when you actually need to find and export the relevant video? it's a whole ordeal, lowkey challenging, and it usually needs a ton of human intervention. ZoneMinder was designed to give you the best possible record quality while letting you search, filter and export your security footage easily. that's the whole point, fr fr.
ZoneMinder is built around a series of independent components that only function when necessary โ which limits any wasted resource and maximises the efficiency of your machine. like, an outdated Pentium II PC can have multiple recording devices connected to it, and it is able to track one camera per device at up to 25 frames per second, which drops by approximately half for each additional camera on the same device. additional cameras on devices that do not interact with other devices can maintain the 25 frame rate per second. and monitoring several cameras will not overload the CPU, because frame processing is designed to synchronise with capture. iconic behaviour honestly.
A fast video interface core plus a user-friendly and comprehensive PHP based web interface means ZoneMinder is efficient, friendly and most importantly useful. you can control and monitor your cameras from home, at work, on the road, or from a web-enabled cell phone ๐ฑ. it supports variable web capabilities based on available bandwidth. the web interface also lets you view events that your cameras have captured, which can be archived, reviewed or deleted. and the web application directly interacts with the core daemons, ensuring full co-operation at all times. ZoneMinder can also be installed as a system service to reboot a system remotely.
The core of ZoneMinder is the capture and analysis of images plus a highly configurable set of parameters that eliminate false positives whilst ensuring minimum loss of footage. for example, you can define a set of 'zones' for each camera of varying sensitivity and functionality. this eliminates zones that you don't wish to track, or defines areas that will alarm if various thresholds are exceeded in conjunction with other zones. chef's kiss.
ZoneMinder is free under GPL License, but if you do find it useful, then please feel free to visit <https://zoneminder.com/donate/> and help us fund our future improvements. bestie it's a vibe, go donate if you can ๐ซถ
๐งฉ Components ๐งฉ
ZoneMinder is not a single monolithic application โ it's formed from several components, and they each pull their weight. these components primarily include executable compiled binaries which do the main video processing work, perl scripts which usually perform helper and/or external interface tasks, and php web scripts which are used for the web interface.
๐บ๏ธ System Overview ๐บ๏ธ
Depicted below is a high level diagram of the ZoneMinder system with key components [image]
a brief description of each of the principle components follows. โฌ๏ธ
๐ฅ Binaries ๐ฅ
zmcโ This is the ZoneMinder Capture daemon. this binary's job is to sit on a video device and suck frames off it as fast as possible, and this should run at more or less constant speed. it's giving dedicated.zmaโ This is the ZoneMinder Analysis daemon. this is the component that goes through the captured frames and checks them for motion which might generate an alarm or event. it generally keeps up with the Capture daemon, but if it's very busy it may skip some frames to prevent it falling behind. queen of not falling behind ๐zmsโ This is the ZoneMinder Streaming server. the web interface connects with this to get real-time or historical streamed images. it runs only when a live monitor stream or event stream is actually being viewed, and it dies when the event finishes or the associate web page is closed. so if you find you have severalzmsprocesses running when nothing is being viewed, then it's likely you need a patch for apache (see the Troubleshooting section). a non-parsed header version ofzms, callednph-zms, is also installed and may be used instead depending on your web server configuration.zmuโ This is the ZoneMinder Utility. it's basically a handy command line interface to several useful functions. it's not really meant to be used by anyone except the web page (there's only limited 'help' in it so far) but it can be used if necessary, especially for debugging video problems. iykyk.
๐ PHP ๐
As well as this there are the web PHP files in the web directory. currently these consist of a single skin with Classic and Flat styles.
- Classic โ Original ZoneMinder skin
- Flat โ An updated version of Classic skin, retaining the same layout with a more modern style. Originally a skin this is now just a CSS style.
๐ Perl ๐
Finally some perl scripts in the scripts directory. these scripts all have some configuration at the top of the files which should be viewed and amended if necessary, and they are as follows.
zmpkg.plโ This is the ZoneMinder Package Control script. this is used by the web interface and service scripts to control the execution of the system as a whole.zmdc.plโ This is the ZoneMinder Daemon Control script. this is used by the web interface and thezmpkg.plscript to control and maintain the execution of the capture and analysis daemons, amongst others. you should not need to run this script yourself, although you can use it to start/top individual ZM processes.zmfilter.plโ This script controls the execution of saved filters and will be started and stopped by the web interface based on whether there are filters that have been defined to be autonomous(background). this script is also responsible for the automatic uploading of events to a 3rd party server. prior to 1.32 there was onezmfilter.plprocess. in 1.32 onwards we start azmfilter.plprocess for each background filter so that the processing time of one filter doesn't delay the processing of another filter. multi-tasking icon.zmaudit.plโ This script is used to check the consistency of the event file system and database. it can delete orphaned events, i.e. ones that appear in one location and not the other, as well as checking that all the various event related tables are in line. it can be run interactively or in batch mode, either from the command line or a cron job or similar. in thezmconfig.plthere is an option to specify fast event deletes where the web interface only deletes the event entry from the database itself. if this is set then it is this script that tidies up the rest.
โ ๏ธ okay bestie, real talk: we do not recommend fast event deletion, and we do not recommend having zmaudit.pl run in the background. it is a very ram cpu and disk io intensive program, constantly scanning every event. please run it manually or from a cron job on weekends or something. ๐
zmwatch.plโ This is a simple script purely designed to keep an eye on the capture daemons and restart them if they lockup. it has been known for sync problems in the video drivers to cause this, so this script makes sure that nothing important gets missed. protective queen ๐ซถzmupdate.plโ Currently this script is responsible for checking whether a new version of ZoneMinder is available and other miscellaneous actions related to upgrades and migrations. it is also intended to be a 'one stop shop' for any upgrades and will execute everything necessary to update your installation to a new version.zmvideo.plโ This script is used from the web interface to generate video files in various formats in a common way. you can also use it from the command line in certain circumstances but this is not usually necessary.zmx10.plโ This is an optional script that can be used to initiate and monitor X10 Home Automation style events and interface with an alarm system, either by the generation of X10 signals on ZoneMinder events, or by initiating ZoneMinder monitoring and capture on receipt of X10 signals from elsewhere, for instance the triggering of an X10 PIR. for example, I have several cameras that don't do motion detection until I arm my alarm system, whereupon they switch to active mode when an X10 signal is generated by the alarm system and received by ZoneMinder. the way that works is so satisfying ngl.zmtrigger.plโ This is an optional script that is a more generic solution to external triggering of alarms. it can handle external connections via either internet socket, unix socket or file/device interfaces. you can either use it 'as is' if you can interface with the existing format, or override connections and channels to customise it to your needs. the format of triggers used byzmtrigger.plis as follows:
"<id>|<action>|<score>|<cause>|<text>|<showtext>"
where:
- 'id' is the id number or name of the ZM monitor.
- 'action' is 'on', 'off', 'cancel' or 'show' where 'on' forces an alarm condition on, 'off' forces an alarm condition off and 'cancel' negates the previous 'on' or 'off'. the 'show' action merely updates some auxiliary text which can optionally be displayed in the images captured by the monitor. ordinarily you would use 'on' and 'cancel', 'off' would tend to be used to suppress motion based events. additionally 'on' and 'off' can take an additional time offset, e.g.
on+20which automatically 'cancel's the previous action after that number of seconds. - 'score' is the score given to the alarm, usually to indicate it's importance. for 'on' triggers it should be non-zero, otherwise it should be zero.
- 'cause' is a 32 char max string indicating the reason for, or source of the alarm e.g. 'Relay 1 open'. this is saved in the 'Cause' field of the event. ignored for 'off' or 'cancel' messages.
- 'text' is a 256 char max additional info field, which is saved in the 'Description' field of an event. ignored for 'off' or 'cancel' messages.
showtextโ up to 32 characters of text that can be displayed inside the timestamp that gets stamped onto your images. Theshowaction is designed to update this text without messing with alarms, but heads up bestie: the text does get updated, if present, for any of the actions. Why does this even exist? So that external input can show up on the images you capture โ temperature, personnel identity, whatever you're into. โจ
Also note that multiple messages can be sent at once, and they should be LF or CRLF delimited. And ngl, this script is not necessarily intended to be a solution all by itself โ it's meant to be โglueโ that helps ZoneMinder interface with other systems. It will almost certainly require some customisation before you can make any use of it. If literally all you want is to generate alarms from external sources, then using the ZoneMinder::SharedMem perl module is likely to be easier. ๐
zmcamtool.pl
This optional script is new for the upcoming 1.27 release of ZoneMinder, and it's here to make the following things easy, okay? Bringing in new ptz controls and camera presets, converting existing monitors into presets, and exporting custom ptz controls and presets. For this initial release it is not integrated into the UI and must be called from the command line. Type zmcamtool.pl โhelp from the command line to get an explanation of the different arguments one can pass to the script. ๐ซถ
zmcontrol-*.pl
These are a set of example scripts you can use to control Pan/Tilt/Zoom class cameras. Each script converts a set of standard parameters used for camera control into the actual protocol commands sent to the camera. If you're using a camera control protocol that's not in the shipped list, then you will have to create a similar script โ though it can be created entirely separately from ZoneMinder and does not need to be named like these scripts are. And even though these scripts are used to action commands that originate from the web interface, they can also be used directly, or from other programs or scripts, for instance to implement periodic scanning to different presets. Iconic. ๐ฅ
zmtrack.pl
This script manages the experimental motion tracking feature. It's responsible for detecting that an alarm is taking place and moving the camera to point at the alarmed location, and then subsequently returning it to a defined standby location. As well as moving the camera, it also controls when motion detection is suspended and restored, so that the action of the camera tracking does not trigger endless further alarms which are not justified. main character energy fr fr ๐
zm
This is the (optional) ZoneMinder init script โ see below for details.
zmeventnotification.pl
This is an optional 3rd party real time event notification server that also provides push notifications for zmNinja, plus machine learning powered object/face-detection. Please see Event Notification Server Documentation https://zmeventnotification.readthedocs.io/en/latest/index.html for more details. (Note that the machine learning components are optional, and are developed in Python3.) ๐ฆ
Finally, there are also a number of ZoneMinder perl modules included. These are used by the scripts above, but they can also be used by your own scripts or 3rd party scripts. Full documentation for most modules is available in โpodโ form via perldoc, but the general purpose of each module is as follows. โญ
ZoneMinder.pm
This is a general ZoneMinder container module. It includes the Base.pm, Config.pm, Debug.pm, Database.pm, and SharedMem.pm modules described below. It also exports all of their symbols by default. If you use the other modules directly you have to request which symbol tags to import.
ZoneMinder/Base.pm
This is the base ZoneMinder perl module. It contains only simple data such as version information. It is included by all other ZoneMinder perl modules.
ZoneMinder/Config.pm
This module imports the ZoneMinder configuration from the database.
ZoneMinder/Debug.pm
This module contains the defined Debug and Error functions etc, that are used by scripts to produce diagnostic information in a standard format.
ZoneMinder/Database.pm
This module contains database access definitions and functions. Currently not a lot is in this module, but it is included as a placeholder for future development.
ZoneMinder/Event.pm
This module contains functions to load, manipulate, delete, copy, move events.
ZoneMinder/Filter.pm
This module contains functions to load, execute etc filters.
ZoneMinder/SharedMem.pm
This module contains standard shared memory access functions. These can be used to access the current state of monitors etc, as well as issuing commands to the monitors to switch things on and off. This module effectively provides a ZoneMinder API. ๐
ZoneMinder/ConfigAdmin.pm
This module is a specialised module that contains the definition, and other information, about the various configuration options. It is not intended for use by 3rd parties.
ZoneMinder/Control/*.pm
These modules contain implementations of the various PTZ protocols.
ZoneMinder/Trigger/*.pm
These modules contain definitions of trigger channels and connections used by the zmtrigger.pl script. Although they can be used โas isโ, they are really intended as examples that can be customised or specialised for different interfaces. Contributed modules for new channels or connections will be welcomed and included in future versions of ZoneMinder. ๐
Getting Started
After installation of Zoneminder you should now be able to load the ZoneMinder web frontend. By default this will be with the Classic skin, and below is an example of the page you should now see. [image] ๐ธ
Setting Timezone
Previous versions of ZoneMinder required the user to set up Timezone correctly in php.ini. This is no longer the case. Starting 1.34, ZoneMinder allows you to specify the TimeZone in the UI. Please make sure it is set up correctly! The Timezone can be changed by selecting Options->System->Timezone [image] ๐ธ
Enabling Authentication
We strongly recommend enabling authentication right away. Yes, there are some situations where certain users don't enable authentication โ like instances where the server is in a LAN that isn't directly exposed to the Internet, and is only accessible via VPN etc. โ but in most cases, authentication should be enabled. So let's do that right away bestie. ๐
- Click on the Options link on the top bar of the web interface
- You will now be presented with a sidebar full of options. Click on the "System" link
[image] - The relevant portions to change are marked in red above
- Enable
OPT_USE_AUTHโ this automatically switches to authentication mode with a default user (more on that later) - Select a random string for
AUTH_HASH_SECRETโ this is used to make the authentication logic more secure, so please generate your own string and make sure it is sufficiently randomized and long. Note that if you plan to use APIs with ZoneMinder (needed by zmNinja/other apps), it is mandatory that you have this field populated - The other options highlighted above should already be set, but if not, please make sure they are
- Note that if you are planning to use zmNinja and plan to use ZM authentication, you must also:
- set
AUTH_RELAYtohashed - Enable
AUTH_HASH_LOGINS
- set
- Click on Save at the bottom and that's it! The next time you refresh that page, you will now be presented with a login screen. Job well done! ๐
[image]
Note: The default login/password is "admin/admin" ๐
Understanding the Web Console
Before we proceed, lets spend a few minutes understanding the key functions of the web console. For the sake of illustration, we are going to use a populated zoneminder configuration with several monitors and events. [image]
This screen is called the "console" screen in ZoneMinder and shows a summary of your monitors, associated events and more information. ๐ฆ
- A: The options menu lets you configure many aspects of ZoneMinder. Refer to Options <>.
- B: This brings up a color coded log window that shows various system and component level logs. This window is useful if you are trying to diagnose issues. Refer to Logging <>.
- C: ZoneMinder allows you to group monitors for logical separation. This option lets you create new groups, associate monitors to them and edit/delete existing groups.
- D: Filters are a powerful mechanism to perform actions when certain conditions are met. ZoneMinder comes with some preset filters that keep a tab of disk space and others. Many users create their own filters for more advanced actions like sending emails when certain events occur and more. Refer to Filtering Events <>.
- E: The Cycle option allows you to rotate between live views of each configured monitor.
- F: The Montage option shows a collage of your monitors. You can customize them including moving them around.
- G: Montage Review allows you to simultaneously view past events for different monitors. Note that this is a very resource intensive page and its performance will vary based on your system capabilities.
- H: Audit Events Report is more of a power user feature. This option looks for recording gaps in events and recording issues in mp4 files.
- I: This is the user you are currently logged in as. ๐
- J โ this is the run states button, and bestie it is so much more powerful than it looks. If you click on the "Running" text, ZoneMinder pops up a little window that lets you define extra "states" (everyone calls them runstates). A runstate is basically a โจsnapshotโจ that records the state of each monitor, and you can flip between states super easily. Example time: maybe you've got one runstate that flips every monitor into "monitor" mode (so nothing is recording at all) and another one that sets some of the monitors to "modect". Why would anyone want that?? Bestie, the classic use case is disable recording when you're home and enable it when you're away, based on time of day or other triggers. You can switch states by hand (just pick the one you want) or automatically via cron jobs, for example. There's an example of using cron to auto-switch in the FAQ <#runstate-cron-example>. And if you want the truly esoteric stuff โ switching run states based on phone location โ it's over here <https://forums.zoneminder.com/viewtopic.php?f=9&t=23026>. Obsessed.
Here's an example of multiple run states that I've defined. Each one of these runstates changes the mode of specific monitors depending on time of day and other conditions. Use your imagination to decide which conditions require state changes. [image]
- K โ this line shows you system health information. ๐ฉบ
- L โ this one defines how Zoneminder will record events. There are various modes, and here's the quick rundown: Modect == record if a motion is detected, Record = always record 24x7, Mocord = always record PLUS detect motion, Monitor = just provide a live view but don't record any time, Nodect = don't record till an external entity via
zmtriggertells Zoneminder to (this is advanced usage, iykyk). - M โ this is the "source" column and it tells you the type of the camera โ IP camera, USB camera, or more. In this example, they are all IP cameras. Green means the monitor is running. Red means there is something wrong with that camera. ๐
- N โ this is the core of ZoneMinder: recording events. It gives you a count of how many events were recorded over the hour, day, week, month. ๐
- O โ these are the "Zones". Zones are areas within the camera that you mark as 'hotspots' for motion detection. Simply put, when you first configure your monitors (cameras), by default Zoneminder uses the entire field of view of the camera to detect motion. You may not want this. You may want to create "zones" specifically for detecting motion and ignore others. For example, lets consider a room with a fan that spins. You surely don't want to consider the fan moving continuously a reason for triggering a record? Probably not โ in that case, you'd leave the fan out while making your zones. ๐
- P โ this is a "visual filter" which lets you 'filter' the console display based on text you enter. While this may not be particularly useful for small systems, ZoneMinder is also used in mega-installations with well over 200+ cameras and this visual filter helps reduce the monitors you are seeing at one time. ๐
๐ Adding Monitors ๐
Now that we have a basic understanding of the web console, lets go about adding a new camera (monitor). For this example, lets assume we have an IP camera that streams RTSP at LAN IP address 192.168.1.33. Let's go. ๐ฆ
๐ Note
This is meant to be a simple example. For a more detailed explanation of other options available when creating a monitor, please see Defining Monitors <>.
The first thing we will need to know is how to access that camera's video feed. You will need to consult your camera's manual or check their forum. Zoneminder community users also have a frequently updated list right here <https://wiki.zoneminder.com/index.php/Hardware_Compatibility_List> that lists information about many cameras. If you don't find your list there and can't seem to find it elsewhere, feel free to register and ask in the user forums <https://forums.zoneminder.com/>. ๐ซถ
The camera we are using as an example here is a Foscam 9831W which is a 1280x960 RTSP camera, and the URL to access it's feed is username:password@IPADDRESS:PORT/videoMain
Let's get started:
Click on the "Add" button below: [image]
This brings up the new monitor window: [image]
- We've given it a name of 'Garage', because, well, its better than Monitor-1 and this is my Garage camera. ๐
- There are various source types. As a brief introduction you'd want to use 'Local' if your camera is physically attached to your ZM server (like a USB camera, for example), and one of 'Remote', 'FFMpeg', 'Libvlc' or 'cURL' for a remote camera (not necessarily, but usually). For this example, let's go with 'FFMpeg'.
Note:
As a thumb rule, if you have a camera accessible via IP and it does HTTP or RTSP, start with FFMpeg first and libvlc if it doesn't work (Defining Monitors <> covers other modes in more details). If you are wondering what 'File' does, well, ZoneMinder was built with compatibility in mind. Take a look at this post <https://wiki.zoneminder.com/index.php/How_to_use_ZoneMinder_with_cameras_it_may_not_directly_support> to see how file can be used for leisure reading. ๐
- In this example, the Function is 'Modect', which means it will start recording if motion is detected on that camera feed. The parameters for what constitutes motion detected is specific in Defining Zones <>. ๐
- In Analysis FPS, we've put in
5FPShere. Note that you should not put an FPS that is greater than the camera FPS. In my case,5FPSis sufficient for my needs.
Note:
Leave Maximum FPS and Alarm Maximum FPS empty if you are configuring an IP camera. In older versions of ZoneMinder, you were encouraged to put a value here, but that is no longer recommended. Infact, if you see your feed going much slower than the feed is supposed to go, or you get a lot of buffering/display issues, make sure this is empty. If you need to control camera FPS, please do it directly on the camera (via its own web interface, for example). ๐ซ
- We are done for the General tab. Let's move to the next tab [image]
- Let's select a protocol of RTSP and a remote method of RTP/RTSP (this is an RTSP camera). ๐ฅ
- Note that starting ZM
1.34, GPUs are supported. In my case, I have an NVIDIA GeForce GTX1050i. These cuda and cuvid parameters are what my system supports to use the NVIDIA hardware decoder and GPU resources. If you don't have a GPU, or don't know how to configure your ffmpeg to support it, leave it empty for now. In future, we will add a section on how to set up a GPU. โก
NOTE: It is entirely possible thatcudaandcuviddon't work for you and you need different values. Isaac usescudainDecoderHWAccelNameand leavesDecoderHWAccelDeviceempty. Try that too.
๐ Todo
add GPU docs
That's pretty much it. Click on Save. We are not going to explore the other tabs in this simple guide.
You now have a configured monitor: [image]
And then, finally, to see if everything works, if you click on the garage monitor you just added, you should be able to see its live feed. If you don't, inspect your webserver logs and your ZoneMinder logs to see what is going on. ๐
๐ Switching to another theme ๐
๐ Todo
Fix theme text after I clearly understand that System->CSS is doing
When you first install ZoneMinder, you see is what is called a "classic" skin. Zoneminder has a host of configuration options that you can customize over time. This guide is meant to get you started the easiest possible way, so we will not go into all the details. However, it is worthwhile to note that Zoneminder also has a 'flat' theme that depending on your preferences may look more modern. So let's use that as an example of introducing you to the Options menu. ๐
- Click on the Options link on the top right of the web interface in the image above
- This will bring you to the options window as shown below. Click on the "System" tab and then select the "flat" option for
CSS_DEFAULTas shown below
[image]
- Click Save at the bottom
Now, switch to the "Display" tab and also select "Flat" there like so: [image]
Your screen will now look like this:
Congratulations! You now have a modern looking interface. [image] โจ
๐ Conclusion ๐
This was a quick 'Getting Started' guide where you were introduced to the very basics of how to add a monitor (camera). We've skipped many details to keep this concise. Please refer to Defining Monitors <> for many other customization details. ๐ซถ
๐ Defining Monitors ๐
To use ZoneMinder properly you need to define at least one Monitor. Essentially, a monitor is associated with a camera and can continually check it for motion detection and such like.
You can access the monitor window by clicking on the โAdd New Monitorโ button, or by clicking on the โSourceโ column of a predefined monitor. [image]
There are a small number of camera setups that ZoneMinder knows about and which can be accessed by clicking on the โPresetsโ link. Selecting one of the presets will fill in the monitor configuration with appropriate values but you will still need to enter others and confirm the preset settings. Here is an example of the presets window: [image]
The options are divided into a set of tabs to make it easier to edit. You do not have to โsaveโ to change to different tab so you can make all the changes you require and then click โSaveโ at the end. The individual options are explained in a little more detail below,
๐ Monitor Tab ๐
Name : The name for your monitor. This should be made up of alphanumeric characters (a-z,A-Z,0-9) and hyphen (-) and underscore(_) only. Whitespace is not allowed.
Server : Multi-Server implementation allows the ability to define multiple ZoneMinder servers sharing a single database. When servers are configured this setting allows you nominate the server for each monitor.
Source Type : This determines whether the camera is a local one attached to a physical video or USB port on your machine, a remote network camera or an image source that is represented by a file (for instance periodically downloaded from a alternate location). Choosing one or the other affects which set of options are shown in the Source tab.
Function : This essentially defines what the monitor is doing. This can be one of the following;
- None โ The monitor is currently disabled. No streams can be viewed or events generated. Nothing is recorded.
- Monitor โ bestie, this one is only for live streaming. No image analysis is done, so no alarms or events will be generated, and nothing will be recorded. It's giving "just looking" energy. ๐
- Modect โ or MOtion DEteCTtion. All captured images will be analysed, and events generated with recorded video where motion is detected. So it's like a motion-activated highlight reel. ๐ฌ
- Record โ the monitor will be continuously recorded. Events of a fixed-length will be generated regardless of motion, analogous to a conventional time-lapse video recorder. No motion detection takes place in this mode. It's the "set it and forget it" vibe. ๐ผ
- Mocord โ the monitor will be continuously recorded, with any motion being highlighted within those events. So you get the full tape and the spicy bits marked. ๐ฅ
- Nodect โ or No DEteCTtion. This is a special mode designed to be used with external triggers. In Nodect, no motion detection takes place, but events are recorded if external triggers require it. It's the "you call the shots" mode. ๐ฏ
Generally speaking, it is best to choose โMonitorโ as an initial setting here. fr fr, just start there, bestie. ๐
โจ Enabled โจ
The enabled field indicates whether the monitor should be started in an active mode or in a more passive state. You will nearly always want to check this box, the only exceptions being when you want the camera to be enabled or disabled by external triggers or scripts. If not enabled, then the monitor will not create any events in response to motion or any other triggers. So it's like, off-off. ๐ซ
๐ Linked Monitors ๐
This field allows you to select other monitors on your system that act as triggers for this monitor. So if you have a camera covering one aspect of your property, you can force all cameras to record while that camera detects motion or other events. You can either directly enter a comma separated list of monitor ids, or click on โSelectโ to choose a selection.
Be very careful not to create circular dependencies with this feature, however, because you will have infinitely persisting alarms which is almost certainly not what you want! ๐ญ To unlink monitors you can ctrl-click.
๐ธ Maximum FPS ๐ธ
Warning: Unless you know what you are doing, please leave this field empty, especially if you are configuring a network camera. More often than not, putting a value here adversely affects recording. ๐
On some occasions you may have one or more cameras capable of high capture rates, but find that you generally do not require this performance at all times and would prefer to lighten the load on your server. This option permits you to limit the maximum capture rate to a specified value. This may allow you to have more cameras supported on your system by reducing the CPU load, or to allocate video bandwidth unevenly between cameras sharing the same video device. This value is only a rough guide, and the lower the value you set, the less close the actual FPS may approach it, especially on shared devices where it can be difficult to synchronise two or more different capture rates precisely. This option controls the maximum FPS in the circumstance where no alarm is occurring only.
This feature is limited and will only work under the following conditions:
- Local cameras
- Remote (IP) cameras in snapshot or jpeg mode only
Using this field for video streams from IP cameras will cause undesirable results when the value is equal to or less than the frame rate from the camera. Note that placing a value higher than the cameraโs frame rate is allowed and can help prevent cpu spikes when communication from the camera is lost.
๐ฅ Alarm Maximum FPS ๐ฅ
Warning: Unless you know what you are doing, please leave this field empty, especially if you are configuring a network camera. More often than not, putting a value here adversely affects recording. ๐
If you have specified a Maximum FPS, it may be that you donโt want this limitation to apply when your monitor is recording motion or other event. This setting allows you to override the Maximum FPS value if this circumstance occurs. As with the Maximum FPS setting, leaving this blank implies no limit, so if you have set a maximum fps in the previous option, then when an alarm occurs this limit would be ignored and ZoneMinder would capture as fast as possible for the duration of the alarm, returning to the limited value after the alarm has concluded. Equally you could set this to the same, or higher (or even lower) value than Maximum FPS for more precise control over the capture rate in the event of an alarm.
IMPORTANT: This field is subject to the same limitations as the Maximum FPS field. Ignoring these limitations will produce undesriable results.
๐ Reference Image Blend %ge ๐
Each analysed image in ZoneMinder is a composite of previous images, and is formed by applying the current image as a certain percentage of the previous reference image. Thus, if we entered the value of 10 here, each imageโs part in the reference image will diminish by a factor of 0.9 each time round. So a typical reference image will be 10% the previous image, 9% the one before that, and then 8.1%, 7.2%, 6.5% and so on of the rest of the way. An image will effectively vanish around 25 images later than when it was added. This blend value is what is specified here, and if higher will make slower progressing events less detectable as the reference image would change more quickly. Similarly, events will be deemed to be over much sooner as the reference image adapts to the new images more quickly. In signal processing terms, the higher this value, the steeper the event attack and decay of the signal. It depends on your particular requirements what the appropriate value would be for you, but start with 10 here and adjust it (usually down) later if necessary.
๐ Triggers ๐
This small section lets you select which triggers will apply if the run mode has been set to โtriggeredโ above. The most common trigger is X10, and this will appear here if you indicated that your system supported it during installation. Only X10 is supported as a shipped trigger with ZoneMinder at present, but it is possible that other triggers will become available as necessary. You can also just use โcronโ jobs or other mechanisms to actually control the camera and keep them completely outside of the ZoneMinder settings. The zmtrigger.pl script is also available to implement custom external triggering.
Source Tab
FFmpeg
This is the recommended source type for most modern ip cameras.
Source Path โ Use this field to enter the full URL of the stream or file your camera supports. This is usually an RTSP url. There are several methods to learn this:
- Check the documentation that came with your camera
- Look for your camera in the hardware compatibility list in the hardware compatibility wiki https://wiki.zoneminder.com/Hardware_Compatibility_List
- Try ZoneMinderโs new ONVIF probe feature
- Download and install the ONVIF Device Manager https://sourceforge.net/projects/onvifdm/ onto a Windows machine
- Use Google to find third party sites, such as ispy, which document this information
Source Colours โ Specify the amount of colours in the captured image. 32 bit is the preferred choice here. Unlike with local cameras, changing this has no controlling effect on the remote camera itself, so ensure that your camera is actually capturing to this palette beforehand.
Capture Width/Height โ Make sure you enter here the same values as they are in the remote cameraโs internal setting.
Keep aspect ratio โ As per local devices.
Orientation โ As per local devices.
LibVLC
The fields for the LibVLC source type are configured the same way as the ffmpeg source type. We recommend only using this source type if issues are experienced with the ffmpeg source type.
cURL
(no description given, bestie. it's just vibes.)
Local
Device Path/Channel โ Enter the full path to the device file that your camera is attached to, e.g. /dev/video0. Some video devices, e.g. BTTV cards, support multiple cameras on one device, so in this case enter the channel number in the Channel box, or leave it at zero if youโre using a USB camera or one with just one channel. Look in Supported Hardware section, how to see if your capture card or USB webcam is supported or not, and what extra settings you may have to do, to make it work.
Device Format โ Enter the video format of the video stream. This is defined in various system files (e.g. /usr/include/linux/videodev.h) but the two most common are 0 for PAL and 1 for NTSC.
Capture Palette โ Finally for the video part of the configuration, enter the colour depth. ZoneMinder supports a handful of the most common palettes, so choose one here. If in doubt, try 32 bit colour first, then 24 bit colour, then grey. If none of these work very well, and your camera is local, then YUV420P or one of the others probably will. There is a slight performance penalty when using palettes other than 32, 24, or grey palettes as an internal conversion is involved. Recent versions of ZoneMinder support 32bit colour. This capture palette provides a performance boost when used on all modern Intel-based processors.
Capture Width/Height โ The dimensions of the video stream your camera will supply. If your camera supports several, just enter the one youโll want to use for this application, you can always change it later. However, I would recommend starting with no larger than 320x240 or 384x288 and then perhaps increasing and seeing how performance is affected. This size should be adequate in most cases. Some cameras are quite choosy about the sizes you can use here, so unusual sizes such as 197x333 should be avoided initially.
โจ Keep aspect ratio โจ
okay so when you're typing in the dimensions of monitors, you can click this checkbox to make sure the width stays in the correct ratio to the height, or vice versa. It lets height be calculated automatically from width (or vice versa) according to a preset aspect ratio. This is preset to 4:3 but can be amended globally via the Options->Config->ZM_DEFAULT_ASPECT_RATIO setting. Aside from 4:3 which is the usual for network and analog cameras, another common setting is 11:9 for CIF (352x288) based sources. ๐
๐ธ Orientation ๐ธ
If your camera is mounted upside down or at right angles, you can use this field to specify a rotation that is applied to the image as it is captured. This incurs an additional processing overhead, so if possible it is better to mount your camera the right way round if you can. If you choose one of the rotation options, remember to switch the height and width fields so that they apply, e.g. if your camera captures at 352x288 and you choose โRotate Rightโ here then set the height to be 352 and width to be 288. You can also choose to โflipโ the image if your camera provides mirrored input. ๐ฆ
๐ฆ Remote ๐ฆ
Remote Protocol
Choices are currently HTTP and RTSP. Before RTSP became the industry standard, many ip cameras streamed directly from their web portal. If you have an ip camera that does not speak RTSP then choose HTTP here. If your 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. ๐
Remote Method
When HTTP is the Remote Protocol, your choices are Simple and Regexp. Most should choose Simple. When RTSP is the Remote Protocol, your choices are RTP/Unicast, RTP/Multicast, RTP/RTSP, RTP,RTSP,HTTP. Try each of these to determine which works with your camera. Most cameras will use either RTP/Unicast (UDP) or RTP/RTSP (TCP). ๐ฅ
Remote Host/Port/Path
Use these fields to enter the full URL of the camera. Basically if your camera is at http://camserver.home.net:8192/cameras/camera1.jpg then these fields will be camserver.home.net, 8192 and /cameras/camera1.jpg respectively. Leave the port at 80 if there is no special port required. If you require authentication to access your camera then add this onto the host name in the form <username>:<password>@<hostname>.com. This will usually be 32 or 24 bit colour even if the image looks black and white. Look in the Supported Hardware > Network Cameras section for how to obtain these strings that may apply to your camera. ๐
Remote Image Colours
Specify the amount of colours in the captured image. Unlike with local cameras, changing this has no controlling effect on the remote camera itself, so ensure that your camera is actually capturing to this palette beforehand. ๐จ
Capture Width/Height
Make sure you enter here the same values as they are in the remote cameraโs internal setting. ๐
Keep aspect ratio
As per local devices. โจ
Orientation
As per local devices. ๐ซ
For an example to setup a MPEG-4 camera see: How_to_Setup_an_Axis211A_with_MPEG-4_streaming
๐ File ๐
File Path
Enter the full path to the file to be used as the image source. ๐
File Colours
Specify the amount of colours in the image. Usually 32 bit colour. ๐
Capture Width/Height
As per local devices. ๐
Keep aspect ratio
As per local devices. ๐
Orientation
As per local devices. ๐
๐ WebSite ๐
This Source Type allows one to configure an arbitrary website as a non-recordable, fully interactive, monitor in ZoneMinder. Note that sites with self-signed certificates will not display until the end user first manually navigates to the site and accepts the unsigned certificate. Also note that some sites will set an X-Frame option in the header, which discourages their site from being displayed within a frame. ZoneMinder will detect this condition and present a warning in the log. When this occurs, the end user can choose to install a browser plugin or extension to workaround this issue. ๐ธ๏ธ
Website URL
Enter the full http or https url to the desired website. ๐
Width (pixels)
Choose a desired width in pixels that gives an acceptable appearance. This may take some experimentation. ๐
Height (pixels)
Choose a desired height in pixels that gives an acceptable appearance. This may take some experimentation. ๐
Web Site Refresh
If the website in question has static content, optionally enter a time period in seconds for ZoneMinder to refresh the content. โณ
๐ Storage Tab ๐
The storage section allows for each monitor to configure if and how video and audio are recorded. ๐ฅ
Save JPEGs
Records video in individual JPEG frames. Storing JPEG frames requires more storage space than h264 but it allows one to view an event anytime while it is being recorded. ๐ธ
- Disabled โ video is not recorded as JPEG frames. If this setting is selected, then โVideo Writerโ should be enabled otherwise there is no video recording at all. ๐ซ
- Frames only โ video is recorded in individual JPEG frames. ๐ผ๏ธ
- Analysis images only (if available) โ video is recorded in individual JPEG frames with an overlay of the motion detection analysis information. Note that this overlay remains permanently visible in the frames. ๐
- Frames + Analysis images (if available) โ video is recorded twice, once as normal individual JPEG frames and once in individual JPEG frames with analysis information overlaid. ๐๏ธ
Video Writer
Records video in real video format. It provides much better compression results than saving JPEGs, thus longer video history can be stored. ๐ฌ
- Disabled โ video is not recorded in video format. If this setting is selected, then โSave JPEGsโ should be enabled otherwise there is no video recording at all. ๐ซ
- X264 Encode โ the video or picture frames received from the camera are transcoded into h264 and stored as a video. This option is useful if the camera cannot natively stream h264. โก
- H264 Camera Passthrough โ this option assumes that the camera is already sending an h264 stream. Video will be recorded as is, without any post-processing in zoneminder. Video characteristics such as bitrate, encoding mode, etc. should be set directly in the camera. ๐ฅ
Recording Audio
Check the box labeled โWhether to store the audio stream when saving an event.โ in order to save audio (if available) when events are recorded. ๐
โฐ Timestamp Tab โฐ
Timestamp Label Format
This relates to the timestamp that is applied to each frame. It is a โstrftimeโ style string with a few extra tokens. You can add %f to add the decimal hundredths of a second to the frame timestamp, so %H:%M:%S.%f will output time like 10:45:37.45. You can also use %N for the name of the monitor and %Q which will be filled by any of the โshow textโ detailed in the zmtriggers.pl section. โฑ๏ธ
Timestamp Label X/Y
The X and Y values determine where to put the timestamp. A value of 0 for the X value will put it on the left side of the image and a Y value of 0 will place it at the top of the image. To place the timestamp at the bottom of the image use a value eight less than the image height. ๐
๐ง Buffers Tab ๐ง
Image Buffer Size
This option determines how many frames are held in the ring buffer at any one time. The ring buffer is the storage space where the last โnโ images are kept, ready to be resurrected on an alarm or just kept waiting to be analysed. It can be any value you like with a couple of provisos, (see next options). However it is stored in shared memory and making it too large especially for large images with a high colour depth can use a lot of memory. A value of no more than 50 is usually ok. If you find that your system will not let you use the value you want it is probably because your system has an arbitrary limit on the size of shared memory that may be used even though you may have plenty of free memory available. This limit is usually fairly easy to change, see the Troubleshooting section for details. ๐ง
Warm-up Frames
This specifies how many frames the analysis daemon should process but not examine when it starts. This allows it to generate an accurate reference image from a series of images before looking too carefully for any changes. I use a value of 25 here, too high and it will take a long time to start, too low and you will get false alarms when the analysis daemon starts up. ๐ฅ
Pre/Post Event Image Buffer
These options determine how many frames from before and after an event should be preserved with it. This allows you to view what happened immediately prior and subsequent to the event. A value of 10 for both of these will get you started but if you get a lot of short events and would prefer them to run together to form fewer longer ones then increase the Post Event buffer size. The pre-event buffer is a true buffer and should not really exceed half the ring buffer size. However the post-event buffer is just a count that is applied to captured frames and so can be managed more flexibly. You should also bear in mind the frame rate of the camera when choosing these values. For instance a network camera capturing at 1FPS will give you 10 seconds before and after each event if you chose 10 here. This may well be too much and pad out events more than necessary. However a fast video card may capture at 25FPS and you will want to ensure that this setting enables you to view a reasonable time frame pre and post event. โชโฉ
๐ Stream Replay Image Buffer
This is how many frames get buffered so you can pause โธ๏ธ and rewind โช the stream while you're live-viewing a monitor. Set it to 0 and the whole feature just... doesn't exist, bestie, it's off. Frames get buffered to ZM_PATH_SWAP. And here's the tea โ โ if that path points to a physical drive, you're gonna cause a lot of IO during live view / montage. So if your system load is giving unhinged ๐ in those situations, either disable the feature or point ZM_PATH_SWAP at a RAM drive. No cap.
๐ธ Alarm Frame Count
Okay so this one lets you say how many consecutive alarm frames have to happen before an alarm event is even generated. The usual (and default!) value is 1, which means literally any alarm frame will cause or participate in an event. You can put any value up to 16 in here to yeet bogus events that were probably just screen flickers or other transients. Realistically though? Values over 3 or 4 are unlikely to be useful, so don't get carried away ๐
.
Heads up bestie: if you have statistics recording enabled, then currently stats are not recorded for the first 'Alarm Frame Count'-1 frames of an event. So if you set this to5, the first4frames will be missing statistics. The more usual value of1keeps you safe and ensures all alarm frames have statistics recorded. ๐ซถ
๐ฅ Control Tab
Note: this tab and all its options will only appear if you've selected the ZM_OPT_CONTROL option, which is how you tell the system it contains cameras that can be controlled via Pan/Tilt/Zoom or other mechanisms. See the Camera Control section elsewhere in this document for the whole rundown on camera control protocols and methods. ๐
๐ Controllable
Check this box to indicate your camera can be controlled. That's it. That's the vibe check. โ
๐ฆ Control Type
Pick the control type that's appropriate for your camera. ZoneMinder ships with a small number of predefined control protocols which will work with some cameras without modification, but which may have to be amended to function with others. Choose the edit link to create new control types or to edit the existing ones. Go off, customization. โจ
๐ Control Device
This is the device used to control your camera. Normally it'll be a serial or similar port. If your camera is a network camera, you generally will not need to specify a control device โ she's wireless, she's free. ๐
โญ Control Address
This is the address of your camera. Some control protocols require that each camera is identified by a particular (usually numeric) id. If your camera uses addressing, enter the id of your camera here. If your camera is a network camera then you'll usually need to enter the hostname or IP address of it here. This is ordinarily the same as that given for the camera itself. iykyk. ๐ซถ
๐ง Auto Stop Timeout
Some cameras only support a continuous mode of movement. Like, you tell the camera to pan right and then when it's aligned correctly you tell it to stop. In some cases it's genuinely difficult to time this precisely over a web interface ๐ญ, so this option lets you specify an automatic timeout where the command will be automatically stopped. So a value of 0.25 here can tell the script to stop moving a quarter of a second after starting. That gives you a more precise method of fine control. Main character precision. ๐
If this value is left blank or at zero it will be ignored. If set, it will be used as the timeout โ however, it will only be applied for the lower 25% of possible speed ranges. In other words, if your camera has a pan speed range of 1 to 100, then selecting to move at 26 or over will be assumed to imply that you want a larger movement that you can control yourself, and no timeout will be applied. Selecting motion at lower speeds will be interpreted as requiring finer control, and the automatic timeout will be invoked. โจ
๐ Track Motion
This and the following four options are used with the experimental motion function. It will only work if your camera supports mapped movement modes, where a point on an image can be mapped to a control command. This is generally most common on network cameras, but it can be replicated to some degree on other cameras that support relative movement modes. See the Camera Control section for more details. Check this box to enable motion tracking. ๐ฅ
๐ Track Delay
This is the number of seconds to suspend motion detection for, following any movement that the camera may make to track motion. Chill time. ๐
๐ Return Location
If your camera supports a 'home' position or presets, you can choose which preset the camera should return to after tracking motion. She comes home. ๐
๐ธ Return Delay
This is the delay, in seconds, once motion has stopped being detected, before the camera returns to any defined return location. Patience is a virtue, bestie. โณ
๐ X10 Tab
Note: this tab and its options will only appear if you've indicated that your system supports the X10 home automation protocol during initial system configuration. Old school but iconic. ๐
โญ X10 Activation String
The contents of this field determine when a monitor starts and/or stops being active when running in 'Triggered' mode and with X10 triggers. The format of this string is as follows:
n: If you simply enter a number then the monitor will be activated when an X10 ON signal for that unit code is detected and will be deactivated when an OFF signal is detected.!n: This inverts the previous mode, e.g.!5means that the monitor is activated when an OFF signal for unit code5is detected and deactivated by an ON.n+: Entering a unit code followed by+means that the monitor is activated on receipt of an ON signal for that unit code but will ignore the OFF signal and as such will not be deactivated by this instruction. If you prepend a!as per the previous definition it similarly inverts the mode, i.e. the ON signal deactivates the monitor.n+<seconds>: As per the previous mode except that the monitor will deactivate itself after the given number of seconds.n-: Entering a unit code followed by-means that the monitor is deactivated on receipt of an OFF signal for that unit code but will ignore the ON signal and as such will not be activated by this instruction. If you prepend a!as per the previous definition it similarly inverts the mode, i.e. the OFF signal activates the monitor.n-<seconds>: As per the previous mode except that the monitor will activate itself after the given number of seconds.
You can also combine several of these expressions by separating them with a comma to create multiple circumstances of activation. However for now, leave this blank. ๐
๐ X10 Input Alarm String
This has the same format as the previous field, but instead of activating the monitor it will cause a forced alarm to be generated and an event recorded if the monitor is Active. The same definition as above applies, except that for activated read alarmed and for deactivated read unalarmed(!). Again, leave this blank for now. ๐
๐ฆ X10 Output Alarm String
This X10 string also has the same format as the two above options. However it works in a slightly different way โ instead of ZoneMinder reacting to X10 events, this option controls how ZoneMinder emits X10 signals when the current monitor goes into or comes out of the alarm state. So just entering a number will cause the ON signal for that unit code to be sent when going into alarm state and the OFF signal when coming out of alarm state. Similarly 7+30 will send the unit code 7 ON signal when going into alarm state and the OFF signal 30 seconds later regardless of state. The combination of the X10 instruction allows ZoneMinder to react intelligently to, and also assume control of, other devices when necessary.
โ ๏ธ But listen: the indiscriminate use of the Input Alarm and Output Alarm signals can cause some horrendous race conditions ๐ โ like a light going on in response to an alarm, which then causes an alarm itself, and so on, forever, a cursed loop. Thus some circumspection is required here. Leave this blank for now anyway. ๐ซถ
๐ง Misc Tab
๐ Event Prefix
By default events are named Event-<event id>, however you're free to rename them individually as you wish. This option lets you modify the event prefix โ the Event- part โ to be a value of your choice, so that events are named differently as they're generated. This lets you name events according to which monitor generated them. Cute and organized. ๐
๐ Section Length
This specifies the length (in seconds) of any fixed length events produced when the monitor function is Record or Mocord. Otherwise it is ignored. This shouldn't be so long that events are difficult to navigate, nor so short that too many events are generated. A length of between 300 and 900 seconds is recommended. ๐
๐ฅ Frame Skip
This setting also applies only to the Record or Mocord functions and specifies how many frames should be skipped in the recorded events. The default setting of zero results in every captured frame being saved. Using a value of one would mean that one frame is skipped between each saved, two means that two frames are skipped between each saved frame, etc. An alternate way of thinking about it: one in every Frame Skip + 1 frames is saved.
The point of this is to ensure that saved events don't take up too much space unnecessarily, whilst still allowing the camera to capture at a fairly high frame rate. The alternate approach is to limit the capture frame rate, which will obviously affect the rate at which frames are saved. Pick your struggle. ๐ญ
๐ FPS Report Interval
How often the current performance in terms of Frames Per Second is output to the system log. Not used in any functional way, so set it to maybe 1000 for now. If you watch /var/log/messages (normally) you'll see this value being emitted at the frequency you specify, both for video capture and processing. Spammy but informative. โจ
Default Scale
okay so if your monitor got set up with a particularly large or small image size, you can pick a default scale right here โ that's the zoom you'll view the monitor at, so it's easier and more visible from the web interface. ๐ธ
Web Colour
Some elements of ZoneMinder now use colours to identify monitors on certain views. You get to pick which colour each monitor uses, right here. Any specification that's valid for HTML colours is valid here, e.g. red or #ff0000. There's a little swatch next to the input box showing off the colour you picked, so you can vibe check it. ๐
Embed EXIF data into image:
Embeds EXIF data into each jpeg frame. ๐ฆ
Todo
what about mp4s? ๐
Defining Zones
The next important thing to do with a new monitor is set up Zones for it to use. By default you'll already have one generated for you when you created your monitor โ that default zone is the full area captured by the monitor โ but you might want to modify it or add others. ๐
Click on the Zones column for your monitor and you should see a small popup window appear. It contains an image from your camera with a stippled pattern laid over it representing your zone. In the default case this covers the whole image. The colour of the zones appearing here is determined by what type they are. The default zone is Active and so will be red, Inclusive zones are orange, exclusive zones are purple, preclusive zones are blue and inactive zones are white. ๐
Beneath the zones image will be a table containing a listing of your zones. Clicking on either the relevant bit of the image or on the Id or Name in the table will bring up another window where you can edit the particulars for your Zones. For more information on defining or editing a zone, see Defining Zones.
Zone configuration and tuning are important when running in the motion detection modes โ otherwise you're out here storing, sorting through, or getting alerted on uninteresting video data. ๐ญ Configuring a zone involves setting some basic parameters, as well as choosing an alarm check method and tuning their associated detection parameters.
The Zone view is split into two main areas: on the left is the options area and on the right is the zone drawing area. A default or new zone will cover the whole drawing area and will overlay any other zones you already have on there. Unlike the previous zones image, the current zone is coloured green, and other zones will be orange regardless of type. The smaller the zone, the less processing time it takes to examine it. โจ
Basic parameters
- Name โ Each Zone can be named for reference purposes. It is used for logging and debugging. Choose a name that helps you identify your zones. ๐ท๏ธ
- Type โ This is one of the more important concepts in ZoneMinder and there are six to choose from. ๐
- Active โ Triggers an alarm when motion is detected within it. This is the zone type you'll use most often, and which will be set for your default zone. Only Active and Exclusive zones can trigger an alarm. ๐ฅ
- Inclusive โ This zone type can be used for any zones that you want to trigger an alarm only if at least one other Active zone has already triggered one. This might be for example to cover an area of the image like a plant or tree which moves a lot and which would trigger lots of alarms. Perhaps this is behind an area you'd like to monitor though โ in this case you'd create an active zone covering the non-moving parts and an inclusive zone covering the tree perhaps with less sensitive detection settings also. If something triggered an alarm in the Active zone and also in the Inclusive zone they would both be registered and the resulting alarm would be that much bigger than if you had blanked it out altogether. ๐ธ
- Exclusive โ Triggers an alarm when motion is detected within it, as long as no alarms have already been triggered in an Active zone. This is the most specialized of the zone types. For instance in the camera covering my garden I keep watch for a hedgehog that visits most nights and scoffs the food out of my cats bowls. By creating a sensitive Exclusive zone in that area I can ensure that a hedgehog alarm will only trigger if there is activity in that small area. If something much bigger occurs, like someone walking by, it will trigger a regular alarm and not one from the Exclusive zone. Thus I can ensure I get alarms for big events and also special small events but not the noise in between. ๐ฆ
- Preclusive โ This zone type is relatively recent. It is called a Preclusive zone because if it is triggered it actually precludes an alarm being generated for that image frame. So motion or other changes that occur in a Preclusive zone will have the effect of ensuring that no alarm occurs at all. The application for this zone type is primarily as a shortcut for detecting general large-scale lighting or other changes. Generally this may be achieved by limiting the maximum number of alarm pixels or other measure in an Active zone. However in some cases that zone may cover an area where the area of variable illumination occurs in different places as the sun and/or shadows move and it thus may be difficult to come up with general values. Additionally, if the sun comes out rapidly then although the initial change may be ignored in this way as the reference image catches up an alarm may ultimately be triggered as the image becomes less different. Using one or more Preclusive zones offers a different approach. Preclusive zones are designed to be fairly small, even just a few pixels across, with quite low alarm thresholds. They should be situated in areas of the image that are less likely to have motion occur such as high on a wall or in a corner. Should a general illumination change occur they would be triggered at least as early as any Active zones and prevent any other zones from generating an alarm. Obviously careful placement is required to ensure that they do not cancel any genuine alarms or that they are not so close together that any motion just hops from one Preclusive zone to another. Preclusive zones may also be used to reduce processing time by situating one over an Active zone. The Preclusive zone is processed first; if it is small, and is triggered, the rest of the zone/image will not be processed. See Extend Alarm Frame Count below for a way to hold the preclusive zone active for an extended period. ๐
- Inactive โ Suppresses the detection of motion within it. This can be layered on top of any other zone type, preventing motion within the Inactive zone from being effective for any other zone type. Use inactive zones to cover areas in which nothing notable will ever happen or where you get false alarms that don't relate to what you are trying to monitor. Inactive zones may be overlaid on other zones to blank out areas, and are processed first (with the exception of Privacy zones, see below). As a general practice, you should try and make zones abut each other instead of overlapping to avoid repeated duplicate processing of the same area. ๐
- Privacy โ Blackens the pixels within it. This can be used if you want to hide some regions in the image if the situation does not allow another solution. This zone type is different to all the others in that it gets processed as soon as possible during capture (even before the timestamp gets into the image) and not in the analyzing process. So if you add, change or delete a Privacy zone, you don't see the changes in the image until the capture process gets restarted. This will be done automatically, but needs a few seconds. ๐ซถ
- Preset โ The preset chooser sets sensible default values based on computational needs (fast v. best) and sensitivity (low, medium, high.) It is not required that you select a preset, and you can alter any of the parameters after choosing a preset. For a small number of monitors with ZoneMinder running on modern equipment, Best, high sensitivity can be chosen as a good starting point. โญ
It is important to understand that the available presets are intended merely as a starting point. Since every camera's view is unique, they are not guaranteed to work properly in every case. Presets tend to work acceptably for indoor cameras, where the objects of interest are relatively close and there typically are few or no unwanted objects moving within the cameras view. Presets, on the other hand, tend to not work acceptably for outdoor cameras, where the field of view is typically much wider, objects of interest are farther away, and changing weather patterns can cause false triggers. For outdoor cameras in particular, you will almost certainly have to tune your motion detection zone to get desired results. Please refer to this guide https://wiki.zoneminder.com/index.php/Understanding_ZoneMinder%27s_Zoning_system_for_Dummies to learn how to do this. ๐ง
- Units โ pick how you wanna think about your numbers:
- Pixels - Selecting this option will allow many of the following values to be entered (or viewed) in units of pixels.
- Percentage - Selecting this option will allow may of the following values to be entered (or viewed) as a percentage. The sense of the percentage values refers to the area of the zone and not the image as a whole. This makes trying to work out necessary sizes rather easier.
Region points [image]
The sample region shown to the right is a region defined by 6 control points. And the shape of that region? It's doing the most so the check methods can straight-up ignore the sidewalk and the bits of porch wall that get changing sunlight โ both of those are not it for this zone, so we're ghosting them. ๐
A region is a part of the captured image that's of interest for this zone. By default, a region is configured to cover the whole captured image. Depending on the selected type of this zone, the shape of the region can be adjusted to accommodate multiple effects. Two ways to do it: drag the control points around in the reference image, or alter the coordinates in the controls below the reference image. Clicking a control point in the reference image highlights its coordinates in the table below. Clicking the + button in a point row adds a control point between this point and the next; clicking the - button removes this control point.
โ ๏ธ bestie, listen โ it is possible to accidentally place a control point outside of the valid coordinates of the image. That will prevent the monitor from working properly. No cap. ๐
You can make zones almost any shape you like; except that zones may not self-intersect (i.e. edges crossing over each other). ๐ซ
๐จ Alarm Colour ๐จ
These parameters can be used to individually colorize the zone overlay pattern. Alarms in this zone will be highlighted in the alarm colour. This option is irrelevant for Preclusive and Inactive zones and will be disabled. (so if you're in one of those, don't even bother, it's giving nothing ๐)
๐ Alarm Check Methods ๐
There are 3 Alarm Check Methods. They are sequential, and they are layered, okay, think of it like a stack:
- In AlarmedPixels mode, only the AlarmedPixel analysis is performed.
- In FilteredPixels mode, the AlarmedPixel analysis is performed first, followed by the FilteredPixel analysis.
- In the Blobs mode, all 3 analysis methods are performed in order.
An alarm is only triggered if all of the enabled analysis modes are triggered. For performance reasons, as soon as the criteria for one of the analysis modes is not met, the alarm checking for the frame is complete. Since the subsequent modes each require progressively more computations, it is a good idea to tune the parameters in each of the activated layers. ๐ง
For reference purposes, the Zone Area box shows the area of the entire region of interest. In percent mode, this is 100. In Pixels mode, this is the pixel count of the region. All 3 Min/Max Area parameter groups are based on the Zone Area as the maximum sensible value, and all 3 are interpreted in the units specified in the Units input. ๐
๐ฅ AlarmedPixels ๐ฅ
Alarmed pixels is the first layer of analysis, and is always enabled. It's recommended that you start with this method and move on to the subsequent methods once the effects of the basic parameters are understood. In the AlarmedPixels mode, 2 parameter categories are available for tuning: Min/Max Pixel Threshold, and Min/Max Alarmed Area. โจ
๐ Min/Max Pixel Threshold (0-255) ๐
In the AlarmedPixel layer of analysis, each individual pixel of the image is compared to the current reference image. Pixels that are different from the reference image are considered alarmed pixels. However, small aberrations in lighting or auto exposure camera adjustments may cause the explicit value of a pixel to vary by small amounts from image to image. This parameter lets you set the limits of what will be considered a changed pixel. Example time: if your camera points to a blank white wall, and you raise a black colored item into view, then the change in any one pixel will be great, indeed, extreme. If however, you raise a white piece of paper, then the change in an individual pixel will be less. ๐
The minimum pixel threshold setting should be high enough to cause minor lighting, imaging, or compression changes to be ignored. Setting the minimum value too high may allow a white cat to walk undetected across the view of the white wall ๐ญ (iconic behaviour from the cat, catastrophic behaviour for your zone). A good starting point for the minimum pixel threshold is 40, meaning that the difference in pixel value from must be greater than 40. A good default for the maximum pixel threshold is 0 (indicating that all differences above the minimum threshold are considered a change.)
๐ธ Min/Max Alarmed Area ๐ธ
The count of alarmed pixels (or percentage of alarmed pixels relative to the pixel area of the region if in percent mode) is used in this first layer of analysis to determine if an alarm is triggered. If the count or percentage is above the minimum alarmed area, but less than the maximum alarmed area, an alarm is triggered. These settings depend on the size of the object you are trying to capture: a value too low may cause false alarms, while a value too high might not detect small objects. A good starting point for both the minimum and maximum are 0 and 0, indicating that any number of alarmed pixels (or any percentage) greater than 0 will trigger an alarm. The frame scores from logged events can then be used to bring the minimum up to a reasonable value. An alternative starting point for the minimum alarmed area (in percent) is 25% of the area that an object of interest takes up in the region. For example, if you approximate that a subject moving through the frame takes up 30% of the frame, then a good starting minimum area is about 7.5%. ๐งฎ
๐ฆ FilteredPixels ๐ฆ
Selecting the FilteredPixels Alarm Check Method adds an additional layer of analysis to the AlarmedPixels check along with 2 additional parameter categories for tuning. This layer works by analyzing the alarmed pixels identified in the first layer. Alarmed pixels are disregarded, in this and future layers if enabled, if they are not in groups of a minimum small square size. Primarily, this filtering removes isolated alarmed pixels that may be artifacts of the camera, lens, or compression. so basically it's the vibe check for lonely pixels ๐
๐ Filter Width/Height (pixels) ๐
This parameter is always specified in Pixels, even when Percentages are the selected units. It specifies the size of the group of pixels surrounding a given pixel that must be in alarmed pixels for the pixel itself to be considered an alarmed pixel. The width and height should always be an odd number. 3 x 3 is the default value, and 5 x 5 is also suggested as a sensible alternative. Avoid using large numbers for the width and height of the filter area. When using the Blobs Alarm Check Method, FilteredPixels can be effectively disabled by setting either the width or height to a value less than 1. โญ
๐ Min/Max Filtered Area ๐
Applying the filtering analysis results in an area that is less than or equal to the alarmed area. Thus the minimum and maximum filtered area parameters for alarm should be equal to or less than the corresponding alarm area parameters, or the FilteredPixels analysis will never trigger an alarm. In particular, it is useful to raise the minimum alarmed area parameter until false events from image artifacts disappear, and setting a minimum filtered area parameter less the minimum alarmed area parameter by enough to capture small events of interest. โจ
๐ซถ Blobs [image] ๐ซถ
This image shows an image with 1 identified blob. The blob is outlined in the Alarm Colour specified above.
When two or more Filtered areas touch or share a boundary, it is sensible to evaluate the regions as one contiguous area instead of separate entities. A Blob is a contiguous area made up of multiple filtered areas. Whereas FilteredPixes is useful for excluding parts of the image that are not part of the actual scene, Blob filtering is better suited to disregarding areas of the actual scene that are not of interest. ๐
Selecting the Blobs Alarm Check Method opens up all of the available parameters. Enabling Blobs adds one more layer of analysis to the AlarmedPixel and FilteredPixel checks in the determination of a valid alarm along with 2 additional parameter categories for tuning: the size of the blobs, and the number of blobs. A Blob is not necessarily the whole object that may be of interest. In the example image, the subject is moving, but only a portion of him is marked as a blob. Why? Because as the subject moves, many pixels of the image do not change in value beyond the set threshold. A pixel that is representing the subject's shoulder in one frame may be representing his back in the next, however, the value of the pixel remains nearly the same. the pixel said "no thoughts, same value" ๐ญ
๐ Min/Max Blob Area ๐
The blob area parameters control the smallest and largest contiguous areas that are to be considered a blob. A good value for the maximum area is the default of 0. (There is no upper bound for the size of a contiguous area that will still be considered a blob.)
๐ Min/Max Blobs ๐
Normally, you would want any positive number of blobs to trigger an event, so the default value of 1 should suffice. In some circumstances, it may benefit to have only one blob NOT trigger an event, in which case, setting this value to 2 or higher may serve some special purpose. A good value for the maximum blobs is the default of 0. (There is no upper bound for the number of blobs that will trigger an event. Use the maximum blobs parameter can be used to tune out events that show a high number of blobs.
๐ Overload Frame Ignore Count ๐
This setting specifies the number of frames to NOT raise an alarm after an overload. In this context, overload is defined as a detected change too big to raise an alarm. Depending on the alarm check method that could be
- Number of alarmed pixels >
Max Alarmed Areaor - Number of filtered pixels >
Max Filtered Areaor - Number of Blobs >
Max Blobs
The idea is that after a change like a light going on that is considered too big to count as an alarm, it could take a couple of frames for things to settle down again. ๐ง let it breathe, bestie.
โจ Extend Alarm Frame Count โจ
Okay so this field is Preclusive Zones only, bestie, nobody else gets to use it ๐ . Drop a value in here and it holds the Preclusive zone active for that many frames after the initial triggering event. Why would you want that? Because sometimes a sudden change in light level trips the Preclusive zone, but the zone actually needs to stay active for a few frames while the camera itself adjusts to that light change. It's giving "hold the line, babe" ๐ซถ.
๐ฆ Other information
If you're brand new to zones and you're sitting there like "what is happening ๐ญ", go peek at this user contributed Zone guide โ it's got illustrations and everything:
https://wiki.zoneminder.com/index.php/Understanding_ZoneMinder%27s_Zoning_system_for_Dummies
๐บ Viewing Monitors
ZoneMinder lets you watch a live feed of your configured monitors, and honestly? iconic behavior ๐. You get there by clicking on the โNameโ column of any of the monitors [image].
Clicking on the name gives you a view kinda like this: [image].
The image should basically explain itself, but if it's giving garbage instead of glamour, there's a real chance your video configuration is wrong. So go look in your system error log and check for โ or report โ anything unusual ๐.
The centre of the window has a tiny little frame that just contains a status. That status will be โIdleโ, โAlarmโ or โAlertโ, depending on the function of the Monitor and what's going on in the field of view:
- Idle means nothing is happening
- Alarm means there is an alarm in progress
- Alert means that an alarm has happened and the monitor is โcooling downโ โ and if another alarm gets generated in this time, it just becomes part of the same event
These indicators are colour coded in green, red and amber respectively.
By default, if you've minimised this window or opened other windows in front of it, it will pop up to the front when it goes to Alarm state. You can turn that behavior off in โoptionsโ if it's not your vibe. You can also specify a sound file in the configuration, which gets played when an alarm occurs to alert you to the fact if you're not sitting in front of your computer ๐. This should be a short sound of only a couple of seconds ideally. Heads up though: the status is refreshed every few seconds, so it's possible for this not to alert you to every single event that takes place โ so don't rely on it for that purpose if you expect very brief events. Alternatively you can decrease the refresh interval for this window in the configuration, though too-frequent refreshing may impact on performance ๐ฌ.
Below the status is a list of recent events that have occurred. By default this is just the last 10, but clicking on โAllโ gives you the full list, and โArchiveโ takes you to the event archive for this monitor โ more on this later. Clicking on any of the column headings sorts the events appropriately.
From here you can also delete events if you want to. The events themselves are listed with:
- the event id
- the event name (which you can change)
- the time that the event occurred
- the length of the event, including any preamble and postamble frames
- the number of frames comprising the event, with the number that actually contain an alarm in brackets
- and finally a score
That score column lists the average score per alarm frame as well as the maximum score that any alarm frame had.
The score is an arbitrary value that essentially represents the percentage of pixels in the zone that are in blobs, divided by the square root of the number of blobs, and then divided by the size of the zone. This gives a nominal maximum of 100 for a zone, and the totals for each zone are added together:
- Active zones scores are added unchanged
- Inclusive zones are halved first
- Exclusive zones are doubled
In reality, values are likely to be much less than 100, but it does give a simple indication of how major the event was. Slay, math ๐ .
๐ Filtering Events
Filters let you define complex conditions with associated actions in ZoneMinder. Examples could include:
- Send an email each time a new event occurs for a specific monitor
- Delete events that are more than 10 days old
- And many more โจ
The filter window can be accessed by tapping on the top level filter menu.
You can use the filter window to create your own filters or to modify existing ones. You can even save your favourite filters to re-use at a future date ๐พ. Filtering itself is fairly simple โ first you choose how many expressions you'd like your filter to contain. Changing this value will cause the window to redraw with a corresponding row for each expression. Then you select what you want to filter on and how the expressions relate, by choosing whether they are โandโ or โorโ relationships. For filters made up of many expressions you also get the option to bracket parts of the filter to make sure you can express it exactly how you want. Then, if you like, choose how you want your results sorted and whether you want to limit the amount of events displayed.
Here's what the filter window looks like [image].
- A: This is a dropdown list where you can select pre-defined filters. You'll notice that ZoneMinder comes with a PurgeWhenFull filter that is configured to delete events if you reach 95% of disk space.
- B: If you're creating a new filter, you can type in a name for your filter here.
- C: This is where you specify conditions that need to match before the filter is executed. You use the โ+โ and โ-โ buttons to add/delete conditions.
- D: This allows you to perform sorting and limiting operations on the output before you take an action.
- E: This is where you specify what needs to happen when the conditions match:
- Archive all matches: sets the archive field to
1in the Database for the matched events. Think of โarchivingโ as grouping them under a special category โ you can view archived events later and also make sure archived events don't get deleted, for example.
- Archive all matches: sets the archive field to
๐ Todo
For the โcreate videoโ filter, put in more details on how it works, any dependencies etc.
- Update used disk space: calculates how much disk space is currently taken by the event and updates the db record.
- Create video for all matches: creates a video file of all the events that match.
- Create video for all matches:
ffmpegwill be used to create a video file (mp4) out of all the stored jpgs if using jpeg storage.- Execute command on all matches: Allows you to execute any arbitrary command on the matched events. You can use replacement tokens as subsequent arguents to the command, the last argument will be the absolute path to the event, preceded by replacement arguents. eg:
/usr/bin/script.sh %MN%will execute as/usr/bin/script.sh MonitorName /path/to/event. Please note that urls may contain characters like&that need quoting. So you may need to put quotes around them like/usr/bin/scrupt.sh "%MN%". - Delete all matches: Deletes all the matched events.
- Email details of all matches: Sends an email to the configured address with details about the event.
- Execute command on all matches: Allows you to execute any arbitrary command on the matched events. You can use replacement tokens as subsequent arguents to the command, the last argument will be the absolute path to the event, preceded by replacement arguents. eg:
- Copy all matches: copies the event files to another location, specified in the Copy To dropdown. The other location must be setup in the Storage Tab under options.
- Message details of all matches: Uses an email to SMS gateway to send an SMS message for each match.
- Move all matches: copies the event files to another location, specified in the Move To dropdown. The other location must be setup in the Storage Tab under options. The files will be delete from the original location.
- Run filter in background: When checked, ZoneMinder will make sure the filter is checked regularly. For example, if you want to be notified of new events by email, you should make sure this is checked. Filters that are configured to run in the background have a โ*โ next to it.
- Run filter concurrently: Allows this filter to run in its own thread, thereby letting other filters run in parallel. โจ multitasking queen โจ
- F: Use โList Matchesโ to โtestโ your matching conditions. This will just match and show you what filters match. Use โExecuteโ to actually execute the action after matching your conditions. Use โSaveโ to save the filter for future use and โResetโ to clear your settings.
๐ Note
More details on filter conditions:
There are several different elements to an event that you can filter on, some of which require further explanation. These are as follows:
- โDate/Timeโ which must evaluate to a date and a time together
- โDateโ and โTimeโ which are variants which may only contain the relevant subsets of this
- โWeekdayโ which as expected is a day of the week
All of the preceding elements take a very flexible free format of dates and time based on the PHP strtotime function (https://www.php.net/manual/en/function.strtotime.php). This allows values such as โlast Wednesdayโ etc to be entered. We recommend acquainting yourself with this function to see what the allowed formats are ๐.
However! Automated filters are run in perl and so are parsed by the Date::Manip package. Not all date formats are available in both, so if you have saved your filter to do automatic deletions or other tasks, you should make sure that the date and time format you use is compatible with both methods. The safest type of format to use is โ-3 dayโ or similar, with easily parseable numbers and units are in English.
okay so the other things you can filter on? all pretty self-explanatory honestly ๐
โ except maybe Archived, which is your lil toggle for including or excluding Archived events. Real talk, you'll probably be doing most of your filtering on un-archived events. periodt.
There are also two elements โ Disk Blocks and Disk Percent โ that don't actually relate to the events themselves at all, but to the disk partition where those events are stored. They let you specify an amount of disk usage, either in blocks or as a percentage, as returned by the df command. Heads up: these are about the disk space used, not the space left free. ๐ซถ
Once your filter is all specified, clicking submit filters the events according to your spec. But here's the tea on the disk-based elements โ because they aren't directly event-related, if you build a filter including the term DiskPercent > 95 and your current disk usage is over that amount when you hit submit, then literally all events get listed. And if it's under? Then none at all. ๐ So the disk-related terms tend to get used mostly for automatic filters (more on that below).
If you've made a filter you wanna keep, you can name it and save it by clicking Save. โจ
If you do that, the subsequent dialog also lets you specify whether you want this filter automatically applied to:
- delete events, or
- upload events via ftp to another server, and
- mail notifications of events to one or more email accounts.
Emails and messages (essentially small emails meant for mobile phones or pagers ๐ฑ) have a format defined in the Options screen, and may include a whole buffet of tokens that get substituted for various details of the event that caused them. That includes links to the event view or the filter, plus the option of attaching images or videos to the email itself. ๐
Be aware that tokens representing links may require you to log in to actually access the page, and sometimes they function differently when viewed outside of the general ZoneMinder context. iykyk.
The tokens you can use are as follows:
%EI%โ Id of the event%EN%โ Name of the event%EC%โ Cause of the event%ED%โ Event description%ET%โ Time of the event%EL%โ Length of the event%EF%โ Number of frames in the event%EFA%โ Number of alarm frames in the event%EST%โ Total score of the event%ESA%โ Average score of the event%ESM%โ Maximum score of the event%EP%โ Path to the event%EPS%โ Path to the event stream%EPF1%โ Path to the frame view for the first alarmed event image%EPFM%โ Path to the frame view for the (first) event image with the highest score%EPFMOD%โ Path to image containing object detection, in frame view%EPFMODG%โ Path to image containing object detection animated gif version, in frame view%EPI%โ Path to the event images%EPI1%โ Path to the first alarmed event image, suitable for use in img tags%EPIM%โ Path to the (first) event image with the highest score, suitable for use in img tags%EPIMOD%โ Path to image containing object detection, suitable for use in img tags%EPIMODG%โ Path to image containing object detection animated gif version, suitable for use in img tags%EI1%โ Attach first alarmed event image%EI1A%โ Attach first alarmed event analysis image%EIM%โ Attach (first) event image with the highest score%EIMA%โ Attach (first) event analysis image with the highest score%EIMOD%โ Attach image containing object detection%EIMODG%โ Attach image containing object detection animated gif version%EV%โ Attach event mpeg video%EVM%โ Attach event mpeg video in phone format%MN%โ Name of the monitor%MET%โ Total number of events for the monitor%MEH%โ Number of events for the monitor in the last hour%MED%โ Number of events for the monitor in the last day%MEW%โ Number of events for the monitor in the last week%MEM%โ Number of events for the monitor in the last month%MEA%โ Number of archived events for the monitor%MP%โ Path to the monitor window%MPS%โ Path to the monitor stream%MPI%โ Path to the monitor recent image%FN%โ Name of the current filter that matched%FP%โ Path to the current filter that matched%ZP%โ Path to your ZoneMinder console
Finally, you can also specify a script which runs on each matched event. ๐ฆ This script should be readable and executable by your web server user. It gets run once per event, and it also gets the relative path to the directory containing the event in question. Normally this will be of the form <MonitorName>/<EventId>, so from this path you can derive both the monitor name and the event id and then go do whatever action your heart desires. ๐
Note that arbitrary commands are not allowed to be specified in the filter โ for security, the only thing it may contain is the full path to an executable. What that executable contains is entirely up to you though. ๐
Filtering is a powerful mechanism you can use to eliminate events that fit a certain pattern โ but in many cases, modifying the zone settings will better address it. Where filtering really comes into its own is generally in applying time filters, so for instance events that happen during weekdays or at certain times of the day get highlighted, uploaded, or deleted. โจ
Additionally, using disk-related terms in your filters means you can automatically create filters that delete the oldest events when your disk gets full. But be warned โ ๏ธ โ if you use this strategy, you should limit the returned results to the amount of events you want deleted in each pass, until the disk usage is at an acceptable level. If you don't do this, then the first pass when the disk usage is high will match, and then delete, all events, unless you've used other criteria inside of limits. ๐ญ
ZoneMinder ships with a sample filter already installed, though disabled. The PurgeWhenFull filter can be used to delete the oldest events when your disk starts filling up. To use it, you should select and load it in the filter interface, modify it to your requirements, and then save it โ making sure you check the Delete all matches option. This will then run in the background and ensure your disk does not fill up with events. ๐
๐ Saving filters ๐
When saving filters, if you want the filter to run in the background, make sure you select the โRun filter in backgroundโ option. When checked, ZoneMinder will make sure the filter is checked regularly. So, for example, if you want to be notified of new events by email, you should make sure this is checked. โจ
Filters that are configured to run in the background have a โ*โ next to it.
๐ง How filters actually work ๐ง
It's useful to know how filters actually work behind the scenes in ZoneMinder, y'know, in the event you find your filter not functioning as intended: ๐
- Each filter set to run in the background will be run in it's own process called
zmfilter.plwhich retrieves filters from the Filters database table zmfilter.plruns everyFILTER_EXECUTE_INTERVALseconds (default is20s, can be changed in Options->System)- after each interval the filter will query the database and apply the action to each matching event.
zmfilter.plalso reloads the filter everyFILTER_RELOAD_DELAYseconds (default is300s/5mins, can be changed in Options->System)- In previous versions of ZoneMinder filter changes would not take immediate effect, but now the web ui will start/stop/restart filters as appropriate upon editing a filter.
๐ Relative items in date strings ๐
Relative items adjust a date (or the current date if none) forward or backward. The effects of relative items accumulate. Here are some examples:
1 year1 year ago3 years2 days
The unit of time displacement may be selected by the string โyearโ or โmonthโ for moving by whole years or months. These are fuzzy units, as years and months are not all of equal duration. More precise units are โfortnightโ which is worth 14 days, โweekโ worth 7 days, โdayโ worth 24 hours, โhourโ worth 60 minutes, โminuteโ or โminโ worth 60 seconds, and โsecondโ or โsecโ worth one second. An โsโ suffix on these units is accepted and ignored. ๐
The unit of time may be preceded by a multiplier, given as an optionally signed number. Unsigned numbers are taken as positively signed. No number at all implies 1 for a multiplier. Following a relative item by the string โagoโ is equivalent to preceding the unit by a multiplier with value -1.
The string โtomorrowโ is worth one day in the future (equivalent to โdayโ), the string โyesterdayโ is worth one day in the past (equivalent to โday agoโ).
The strings โnowโ or โtodayโ are relative items corresponding to zero-valued time displacement โ these strings come from the fact a zero-valued time displacement represents the current time when not otherwise changed by previous items. They may be used to stress other items, like in โ12:00 todayโ. The string โthisโ also has the meaning of a zero-valued time displacement, but is preferred in date strings like โthis thursdayโ.
When a relative item causes the resulting date to cross a boundary where the clocks were adjusted, typically for daylight saving time, the resulting date and time are adjusted accordingly. โฐ
The fuzz in units can cause problems with relative items. For example, โ2003-07-31 -1 monthโ might evaluate to 2003-07-01, because 2003-06-31 is an invalid date. To determine the previous month more reliably, you can ask for the month before the 15th of the current month. For example:
$ date -R
Thu, 31 Jul 2003 13:02:39 -0700
$ date --date='-1 month' +'Last month was %B?'
Last month was July?
$ date --date="$(date +%Y-%m-15) -1 month" +'Last month was %B!'
Last month was June!
Okay so real talk โ filters can search for events in a chunk of time, or, say, be a lil purge filter that yeets events older than 30 days. For that second one you're gonna want at least two lines in your filter.
Line one should be:
[<Archive Status> <equal to> <Unarchived Only>]
because bestie we are NOT deleting your archived events. Absolutely not. ๐
Then your second line, to catch events older than 30 days, is:
[and <Date><less than> -30 days]
You use โless thanโ to say hey, match me events before this date, and you say โ-30 daysโ to mean a date 30 days before the filter actually runs. And yeah, you could lowkey use 30 days ago as well(?). ๐
Always test your filters before enabling any actions based on them, so you know they consistently return the results you want. Hit the submit button to see what events your query is serving up. โจ
๐ธ Caveat with Relative items ๐ธ
Okay this one is IMPORTANT so pay attention bestie. If you specify relative dates like โnowโ or โ1 minute agoโ, etc., they get converted into a specific date and time by Zoneminder's filtering process (zmfilter.pl) when the filters are loaded. They are _NOT_ recomputed every time the filter runs. Filters get re-loaded depending on the value specified by the FILTER_RELOAD_DELAY variable in the Zoneminder Web Console->Options->System. ๐ญ
This can cause confusion, for example: let's say a user specifies that he wants to be notified of events via email the moment the event โDateTimeโ is โless thanโ โnowโ as a filter criteria. When the filter first gets loaded by zmfilter.pl, this will translate to:
โMatch events where Start Time < โ + localtime()
where local time is the time that is resolved when this filter gets loaded. Now, till the time the filter gets reloaded after FILTER_RELOAD_DELAY seconds (which is usually set to 300 seconds, or 5 minutes), that time does not get recomputed, so the filter will not process any new events that occur after that computed date till another 5 minutes โ which is probably not what you want. ๐
๐ซถ Troubleshooting tips ๐ซถ
If your filter is not working, here are some useful tips:
- Look at Info and Debug logs in Zoneminder ๐
- Run
sudo zmfilter.pl -f <yourfiltername>from command line and see the log output - Check how long your action is taking โ
zmfilter.plwill wait for the action to complete before it checks again - If you are using relative times like โnowโ or โ1 year agoโ etc., remember that
zmfilterconverts that relative time to an absolute date only when it reloads filters, which is dictated by theFILTER_RELOAD_DELAYduration. So, for example, if you are wondering why your events are not being detected before intervals of 5 minutes and you have used such a relative condition, this is why - In the event that you see your new filter is working great when you try it out from the Web Console (using the Submit or Execute button) but does not seem to work when it's running in background mode, you might have just chanced upon a compatibility issue between how Perl and PHP translate free form text to dates/times. When you test it via the โSubmitโ or โExecuteโ button, you are invoking a PHP function for time conversion. When the filter runs in background mode,
zmfilter.plcalls a perl equivalent function. In some cases, depending on the version of Perl and PHP you have, the results may vary. If you face this situation, the best thing to do is to runsudo zmfilter.pl -f <yourfiltername>from a terminal to make sure the filter actually works in Perl as well. ๐ง
๐ฆ Viewing Events ๐ฆ
From the monitor or filtered events listing you can now click on an event to view it in more detail.
This is an example view that shows events for a specific monitor:
[image]
If you have streaming capability you will see a series of images that make up the event. Under that you should also see a progress bar. Depending on your configuration this will either be static or will be filled in to indicate how far through the event you are. By default this functionality is turned off for low bandwidth settings, as the image delivery tends to not be able to keep up with real-time and the progress bar cannot take this into account. Regardless of whether the progress bar updates, you can click on it to navigate to particular points in the events. โจ
You will also see a link to allow you to view the still images themselves. If you don't have streaming then you will be taken directly to this page. The images themselves are thumbnail size and, depending on the configuration and bandwidth you have chosen, will either be the full images scaled in your browser or actual scaled images. If it is the latter, if you have low bandwidth for example, it may take a few seconds to generate the images. If thumbnail images are required to be generated, they will be kept and not re-generated in future. Once the images appear you can mouse over them to get the image sequence number and the image score. ๐
Here is an example of viewing an event stream: [image]
The image above shows a typical window for an event that was recorded as an MP4 video. ๐
๐ Options ๐
The various options you can specify are displayed in a tabbed dialog with each group of options displayed under a different heading. Each option is displayed with its name, a short description and the current value. You can also click on the โ?โ link following each description to get a fuller explanation about each option. This is the same as you would get from zmconfig.pl. A number of option groups have a master option near the top which enables or disables the whole group, so you should be aware of the state of this before modifying options and expecting them to make any difference. ๐
If you have changed the value of an option you should then โsaveโ it. A number of the option groups will then prompt you to let you know that the option(s) you have changed will require a system restart. This is not done automatically, in case you will be changing many values in the same session โ however once you have made all of your changes you should restart ZoneMinder as soon as possible. The reason for this is that web and some scripts will pick up the new changes immediately, but some of the daemons will still be using the old values, and this can lead to data inconsistency or loss. ๐ญ
Note: If you are looking forOptions->Pathsdocumentation, it was moved to a configuration file starting ZoneMinder1.32. See here<# replacement-for-options-path>.
๐ Options - Display ๐
This option screen allows user to select the skin for ZoneMinder. Currently available styles are: [image]
โญ Options - System โญ
This screen allows the admin to configure various core operations of the system.
A partial screenshot is shown below: [image]
SKIN_DEFAULTโ ZoneMinder allows the use of many different web interfaces. This option allows you to set the default skin used by the website. Users can change their skin later, this merely sets the default.CSS_DEFAULTโ ZoneMinder allows the use of many different web interfaces, and some skins allow the use of different set of CSS files to control the appearance. This option allows you to set the default set of css files used by the website. Users can change their css later, this merely sets the default.LANG_DEFAULTโ ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language.OPT_USE_AUTHโ ZoneMinder can run in two modes. The simplest is an entirely unauthenticated mode where anyone can access ZoneMinder and perform all tasks. This is most suitable for installations where the web server access is limited in other ways. The other mode enables user accounts with varying sets of permissions. Users must login or authenticate to access ZoneMinder and are limited by their defined permissions. Authenticated mode alone should not be relied up for securing Internet connected ZoneMinder. โ ๏ธAUTH_TYPEโ ZoneMinder can use two methods to authenticate users when running in authenticated mode. The first is a builtin method where ZoneMinder provides facilities for users to log in and maintains track of their identity. The second method allows interworking with other methods such as http basic authentication which passes an independently authenticated โremoteโ user via http. In this case ZoneMinder would use the supplied user without additional authentication, provided such a user is configured in ZoneMinder.CASE_INSENSITIVE_USERNAMESโ This option makes usernames case insensitive when authenticating.AUTH_RELAYโ When ZoneMinder is running in authenticated mode it can pass user details between the web pages and the back end processes. There are two methods for doing this. This first is to use a time limited hashed string which contains no direct username or password details, the second method is to pass the username and passwords around in plaintext. This method is not recommend except where you do not have the md5 libraries available on your system or you have a completely isolated system with no external access. You can also switch off authentication relaying if your system is isolated in other ways.AUTH_HASH_SECRETโ When ZoneMinder is running in hashed authenticated mode it is necessary to generate hashed strings containing encrypted sensitive information such as usernames and passwords. Although these strings are reasonably secure, the addition of a random secret increases security substantially. Note that if you are using the new token based APIs, then this field is mandatory with ZM1.34and above. ๐ฅAUTH_HASH_IPSโ When ZoneMinder is running in hashed authenticated mode it can optionally include the requesting IP address in the resultant hash. This adds an extra level of security as only requests from that address may use that authentication key. However in some circumstances, such as access over mobile networks, the requesting address can change for each request which will cause most requests to fail. This option allows you to control whether IP addresses are included in the authentication hash on your system. If you experience intermitent problems with authentication, switching this option off may help. It is recommended you keep this off if you use mobile apps likezmNinjaover mobile carrier networks โ several APNs change the IP very frequently which may result in authentication failures. ๐ซถAUTH_HASH_TTLโ how long (in hours, bestie) a ZM auth lasts before it expires. Heads up: this does not apply to API tokens. The default has traditionally been2hours, and a fresh hash gets auto-regenerated at half this value. โจAUTH_HASH_LOGINSโ okay so normally you log into ZoneMinder through the login screen with username + password. But sometimes you wanna let someone (like a third-party app ๐) jump straight to one or more pages. If this option is on, adding anauthparameter to any request gives you a shortcut login that bypasses the login screen โ as long as you're not already logged in. Since auth hashes are time-limited and, optionally, IP-limited, this lets you hand out short-term access to ZoneMinder screens from other web pages etc. To pull it off, the calling application has to generate the authentication hash itself and make sure it's valid. And if you turn this on, you should really make sure you've changedZM_AUTH_HASH_SECRETto something unique to your system. ๐ENABLE_CSRF_MAGICโ CSRF = Cross-Site Request Forgery, and under specific circumstances it lets an attacker do literally anything your ZoneMinder user account has permission to do ๐ญ. To pull it off, the attacker has to write a super specific web page and get you to navigate to it while you're logged into the ZoneMinder web console at the same time. EnablingZM_ENABLE_CSRF_MAGIChelps mitigate these kinds of attacks. Oh and if you're using zmNinja and hitting access issues, you might try turning this off.OPT_USE_APIโ the global on/off switch for ZoneMinder APIs. Using mobile apps like zmNinja? Then this needs to be enabled, no cap.
๐ Note: if you're using zmNinja along with authentication, please make sureAUTH_HASH_LOGINSis enabled,OPT_USE_APIis elabled,AUTH_RELAYis set tohashed,AUTH_HASH_IPSis off, and a validAUTH_HASHED_SECRETis specified. (Yes bestie, that's a checklist โ do all of it.)
OPT_USE_LEGACY_AUTHโ starting version1.34.0, ZoneMinder uses a way more secure Authentication mechanism using JWT tokens. Older versions used a less secure MD5 based auth hash. It's recommended you turn this off once you're sure you don't need it. If you're running a 3rd party app that relies on the older API auth mechanisms, you'll have to update that app if you turn this off. FYI zmNinja1.3.057onwards supports the new token system. ๐OPT_USE_EVENT_NOTIFICATIONโzmeventnotificationis a 3rd party event notification server used to get notifications for alarms detected by ZoneMinder in real time. zmNinja requires this server for push notifications to mobile phones. This option only enables the server if it is already installed. Installation instructions live at the Event Notification Server project site:https://github.com/pliablepixels/zmeventserver. ๐ฆOPT_USE_GOOG_RECAPTCHAโ this one adds a google reCaptcha validation at login, so on top of a valid username and password you also have to pass the reCaptcha test. Fair warning: enabling this means the zoneminder login page reaches out to google servers for captcha validation. Also, enabling it may break 3rd party clients if they rely on web based logins (though zmNinja now uses the API based token method, so it won't be affected if reCAPTCHA is enabled โ slay). If you enable this, you also need to specify your site and secret key (check the context help in the ZoneMinder system screen). โจSYSTEM_SHUTDOWNโ this option puts a poweroff icon in the header of the ZM UI for users with System privilege accessi. That icon lets the user shutdown the full system via the ZM UI. The system will needsudoinstalled and the following added to/etc/sudoers:
www-data ALL=NOPASSWD: /sbin/shutdown
...to perform the shutdown or reboot. ๐
OPT_FAST_DELETEโ normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When you're deleting events in the browser, removing all of that can take a long time if youxr trying to do a lot of events at once. โ ๏ธ NOTE: it's recommended that you keep this option OFF, unless you're running on an old or low-powered system.FILTER_RELOAD_DELAYโ ZoneMinder lets you save filters to the database, which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. Thezmfilterdaemon loads these and does the actual operation. This option determines how often, in seconds, the filters are reloaded from the database to get the latest versions or new filters. If you don't change filters very often, this value can be set to a large value. As of1.34.0filters should be automatically reloaded when saving a filter, so this setting should have little effect. ๐ซFILTER_EXECUTE_INTERVALโ same filter situation as above (saved filters โ events matching criteria โ emailed, deleted, uploaded to a remote machine etc., andzmfilterdoes the actual operation). This option determines how often the filters are executed on the saved event in the database. Want a rapid response to new events? Make it smaller. But beware: that may increase the overall load on the system and affect performance of other elements. ๐ซถMAX_RESTART_DELAYโ thezmdc(zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.STATUS_UPDATE_INTERVALโ thezmstatsdaemon performs various db queries related to collecting system statistics that may take a long time in the background. This option decides how often this update is scheduled. ๐WATCH_CHECK_INTERVALโ thezmwatchdaemon checks the image capture performance of the capture daemons to make sure they haven't locked up (rarely a sync error may occur which blocks indefinitely). This option determines how often the daemons are checked. ๐WATCH_MAX_DELAYโ samezmwatchvibe: it checks the image capture performance of the capture daemons to make sure they haven't locked up (rarely a sync error may occur which blocks indefinitely). This option determines the maximum delay to allow since the last captured frame. The daemon will be restarted if it hasn't captured any images after this period โ though the actual restart may take slightly longer in conjunction with the check interval value above. โ ๏ธ Please note that some cameras can take up to30seconds to get a valid image, so this setting should be larger than that.RUN_AUDITโ thezmauditdaemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs, or if you're using 'fast deletes', it may be that database records are deleted but files remain. In this case, and similar,zmauditwill remove redundant information to synchronise the two data stores. This option controls whetherzmauditruns in the background and performs these checks and fixes continuously. It is recommended you keep this OFF in most systems and run it manually if needed after a system crash. ๐ฅAUDIT_CHECK_INTERVALโ again withzmaudit(database โ filesystem consistency checker; if an error occurs or you're using 'fast deletes', database records may be deleted while files remain, andzmauditremoves redundant information to synchronise the two data stores). The default check interval of900seconds (15minutes) is fine for most systems โ however, if you have a very large number of events, the process of scanning the database and filesystem may take a long time and impact performance. In that case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.AUDIT_MIN_AGEโ one morezmauditmoment: it checks that the saved information in the database and on the filesystem match and are consistent with each other. Event files or db records that are younger than this setting will not be deleted, and a warning will be given. ๐OPT_CONTROLโ ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. Wanna control your cameras via ZoneMinder? Select this option. Only have static cameras or use other control methods? Then leave this option off. ๐ฎOPT_TRIGGERSโ ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via thezmtrigger.plscript. This option indicates whether you want to use these external triggers. Most people will say no here.CHECK_FOR_UPDATESโ to save you checking manually for each new version, ZoneMinder can check with thezoneminder.comwebsite to determine the most recent release. These checks are infrequent โ about once per week โ and no personal or system information is transmitted other than your current version number. If you don't want these checks happening, or your ZoneMinder system has no internet access, you can switch these checks off with this configuration variable. ๐TELEMETRY_DATAโ enable collection of usage information of the local system and send it to the ZoneMinder development team. This data will be used to determine things like who and where our customers are, how big their systems are, the underlying hardware and operating system, etc. This is being done for the sole purpose of creating a better product for our target audience. This script is intended to be completely transparent to the end user, and can be disabled from the web console under Options. For more details on what information we collect, please refer to Zoneminder's privacy statement (available in the contextual help ofTELEMETRY_DATAon your installation). ๐ซถUPDATE_CHECK_PROXYโ if you use a proxy to access the internet, then ZoneMinder needs to know so it can accesszoneminder.comto check for updates. If you do use a proxy, enter the full proxy url here in the form ofhttp://<proxy host>:<proxy port>/. ๐ธSHM_KEYโ okay so ZoneMinder uses shared memory to make the modules chat with each other fast ๐จ, and to figure out which chunk of shared memory to grab, it uses shared memory keys. This option sets the base key, and every monitor gets its Id OR'ed with it to make the actual key that gets used. You will not normally need to change this value โ only if it clashes with another instance of ZoneMinder on the same machine. Heads up: only the first four hex digits are used, the lower four get masked out and ignored. ๐COOKIE_LIFETIMEโ this one decides how long a session stays valid for, counting from the last request. Keeping it short helps prevent session hijacking (protect the account bestie ๐ซถ). Keeping it long lets you stay logged in longer without refreshing the view. If you're not sure, they recommend you keep this to the default of3600. โจ
๐ Options - Config ๐
The config screen is where the admin gets to change a whole bunch of configuration parameters all about image capturing and storage. ๐ฆ
A partial screenshot is shown below: [image]
TIMESTAMP_ON_CAPTUREโ ZoneMinder can add a timestamp to images in two ways. The default method (when this option is set) is that each image gets timestamped immediately when captured, so the image sitting in memory is marked right away. The second method doesn't timestamp the images until they're either saved as part of an event or accessed over the web. Whichever method you use, the timestamp will contain the same time, because that time is preserved along with the image. The first method guarantees an image is timestamped no matter what else happens โ but the side effect is that all images get timestamped, even the ones that never get saved or viewed. ๐ญ The second method requires that saved images are copied before being saved, otherwise two timestamps โ maybe at different scales โ could get applied. But that comes with a (perhaps) desirable side effect: the timestamp is always applied at the same resolution, so an image that's had scaling applied still ends up with a legible, correctly scaled timestamp. ๐TIMESTAMP_CODE_CHARโ there are a few codes you can use to tell ZoneMinder to insert data into the timestamp of each image. Traditionally the percent (%) character has been used to identify these codes, since the current character codes don't conflict with thestrftimecodes, which can also be used in the timestamp. That works great for Linux, but not great for BSD operating systems. ๐ฉ Changing the default character to something else โ like an exclamation point (!) โ resolves the issue. Note this only affects the timestamp codes built into ZoneMinder. It has no effect on the family ofstrftimecodes you can use. โญCPU_EXTENSIONSโ when advanced processor extensions like SSE2 or SSSE3 are available, ZoneMinder can use them, which should boost performance and reduce system load. ๐ฅ Enabling this option on processors that don't support the advanced extensions ZoneMinder uses is harmless and will have no effect. So no stress. ๐FAST_IMAGE_BLENDSโ to detect alarms, ZoneMinder needs to blend the captured image with the stored reference image to update it for comparison with the next image. The reference blend percentage you specify for the monitor controls how much the new image affects the reference image. There are two methods available for this. If this option is set, a fast calculation is used that does no multiplication or division โ extremely fast, no cap โก โ but it limits the possible blend percentages to50%,25%,12.5%,6.25%,3.25%and1.5%. Any other blend percentage gets rounded to the nearest possible one. The alternative is to switch this option off and use standard blending instead, which is slower. ๐OPT_ADAPTIVE_SKIPโ in previous versions of ZoneMinder, the analysis daemon would try to keep up with the capture daemon by processing the last captured frame on each pass. That sometimes had the undesirable side-effect of missing a chunk of the initial activity that caused the alarm, because the pre-alarm frames all had to be written to disk and the database before the next frame could be processed โ leading to some delay between the first and second event frames. Setting this option enables a newer adaptive algorithm, where the analysis daemon tries to process as many captured frames as possible, only skipping frames when it's in danger of the capture daemon overwriting frames that haven't been processed yet. This skip is variable, depending on the size of the ring buffer and how much space is left in it. Enabling this option gives you much better coverage of the beginning of alarms, while biasing any skipped frames toward the middle or end of the event. ๐ But you should be aware โ this makes the analysis daemon run somewhat behind the capture daemon during events, and for particularly fast rates of capture it's possible for the adaptive algorithm to get overwhelmed and not have time to react to a rapid build-up of pending frames, and thus for a buffer overrun condition to occur. ๐MAX_SUSPEND_TIMEโ ZoneMinder lets monitors have motion detection suspended, like while you're panning a camera. Ordinarily this relies on the operator resuming motion detection afterwards, because failing to do so can leave a monitor in a permanently suspended state. ๐ฌ This setting lets you set a maximum time a camera may be suspended for, before it automatically resumes motion detection. That time can be extended by subsequent suspend indications after the first, so continuous camera movement will also occur while the monitor is suspended. ๐ฅSTRICT_VIDEO_CONFIGโ with some video devices, errors can be reported when setting the various video attributes, when in fact the operation was successful. Switching this option off will still allow these errors to be reported, but will not cause them to kill the video capture daemon. Note however that doing this causes all errors to be ignored โ including the genuine ones, which may cause video capture to not function correctly. Use this option with caution. โ ๏ธLD_PRELOADโ some older cameras require the use of thev4l1compat library. This setting lets you set the path to the library, so it can be loaded byzmdc.plbefore launchingzmc.V4L_MULTI_BUFFERโ performance when using Video 4 Linux devices is usually best when multiple buffers are used, allowing the next image to be captured while the previous one is being processed. But if you have multiple devices on a card sharing one input that requires switching, this approach can sometimes cause frames from one source to get mixed up with frames from another. ๐ตโ๐ซ Switching this option off prevents multi buffering, resulting in slower but more stable image capture. This option is ignored for non-local cameras, or if only one input is present on a capture chip. It addresses a similar problem to theZM_CAPTURES_PER_FRAMEoption, and you should normally change the value of only one of the options at a time. If you have different capture cards that need different values, you can ovveride them in each individual monitor on the source page.CAPTURES_PER_FRAMEโ if you're using cameras attached to a video capture card that forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed, resulting in poor image quality and a distinctive comb edge appearance. ๐ Increasing this setting lets you force additional image captures before one is selected as the captured frame. This lets the capture hardware "settle down" and produce better quality images, at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip. It addresses a similar problem to theZM_V4L_MULTI_BUFFERoption, and you should normally change the value of only one of the options at a time. If you have different capture cards that need different values, you can ovveride them in each individual monitor on the source page. ๐FORCED_ALARM_SCOREโ thezmuutility can be used to force an alarm on a monitor, rather than relying on the motion detection algorithms. This option determines what score to give these alarms, to distinguish them from regular ones. It must be255or less. ๐จBULK_FRAME_INTERVALโ traditionally ZoneMinder writes an entry into the Frames database table for each frame that's captured and saved. That works well in motion detection scenarios, but in a DVR situation (RecordorMocordmode) it results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. ๐ฉ Setting this to a non-zero value enables ZoneMinder to group these non-alarm frames into one "bulk" frame entry, which saves a lot of bandwidth and space. The only disadvantage is that timing information for individual frames is lost โ but in constant frame rate situations this is usually not significant. This setting is ignored inModectmode, and individual frames are still written if an alarm occurs inMocordmode also. ๐พEVENT_CLOSE_MODEโ when a monitor is running in a continuous recording mode (RecordorMocord), events are usually closed after a fixed period of time (the section length). However inMocordmode it's possible that motion detection may occur near the end of a section. This option controls what happens when an alarm occurs inMocordmode. Thetimesetting means the event will be closed at the end of the section, regardless of alarm activity. Theidlesetting means the event will be closed at the end of the section if there's no alarm activity happening at the time โ otherwise it gets closed once the alarm is over, meaning the event may end up being longer than the normal section length. Thealarmsetting means that if an alarm occurs during the event, the event will be closed once the alarm is over, regardless of when that occurs. This has the effect of limiting the number of alarms to one per event, and the events will be shorter than the section length if an alarm has occurred. โฑ๏ธWEIGHTED_ALARM_CENTRESโ ZoneMinder will always calculate the centre point of an alarm in a zone, to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature, or by your own custom extensions. ๐ In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method, it can instead be calculated using weighted pixel locations, to give more accurate positioning for irregularly shaped blobs. This method, while more precise, is also slower โ and so is turned off by default. ๐ฆEVENT_IMAGE_DIGITSโ okay so when event images get captured, they land on the filesystem with a numerical index, right? Default is three digits so it goes001,002, etc. ๐ For most scenarios this is literally fine because events with more than 999 frames are rarely captured. But if you've got extremely long events and you use external applications, you might wanna bump this up so the images sort correctly in listings and stuff. ๐๏ธ
โ ๏ธ WARNING bestie: raising this value on a live system may render existing events unviewable, because the event will have been saved with the previous scheme. ๐ Decreasing this value should have no ill effects though, so down is safe, up is spicy. ๐ถ๏ธ
DEFAULT_ASPECT_RATIOโ when you're specifying monitor dimensions you can click a checkbox to keep the width locked in the correct ratio to the height, or the other way round. This setting is where you tell it what that ratio should actually be. Format it like<width value>:<height value>โ the default of4:3will normally be acceptable, but11:9is another common setting. โจ And ngl, if the checkbox isn't clicked when you're specifying monitor dimensions, this setting has no effect. Zero. Nada. ๐ซถUSER_SELF_EDITโ ordinarily only users with system edit privilege can change user details. Flip this on and ordinary users get to change their own passwords and their language settings. Let them cook. ๐
โจ Options - API โจ
๐ Note: the ZoneMinder web interface does not use APIs, so the tokens we're yapping about here don't apply to the ZoneMinder UI at all. These only apply to apps that use the ZoneMinder API โ like zmNinja. ๐ฅ
The API option screen lets you enable/disable APIs on a per user basis. And bestie, it also lets you "revoke" tokens that were allotted to users. ๐
Starting ZoneMinder 1.34, the whole API ecosystem got overhauled and we now support JWT tokens with a concept of refresh tokens and access tokens. This allows for authentication without the need to send passwords with every single authentication request. Iconic, honestly. ๐
For a more detailed understanding of how this works, please refer to API <>. Over time, more control will be added to this screen. [image]
The "Revoke All Tokens" button can be used to globally invalidate access tokens for all users. If tokens are revoked, the user(s) will need to re-authenticate with login and password. As of today, refresh tokens last for 24 hours and access tokens for 1 hour. โฐ
๐ฅ๏ธ Options - Servers ๐ฅ๏ธ
Todo
- needs to be refreshed
[image]
Servers tab is used for setting up multiple ZoneMinder servers sharing the same database and using a shared file share for all event data. ๐ To add a new server, use the Add Server button. All that is required is a Name for the Server and a Hostname. That's it, that's the whole form. ๐ซถ
To delete a server, mark that server and click the Delete button. ๐๏ธ
๐ก Please note that all servers must have a functional web UI, because the live view must come from the monitor's host server. No skimping on the UI, babe.
On each server, you will have to edit /etc/zm/zm.conf and set either ZM_SERVER_NAME=
๐พ Options - Storage ๐พ
[image]
Storage tab is used to setup storage areas for recorded Events. To add a new area use the Add New Storage button. โจ
By default, storage on local drive is automatically set up on installation. When no area is specified, events will be stored to a default built-in location, which for example on Ubuntu is /var/cache/zoneminder/events. ๐
Name: Storage names โ can be anything. Literally anything, go feral. ๐
Path: String path to storage location, for example /media/Videos
Url: Used for S3 communication โ format:
s3fs://ACCESS_KEY_ID:SECRET_ACCESS_KEY@s3.ca-central-1.amazonaws.com/bucket-name/events
Supported storage types:
- Local โ Local/mounted or network storage in local network
- s3fs โ S3 mounted drive
Some users may require more advanced storage such as S3 provided by amazon or others. ๐ฉ๏ธ
๐ฉ๏ธ S3 storage setup ๐ฉ๏ธ
You must use s3fs to mount the S3 bucket in your fs tree. Telling ZoneMinder that the location is S3 will let it use more efficient code to send and delete the event data. ๐ฅ
The Do Deletes option tells ZoneMinder whether to actually perform delete operations when deleting events. S3fs systems often do deletes in a cron job or other background task, and doing the deletes can overload an S3 system. So like, be mindful. ๐
Refer to this guide for installation and configuration of s3fs โ <https://github.com/s3fs-fuse/s3fs-fuse>
Adding credentials to passwd_file
Create credentials file:
echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/passwd-s3fs
Set file permissions:
chmod 600 /etc/passwd-s3fs
S3 mounting with fstab
s3fs#bucket_name /media/S3 fuse
_netdev,allow_other,uid=33,url=https://s3.ca-central-1.amazonaws.com,passwd_file=/etc/passwd-s3fs,umask=022
0 0
Setting up storage.
- Click on Add new Storage
- Set path to
/media/S3 - Add Url
s3fs://username:password@s3.ca-central-1.amazonaws.com/bucket-name/events
- Set type to
s3fs - Save settings and monitor logs for errors ๐
๐ Options - Web ๐
This screen lets you customize several aspects of the web interface of ZoneMinder. A partial screenshot is shown below: [image]
WEB_TITLEโ the actual text that's shown on the login screen. It is possible that it also appears in other areas. ๐WEB_TITLE_PREFIXโ if you have more than one installation of ZoneMinder, it can be helpful to display different titles for each one. Changing this option lets you customise the window titles to include further information to aid identification. ๐HOME_URLโ the link to navigate to, when a user clicks on the top left title.HOME_CONTENTโ the actual text that's shown on the top left corner. You can choose to leave it empty and put in a logo in a custom CSS as well. ๐ผ๏ธWEB_CONSOLE_BANNERโ lets the administrator place an arbitrary text message near the top of the web console. This is useful for the developers to display a message which indicates the running instance of ZoneMinder is a development snapshot, but it can also be used for any other purpose as well. โจWEB_EVENT_DISK_SPACEโ adds another column to the listing of events showing the disk space used by the event. This will impart a small overhead as it will callduon the event directory. In practice this overhead is fairly small but may be noticeable on IO-constrained systems. ๐WEB_RESIZE_CONSOLEโ traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusive but may not be to everyone's tastes, especially if opened in a tab in browsers which support this kind of layout. Switch this option off to have the console window size left to the user's preference. ๐ฆWEB_ID_ON_CONSOLEโ some find it useful to have the monitor id always visible on the console. This option will add a column listing it. Note that if it is disabled, you can always hover over the monitor to see the id as well. ๐ซถWEB_POPUP_ON_ALARMโ when viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example, when they can pop up if someone comes to the doorway. ๐ชWEB_SOUND_ON_ALARMโ when viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs. ๐WEB_ALARM_SOUNDโ you can specify a sound file to play if an alarm occurs whilst you're watching a live monitor stream. So long as your browser understands the format it doesn't need to be any particular type. This file should be placed in the sounds directory defined earlier. ๐ตWEB_COMPACT_MONTAGEโ the montage view shows the output of all of your active monitors in one window. This includes a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images. ๐ผ๏ธWEB_EVENT_SORT_FIELDโ events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering. โณWEB_EVENT_SORT_ORDERโ events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering. ๐WEB_EVENTS_PER_PAGEโ in the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode. ๐WEB_LIST_THUMBSโ ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options. ๐ธWEB_LIST_THUMB_WIDTHโ this option controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option, but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored. ๐WEB_LIST_THUMB_HEIGHTโ this option controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option, but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored. โจ
WEB_USE_OBJECT_TAGS โ okay so bestie, there are literally two ways to shove media content into web pages ๐
. The super common way is the EMBED tag, which can kinda hint at what type of content it is. But plot twist: EMBED is not a standard part of HTML ๐. The official method is to use OBJECT tags, which can carry more info so the right media viewers etc. get loaded. BUT โ and this is the tea โ OBJECT tags are less widely supported and content might be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only, or whether (where appropriate) it's additionally wrapped in OBJECT tags. Right now OBJECT tags only get used in a limited number of circumstances, but they may become more widespread in the future. The suggestion is to just leave this option on unless you run into problems playing some content. Slay โจ
WEB_XFRAME_WARN โ so when you're making a Web Site monitor, if the target web site has X-Frame-Options set to sameorigin in the header, the site will not display in ZoneMinder ๐ญ. This is literally a design feature in most modern browsers, no cap. When this happens, ZoneMinder writes a warning to the log file. To get around it, you can install a browser plugin or extension to ignore X-Frame headers, and then the page will display properly. Once the plugin or extension has ben installed, the end user may choose to turn this warning off ๐ซถ
WEB_FILTER_SOURCE โ this option only affects monitors with a source type of Ffmpeg, Libvlc, or WebSite. This setting controls what info is displayed in the Source column on the console:
- Selecting
Nonewill not filter anything. The entire source string will be displayed, which may contain sensitive information ๐ - Selecting
NoCredentialswill strip out usernames and passwords from the string. If there are any port numbers in the string and they are common (80,554, etc.) then those will be removed as well. - Selecting
Hostnamewill filter out all information except for the hostname or ip address.
When in doubt, stay with the default Hostname. This feature uses the php function url_parts to identify the various pieces of the url. If the url in question is unusual or not standard in some way, then filtering may not produce the desired results ๐
โจ Options - Images โจ
This screen lets you control various image quality settings for live and recorded events. A partial screenshot is shown below: [image] ๐ธ
COLOUR_JPEG_FILES โ cameras that capture in greyscale can write their captured images to jpeg files with a corresponding greyscale colour space. This saves a small amount of disk space over colour ones. However, some tools such as ffmpeg either fail to work with this colour space or have to convert it beforehand ๐ฉ. Setting this option to yes uses up a little more space but makes creation of MPEG files much faster. Worth it fr fr.
ADD_JPEG_COMMENTS โ JPEG files may have a number of extra fields added to the file header. The comment field may have any kind of text added. This option allows you to have the same text that is used to annotate the image additionally included as a file header comment. If you archive event images to other locations, this may help you locate images for particular events or times if you use software that can read comment headers ๐
JPEG_FILE_QUALITY โ when ZoneMinder detects an event it will save the images associated with that event to files. These files are in the JPEG format and can be viewed or streamed later. This option specifies what image quality should be used to save these files. A higher number means better quality but less compression, so it will take up more disk space and take longer to view over a slow connection. By contrast, a low number means smaller, quicker-to-view files but at the price of lower quality images. This setting applies to all images written, except if the capture image has caused an alarm and the alarm file quality option is set at a higher value, in which case that is used instead ๐
JPEG_ALARM_FILE_QUALITY โ this value is equivalent to the regular jpeg file quality setting above, except that it only applies to images saved while in an alarm state, and then only if this value is set to a higher quality setting than the ordinary file setting. If set to a lower value then it is ignored. So leaving it at the default of 0 effectively means to use the regular file quality setting for all saved images. This is to prevent accidentally saving important images at a worse quality setting โ protective king behaviour ๐
JPEG_STREAM_QUALITY โ when viewing a 'live' stream for a monitor, ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression, so it will take longer to view over a slow connection. By contrast, a low number means quicker-to-view images but at the price of lower quality images. This option does not apply when viewing events or still images, as these are usually just read from disk and so will be encoded at the quality specified by the previous options ๐ธ
MPEG_TIMED_FRAMES โ when using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected, then the timestamp for each frame, taken from its capture time, is included in the stream. This means that where the frame rate varies โ for instance around an alarm โ the stream will still maintain its 'real' timing โฐ. If this option is not selected, then an approximate frame rate is calculated and that is used to schedule frames instead. This option should be selected unless you encounter problems with your preferred streaming method.
MPEG_LIVE_FORMAT โ when using MPEG mode, ZoneMinder can output live video. However, what formats are handled by the browser varies greatly between machines ๐. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player, but the author's currently not sure what, if anything, works on a Linux platform. If you find out please let them know! If this option is left blank then live streams will revert to being in motion jpeg format.
MPEG_REPLAY_FORMAT โ when using MPEG mode, ZoneMinder can replay events in encoded video format. However, what formats are handled by the browser varies greatly between machines ๐. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player, and 'mpg', or 'avi' etc. should work under Linux. If you know any more then please let them know! If this option is left blank then live streams will revert to being in motion jpeg format.
RAND_STREAM โ some browsers can cache the streams used by ZoneMinder. In order to prevent this, a harmless random string can be appended to the url to make each invocation of the stream appear unique ๐ฅ
OPT_CAMBOZOLA โ Cambozola is a handy low fat cheese flavoured Java applet ๐ง that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from this link <http://www.charliemouse.com/code/cambozola/> โ however, if it is not installed, still images at a lower refresh rate can still be viewed. Note that practically, if you are not using an old version of IE, you will likely not need this ๐
PATH_CAMBOZOLA โ leave this as 'cambozola.jar' if cambozola is installed in the same directory as the ZoneMinder web client files.
RELOAD_CAMBOZOLA โ Cambozola allows for the viewing of streaming MJPEG, however it caches the entire stream into cache space on the computer. Setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive ๐พ
OPT_FFMPEG โ ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option, as events can still be reviewed as video streams without it ๐ซถ
PATH_FFMPEG โ this path should point to where ffmpeg has been installed.
FFMPEG_INPUT_OPTIONS โ Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here โญ
FFMPEG_OUTPUT_OPTIONS โ Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder ๐
FFMPEG_FORMATS โ Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a '*' after a format indicates that this will be the default format used for web video, adding '**' defines the default format for phone video ๐ฑ
FFMPEG_OPEN_TIMEOUT โ when Ffmpeg is opening a stream, it can take a long time before failing; certain circumstances even seem to be able to lock indefinitely ๐ต. This option allows you to set a maximum time in seconds to pass before closing the stream and trying to reopen it again.
๐ Options - Logging ๐
ZoneMinder has a powerful logging system. Understanding how to configure logging will help you track issues better. The logging options are accessed via Options->Logging. Let's follow along with an example. But before that, here is a basic construct of how logging works:
- Every component of ZoneMinder can generate different types of logs. Typically,
ERRrefers to an error condition that you should look at (in some cases, they are transient during startup/shutdown in which case they are usually benign).INFlogs are informational,WARare warning logs that might have a potential to cause issues, whilstDBGare debug logs that are useful when you need to debug a problems - You also get to decide where all these logs actually get written, bestie. Normally ZoneMinder writes logs out to multiple sources:
- Syslog
- Database
- individual files belonging to each component inside the logging folder configured
Okay so picture this ๐ญ โ you're trying to figure out why your zmc 11 (that's Monitor 11, hey girl ๐) is just not working. Obviously you need to flip on debug logs, because the standard info logs are giving you nothing. But you would NOT want to write debug logs to the Database. And maybe you also don't want it polluting your syslog, and you only want those debug logs going to the debug file of that one component (/var/log/zm/zmc_m11.log for example). That right there is where customizing your logging comes in clutch. ๐
๐ธ Logging example ๐ธ
[image]
In the example above, I've configured my logging like this:
- I only want to log INFO level logs to Syslog
- I want DEBUG logs to only go to the component file
- When it comes to my WEBLOG (what I see in the ZM Log window) and Database log, I only want FATAL logs (you may want to set this to WAR or INF)
- I don't want to save FFMPEG logs (this was a new feature added). FFMPEG generates a log of logs on its own that you should only enable if you are trying to figure out video playback related issues
- I have enabled
LOG_DEBUG(unless you enable this, DEBUG logs won't be logged) - The
LOG_DEBUG_TARGETis useful if you don't want to enable DEBUG logs for every component. In this case, I'm only interested in debugging the ZM Event Server and Monitor 11. Nothing else will have debug logs enabled. - I prefer to keep the
LOG_DEBUG_FILEto empty. This creates nicely separate files in my log folder with component names
The other logging parameters are left to their defaults, like so:
[image]
๐ A more comprehensive explanation of the various log options ๐
LOG_LEVEL_SYSLOGโ ZoneMinder logging is now more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to the system log. ZoneMinder binaries have always logged to the system log but now scripts and web logging is also included. To preserve the previous behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can severely affect system performance. If you want debug you will also need to set a level and component belowLOG_LEVEL_FILEโ ZoneMinder logging is now more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that goes to individual log files written by specific components. This is how logging worked previously and although useful for tracking down issues in specific components it also resulted in many disparate log files. To preserve this behaviour you should ensure this value is set to Info or Warning. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can severely affect system performance though file output has less impact than the other options. If you want debug you will also need to set a level and component belowLOG_LEVEL_WEBLOGโ ZoneMinder logging is now more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output from the web interface that goes to the httpd error log. Note that only web logging from PHP and JavaScript files is included and so this option is really only useful for investigating specific issues with those components. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can severely affect system performance. If you want debug you will also need to set a level and component belowLOG_LEVEL_DATABASEโ ZoneMinder logging is now more integrated between components and allows you to specify the destination for logging output and the individual levels for each. This option lets you control the level of logging output that is written to the database. This is a new option which can make viewing logging output easier and more intuitive and also makes it easier to get an overall impression of how the system is performing. If you have a large or very busy system then it is possible that use of this option may slow your system down if the table becomes very large. Ensure you use theLOG_DATABASE_LIMIToption to keep the table to a manageable size. This option controls the maximum level of logging that will be written, so Info includes Warnings and Errors etc. To disable entirely, set this option to None. You should use caution when setting this option to Debug as it can severely affect system performance. If you want debug you will also need to set a level and component belowLOG_DATABASE_LIMITโ If you are using database logging then it is possible to quickly build up a large number of entries in the Logs table. This option allows you to specify how many of these entries are kept. If you set this option to a number greater than zero then that number is used to determine the maximum number of rows, less than or equal to zero indicates no limit and is not recommended. You can also set this value to time values such as '<n> day' which will limit the log entries to those newer than that time. You can specify 'hour', 'day', 'week', 'month' and 'year', note that the values should be singular (no 's' at the end). The Logs table is pruned periodically so it is possible for more than the expected number of rows to be present briefly in the meantime.LOG_DEBUGโ ZoneMinder components usually support debug logging available to help with diagnosing problems. Binary components have several levels of debug whereas more other components have only one. Normally this is disabled to minimise performance penalties and avoid filling logs too quickly. This option lets you switch on other options that allow you to configure additional debug information to be output. Components will pick up this instruction when they are restarted.LOG_DEBUG_TARGETโ There are three scopes of debug available. Leaving this option blank means that all components will use extra debug (not recommended). Setting this option to '_<component>', e.g._zmc, will limit extra debug to that component only. Setting this option to '_<component>_<identity>', e.g. '_zmc_m1' will limit extra debug to that instance of the component only. This is ordinarily what you probably want to do. To debug scripts use their names without the.plextension, e.g. '_zmvideo' and to debug issues with the web interface use '_web'. You can specify multiple targets by separating them with '|' characters.LOG_DEBUG_LEVELโ There are 9 levels of debug available, with higher numbers being more debug and level 0 being no debug. However not all levels are used by all components. Also if there is debug at a high level it is usually likely to be output at such a volume that it may obstruct normal operation. For this reason you should set the level carefully and cautiously until the degree of debug you wish to see is present. Scripts and the web interface only have one level so this is an on/off type option for them.LOG_DEBUG_FILEโ This option allows you to specify a different target for debug output. All components have a default log file which will normally be in/tmpor/var/logand this is where debug will be written to if this value is empty. Adding a path here will temporarily redirect debug, and other logging output, to this file. This option is a simple filename and you are debugging several components then they will all try and write to the same file with undesirable consequences. Appending a '+' to the filename will cause the file to be created with a '.<pid>' suffix containing your process id. In this way debug from each run of a component is kept separate. This is the recommended setting as it will also prevent subsequent runs from overwriting the same log. You should ensure that permissions are set up to allow writing to the file and directory specified here.LOG_CHECK_PERIODโ When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to indicate what period of historical events are used in this calculation. This value is expressed in seconds and is ignored ifLOG_LEVEL_DATABASEis set to None.LOG_ALERT_WAR_COUNTโ When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alert state. A value of zero means warnings are not considered. This value is ignored ifLOG_LEVEL_DATABASEis set to None.LOG_ALERT_ERR_COUNTโ When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alert state. A value of zero means errors are not considered. This value is ignored ifLOG_LEVEL_DATABASEis set to None.LOG_ALERT_FAT_COUNTโ When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alert state. A value of zero means fatal errors are not considered. This value is ignored ifLOG_LEVEL_DATABASEis set to None.LOG_ALARM_WAR_COUNTโ okay so when ZoneMinder is logging events to the database, it can look back over everything and count up how many warnings and errors have happened, and from that work out an overall state of system health. This option is where you say how many warnings have to have happened inside the defined time period before the whole system gets flagged as being in an alarm state. Set it to zero and warnings justโฆ don't count. And heads up: this value gets straight-up ignored ifLOG_LEVEL_DATABASEis set toNone. ๐LOG_ALARM_ERR_COUNTโ same whole vibe as above: ZoneMinder logs events to the database and can retrospectively examine how many warnings and errors occurred to calculate an overall state of system health. This one is how many errors must have occurred within the defined time period to generate an overall system alarm state. Zero means errors aren't considered. Ignored ifLOG_LEVEL_DATABASEis set toNone. ๐ซถLOG_ALARM_FAT_COUNTโ bestie, third verse, same as the first: when ZoneMinder logs events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option sets how many fatal errors (panics included, yes) must have occurred within the defined time period to generate an overall system alarm state. Zero means fatal errors aren't considered. And yep, ignored ifLOG_LEVEL_DATABASEis set toNone. ๐ญRECORD_EVENT_STATSโ this version of ZoneMinder records detailed info about events in the Stats table. It can help with profiling what the optimum settings are for Zones, though ngl that's kinda tricky at the moment. But in future releases it'll be done way more easily and intuitively, especially once there's a large sample of events. The default option of'yes'means this info is collected now, in readiness for that. If you're worried about performance though, you can switch it off, and in that case no Stats information will be saved at all. โจRECORD_DIAG_IMAGESโ not just event statistics, you can also record the intermediate diagnostic images that show the results of all the various checks and processing that happen when it's trying to work out if an alarm event took place. There are several of these images generated for each frame and each zone for every alarm or alert frame, so this can have a massive impact on performance. Only turn this on for debug or analysis purposes, and remember to switch it back off again once you don't need it anymore. ๐ฅRECORD_DIAG_IMAGES_FIFOโ adds fifo options for diagnostic images, giving you a much lower impact diagnostics mode. Diagnostic images only get written when there's actually a client (like a web browser) listening for them. No active client connected? FIFO images are skipped, periodt. Note that this feature also needsRECORD_DIAG_IMAGESto be on. Note: your monitor needs to be in some recording mode (modect/mocord/etc.).
On top of creating diagnostic images, this feature also adds a json stream for the detection data so you can watch, in real time, the pixels or blobs detected for the motion. That means an easy real time stream of both delta and reference images (as video streams) along with the detection numbers. ๐ฆ
Once you turn on RECORD_DIAG_IMAGES and the new RECORD_DIAG_IMAGES_FIFO in the logging options, you can use 3 new remote stream urls:
- The delta images as an MJPEG stream (great to see where it is seeing the motion!):
https://portal/zm/cgi-bin/nph-zms?mode=jpeg&bitrate=2&buffer=0&source=fifo&format=delta&monitor=1&maxfps=5&<auth>
(change monitor, portal to your values. <auth> could be &user=user&pass=pass or &auth=authval or &token=access_token)
- The reference images as an MJPEG stream:
https://portal/zm/cgi-bin/nph-zms?mode=jpeg&bitrate=2&buffer=0&source=fifo&format=reference&monitor=1&maxfps=5&<auth>
(change monitor, portal to your values. <auth> could be &user=user&pass=pass or &auth=authval or &token=access_token)
- text json raw stream:
https://portal/zm/cgi-bin/nph-zms?&buffer=0&source=fifo&format=raw&monitor=1&<auth>
(change monitor, portal to your values, <auth> could be &user=user&pass=pass or &auth=authval or &token=access_token)
This will output a text stream on the browser like:
{"zone":5,"type":"ALRM","pixels":778661,"avg_diff":50}
{"zone":5,"type":"FILT","pixels":762704}
{"zone":5,"type":"RBLB","pixels":728102,"blobs":5}
{"zone":5,"type":"FBLB","pixels":728021,"blobs":2}
{"zone":6,"type":"ALRM","pixels":130844,"avg_diff":44}
{"zone":6,"type":"FILT","pixels":128608}
There are four types of events right now: Alarm (ALRM), Filter (FILT), Raw Blob (RBLB) and Filtered Blobs (FBLB), and they correspond to those stages of analysis. It shows the number of pixels detected (along with the average pixel difference against the threshold) and the number of blobs at each stage. ๐
For example, here's a delta image stream from one of my monitors showing in live mode:
https://myserver/cgi-bin/nph-zms?mode=jpeg&bitrate=2&buffer=0&source=fifo&format=delta&monitor=8&maxfps=5&user=admin&pass=mypass
[image]
DUMP_CORESโ when an unrecoverable error happens in a ZoneMinder binary process, traditionally it's been trapped and the details written to the logs to help with remote analysis. But in some cases it's way easier to diagnose the error if a core file is created โ that's a memory dump of the process at the time of the error. You can analyse it interactively in the debugger and it might reveal more, or better, info than what the logs give you. This option is recommended for advanced users only, otherwise leave it at the default. Note that using this option to trigger core files means there will be no indication in the binary logs that a process has died โ they'll just stop โ however thezmdclog will still contain an entry. Also note that you may have to explicitly enable core file creation on your system via theulimit -ccommand or other means, otherwise no file will be created regardless of what this option is set to. ๐
๐ Options - Network ๐
[image]
HTTP_VERSIONโ ZoneMinder can talk to network cameras using either theHTTP/1.1orHTTP/1.0standard. A server will normally fall back to the version it supports with no problem, so usually this should just be left at the default. But it can be changed toHTTP/1.0if that's necessary to resolve particular issues. โจHTTP_UAโ when ZoneMinder communicates with remote cameras, this is the string it identifies itself with, along with its version number. That's normally enough, but if a particular camera expects to only ever talk to certain browsers, you can change this to a different string that identifies ZoneMinder as Internet Explorer or Netscape etc. ๐HTTP_TIMEOUTโ when retrieving remote images, ZoneMinder will wait this length of time before deciding an image isn't going to arrive and taking steps to retry. This timeout is in milliseconds (1000 per second), and it applies to each part of an image if it isn't sent in one whole chunk. โณMIN_STREAMING_PORTโ ZoneMinder supports a concept called multi-port streaming. The core idea: modern browsers like Chrome limit the number of simultaneous connections allowed from a specific domain (host name + port). For Chrome that value is6, which means you can't see more than 6 simultaneous streams from your server at one time. But if the streams originated from different ports (or sub domains), that limitation wouldn't apply. When you enable this option with a value (in this case,30000), the streams from the monitors will originate from30000plus the monitor ID, effectively overcoming that limitation. Note that this also needs additional setup in your webserver configuration before it'll start to work. Please refer to this article <https://medium.com/zmninja/multi-port-storage-areas-and-more-d5836a336c93> on how to setup multi port streaming on Apache. ๐MIN_RTP_PORTโ when ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method, it has to open ports for the camera to connect back to, for control and streaming purposes. This setting specifies the minimum port number that ZoneMinder will use. Ordinarily two adjacent ports are used for each camera โ one for control packets and one for data packets. This port should be set to an even number, and you may also need to open up a hole in your firewall to allow cameras to connect back if you want to use unicasting. ๐ฅMAX_RTP_PORTโ same deal, other end: when ZoneMinder communicates with MPEG4 capable cameras using RTP with the unicast method, it must open ports for the camera to connect back to for control and streaming purposes. This setting specifies the maximum port number ZoneMinder will use. Ordinarily two adjacent ports are used per camera โ one for control packets, one for data packets. This should be an even number too, and you may need to open a hole in your firewall so cameras can connect back for unicasting. You should also make sure you've opened up at least two ports for each monitor that will be connecting to unicasting network cameras. ๐ซถ
๐ Options - Email ๐
[image]
OPT_EMAILโ in ZoneMinder you can create event filters that specify whether events matching certain criteria should have their details emailed to you at a designated email address. That way you get notified about events the moment they happen, and you can jump straight to viewing them. This option says whether that functionality should be available at all. The email created with this option can be any size, and it's intended to be sent to a regular email reader rather than a mobile device. ๐EMAIL_ADDRESSโ this option defines the email address that any events matching the appropriate filters get sent to. ๐EMAIL_SUBJECTโ this option defines the subject of the email sent for any events matching the appropriate filters. โจEMAIL_BODYโ this option defines the content of the email sent for any events matching the appropriate filters. ๐ง
๐ Todo
check if any other tags have been added ๐
ok so here's the full roster of tokens, bestie โ these are the little placeholders you can drop into stuff. ๐
%EI%โ Id of the event%EN%โ Name of the event%EC%โ Cause of the event%ED%โ Event description%ET%โ Time of the event%EL%โ Length of the event%EF%โ Number of frames in the event%EFA%โ Number of alarm frames in the event%EST%โ Total score of the event%ESA%โ Average score of the event%ESM%โ Maximum score of the event%EP%โ Path to the event%EPS%โ Path to the event stream%EPI%โ Path to the event images%EPI1%โ Path to the first alarmed event image%EPIM%โ Path to the (first) event image with the highest score%EI1%โ Attach first alarmed event image%EIM%โ Attach (first) event image with the highest score%EIMOD%โ Attach image of object detected. Requires eventnotfn.server setup and machine learning hooks%EV%โ Attach event mpeg video%MN%โ Name of the monitor%MET%โ Total number of events for the monitor%MEH%โ Number of events for the monitor in the last hour%MED%โ Number of events for the monitor in the last day%MEW%โ Number of events for the monitor in the last week%MEM%โ Number of events for the monitor in the last month%MEA%โ Number of archived events for the monitor%MP%โ Path to the monitor window%MPS%โ Path to the monitor stream%MPI%โ Path to the monitor recent image%FN%โ Name of the current filter that matched%FP%โ Path to the current filter that matched%ZP%โ Path to your ZoneMinder console
OPT_MESSAGE โ so ZoneMinder lets you build event filters, right? And those filters can say "hey, if an event matches these criteria, yeet the details to this one short-message email address" โ that way you get pinged like, the instant something happens. ๐ธ This option right here is the on/off switch for that whole feature. Heads up tho: the email it makes is brief โ like, deliberately tiny. It's meant to land on an SMS gateway or a minimal mail reader (think mobile device, think phone ๐ฑ), not a full regular email client.
MESSAGE_ADDRESS โ this is where you put the short message email address that everything matching the right filters gets sent to. ๐
MESSAGE_SUBJECT โ this one sets the subject line of the message that goes out for any event matching the appropriate filters. โจ
MESSAGE_BODY โ and this one sets the actual content of that message. ๐
NEW_MAIL_MODULES โ okay so, history lesson: ZoneMinder has traditionally used the MIME::Entity perl module to build and send its notification emails and messages. But some people have reported problems โ either the module just isn't there at all, or it's not flexible enough for what they need. If you're one of those people, this option is your moment ๐
: it lets you pick a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone, but ngl it hasn't been extensively tested, so currently it is not selected by default.
EMAIL_HOST โ if you picked SMTP as your method for sending notification emails or messages, this option lets you choose which SMTP server to send them through. The default of localhost may work if you've got sendmail, exim or a similar daemon running โ but you may wanna put your ISP's SMTP mail server here instead. ๐ฆ
FROM_EMAIL โ the emails or messages that tell you about events can appear to come from a designated email address, which is a huge slay for mail filtering and all that. An address like ZoneMinder@your.domain is recommended. ๐
URL โ the emails or messages informing you about events can include a link to the events themselves, for easy viewing. If you wanna use that feature, set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm/index.php. ๐
SSMTP_MAIL โ SSMTP is a lightweight and efficient way to send email. Lowkey important: the SSMTP application is not installed by default, and NEW_MAIL_MODULES must also be enabled. Please visit the ZoneMinder SSMTP Wiki page https://wiki.zoneminder.com/How_to_get_ssmtp_working_with_Zoneminder for setup and configuration help. ๐ซถ
SSMTP_PATH โ the path to the SSMTP application. If path is not defined. Zoneminder will try to determine the path via shell command. Example path: /usr/sbin/ssmtp. ๐
๐ Options - Upload ๐
Okay so this whole section is about shipping your events off to another server for safekeeping, and there's a partial screenshot of the upload options right here: [image]
OPT_UPLOADโ bestie, ZoneMinder lets you build event filters that say "hey, if an event matches these criteria, upload it to a remote server for archiving." This option is the master switch for whether that whole functionality is even available. โจUPLOAD_ARCH_FORMATโ uploaded events get stored as either.taror.zip, and this is where you pick which one. Heads up though: to actually use this you need theArchive::Tarand/orArchive::Zipperl modules installed. No modules, no archive, iykyk.UPLOAD_ARCH_COMPRESSโ when the archive files get created, you can compress them. But lowkey, since the images are already compressed, you save only a minimal amount of space while burning extra CPU to make them. So only turn this on if you genuinely have CPU to waste and you're limited on disk space on your remote server, or on bandwidth. Otherwise, leave it, fr.UPLOAD_ARCH_ANALYSEโ archives can contain either just the captured frames, or both the captured frames and โ for the frames that caused an alarm โ the analysed image with the changed area highlighted. This option controls which of those files get included. Only include the analysed frames if you've got a high bandwidth connection to the remote server, or if you need help figuring out what caused an alarm in the first place, because archives with these files in them can be considerably larger. ๐UPLOAD_PROTOCOLโ ZoneMinder can upload events using either FTP or SFTP. Regular FTP is widely supported but not necessarily very secure, whereas SFTP (Secure FTP) runs over an ssh connection, so it's encrypted and uses regular ssh ports. Note that to use this you'll need the appropriate perl module installed depending on your choice: eitherNet::FTPorNet::SFTP. ๐ฆUPLOAD_HOSTโ you can use filters to instruct ZoneMinder to upload events to a remote server, and this option is the name, or ip address, of the server to use.UPLOAD_PORTโ again, filters โ remote server uploads. If you're using the SFTP protocol, this option lets you specify a particular port to connect on. Leave it blank and the default kicks in, port 22. And FYI, this option is ignored for FTP uploads. ๐UPLOAD_USERโ you guessed it, remote server uploads via filters. This one is the username ZoneMinder should log in with for the transfer.UPLOAD_PASSโ same vibe: the password ZoneMinder should use to log in for transfer. And if you're using certificate based logins for SFTP servers, you can just leave this option blank. ๐ซถUPLOAD_LOC_DIRโ this one is the local directory ZoneMinder should use for temporary upload files. These are files created from events, uploaded, and then deleted. Very much a "here for a good time not a long time" situation. ๐UPLOAD_REM_DIRโ and this is the remote directory that ZoneMinder should upload event files to.UPLOAD_TIMEOUTโ the maximum inactivity timeout (in seconds) that should be tolerated before ZoneMinder decides the transfer has failed and closes down the connection. Rip to slow connections. ๐ญUPLOAD_STRICTโ this lets you require SFTP uploads to verify the host key of the remote server, for protection against man-in-the-middle attacks. To make that work you'll need to add the server's key to theknown_hostsfile. On most systems, this will be~/.ssh/known_hosts, where~is the home directory of the web server running ZoneMinder. Safety first, bestie. ๐UPLOAD_FTP_PASSIVEโ filters, remote ftp server, you know the drill. This option says ftp transfers should be done in passive mode. That uses a single connection for all ftp activity, and whilst it's slower than active transfers, it's more robust and likely to work from behind firewalls. Also, this option is ignored for SFTP transfers.UPLOAD_DEBUGโ if you're having (or expecting) troubles with uploading events, setting this to 'yes' permits additional information to be generated by the underlying transfer modules and included in the logs. Detective mode: activated. ๐ฅ
โก Options - X10 โก
[image]
OPT_X10โ if you have an X10 Home Automation setup in your home, you can use ZoneMinder to initiate or react to X10 signals, assuming your computer has the appropriate interface controller. This option says whether X10 options will even show up in the browser client.X10_DEVICEโ if you have an X10 controller device (e.g.XM10U) connected to your computer, this option details which port it's connected on. The default of/dev/ttyS0maps to serial or com port 1.X10_HOUSE_CODEโ X10 devices get grouped together by identifying them all as belonging to one House Code, and this option details what that is. It should be a single letter between A and P. ๐คX10_DB_RELOAD_INTERVALโ thezmx10daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently that check occurs. Unless you change this area frequently, it can be a fairly large value. No need to be extra about it. โจ
๐ Options - High, Medium and Low B/W ๐
So there's a whole cluster of options grouped into bandwidth categories, which lets you configure the ZoneMinder client to work optimally over the various access methods you might use to reach it. Depending on your network, you may want different modes to preserve bandwidth. ๐ธ
A partial screenshot is shown below: [image]
The following options are available in H, M and L options. These 3 groups control what happens when the client is running in 'high', 'medium' and 'low' bandwidth mode respectively. In most cases the default values will be a totally fine starting point.
- High โ set these options for when you're accessing the ZoneMinder client over a local network or high speed link. ๐
- Medium โ set these for when you're accessing the ZoneMinder client over a slower cable or DSL link.
- Slow โ set these for when you're accessing the Zoneminder client over a slow network link. ๐
And now the actual options, each one coming in an H, M and L flavour:
WEB_H_REFRESH_MAIN,WEB_M_REFRESH_MAIN,WEB_L_REFRESH_MAINโ how often (in seconds) the main console window should refresh itself. The main console window lists a general status and the event totals for all monitors. Not me telling you this is not a trivial task โ don't repeat it too frequently or it may affect the performance of the rest of the system. ๐WEB_H_REFRESH_CYCLE,WEB_M_REFRESH_CYCLE,WEB_L_REFRESH_CYCLEโ how often (in seconds) the cycle watch window swaps to the next monitor. The cycle watch window is a method of continuously cycling between images from all of your monitors, and this option determines how often it refreshes with a new image.WEB_H_REFRESH_IMAGE,WEB_M_REFRESH_IMAGE,WEB_L_REFRESH_IMAGEโ how often (in seconds) the watched image is refreshed (if not streaming). Live images from a monitor can be viewed in either streamed or stills mode, and this option determines how often a stills image is refreshed. It has no effect if streaming is selected. ๐ธWEB_H_REFRESH_STATUS,WEB_M_REFRESH_STATUS,WEB_L_REFRESH_STATUSโ how often (in seconds) the status refreshes itself in the watch window. Plot twist: the monitor window is actually made from several frames, and the one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.WEB_H_REFRESH_EVENTS,WEB_M_REFRESH_EVENTS,WEB_L_REFRESH_EVENTSโ how often (in seconds) the event listing is refreshed in the watch window. Again, several frames: the lower frame contains a listing of the last few events for easy access, and this option determines how often that gets refreshed.WEB_H_CAN_STREAM,WEB_M_CAN_STREAM,WEB_L_CAN_STREAMโ if you know your browser can handle image streams of the type 'multipart/x-mixed-replace' but ZoneMinder doesn't detect that correctly, you can set this option to make sure the stream is delivered with or without the use of the Cambozola plugin. Selecting 'yes' will tell ZoneMinder that your browser can handle the streams natively. ๐WEB_H_STREAM_METHOD,WEB_M_STREAM_METHOD,WEB_H_STREAM_METHODโ ZoneMinder can be configured to use either mpeg encoded video or a series or still jpeg images when sending video streams, and this option defines which is used. If you choose mpeg you should make sure you have the appropriate plugins available on your browser, whereas choosing jpeg will work natively on Mozilla and related browsers, and with a Java applet on Internet Explorer.WEB_H_DEFAULT_SCALE,WEB_M_DEFAULT_SCALE,WEB_L_DEFAULT_SCALEโ normally ZoneMinder displays 'live' or 'event' streams in their native size. But if you have monitors with large dimensions, or a slow link, you may prefer to reduce that size โ or alternatively, for small monitors, you can enlarge it. This option lets you specify the default scaling factor, expressed as a percentage, so 100 is normal size, 200 is double size, etc. ๐WEB_H_DEFAULT_RATE,WEB_M_DEFAULT_RATE,WEB_L_DEFAULT_RATEโ normally ZoneMinder displays 'event' streams at their native rate, i.e. as close to real-time as possible. But if you have long events, it's often convenient to replay them at a faster rate for review. This option lets you specify the default replay rate, expressed as a percentage, so 100 is normal rate, 200 is double speed, etc. โฉWEB_H_VIDEO_BITRATE,WEB_M_VIDEO_BITRATE,WEB_L_VIDEO_BITRATEโ when encoding real video via the ffmpeg library, a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a 'quality' setting for the video: a low value will result in a blocky image, whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video โ however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate results in individual frames being at a lower quality. ๐ฅWEB_H_VIDEO_MAXFPS,WEB_M_VIDEO_MAXFPS,WEB_L_VIDEO_MAXFPSโ okay so when you're doing streamed video, the main character is the bitrate, because that's what decides how much data can actually travel. But here's the tea ๐ต: a lower bitrate at high frame rates = a lower quality image. So this option lets you cap the max frame rate so your video quality stays cute. Bonus perk โจ: encoding video at high frame rates is a processor-intensive task, and honestly a super high frame rate gives you barely any perceptible improvement over one that's way easier on resources. Heads up though, bestie โ this is implemented as a cap, and past that cap a binary reduction happens. So if your device captures at15fpsand you set this to10fps, you do NOT get10fps. You get7.5fps(15divided by2), because the final frame rate has to be the original divided by a power of2. Math is math, periodt ๐WEB_H_SCALE_THUMBS,WEB_M_SCALE_THUMBS,WEB_L_SCALE_THUMBSโ if this is unset, the whole entire image gets yeeted to the browser and the browser resizes it in the window. If it IS set, the image gets scaled down on the server before a reduced-size image goes to the browser โ that conserves bandwidth, at the cost of cpu on the server. Note that ZM can only do the resizing if the appropriate PHP graphics functionality</> is installed. That's usually chillin' in thephp-gdpackage ๐ซถWEB_H_EVENTS_VIEW,WEB_M_EVENTS_VIEW,WEB_L_EVENTS_VIEWโ stored events can be viewed either as an events list or as a timeline. This option sets the default view. Picking one here does NOT lock you out of the other, bestie โ it's always selectable from whichever view you're currently in. You always have options ๐WEB_H_SHOW_PROGRESS,WEB_M_SHOW_PROGRESS,WEB_L_SHOW_PROGRESSโ when you're viewing events, there's an event navigation panel and a progress bar below the event itself. It lets you jump to specific points in the event, and it can also dynamically update to show the current progress of the event replay itself. That progress is calculated from the actual event duration and is not directly linked to the replay, so on limited bandwidth connections it may be out of step with the replay ๐ This option lets you turn OFF the progress display while still keeping the navigation part โ useful when bandwidth stops it from functioning effectively.WEB_H_AJAX_TIMEOUT,WEB_M_AJAX_TIMEOUT,WEB_L_AJAX_TIMEOUTโ the newer versions of the live feed and event views use Ajax to request info from the server and populate the views dynamically. This option lets you specify a timeout if you need one, after which requests get abandoned. A timeout may be necessary if requests would otherwise hang, like on a slow connection โ because that tends to consume a LOT of browser memory and make the interface unresponsive ๐ญ Ordinarily no requests should ever timeout, so set this to a value greater than your slowest expected response. The value is in milliseconds, and if you set it to zero then no timeout will be used at all.
๐ธ Options - Users ๐ธ
[image]
In this section you'll see a list of all the current users defined on the system. You can also add or delete users right from here. Recommended: do NOT delete the admin user unless you've already created another fully privileged user to take over the exact same role. Bestie, don't orphan your own system ๐ญ
Every user is defined with a name and a password (which is hidden, obvs) plus an enabled setting you can use to temporarily enable or disable users โ like a guest user for limited-time access. And there's also a language</> setting for user-specific languages. If you set a language here that's different from the system language, then when that user logs in they get the web interface in their own language instead of the system default โ if it's available, that is ๐
This screen lets you configure permissions on a per-user basis. As of today, the permissions are:
- Streams โ None: the user has no access to view live streams from the defined monitors. View: the user can only view live streams from the defined monitors. Edit: the user can edit live streams from the defined monitors.
- Events โ these permissions are about viewing events from the defined monitors. Same permission levels as Streams, except they apply to recorded events.
- Control โ these permissions are about controlling Pan/Tilt/Zoom (PTZ) of the defined monitors. Same permission levels as Streams, except they apply to PTZ.
- Monitors โ specifies whether a user can see the current monitor settings and change them. Same permission levels as Streams, except they apply to monitor settings.
- Groups โ specifies whether a user can see monitor groups and change them. Same permission levels as Streams, except they apply to groups.
- System โ determines whether a user can view or modify the system settings as a whole, like options and users, or controlling the running of the system as a whole. The permission levels are the same as the Streams permissions, except that they apply to groups.
Note: if you're using zmNinja, users are required to have 'View' access to system, because multi-server information is only available as part of this permission ๐
- Bandwidth โ specifies the maximum bandwidth this user can configure (
Low,MediumorHigh). - API enabled โ specifies if the ZoneMinder API is enabled for this user (this needs to be on if you're using a mobile app like
zmNinja).
Finally, you can specify a list of monitors this user is allowed to access using the 'Restriced Monitors' list. (Yes, that's how it's spelled, we're keeping it ๐
) You can select multiple monitors by shift+click (or command+click) on multiple monitors. If a user with 'Monitors' edit privileges is limited to specific monitors here, they will NOT be able to add or delete monitors โ they can only change the details of the ones they have access to. And if a user has 'System' privileges, then the 'Monitors Ids' setting is ignored and has no effect. Nada. Zero. Zilch ๐
Here's an example of a restricted user: [image]
This user home is enabled, can view live streams and events, but ONLY from DoorBell and DeckCamera. This user also cannot control PTZ. Very demure, very mindful ๐
๐ฅ Camera Control ๐ฅ
ZoneMinder gives you the facility to control cameras from the web interface, and to some extent automatically. Pan/Tilt/Zoom (PTZ) cameras have a wide range of capabilities and use a huge number of different protocols, which makes any kind of generic control solution potentially very difficult. To get around this, ZoneMinder uses two key approaches:
โจ Definition of Capabilities โจ
For every camera model you use, an entry in the camera capabilities table must be created. These entries say what functions the camera supports, and they make sure the interface only presents the capabilities the camera actually has. There are a very large number of capabilities that may be supported, and it is very important that the entries in this table reflect the actual abilities of the camera. A small number of example capabilities are included in ZoneMinder โ use them 'as is' or modify them, your call ๐ฆ
โจ Control Scripts โจ
ZoneMinder itself doesn't generally provide the ability to send commands to cameras or receive responses. What it does is mediate motion requests from the web interface into a standard set of commands, which then get passed to a script defined in the control capability. Example scripts are provided in ZoneMinder that support a number of serial or network protocols, but ngl, it's likely that for many cameras you'll have to create new scripts. Model them on the example ones โ or, if control commands already exist from other applications, the script can just act as a 'glue' layer between ZoneMinder and those commands ๐ซถ
It should be emphasised that the control and capability elements of ZoneMinder are not intended to support every camera out of the box. Some degree of development is likely to be required for many cameras. That's just the vibe, iykyk ๐
๐น๏ธ Controlling Monitors ๐น๏ธ
If you've defined your system as having controllable monitors, and you're looking at a monitor that's configured for control, then clicking the 'Control' link along the top of the window will change the short event listing area into a control area. The capabilities you defined earlier decide exactly what shows up in this window. Generally you'll get a Pan/Tilt control area plus one or more subsidiary areas like zoom or focus control off to the side. If you have preset support, those show up near the bottom of the window. The normal way to control the monitor is clicking the appropriate graphics, which send a command via the control script to the camera itself. Sometimes there's a noticeable delay before the camera responds โ be patient, bestie, it's on its way ๐ข
Usually the control arrows are sensitive to where you click on them. If your camera allows different speeds for panning or zooming etc, then clicking near the point of the arrow gives you the faster speed, while clicking near the base of the arrow is slower. If you've defined continuous motion, you can stop ongoing activities by clicking the area between the arrows โ that'll be a graphic for pan/tilt controls, or a word for zoom and focus controls etc. Stop button but make it aesthetic โ
Certain control capabilities, like mapped motion</>, allow direct control by clicking on the image itself โ when used in browsers that support streamed images directly. Used this way, you just click the area of the image that interests you and the camera centres on that spot ๐ฏ You can also use direct image control for relative motion, where the area of the image you click defines the direction, and the distance away from the centre of the image determines the speed. Since it's not always very easy to estimate direction near the centre of the image, the active area doesn't start until a short distance away from the centre โ which leaves a 'dead' zone in the middle of the image. Main character energy only at the edges ๐
๐ Control Flow ๐
Having a basic understanding of how camera control works in ZoneMinder will go a long way in debugging issues in the future. Important to note: many of the 'camera control' scripts are user contributed, and it's entirely possible they break in a future version upgrade ๐ญ No cap.
- ZoneMinder relies on โcontrol protocolsโ for specific camera models, bestie. These โcontrolโ protocols are literally nothing but perl packages chilling in
/usr/share/perl5/ZoneMinder/Control/(on Ubuntu distributions) that get invoked by ZoneMinder when you invoke a PTZ operation ๐ - When you associate a โprotocolโ for PTZ with a camera, you are effectively letting ZoneMinder know where to locate the perl file that will eventually control the camera movement ๐
- Letโs take an example, okay? Say youโre configuring a Foscam 9831W camera and youโve associated the โ9831wโ protocol to that camera. This basically means when you move the camera via ZoneMinder, it will pass on the movements to
FI9831w.pmin/usr/share/perl5/ZoneMinder/Control/โจ - ZoneMinder also maintains protocol configuration parameters in a table called
Controlsin the DB. This table is used to store parameters like whether the camera supports continuous move, zoom, etc. ๐ - The
Controlstable is used by ZoneMinder to build its PTZ web interface. For example, anFI9831Wcamera does not support Zoom โ so when you open the PTZ interface of ZoneMinder via the Web Console and navigate to theFI9831Wcamera, the Zoom option will not be shown. It knows not to show this because the Control table entry forFI9831Wspecifies it does not support Zoom. Note that you edit these parameters viaSource->Control->Control Type->Editin the web console ๐ฆ - If you ever look at any of the control protocol files, you will notice it has functions like
moveRelUpormoveConLeftetc. โ these are the functions that eventually get invoked to move the camera around, and it is expected that contributors who implement missing camera profiles fill in these functions with the appropriate camera specific commands. This way, the core ZoneMinder code does not need to worry about camera specific commands. All it needs to know is the features of a camera and accordingly invoke abstract commands in the protocol perl file, and it is the responsibility of the perl file for that camera to implement the specifics. So if you are facing problems with PTZ not working, these protocol files are what you should be debugging ๐ฅ
Control Capabilities ๐๏ธ
If you have a camera that supports PTZ controls and wish to use it with ZoneMinder, then the first thing you need to do is ensure that it has an accurate entry in the capabilities table. To do this you need to go to the Control tab of the Monitor configuration dialog and select โEditโ where it is listed by the Control Type selection box. This will bring up a new window which lists, with a brief summary, the existing capabilities. To edit an existing capability to modify, select the Id or Name of the capability in question, or click on the Add button to add a new control capability. Either of these approaches will create a new window, in familiar style, with tabs along the top and form fields below. In the case of the capabilities table there are a large number of settings and tabs โ the meaning and use of these are briefly explained below ๐
Main Tab ๐ธ
- Name โ This is the name of the control capability. It will usually make sense to name capabilities after the camera model or protocol being used.
- Type โ Whether the capability uses a local (usually serial) or network control protocol.
- Command โ This is the full path to a script or application that will map the standard set of ZoneMinder control commands to equivalent control protocol commands. This may be one of the shipped example
zmcontrol-*.plscripts or something else entirely. - Can Wake โ This is the first of the actual capability definitions. Checking this box indicates that a protocol command exists to wake up the camera from a sleeping state.
- Can Sleep โ The camera can be put to sleep.
- Can Reset โ The camera can be reset to a previously defined state.
Move Tab ๐บ
- Can Move โ The camera is able to move, i.e. pan or tilt.
- Can Move Diagonally โ The camera can move diagonally. Some devices can move only vertically or horizontally at a time.
- Can Move Mapped โ The camera is able internally map a point on an image to a precise degree of motion to centre that point in the image.
- Can Move Absolute โ The camera can move to an absolute location.
- Can Move Relative โ The camera can move to a relative location, e.g. 7 point left or up.
- Can Move Continuous โ The camera can move continuously in a defined direction until told to stop or the movement limits are reached, e.g. left.
Pan Tab โ๏ธ
- Can Pan โ The camera can pan, or move horizontally.
- Min/Max Pan Range โ If the camera supports absolute motion this is the minimum and maximum pan co-ordinates that may be specified, e.g.
-100to100. - Min/Man Pan Step โ If the camera supports relative motion, this is the minimum and maximum amount of movement that can be specified.
- Has Pan Speed โ The camera supports specification of pan speeds.
- Min/Max Pan Speed โ The minimum and maximum pan speed supported.
- Has Turbo Pan โ The camera supports an additional turbo pan speed.
- Turbo Pan Speed โ The actual turbo pan speed. ๐๏ธ
Tilt Tab โ๏ธ
Definition of Tilt capabilities, fields as for โPanโ tab.
Zoom Tab ๐
- Can Zoom โ The camera can zoom.
- Can Zoom Absolute โ The camera can zoom to an absolute position.
- Can Zoom Relative โ The camera can zoom to a relative position.
- Can Zoom Continuous โ The camera can zoom continuously in or out until told to stop or the zoom limits are reached.
- Min/Max Zoom Range โ If the camera supports absolute zoom this is the minimum and maximum zoom amounts that may be specified.
- Min/Man Zoom Step โ If the camera supports relative zoom, this is the minimum and maximum amount of zoom change that can be specified.
- Has Zoom Speed โ The camera supports specification of zoom speed.
- Min/Max Zoom Speed โ The minimum and maximum zoom speed supported.
Focus Tab ๐ซถ
Definition of Focus capabilities, fields as for โZoomโ tab, but with the following additional capability.
- Can Auto Focus โ The camera can focus automatically.
White Tab ๐ค
Definition of White Balance capabilities, fields as for โFocusโ tab.
Iris Tab ๐๏ธ
Definition of Iris Control capabilities, fields as for โFocusโ tab.
Presets Tab โญ
- Has Presets โ The camera supports preset positions.
- Num Presets โ How many presets the camera supports. If the camera supports a huge number of presets then it makes sense to specify a more reasonable number here,
20or less is recommended. - Has Home Preset โ The camera has a defined โhomeโ position, usually in the mid point of its range.
- Can Set Presets โ The camera supports setting preset locations via its control protocol.
Control Scripts ๐
The second key element to controlling cameras with ZoneMinder is ensuring that an appropriate control script or application is present. A small number of sample scripts are included with ZoneMinder and can be used directly or as the basis for development. Control scripts are run atomically โ that is to say that one requested action from the web interface results in one execution of the script and no state information is maintained. If your protocol requires state information to be preserved then you should ensure that your scripts do this, as ZoneMinder has no concept of the state of the camera in control terms ๐ญ
If you are writing a new control script then you need to ensure that it supports the parameters that ZoneMinder will pass to it. If you already have scripts or applications that control your cameras, the ZoneMinder control script will just act as glue to convert the parameters passed into a form that your existing application understands. If you are writing a script to support a new protocol then you will need to convert the parameters passed into the script to equivalent protocol commands. If you have carefully defined your control capabilities above then you should only expect commands that correspond to those capabilities. No cap ๐ฏ
The standard set of parameters passed to control scripts is defined below,
--device=<device>โ This is the control device from the monitor definition. Absent if no device is specified.--address=<address>โ This is the control address from the monitor definition. This will usually be a hostname or ip address for network cameras or a simple numeric camera id for other cameras.--autostop=<timeout>โ This indicates whether an automatic timeout should be applied to โstopโ the given command. It will only be included for โcontinuousโ commands, as listed below, and will be a timeout in decimal seconds, probably fractional.--command=<command>โ This specifies the command that the script should execute. Valid commands are given below.--xcoord=<x>,--ycoord=<y>โ This specifies the x and/or y coordinates for commands which require them. These will normally be absolute or mapped commands.width=<width>,--height=<height>โ This specifies the width and height of the current image, for mapped motion commands where the coordinates values passed must have a context.--speed=<speed>โ This specifies the speed that the command should use, if appropriate.panspeed=<speed>,--tiltspeed=<speed>โ This indicates the specific pan and tilt speeds for diagonal movements which may allow a different motion rate for horizontal and vertical components.--step=<step>โ This specifies the amount of motion that the command should use, if appropriate. Normally used for relative commands only.panstep=<step>,--tiltstep=<step>โ This indicates the specific pan and tilt steps for diagonal movements which may allow a different amount of motion for horizontal and vertical components.--preset=<preset>โ This specifies the particular preset that relevant commands should operate on.
The command option listed above may take one of the following commands as a parameter.
wakeโ Wake the camera. โ๏ธsleepโ Send the camera to sleep. ๐ดresetโ Reset the camera. ๐move_mapโ Move mapped to a specified location on the image. ๐บ๏ธmove_pseudo_mapโ literally the same energy asmove_mapup above ๐ซ Pseudo-mapped motion is your girl when mapped motion just isn't supported but relative motion is โ in that case you can roughly approximate mapped motion with some careful calibration, iykyk.move_abs_<direction>โ move to a specified absolute location ๐ The direction element is just a lil hint about which way to go and you can totally omit it. If you do include it, it's one of โupโ, โdownโ, โleftโ, โrightโ, โupleftโ, โuprightโ, โdownleftโ or โdownrightโ.move_rel_<direction>โ move a specified amount in the given direction ๐ฆmove_con_<direction>โ move continuously in the given direction until you tell it to stop. no cap, it just keeps going ๐move_stopโ stop any motion which may be in progress. the panic button, iconic ๐zoom_abs_<direction>โ zoom to a specified absolute zoom position ๐ The direction element is a hint, optional. If present it's one of โteleโ or โwideโ.zoom_rel_<direction>โ zoom a specified amount in the given direction โจzoom_con_<direction>โ zoom continuously in the given direction until told to stop ๐ธzoom_stopโ stop any zooming which may be in progress ๐focus_autoโ set focusing to be automatic ๐คfocus_manโ set focusing to be manual ๐focus_abs_<direction>โ focus to a specified absolute focus position. The direction element is a hint, and again, omittable. If present it's one of โnearโ or โfarโ.focus_rel_<direction>โ focus a specified amount in the given direction ๐ฅfocus_con_<direction>โ focus continuously in the given direction until told to stop ๐focus_stopโ stop any focusing which may be in progress ๐white_<subcommand>โ exactly like the focus commands, except the direction may be โinโ or โoutโ ๐iris_<subcommand>โ also like the focus commands, except the direction may be โopenโ or โcloseโ ๐๏ธpreset_setโ set the given preset to the current location ๐preset_gotoโ move to the given preset ๐preset_homeโ move to the โhomeโ preset ๐
Mobile Devices ๐ซถ
Here are some options for using ZoneMinder on Mobile devices:
Third party mobile clients
- zmNinja (source code
https://github.com/pliablepixels/zmNinja, and it needs APIs to be installed to work)- Available in App Store, Play Store and for Desktops โ website
http://pliablepixels.github.io/zmNinja/โญ
- Available in App Store, Play Store and for Desktops โ website
Using the existing web console
- You can directly use the ZoneMinder interface by launching a browser and going to the ZoneMinder server just like you do on the Desktop ๐ป
Discontinued clients
The following are a list of clients that do not work and have not been updated:
- eyeZM
- zmView
rip bestie, these ones are giving abandoned ๐
Logging ๐
Note: Understanding how logging works in ZoneMinder is key to being able to isolate/pinpoint issues well. Please refer to Options - Logging to read about how to customize logging.
Most components of ZoneMinder can emit informational, warning, error and debug messages in a standard format. These messages can be logged in one or more locations. By default all messages produced by scripts are logged in <script name>.log files which are placed in the directory defined by the ZM_PATH_LOGS configuration variable. This is initially defined as /var/log/zm (on debian based systems) though it can be overridden to a custom path (the path is usually defined in /etc/zm/conf.d/01-system-paths.conf, but to override it, you should create your own config file, not overwrite this file โ do not do that bestie ๐). So for example, the zmdc.pl script will output messages to /var/log/zmdc.log, an example of these messages is:
10/24/2019 08:01:19.291513 zmdc[6414].INF [ZMServer:408] [Starting pending process, zma -m 2]
10/24/2019 08:01:19.296575 zmdc[6414].INF [ZMServer:408] ['zma -m 2' starting at 19/10/24 08:01:19, pid = 15740]
10/24/2019 08:01:19.296927 zmdc[15740].INF [ZMServer:408] ['zma -m 2' started at 19/10/24 08:01:19]
where the first part refers to the date and time of the entry, the next section is the name (or an abbreviated version) of the script, followed by the process id in square brackets, a severity code (INF, WAR, ERR or DBG) and the debug text. If you change the location of the log directory, ensure it refers to an existing directory which the web user has permissions to write to. Also ensure that no logs are present in that directory the web user does not have permission to open. This can happen if you run commands or scripts as the root user for testing at some point. If this occurs then subsequent non-privileged runs will fail due to being unable to open the log files ๐ญ
As well as specific script logging above, information, warning and error messages are logged via the system syslog service. This is a standard component on Linux systems and allows logging of all sorts of messages in a standard way and using a standard format. On most systems, unless otherwise configured, messages produced by ZoneMinder will go to the /var/log/messages or /var/log/syslog file. On some distributions they may end up in another file, but usually still in /var/log. Messages in this file are similar to those in the script log files but differ slightly. For example the above event in the system log file looks like:
Jan 3 13:46:00 shuttle52 zmpkg[11148]: INF [Command: start]
where you can see that the date is formatted differently (and only to 1 second precision) and there is an additional field for the hostname (as syslog can operate over a network). As well as ZoneMinder entries in this file you may also see entries from various other system components. You should ensure that your syslogd daemon is running for syslog messages to be correctly handled ๐ง
Customizing logging properly in ZoneMinder โจ
Other Notes
A number of users have asked how to suppress or redirect ZoneMinder messages that are written to this file. This most often occurs due to not wanting other system messages to be overwhelmed and obscured by the ZoneMinder produced ones (which can be quite frequent by default ๐
). In order to control syslog messages you need to locate and edit the syslog.conf file on your system. This will often be in the /etc directory. This file allows configuration of syslog so that certain classes and categories of messages are routed to different files or highlighted to a console, or just ignored. Full details of the format of this file is outside the scope of this document (typing โman syslog.confโ will give you more information) but the most often requested changes are easy to implement.
The syslog service uses the concept of priorities and facilities where the former refers to the importance of the message and the latter refers to that part of the system from which it originated. Standard priorities include โinfoโ, โwarningโ, โerrโ and โdebugโ and ZoneMinder uses these priorities when generating the corresponding class of message. Standard facilities include โmailโ, โcronโ and โsecurityโ etc but as well this, there are eight โlocalโ facilities that can be used by machine specific message generators. ZoneMinder produces itโs messages via the โlocal1โ facility.
So armed with the knowledge of the priority and facility of a message, the syslog.conf file can be amended to handle messages however you like ๐
So to ensure that all ZoneMinder messages go to a specific log file you can add the following line near the top of your syslog.conf file:
# Save ZoneMinder messages to zm.log
local1.* /var/log/zm/zm.log
which will ensure that all messages produced with the local1 facility are routed to the /var/log/zm/zm.log file. However this does not necessarily prevent them also going into the standard system log. To do this you will need to modify the line that determines which messages are logged to this file. This may look something like:
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;news.none;authpriv.none;cron.none /var/log/messages
by default. To remove ZoneMinder messages altogether from this file you can modify this line to look like:
*.info;local1.!*;mail.none;news.none;authpriv.none;cron.none /var/log/messages
which instructs syslog to ignore any messages from the local1 facility. If however you still want warnings and errors to occur in the system log file, you could change it to:
*.info;local1.!*;local1.warning;mail.none;news.none;authpriv.none;cron.none /var/log/messages
which follows the ignore instruction with a further one to indicate that any messages with a facility of local1 and a priority of warning or above should still go into the file.
These recipes are just examples of how you can modify the logging to suit your system, there are a lot of other modifications you could make. If you do make any changes to syslog.conf you should ensure you restart the syslogd process or send it a HUP signal to force it to reread its configuration file otherwise your changes will be ignored โ ๏ธ
The discussion of logging above began by describing how scripts produce error and debug messages. The way that the binaries work is slightly different. Binaries generate information, warning and error messages using syslog in exactly the same way as scripts and these messages will be handled identically. However debug output is somewhat different. For the scripts, if you want to enable debug you will need to edit the script file itself and change the DBG_LEVEL constant to have a value of 1. This will then cause debug messages to be written to the <script>.log file as well as the more important messages. Debug messages however are not routed via syslog. Scripts currently only have one level of debug so this will cause any and all debug messages to be generated. Binaries work slightly differently and while you can edit the call to zmDbgInit that is present in every binaryโs โmainโ function to update the initial value of the debug level, there are easier ways.
Okay so the easiest way to scoop up debug output is to click the Options link from the main ZoneMinder console view and then slide over to the Debug tab. There you'll find a whole lil collection of debug options. First thing first, bestie: make sure the ZM_EXTRA_DEBUG setting is switched on. That's the master switch that turns debugging on generally. Then you pick your debug target, level, and destination file with the relevant options. There's a ? next to each option that'll tell you what the valid settings are, so tap that if you're unsure. โจ
You will need to restart ZoneMinder as a whole โ or at minimum the component in question โ for the logging to actually take effect. And when you're done debugging? Turn it back off by unchecking the ZM_EXTRA_DEBUG option and restarting ZoneMinder again. The other options can stay however you like, because they get ignored when the master debug option is off. No harm, no foul. ๐
Once debug is being logged, you can change the level on the fly by sending USR1 and USR2 signals to the relevant binary (or binaries) โ that bumps the level of debug being emitted up or down with immediate effect. ๐ Just know that this tweak does not persist if the binary gets restarted. It's giving temporary main character energy.
If you wanna run a binary directly from the command line to test specific functionality or scenarios, you can set the ZM_DBG_LEVEL and ZM_DBG_LOG environment variables to set the level and log file of the debug you want to see, and set the ZM_DBG_PRINT environment variable to 1 to output the debug straight to your terminal. ๐ฅ๏ธ
Also! All ZoneMinder logs can now be rotated by logrotate. A sample logrotate config file is shown below:
/var/log/zm/*.log {
missingok
notifempty
sharedscripts
postrotate
/usr/local/bin/zmpkg.pl logrot 2> /dev/null > /dev/null || true
endscript
}
๐๏ธ Configuration Files ๐๏ธ
This section is all about the config files ZoneMinder uses beyond the various Web UI options. Yes, there's more than just clicking around the web interface, bestie.
๐งญ System Path Configurations ๐งญ
At one point of time, ZoneMinder stored various system path configurations under the Web UI (Options->Paths). That got removed a few versions ago and now lives in a configuration file instead. The motivation for this glow-up can be read in this discussion: https://github.com/ZoneMinder/zoneminder/pull/1908.
Typically, path configurations now reside in /etc/zm.
Here's an example of the file hierarchy:
/etc/zm
โโโ conf.d
โ โโโ 01-system-paths.conf
โ โโโ 02-multiserver.conf
| โโโ 03-custom.conf #optional
โ โโโ README
โโโ objectconfig.ini # optional
โโโ zm.conf
โโโ zmeventnotification.ini #optional
The roles of the files are as follows:
zm.confcontains various base configuration entries. You should not edit this file as it may be overwritten on an upgrade. ๐zmeventnotification.iniis only present if you have installed the ZoneMinder Event Notification Server.objectconfig.iniis only present if you have installed the machine learning hooks for the Event Notification Server.conf.dcontains additional configuration items as follows:01-system-paths.confcontains all the paths that were once part ofOptions->Pathsin the Web UI. You should not edit this file as it may be overwritten on an upgrade.02-multiserver.conffile consists of custom variables if you are deploying ZoneMinder in a multi-server configuration (see/installationguide/multiserver).03-custom.confis a custom config file that was created to override specific variables in the path files. This is the recommended way to customize entries. Anything that you want to change should be in a new file insideconf.d. Note that ZoneMinder will sort all the files alphabetically and run their contents in ascending order. So it doesn't really matter what you name them, as long as you make sure your changes are not overwritten by another file in the sorting sequence. It is therefore good practice to prefix your file names bynn-where nn is a monotonically increasing numerical sequence01-02-03-and so forth, so you know the order they will be processed. ๐
โฐ Timezone Configuration โฐ
Earlier versions of ZoneMinder relied on php.ini to set Date/Time Zone. That is no longer the case, bestie. You can (and must) set the Timezone via the Web UI, starting ZoneMinder version 1.34. See here #timezone-config.
๐๏ธ Database Specific Configuration ๐๏ธ
๐ Todo ๐
do we really need to have this section? Not sure if its generic and not specific to ZM
While the ZoneMinder specific database config entries reside in /etc/zm/zm.conf and related customizations discussed above, general database configuration items can be tweaked in /etc/mysql (or whichever path your DB server is installed).
๐ API ๐
This document will provide an overview of ZoneMinder's API. Buckle up, it's iconic.
๐ญ Overview ๐ญ
In an effort to further 'open up' ZoneMinder, an API was needed. This will allow quick integration with and development of ZoneMinder. ๐ซถ
The API is built in CakePHP and lives under the /api directory. It provides a RESTful service and supports CRUD (create, retrieve, update, delete) functions for Monitors, Events, Frames, Zones and Config.
๐งฐ API Wrappers ๐งฐ
pyzmis a python wrapper for the ZoneMinder APIs. It supports both the legacy and new token based API, as well as ZM logs/ZM shared memory support. See its project sitehttps://github.com/pliablepixels/pyzm/for more details. Documentation is herehttps://pyzm.readthedocs.io/en/latest/.
๐ฆ API evolution ๐ฆ
The ZoneMinder API has evolved over time. Broadly speaking the iterations were as follows:
- Prior to version
1.29, there really was no API layer. Users had to use the same URLs that the web console used to 'mimic' operations, or use an XML skin. - Starting version
1.29, av1.0CakePHP based API was released which continues to evolve over time. From a security perspective, it still tied into ZM auth and required client cookies for many operations. Primarily, two authentication modes were offered:- You use cookies to maintain session state (
ZM_SESS_ID) - You use an authentication hash to validate yourself, which included encoding personal information and time stamps which at times caused timing validation issues, especially for mobile consumers ๐ญ
- You use cookies to maintain session state (
- Starting version
1.34, ZoneMinder has introduced a new "token" based system which is based JWT. We have given it a '2.0' version ID. These tokens don't encode any personal data and can be statelessly passed around per request. It introduces concepts like access tokens, refresh tokens and per user level API revocation to manage security better. The internal components of ZoneMinder all support this new scheme now and if you are using the APIs we strongly recommend you migrate to1.34and use this new token system (as a side note,1.34also moves fromMYSQL PASSWORDtoBcryptfor passwords, which is also a good reason why you should migrate). ๐ - Note that as of
1.34, both versions of API access will work (tokens and the older auth hash mechanism), however we no longer use sessions by default. You will have to add astateful=1query parameter during login to tell ZM to set a COOKIE and store the required info in the session. This option is only available ifOPT_USE_LEGACY_API_AUTHis set toON.
Note: For the rest of the document, we will specifically highlight v2.0 only features. If you don't see a special mention, assume it applies for both API versions.
๐ Enabling API ๐
ZoneMinder comes with APIs enabled. To check if APIs are enabled, visit Options->System. If OPT_USE_API is enabled, your APIs are active. For v2.0 APIs, you have an additional option right below it:
OPT_USE_LEGACY_API_AUTHwhich is enabled by default. When enabled, thelogin.jsonAPI (discussed later) will return both the old style (auth=) and new style (token=) credentials. The reason this is enabled by default is because any existing apps that use the API would break if they were not updated to use v2.0. (Note thatzmNinja1.3.057and beyond will support tokens)
๐ Enabling secret key ๐
- It is important that you create a "Secret Key". This needs to be a set of hard to guess characters, that only you know. ZoneMinder does not create a key for you. It is your responsibility to create it. If you haven't created one already, please do so by going to
Options->Systemsand populatingAUTH_HASH_SECRET. Don't forget to save. ๐พ - If you plan on using V2.0 token based security, it is mandatory to populate this secret key, as it is used to sign the token. If you don't, token authentication will fail. V1.0 did not mandate this requirement.
๐๏ธ Getting an API key ๐๏ธ
To get an API key:
curl -XPOST -d "user=yourusername&pass=yourpassword" https://yourserver/zm/api/host/login.json
If you want to use a stateful connection, so you don't have to pass auth credentials with each query, you can use the following:
curl -XPOST -c cookies.txt -d "user=yourusername&pass=yourpassword&stateful=1" https://yourserver/zm/api/host/login.json
This returns a payload like this for API v1.0:
{
"credentials": "auth=05f3a50e8f7<deleted>063",
"append_password": 0,
"version": "1.33.9",
"apiversion": "1.0"
}
Or for API 2.0:
{
"access_token": "eyJ0eXAiOiJK<deleted>HE",
"access_token_expires": 3600,
"refresh_token": "eyJ0eXAiOi<deleted>mPs",
"refresh_token_expires": 86400,
"credentials": "auth=05f3a50e8f7<deleted>063", # only if OPT_USE_LEGACY_API_AUTH is enabled
"append_password": 0, # only if OPT_USE_LEGACY_API_AUTH is enabled
"version": "1.33.9",
"apiversion": "2.0"
}
๐ฎ Using these keys with subsequent requests ๐ฎ
Once you have the keys (a.k.a credentials (v1.0, v2.0) or token (v2.0)) you should now supply that key to subsequent API calls like this:
# v1.0 or 2.0 based API access (will only work if AUTH_HASH_LOGINS is enabled
# RECOMMENDED: v2.0 token based
curl -XGET https://yourserver/zm/api/monitors.json?token=<access_token>
# or, for legacy mode:
curl -XGET https://yourserver/zm/api/monitors.json?auth=<hex digits from 'credentials'>
# or, if you specified -c cookies.txt in the original login request
curl -b cookies.txt -XGET https://yourserver/zm/api/monitors.json
Note: okay so if you're hitting the API with an HTTP GET request, your token/auth has to ride along as a query parameter in the URL, bestie. If you're doing an HTTP POST (like when you're modifying a monitor, for example), you can choose to pass the token as a data payload instead. Heads up tho โ the API layer discards data payloads for HTTP GET, so don't try to be cute there. And finally, if you don't pass keys at all, you could also use cookies (not recommended as a general approach, fr fr). ๐
Key lifetime (v1.0)
So if you're using the old credentials mechanism from v1.0, your credentials are gonna time out based on PHP session timeout (that's if you're using cookies), OR based on the value of AUTH_HASH_TTL (that's if you're using auth= and you've enabled AUTH_HASH_LOGINS) โ and that one defaults to 2 hours.
The way that there's literally no way to look at the hash and decipher how much time is remaining... ๐ so it is your responsibility to record the time you got the hash, assume it was generated at the time you got it, and re-login before that time expires. No skipping this step, bestie.
Key lifetime (v2.0)
In version 2.0 it's easy to know when a key will expire before you even use it โจ You can find that out from the access_token_expires and refresh_token_expires values (in seconds) after you decode the JWT key (and there are JWT decode libraries for every language you want, iykyk). You should refresh the keys before the timeout occurs, or you will not be able to use the APIs. Periodt.
Understanding access/refresh tokens (v2.0)
If you're on V2.0, then you need to know how to use these tokens effectively:
- Access tokens are short lived. ZoneMinder issues access tokens that live for
3600seconds (1 hour). - Access tokens should be used for all subsequent API accesses.
- Refresh tokens should ONLY be used to generate new access tokens. For example, if an access token lives for 1 hour, before the hour completes, invoke the
login.jsonAPI above with the refresh token to get a new access token. ZoneMinder issues refresh tokens that live for24hours. - To generate a new refresh token before 24 hours are up, you will need to pass your user login and password to
login.json.
To Summarize:
- Pass your username and password to
login.jsononly once in 24 hours to renew your tokens. - Pass your โrefresh tokenโ to
login.jsononce in two hours (or whatever you have set the value ofAUTH_HASH_TTLto) to renew your access token. - Use your access token for all API invocations.
In fact, V2.0 will reject your request (if it is not to login.json) if it comes with a refresh token instead of an access token โ specifically to discourage usage of this token when it should not be used. So rude, but so valid.
This minimizes the amount of sensitive data that is sent over the wire, and the lifetime durations are made so that if they get compromised, you can regenerate or invalidate them (more on this later) ๐ซถ
Understanding key security
- Version 1.0 uses an MD5 hash to generate the credentials. The hash is computed over your secret key (if available), username, password and some time parameters (along with remote IP if enabled). This is not a secure/recommended hashing mechanism. If your auth hash is compromised, an attacker will be able to use your hash till it expires. To avoid this, you could disable the user in ZoneMinder. Furthermore, enabling remote IP (
AUTH_HASH_REMOTE_IP) requires that you issue future requests from the same IP that generated the tokens. While this may be considered an additional layer for security, this can cause issues with mobile devices ๐ญ - Version 2.0 uses a different approach. The hash is a simple base64 encoded form of โclaimsโ, but signed with your secret key. Consider for example, the following access key:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNTU3OTQwNzUyLCJleHAiOjE1NTc5NDQzNTIsInVzZXIiOiJhZG1pbiIsInR5cGUiOiJhY2Nlc3MifQ.-5VOcpw3cFHiSTN5zfGDSrrPyVya1M8_2Anh5u6eNlI
If you were to use any JWT token verifier https://jwt.io it can easily decode that token and will show:
{
"iss": "ZoneMinder",
"iat": 1557940752,
"exp": 1557944352,
"user": "admin",
"type": "access"
}
Invalid Signature
Donโt be surprised. JWT tokens, by default, are not meant to be encrypted https://softwareengineering.stackexchange.com/questions/280257/json-web-token-why-is-the-payload-public. It is just an assertion of a claim. It states that the issuer of this token was ZoneMinder, It was issued at (iat) Wednesday, 2019-05-15 17:19:12 UTC and will expire on (exp) Wednesday, 2019-05-15 18:19:12 UTC. This token claims to be owned by an admin and is an access token. If your token were to be stolen, this information is available to the person who stole it. Note that there are no sensitive details like passwords in this claim.
However, that person will not have your secret key as part of this token and therefore, will NOT be able to create a new JWT token to get, say, a refresh token. They will however, be able to use your access token to access resources just like the auth hash above, till the access token expires (2 hrs). To revoke this token, you donโt need to disable the user. Go to Options->API and tap on โRevoke All Access Tokensโ. This will invalidate the token immediately (this option will invalidate all tokens for all users, and new ones will need to be generated).
Over time, we will provide you with more fine grained access to these options.
Summarizing good practices:
- Use HTTPS, not HTTP
- If possible, use free services like LetsEncrypt
https://letsencrypt.orginstead of self-signed certificates (sometimes this is not possible) - Keep your tokens as private as possible, and use them as recommended above
- If you believe your tokens are compromised, revoke them, but also check if your attacker has compromised more than you think (example, they may also have your username/password or access to your system via other exploits, in which case they can regenerate as many tokens/credentials as they want).
Note: Subsequent sections donโt explicitly callout the key addition to APIs. We assume that you will append the correct keys as per our explanation above. So don't come for me when there's no token in the examples, bestie ๐
Examples
(In all examples, replace โserverโ with IP or hostname & port where ZoneMinder is running)
API Version
To retrieve the API version:
curl http://server/zm/api/host/getVersion.json
Return a list of all monitors
curl http://server/zm/api/monitors.json
It is worthwhile to note that starting ZM 1.32.3 and beyond, this API also returns a Monitor_Status object per monitor. It looks like this:
"Monitor_Status": {
"MonitorId": "2",
"Status": "Connected",
"CaptureFPS": "1.67",
"AnalysisFPS": "1.67",
"CaptureBandwidth": "52095"
}
If you donโt see this in your API, you are running an older version of ZM ๐ This gives you a very convenient way to check monitor status without calling the daemonCheck API described later. Slay.
Retrieve monitor 1
curl http://server/zm/api/monitors/1.json
Change State of Monitor 1
This API changes monitor 1 to Modect and Enabled
curl -XPOST http://server/zm/api/monitors/1.json -d "Monitor[Function]=Modect&Monitor[Enabled]=1"
Get Daemon Status of Monitor 1
curl http://server/zm/api/monitors/daemonStatus/id:1/daemon:zmc.json
Add a monitor
This command will add a new http monitor.
curl -XPOST http://server/zm/api/monitors.json -d "Monitor[Name]=Cliff-Burton\
&Monitor[Function]=Modect\
&Monitor[Protocol]=http\
&Monitor[Method]=simple\
&Monitor[Host]=usr:pass@192.168.11.20\
&Monitor[Port]=80\
&Monitor[Path]=/mjpg/video.mjpg\
&Monitor[Width]=704\
&Monitor[Height]=480\
&Monitor[Colours]=4"
Edit monitor 1
This command will change the โNameโ field of Monitor 1 to โtest1โ
curl -XPUT http://server/zm/api/monitors/1.json -d "Monitor[Name]=test1"
Delete monitor 1
This command will delete Monitor 1, but will _not_ delete any Events which depend on it. (Yes, they just hang around like ghosts, lowkey iconic.)
curl -XDELETE http://server/zm/api/monitors/1.json
Arm/Disarm monitors
This command will force an alarm on Monitor 1:
curl http://server/zm/api/monitors/alarm/id:1/command:on.json
This command will disable the alarm on Monitor 1:
curl http://server/zm/api/monitors/alarm/id:1/command:off.json
This command will report the status of the alarm Monitor 1:
curl http://server/zm/api/monitors/alarm/id:1/command:status.json
Return a list of all events
http://server/zm/api/events.json
Note that events list can be quite large and this API (as with all other APIs in ZM) uses pagination. Each page returns a specific set of entries. By default this is 25 and ties into WEB_EVENTS_PER_PAGE in the ZM options menu.
So the logic to iterate through all events should be something like this (pseudocode): (unfortunately there is no way to get pageCount without getting the first page)
data = http://server/zm/api/events.json?page=1 # this returns the first page
# The json object returned now has a property called data.pagination.pageCount
count = data.pagination.pageCount;
for (i=1, i<count, i++)
{
data = http://server/zm/api/events.json?page=i;
doStuff(data);
}
Retrieve event Id 1000
curl -XGET http://server/zm/api/events/1000.json
Edit event 1
This command will change the โNameโ field of Event 1 to โSeek and Destroyโ
curl -XPUT http://server/zm/api/events/1.json -d "Event[Name]=Seek and Destroy"
Delete event 1
This command will delete Event 1, and any Frames which depend on it.
curl -XDELETE http://server/zm/api/events/1.json
Return a list of events for a specific monitor Id =5
curl -XGET http://server/zm/api/events/index/MonitorId:5.json
Note that the same pagination logic applies if the list is too long ๐ฆ
Return a list of events for a specific monitor within a specific date/time range
http://server/zm/api/events/index/MonitorId:5/StartTime >=:2015-05-15 18:43:56/EndTime <=:2015-05-16 18:43:56.json
To try this in CuRL, you need to URL escape the spaces like so:
curl -XGET "http://server/zm/api/events/index/MonitorId:5/StartTime%20>=:2015-05-15%2018:43:56/EndTime%20<=:2015-05-16%2018:43:56.json"
Return a list of events for all monitors within a specified date/time range
curl -XGET "http://server/zm/api/events/index/StartTime%20>=:2015-05-15%2018:43:56/EndTime%20<=:208:43:56.json"
Return event count based on times and conditions
The API also supports a handy mechanism to return a count of events for a period of time ๐
This returns number of events per monitor that were recorded in the last one hour:
curl "http://server/zm/api/events/consoleEvents/1%20hour.json"
okay so this returns the number of events per monitor that got recorded in the last day, but only where there were atleast 10 frames that were alarms ๐
curl "http://server/zm/api/events/consoleEvents/1%20day.json/AlarmFrames >=: 10.json"
๐ Return sorted events ๐
this one hands you back a list of events inside a time range and sorts them descending, like a good bestie organising your camera roll ๐
curl -XGET "http://server/zm/api/events/index/StartTime%20>=:2015-05-15%2018:43:56/EndTime%20<=:208:43:56.json?sort=StartTime&direction=desc"
๐ Configuration Apis ๐
these APIs let you reach all the configuration parameters of ZM โ the exact ones you'd normally click around for inside the web console ๐ฑ๏ธโจ this here returns the full list of configuration parameters:
curl -XGET http://server/zm/api/configs.json
every config parameter has an Id, a Name, a Value and other fields. realistically you're only ever gonna care about those 3 ๐
ngl the edit function of the Configs API is a little quirky rn ๐ญ its format deviates from the usual edit flow of the other APIs. this will be fixed, eventually, promise ๐ค for now, to change the "Value" of ZM_X10_HOUSE_CODE from A to B:
curl -XPUT http://server/zm/api/configs/edit/ZM_X10_HOUSE_CODE.json -d "Config[Value]=B"
and to validate that the changes actually landed:
curl -XGET http://server/zm/api/configs/view/ZM_X10_HOUSE_CODE.json
๐ธ Run State Apis ๐ธ
the ZM API can also start / stop / restart / list states of ZM, and honestly it's giving main character energy ๐
examples:
curl -XGET http://server/zm/api/states.json # returns list of run states
curl -XPOST http://server/zm/api/states/change/restart.json #restarts ZM
curl -XPOST http://server/zm/api/states/change/stop.json #Stops ZM
curl -XPOST http://server/zm/api/states/change/start.json #Starts ZM
๐ฆ Create a Zone ๐ฆ
here's the whole recipe for manifesting a zone into existence, no cap โจ
curl -XPOST http://server/zm/api/zones.json -d "Zone[Name]=Jason-Newsted\
&Zone[MonitorId]=3\
&Zone[Type]=Active\
&Zone[Units]=Percent\
&Zone[NumCoords]=4\
&Zone[Coords]=0,0 639,0 639,479 0,479\
&Zone[Area]=307200\
&Zone[AlarmRGB]=16711680\
&Zone[CheckMethod]=Blobs\
&Zone[MinPixelThreshold]=25\
&Zone[MaxPixelThreshold]=\
&Zone[MinAlarmPixels]=9216\
&Zone[MaxAlarmPixels]=\
&Zone[FilterX]=3\
&Zone[FilterY]=3\
&Zone[MinFilterPixels]=9216\
&Zone[MaxFilterPixels]=230400\
&Zone[MinBlobPixels]=6144\
&Zone[MaxBlobPixels]=\
&Zone[MinBlobs]=1\
&Zone[MaxBlobs]=\
&Zone[OverloadFrames]=0"
๐ PTZ Control Meta-Data APIs ๐
okay so the PTZ controls tied to a monitor live in the Controls</c> table, not the Monitors table, inside ZM. what that means for you: when you pull up the details of a Monitor, all you'll know is whether it's controllable (isControllable:true) and its control ID. to actually retrieve the PTZ info attached to that Control ID, you need the controls API ๐ฎ
heads up bestie: these APIs only retrieve control data related to PTZ. they do not actually move the camera. if you wanna move it, go read the "PTZ on live streams" section below ๐
this returns all the control definitions:
curl http://server/zm/api/controls.json
and this returns the control definitions for one specific control, ID=5:
curl http://server/zm/api/controls/5.json
โญ Host APIs โญ
ZM's APIs have a bunch of endpoints that help you figure out host (aka ZM) daemon status, load, etc. some examples:
curl -XGET http://server/zm/api/host/getLoad.json # returns current load of ZM
# Note that ZM 1.32.3 onwards has the same information in Monitors.json which is more reliable and works for multi-server too.
curl -XGET http://server/zm/api/host/daemonCheck.json # 1 = ZM running 0=not running
# The API below uses "du" to calculate disk space. We no longer recommend you use it if you have many events. Use the Storage APIs instead, described later
curl -XGET http://server/zm/api/host/getDiskPercent.json # returns in GB (not percentage), disk usage per monitor (that is,space taken to store various event related information,images etc. per monitor)
๐ Storage and Server APIs ๐
ZoneMinder rolled out a whole pile of new options that let you do multiserver / multistorage</c> setups ๐๏ธ part of this existed in earlier versions, but a lot of rework happened across ZM 1.31 and 1.32. and as part of all that work, a ton of new and genuinely useful APIs got added ๐ some of them ship with ZM 1.32, others land in ZM 1.32.3 (and ofc, if you build from master, you can grab them right away, or just wait till a stable release drops ๐).
this returns the storage data for a single-server install. if you're running multi-storage, you'll see many of these "Storage" entries, one for each storage you've defined:
curl http://server/zm/api/storage.json
returns:
{
"storage": [
{
"Storage": {
"Id": "0",
"Path": "\/var\/cache\/zoneminder\/events",
"Name": "Default",
"Type": "local",
"Url": null,
"DiskSpace": "364705447651",
"Scheme": "Medium",
"ServerId": null,
"DoDelete": true
}
}
]
}
"DiskSpace" is the disk used in bytes. it doesn't give you disk space data as rich as /host/getDiskPercent, but it is much more efficient ๐
similarly,
curl http://server/zm/api/servers.json
returns:
{
"servers": [
{
"Server": {
"Id": "1",
"Name": "server1",
"Hostname": "server1.mydomain.com",
"State_Id": null,
"Status": "Running",
"CpuLoad": "0.9",
"TotalMem": "6186237952",
"FreeMem": "156102656",
"TotalSwap": "536866816",
"FreeSwap": "525697024",
"zmstats": false,
"zmaudit": false,
"zmtrigger": false
}
}
]
}
important: this one only works if you actually have a multiserver setup in place. if you don't, it returns an empty array ๐
๐ Other APIs ๐
not me telling you this is not a complete list ๐ ZM supports more parameters/APIs than we can fit here. the best way to dive in is to go look at the API code directly at https://github.com/ZoneMinder/zoneminder/tree/master/web/api/app/Controller ๐ต๏ธโโ๏ธ
๐ Streaming Interface ๐
devs working on their own applications keep asking if there's an "API" to receive live streams or recorded event streams. and yes โ you can stream both live and recorded streams ๐ฅ it isn't strictly an "API" per-se (that is, it is not integrated into the Cake PHP based API layer discussed here), which is also exactly why we've been using the term "Interface" instead of an "API" โจ
๐ฆ Live Streams ๐ฆ
here's the tea: if you want to display "live streams", ZoneMinder sends you streaming JPEG images (MJPEG) which render super easily in a browser using an img src tag ๐ผ๏ธ
for example:
<img src="https://yourserver/zm/cgi-bin/nph-zms?scale=50&width=640p&height=480px&mode=jpeg&maxfps=5&buffer=1000&&monitor=1&token=eW<deleted>03&connkey=36139" />
# or
<img src="https://yourserver/zm/cgi-bin/nph-zms?scale=50&width=640p&height=480px&mode=jpeg&maxfps=5&buffer=1000&&monitor=1&auth=b5<deleted>03&connkey=36139" />
this will display a live feed from monitor id 1, scaled down by 50% in quality and resized to 640x480px ๐
- this assumes
/zm/cgi-binis yourCGI_BINpath. change it to whatever is correct on your system ๐ ๏ธ - the "auth" token you see above is required if you use ZoneMinder authentication. to understand how to get the auth token, go read the "Login, Logout & API security" section below ๐
- the "connkey" parameter is essentially a random number which uniquely identifies a stream. if you don't specify a
connkey, ZM will generate its own. it's recommended to generate a connkey, because then you can use it to "control" the stream (pause/resume etc.) โฏ๏ธ - instead of dealing with the "auth" token, you can also use
&user=username&pass=passwordwhere "username" and "password" are your ZoneMinder username and password respectively. note that this is not recommended because you are transmitting them in a URL and even if you use HTTPS, they may show up in web server logs ๐ฌ
๐ธ PTZ on live streams ๐ธ
PTZ commands are pretty cryptic in ZoneMinder ngl ๐ตโ๐ซ this isn't meant to be an exhaustive guide, just something to whet your appetite ๐ฝ๏ธ
let's assume you have a monitor, with ID=6. and let's further assume you want to pan it left โฌ
๏ธ
you'd need to send a: POST command to https://yourserver/zm/index.php with the following data payload in the command (NOT in the URL):
view=request&request=control&id=6&control=moveConLeft&xge=30&yge=30
obviously, if you're using authentication, you need to be logged in for this to work ๐
like I said, at this stage this is only meant to get you started ๐ซถ explore the ZoneMinder code and use "Inspect source" as you use PTZ commands in the ZoneMinder source code. control_functions.php (https://github.com/ZoneMinder/zoneminder/blob/10531df54312f52f0f32adec3d4720c063897b62/web/skins/classic/includes/control_functions.php) is a great place to start ๐
โญ Pre-recorded (past event) streams โญ
similar to live playback, if you've chosen to store events in JPEG mode, you can play it back using:
<img src="https://yourserver/zm/cgi-bin/nph-zms?mode=jpeg&frame=1&replay=none&source=event&event=293820&connkey=77493&token=ew<deleted>" />
# or
<img src="https://yourserver/zm/cgi-bin/nph-zms?mode=jpeg&frame=1&replay=none&source=event&event=293820&connkey=77493&auth=b5<deleted>" />
- this assumes
/zm/cgi-binis yourCGI_BINpath. change it to whatever is correct on your system ๐ ๏ธ - this will playback event
293820, starting from frame1as an MJPEG stream โถ๏ธ - like before, you can add more parameters like
scaleetc. ๐ authandconnkeyhave the same meaning as before, and yes, you can replaceauthby&user=usename&pass=passwordas before and the same security concerns cited above apply ๐
if instead you've chosen to use the MP4 (Video) storage mode for events, you can directly play back the saved video file:
<video src="https://yourserver/zm/index.php?view=view_video&eid=294690&token=eW<deleted>" type="video/mp4"></video>
# or
<video src="https://yourserver/zm/index.php?view=view_video&eid=294690&auth=33<deleted>" type="video/mp4"></video>
this above will play back the video recording for event 294690 ๐ฌ
What other parameters are supported? ๐ซถ
Okay bestie, the best way to answer this is literally just to go play with the ZoneMinder console yourself. Open a browser, play back a live or recorded feed, and do an โInspect Sourceโ to see what parameters get generated. Change stuff and observe. That's it, that's the method. ๐
Further Reading ๐
Like we said earlier, treat this document as an โintroductionโ to the important parts of the API and streaming interfaces. There are several details that havenโt yet been documented. Till they are, here are some resources:
zmNinja, the open source mobile app for ZoneMinder, is 100% based on ZM APIs. Explore its source code <https://github.com/pliablepixels/zmNinja> to see how things work.- Launch up ZM console in a browser, and do an โInspect sourceโ. See how images are being rendered. Go to the networks tab of the inspect source console and look at network requests that are made when you pause/play/forward streams.
- If you still canโt find an answer, post your question in the forums <https://forums.zoneminder.com/index.php> (not the github repo).
โจ FAQ โจ
Todo ๐
needs to be reviewed - some entries may be old/invalid. Iโve done one round, but icOn needs to review.
This is the FAQ page. Feel free to contribute any FAQs that you think are missing. ๐ธ
Note: It is always a good idea to refer to the ZoneMinder forums <https://forums.zoneminder.com/viewforum.php?f=26&sid=fc93f65726d3a29fbf6f610b21f52b16> for tips and tricks. While we try and make sure this FAQ is pruned/adjusted to align with the latest stable release, some of the entries may no longer be accurate (or there may be better suggestions in the forums).
How can I stop ZoneMinder filling up my disk? ๐พ๐ญ
Recent versions of ZoneMinder come with a filter you can use for this purpose already included. The filter is called PurgeWhenFull and to find it, click on the word Filters in the header. Note that this filter is automatically enabled if you do a fresh install of ZoneMinder including creating a new database. If you already have an existing database and are upgrading ZoneMinder, it will retain the settings of the filter (which in earlier releases was disabled by default). So you may want to check if PurgeWhenFull is enabled and if not, enable it.
To enable it, go to Web Console, click on the word Filters in the UI header.
In the filter window there is a drop down select box labeled โUse Filterโ, that lets you select a saved filter. Select โPurgeWhenFullโ and it will load that filter.
Make any modifications you might want, such as the percentage full you want it to kick in, or how many events to delete at a time (it will repeat the filter as many times as needed to clear the space, but will only delete this many events each time to get there).
Ensure that the Run filter in background checkbox is checked. Ensure that the Delete all matches checkbox is checked.
Then click on โSaveโ. The filter will immediately begin executing in the background to keep your disk within those limits. ๐
Please note that that this filter will only affect the default storage location. If you have added other storage areas, you must create a PurgeWhenFull filter for each one, and specify the Storage Area as one of the parameters in the filter. You can duplicate the existing PurgeWhenFull filter by using Save As instead of Save.
Check the zmfilter.log file to make sure it is running as sometimes missing perl modules mean that it never runs but people donโt always realize. ๐
Purge By Age โ To delete events that are older than 7 days, create a new filter with โEnd Dateโ set to โless thanโ and a value of โ-7 daysโ, sort by โdate/timeโ in โascโending order, then enable the checkbox โdelete all matchesโ. You can also use a value of week or week and days: โ-2 weekโ or โ-2 week 4 dayโ
Save with โRun Filter In Backgroundโ enabled to have it run automatically. Optional skip archived events: click on the plus sign next to -7 days to add another condition. โandโ โarchive statusโ equal to โunarchived onlyโ.
Optional slow delete: limit the number of results to a number, say 10 in the filter. If you have a large backlog of events that would be deleted, this can hard spike the CPU usage for a long time. Limiting the number of results to only the first three each time the filter is run spreads out the delete processes over time, dramatically lessening the CPU load.
Warning: We no longer recommend use enableOPT_FAST_DELETEorRUN_AUDITanymore, unless you are using an old or low powered system to run Zoneminder. Please consider the remaining tips in this answer to be โgenerally deprecated, use only if you mustโ.
There are two methods for ZM to remove files when they are deleted that can be found in Options under the System tab ZM_OPT_FAST_DELETE and ZM_RUN_AUDIT.
ZM_OPT_FAST_DELETE:
Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if you are trying to do a lot of events at once. If you are running on an older or under-powered system, you may want to set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later. If you do so, disk space will not be freed immediately so you will need to run zmaudit more frequently. On modern systems, we recommend that you leave this off.
ZM_RUN_AUDIT:
The zmaudit daemon exists to check that the saved information in the database and on the file system match and are consistent with each other. If an error occurs or if you are using โfast deletesโ it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronize the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is not recommended for most systems, as zmaudit.pl is very resource intensive.
ZM_AUDIT_CHECK_INTERVAL:
The zmaudit daemon exists to check that the saved information in the database and on the files system match and are consistent with each other. If an error occurs or if you are using โfast deletesโ it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronize the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and file system may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.
Math for Memory: Making sure you have enough memory to handle your cameras ๐ง โจ
One of the most common issues for erratic ZoneMinder behavior is you donโt have enough memory to handle all your cameras. Many users often configure multiple HD cameras at full resolution and 15FPS or more and then face various issues about processes failing, blank screens and other completely erratic behavior. The core reason for all of this is you either donโt have enough memory or horsepower to handle all your cameras. The solution often is to reduce FPS, reduce cameras or bump up your server capabilities.
Here are some guidelines with examples on how you can figure out how much memory you need. With respect to CPU, you should benchmark your server using standard unix tools like top, iotop and others to make sure your CPU load is manageable. ZoneMinder also shows average load on the top right corner of the Web Console for easy access.
In general a good estimate of memory required would be:
Min Bits of Memory = 20% overhead * (image-width*image-height*image buffer size*target color space*number of cameras)
Where:
image-widthandimage-heightare the width and height of images that your camera is configured for (in my case,1280x960). This value is in the Source tab for each monitorimage buffer sizeis the # of images ZM will keep in memory (this is used by ZM to make sure it has pre and post images before detecting an alarm - very useful because by the time an alarm is detected, the reason for the alarm may move out of view and a buffer is really useful for this, including for analyzing stats/scores). This value is in the buffers tab for each monitortarget color spaceis the color depth -8bit,24bitor32bit. Itโs again in the source tab of each monitor
The 20% overhead on top of the calculation to account for image/stream overheads (this is an estimate)
The math breakdown for 4 cameras running at 1280x960 capture, 50 frame buffer, 24 bit color space:
1280*960 = 1,228,800 (bytes)
1,228,800 * (3 bytes for 24 bit) = 3,686,400 (bytes)
3,686,400 * 50 = 184,320,000 (bytes)
184,320,000 * 4 = 737,280,000 (bytes)
737,280,000 / 1024 = 720,000 (Kilobytes)
720,000 / 1024 = 703.125 (Megabytes)
703.125 / 1024 = 0.686 (Gigabytes)
Around 700MB of memory. ๐
So if you have 2GB of memory, you should be all set. Right? Not, really:
- This is just the base memory required to capture the streams. Remember ZM is always capturing streams irrespective of whether you are actually recording or not - to make sure its image ring buffer is there with pre images when an alarm kicks in.
- You also need to account for other processes not related to ZM running in your box
- You also need to account for other ZM processes - for example, I noticed the audit daemon takes up a good amount of memory when it runs, DB updates also take up memory
- If you are using
H264encoding, that buffers a lot of frames in memory as well.
So a good rule of thumb is to make sure you have twice the memory as the calculation above (and if you are using the ZM server for other purposes, please factor in those memory requirements as well)
Also remember by default ZM only uses 50% of your available memory unless you change it
As it turns out, ZM uses mapped memory and by default, 50% of your physical memory is what this will grow to. When you reach that limit, ZM breaks down with various errors. ๐
A good way to know how much memory is allocated to ZM for its operation is to do a df -h
A sample output on Ubuntu:
pp@camerapc:~$ df -h|grep "Filesystem\|shm"
Filesystem Size Used Avail Use% Mounted on
tmpfs 2.6G 923M 1.7G 36% /run/shm
so the main character of this whole output is tmpfs โ in the example up there we've got 1.7G of mapped memory space allocated, and only 36% of it is used, which is a healthy little number bestie โจ. but if you're seeing Use% creep past 70%, you should probaby bump up that mapped memory. (yes, "probaby". the manpage said it, i'm not fighting it ๐)
so say you wanna raise that limit to 70% of your memory โ you drop this into /etc/fstab:
tmpfs SHMPATH tmpfs defaults,noexec,nosuid,size=70% 0 0
where SHMPATH is the Mounted on path. here, that'd be /run/shm. other systems might be /dev/shm. ๐
I have enabled motion detection but it is not always being triggered when things happen in the camera view ๐
ZoneMinder uses zones to examine images for motion detection. when you make your first zones you get to pick from a bunch of preset values for sensitivity and friends. those presets are usually a decent starting point, but ngl they are not always suitable for every situation, so you'll probably need to tweak the values for your specific circumstances. the meanings of all the various settings are described in the docs (here <https://zoneminder.readthedocs.io/en/latest/userguide/definezone.html>). there's also another user-contributed illustrated Zone definition guide right here: An illustrated guide to Zones <https://wiki.zoneminder.com/index.php/Understanding_ZoneMinder%27s_Zoning_system_for_Dummies> ๐
but okay โ if you genuinely believe you've got sensible settings configured, then there are diagnostic approaches you can use. let's go โจ
Event Statistics ๐
the first technique is to use event statistics. first thing first: make sure they're switched on in Options->Logging->RECORD_EVENT_STATS. that will then cause the raw motion detection statistics for any subsequently generated events to be written to the DB. then you can get at them by first clicking on the Frames or Alarm Frames values of the event from any event list view in the web gui. then click on the score value to see the actual values that caused the event. alternatively the stats can be accessed by clicking on the Stats link when viewing any individual frame. the values displayed there correspond with the values that are used in the zone configuration, and they give you an idea of what "real world" values are being generated. ๐ฆ
heads up bestie: if you're investigating why events do not happen, then these will not be saved, so they won't be accessible. ๐ the best thing to do in that circumstance is to make your zone more sensitive so that it captures all events (perhap even ones you don't want) so you can get an idea of what values are being generated, and then start adjusting back toward less sensitive settings if necessary. you should make sure you test your settings under a variety of lighting conditions (e.g. day and night, sunny or dull) to get the best feel for that works and what doesn't. ๐๐
using statistics will slow your system down to a small degree and use a little extra disk space in the DB, so once you're happy you can switch them off again. but it's perfectly feasible to keep them permanently on if your system is able to cope โ which will let you review your setting periodically. ๐
Diagnostic Images along with FIFO ๐ผ๏ธ
the second approach is to use diagnostic images, which are saved copies of the intermediate images that ZM uses when determining motion detection. these are switched on and off using Options->Logging->RECORD_DIAG_IMAGES. ๐
Note: in addition to the detailed explanation below, a recently addedRECORD_DIAG_IMAGES_FIFOoption, also available inOptions->Logging, can be an invaluable tool to see how your current motion settings are affecting motion detection. the delta stream along with the raw (json output) stream can be invaluable to see the effect in real time. please refer to the explanation of this feature in Options - Logging <> ๐ฅ
there are two kinds of diagnostic images, which are written (and continuously overwritten) to the top level monitor event directory. if an event occurs then the files are additionally copied to the event directory and renamed with the appropriate frame number as a prefix. ๐
the first set is produced by the monitor on the image as a whole. the diag-r.jpg image is the current reference image against which all individual frames are compared, and the diag-d.jpg image is the delta image highlighting the difference between the reference image and the last analysed image. in this images identical pixels will be black and the more different a pixel is the whiter it will be. viewing this image and determining the colour of the pixels is a good way of getting a feel for the pixel differences you might expect (often more than you think ๐ญ).
the second set of diag images are labelled as diag-<zoneid>-<stage>.jpg where zoneid is the id of the zone in question (Smile) and the stage is where in the alarm check process the image is generated from. so if you have several zones you can expect to see multiple files. also these files are only interested in what is happening in their zone only and will ignore anything else outside of the zone. the stages that each number represents are as follows, โจ
- Alarmed Pixels โ this image shows all pixels in the zone that are considered to be alarmed as white pixels and all other pixels as black.
- Filtered Pixels โ this is as stage one except that all pixels removed by the filters are now black. the white pixels represent the pixels that are candidates to generate an event.
- Raw Blobs โ this image contains all alarmed pixels from stage 2 but aggregated into blobs. each blob will have a different greyscale value (between 1 and 254) so they can be difficult to spot with the naked eye, but using a colour picker or photoshop will make it easier to see what blob is what. ๐
- Filtered Blobs โ this image is as stage 3 but under (or over) sized blobs have been removed. this is the final step before determining if an event has occurred, just prior to the number of blobs being counted. thus this image forms the basis for determining whether an event is generated, and outlining on alarmed images is done from the blobs in this image. ๐ฅ
using the above images you should be able to tell at all stages what ZM is doing to determine if an event should happen or not. they're useful diagnostic tools, but as is mentioned elsewhere they will massively slow your system down and take up a great deal more space. you should never leave ZM running for any length of time with diagnostic images on. ๐จ
Why can't ZoneMinder capture images (either at all or just particularly fast) when I can see my camera just fine in xawtv or similar? ๐ฅ
with capture cards, ZoneMinder will pull images as fast as it possibly can unless limited by configuration. ZoneMinder (and any similar application) uses the frame grabber interface to copy frames from video memory into user memory. that takes some time, plus if you have several inputs sharing one capture chip it has to switch between inputs between captures, which further slows things down. ๐ข
on average a card that can capture at 25fps per chip PAL for one input will do maybe 6-10fps for two, 1-4fps for three and 1-2 for four. for a 30fps NTSC chip the figures will be correspondingly higher. however sometimes it's necessary to slow down capture even further, since after an input switch it may take a short while for the new image to settle before it can be captured without corruption. ๐
when using xawtv etc to view the stream you are not looking at an image captured using the frame grabber, but the card's video memory mapped onto your screen. that requires no capture or processing unless you do an explicit capture via the J or ctrl-J keys for instance. some cards or drivers don't support the frame grabber interface at all, so they may not work with ZoneMinder even though you can view the stream in xawtv. if you can grab a still using the grab functionality of xawtv then in general your card will work with ZoneMinder. ๐ซถ
Why can't I see streamed images when I can see stills in the zone window etc? ๐ญ
this issue is normally down to one of two causes. no cap. ๐
- you're using Internet Explorer and are trying to view multi-part jpeg streams. IE does not support these streams directly, unlike most other browsers. you'll need to install Cambozola or another multi-part jpeg aware plugin to view them. to do this you'll need to obtain the applet from the Downloads page and install the
cambozola.jarfile in the same directory as the ZoneMinder php files. then find the ZoneMinderOptions->Imagespage and enableOPT_CAMBOZOLAand enter the web path to the.jarfile inPATH_CAMBOZOLA. this will ordinarily just becambozola.jar. provided (Options / B/W tabs)WEB_H_CAN_STREAMis set toautoandWEB_H_STREAM_METHODis set tojpegthen Cambozola should be loaded next time you try and view a stream. โจ
NOTE: if you find that the Cambozola applet loads in IE but the applet just displays the version of Cambozola and the author's name (as opposed to seeing the streaming images), you may need tochmod(-rwxrwxr-x) your (usr/share/zoneminder/)cambozola.jar:sudo chmod 775 cambozola.jaronce I did this, images started to stream for me. ๐ญ๐
- the other common cause for being unable to view streams is that you've installed the ZoneMinder cgi binaries (
zmsandnph-zms) in a different directory than your web server is expecting. make sure that theโwith-cgidiroption you use to the ZoneMinder configure script is the same as the CGI directory configure for your web server. if you're using Apache, which is the most common one, then in yourhttpd.conffile there should be a line like:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
where the last directory in the quotes is the one you've specified. if not, then change one or the other to match. be warned that configuring apache can be complex, so changing the one passed to the ZoneMinder configure (and then rebuilding and reinstalling) is recommended in the first instance. if you change the apache config you'll need to restart apache for the changes to take effect. if you still cannot see stream reliably then try changing ZM_PATH_ZMS in your /etc/zm/config directory to just use zms if nph-zms is specified, or vice versa. also check in your apache error logs. ๐
lastly, please look for errors created by the zmc processes. if zmc isn't running, then zms will not be able to get an image from it and will exit. ๐
๐ "I have several monitors configured but when I load the Montage view why can I only see two?" โ or, "Why don't all my cameras display when I use the Montage view?"
okay bestie so this one is not a ZoneMinder bug, it's a browser thing, and it's lowkey the most annoying vibe ever. By default most browsers only support a small number of simultaneous connections to any given server. And the montage view? It usually needs one persistent connection for each camera plus intermittent connections for other stuff like statuses. So the browser justโฆ stops. Rude.
In firefox you can increase the limit, but other browsers are not configurable in this way. Tragic.
A solution for all browsers is something we call multi-port. The way that works is we reconfigure apache to operate on ports other than the default of 80 (http) or 443 (https). You need to pick a range, let's say 30000 to 30010 in order to support 10 cameras. We add lines to your zoneminder apache config file as follows:
Listen 30000 Listen 30001 Listen 30002 Listen 30003 etc Listen 30010
If you are using virtualhosts, you will have to add these to the VirtualHost directive as well.
Then in ZoneMinder config, go Options -> Network and set MIN_STREAMING_PORT to 30000. Now when generating urls to stream images from ZoneMinder a port will be appended that is 30000 + MonitorId, so Monitor 1 will stream from 30001 and so on. This will allow Montage to stream from all monitors. slay.
Alternatively, if you are in fact using only Firefox, you can increase the limit as follows:
- Enter
about:configin the address bar - scroll down to
browser.cache.check_doc_frequency 3and change the3to a1
browser.cache.disk.enable True -> False
network.http.max-connections-per-server -> put a value of 100
network.http.max-persistent-connections-per-proxy -> 100 again
network.http.max-persistent-connections-per-server -> 100 again
๐ญ "I can't see more than 6 monitors in montage on my browser"
Browsers such a Chrome and Safari only support up to 6 streams from the same domain. To work around that, take a look at the multi-port configuration discussed in the MIN_STREAMING_PORT configuration in Options - Network. (the original points you at Options - Network <>, that's the spot ๐
)
๐ฅ "Why is ZoneMinder using so much CPU?"
The various elements of ZoneMinder can be involved in some pretty intensive activity, especially while analysing images for motion. However generally this should not overwhelm your machine unless it is very old or underpowered.
There are a number of specific reasons why processor loads can be high either by design or by accident. To figure out exactly what is causing it in your circumstances requires a bit of experimentation.
The main causes are:
- Using a video palette other than greyscale or
RGB24. This can cause a relatively minor performance hit, though still significant. Although some cameras and cards require using planar palettes ZM currently doesn't support this format internally and each frame is converted to an RGB representation prior to processing. Unless you have compelling reasons for using YUV or reduced RGB type palettes such as hitting USB transfer limits I would experiment to see ifRGB24or greyscale is quicker. Put your monitors into 'Monitor' mode so that only the capture daemons are running and monitor the process load of these (thezmcprocesses) usingtop. Try it with various palettes to see if it makes a difference. - Big image sizes. A image of
640x480requires at least four times the processing of a320x240image. Experiment with different sizes to see what effect it may have. Sometimes a large image is just two interlaced smaller frames so has no real benefit anyway. This is especially true for analog cameras/cards as image height over320(NTSC) or352(PAL) are invariably interlaced. - Capture frame rates. Unless there's a compelling reason in your case there is often little benefit in running cameras at
25fpswhen5-10fpswould often get you results just as good. Try changing your monitor settings to limit your cameras to lower frame rates. You can still configure ZM to ignore these limits and capture as fast as possible when motion is detected. - Run function. Obviously running in Record or Mocord modes or in Modect with lots of events generates a lot of DB and file activity and so CPU and load will increase.
- Basic default detection zones. By default when a camera is added one detection zone is added which covers the whole image with a default set of parameters. If your camera covers a view in which various regions are unlikely to generate a valid alarm (ie the sky) then I would experiment with reducing the zone sizes or adding inactive zones to blank out areas you don't want to monitor. Additionally the actual settings of the zone themselves may not be optimal. When doing motion detection the number of changed pixels above a threshold is examined, then this is filter, then contiguous regions are calculated to see if an alarm is generated. If any maximum or minimum threshold is exceeded according to your zone settings at any time the calculation stops. If your settings always result in the calculations going through to the last stage before being failed then additional CPU time is used unnecessarily. Make sure your maximum and minimum zone thresholds are set to sensible values and experiment by switching
RECORD_EVENT_STATSon and seeing what the actual values of alarmed pixels etc are during sample events. - Optimise your settings. After you've got some settings you're happy with then switching off
RECORD_EVENT_STATSwill prevent the statistics being written to the database which saves some time. Other settings which might make a difference areZM_FAST_RGB_DIFFSand theJPEG_xxx_QUALITYones.
I'm sure there are other things which might make a difference such as what else you have running on the box and memory sizes (make sure there's no swapping going on). Also speed of disk etc will make some difference during event capture and also if you are watching the whole time then you may have a bunch of zms processes running also.
I think the biggest factors are image size, colour depth and capture rate. Having said that I also don't always know why you get certains results from top. For instance if I have a zma daemon running for a monitor that is capturing an image. I've commented out the actual analysis so all it's doing is blending the image with the previous one. In colour mode this takes ~11 milliseconds per frame on my system and the camera is capturing at ~10fps. Using top this reports the process as using ~5% of CPU and permanently in R(un) state. Changing to greyscale mode the blending takes ~4msec (as you would expect as this is roughly a third of 11) but top reports the process as now with 0% CPU and permanently in S(leep) state. So an actual CPU resource usage change of a factor of 3 causes huge differences in reported CPU usage. I have yet to get to the bottom of this but I suspect it's to do with scheduling somewhere along the line and that maybe the greyscale processing will fit into one scheduling time slice whereas the colour one won't but I have no evidence of this yet!
๐ฆ "Why is the timeline view all messed up?"
The timeline view is a new view allowing you to see a graph of alarm activity over time and to quickly scan and home in on events of interest. However this feature is highly complex and still in beta. It is based extensively on HTML div tags, sometimes lots of them. Whilst FireFox is able to render this view successfully other browsers, particular Internet Explorer do not seem able to cope and so present a messed up view, either always or when there are a lot of events. Using the timeline view is only recommended when using FireFox, however even then there may be issues.
This function has from time to time been corrupted in the SVN release or in the stable releases, try and reinstall from a fresh download.
๐พ "How much Hard Disk Space / Bandwidth do I need for ZM?"
Please see this online excel sheet at https://docs.google.com/spreadsheets/d/1iPMCGwlXiW8WnQuewgFhUqBs7ZaPKqXDkBtCQVHR6H0/edit?usp=sharing. Note that this is just an estimate.
Or go to http://www.axis.com/products/video/design_tool/v2/ for the Axis bandwidth calculator. Although this is aimed at Axis cameras it still produces valid results for any kind of IP camera.
As a quick guide I have 4 cameras at 320x240 storing 1 fps except during alarm events. After 1 week 60GB of space in the volume where the events are stored (/var/www/html/zm) has been used.
๐จ "When I try and run ZoneMinder I get lots of audit permission errors in the logs and it won't start"
Many Linux distributions nowadays are built with security in mind. One of the latest methods of achieving this is via SELinux (Secure Linux) which controls who is able to run what in a more precise way then traditional accounting and file based permissions (https://en.wikipedia.org/wiki/Selinux). If you are seeing entries in your system log like:
Jun 11 20:44:02 kernel: audit(1150033442.443:226): avc: denied { read
} for pid=5068 comm="uptime" name="utmp" dev=dm-0 ino=16908345
scontext=user_u:system_r:httpd_sys_script_t
tcontext=user_u:object_r:initrc_var_run_t tclass=file
then it is likely that your system has SELinux enabled and it is preventing ZoneMinder from performing certain activities. You then have two choices. You can either tune SELinux to permit the required operations or you can disable SELinux entirely which will permit ZoneMinder to run unhindered. Disabling SELinux is usually performed by editing its configuration file (e.g., /etc/selinux/config) and then rebooting. However if you run a public server you should read up on the risks associated with disabled Secure Linux before disabling it.
โ ๏ธ heads up bestie โ disabling Secure Linux on a public server is a real risk, do your reading first fr fr.
Note that SELinux may cause errors other than those listed above. If you are in any doubt then it can be worth disabling SELinux experimentally to see if it fixes your problem before trying other solutions.
๐ "How do I enable ZoneMinder's security?"
In the console, click on Options->System. Check the box next to ZM_OPT_USE_AUTH. You will immediately be asked to login. The default username is admin and the password is admin.
To Manage Users: In main console, go to Options->Users.
You may also wanna layer on the web server security too, bestie โ think htaccess files under Apache scope. You can totally run that as an extra / redundant security blanket on top of ZoneMinder's own built-in security features. Heads up tho: if you turn on webserver auth, zmNinja might get cranky. Go read the zmNinja FAQ on basic authentication <https://zmninja.readthedocs.io/en/latest/guides/FAQ.html#i-can-t-see-streams-i-use-basic-auth> for the deets. Also important: zmNinja does not support digest authentication. Periodt.
๐ธ Managing system load (with IP Cameras in mind) ๐ธ
โจ Introduction โจ
Zoneminder is a superb application in every way, but it does a job that needs a lot of horsepower โ especially when you're running multiple IP cameras. IP Cams need an extra level of processing compared to analogue cards, because the jpg or mjpeg images need to be decoded before analysing. That needs grunt. And if you have lots of cameras, you need lots of grunt. ๐ช
Why does ZM need so much grunt? Think about what Zoneminder is actually doing, bestie. In modect mode ZM is:
- Fetching a jpeg from the camera. (Either in single part or multipart stream)
- Decoding the jpeg image.
- Comparing the zoned selections to the previous image or images and applying rules.
- If in alarm state, writing that image to the disk and updating the mysql database.
If you're capturing at five frames per second, all of the above gets repeated five times every second, multiplied by the number of cameras. Decoding the images is what takes the real power from the processor, and that's the main reason why analogue cameras โ which present an image ready-decoded in memory โ take less work.
๐ฆ How do I know if my computer is overloaded? ๐ฆ
If your CPU is running at 100% all the time, it's probably overloaded (or running at exact optimisation, iykyk). If the load is consistently high (over 10.0 for a single processor) then Bad Things happen โ like lost frames, unrecorded events, etc. Occasional peaks are fine, normal, and nothing to worry about. ๐
Zoneminder runs on Linux, and Linux measures system load using "load", which is complicated but gives a rough guide on what the computer is doing at any given time. Zoneminder shows Load on the main page (top right) as well as disk space. Typing uptime on the command line will give you a similar guide, but with three figures to give a fuller measure of what's happening over a period of time. But for the best guide to see what's happening, install htop โ it gives easy to read graphs for load, memory and cpu usage.
A load of 1.0 means the processor has "just enough to do right now". Also worth noting: a load of 4.0 means exactly the same for a quad processor machine โ each number equals a single processor's workload. A very high load can be fine on a computer that has a stacked workload โ like a machine sending out bulk emails, or working its way through a knotty problem; it'll just keep churning away until it's done. However โ Zoneminder needs to process information in real time so it can't afford to stack its jobs, it needs to deal with them right away.
For a better and full explanation of Load: Please read this <https://en.wikipedia.org/wiki/Load_%28computing%29> ๐
๐ My load is too high, how can I reduce it? ๐
(The previous documentation explained how to use turbo jpeg libraries as an optimization technique. These libraries have long been part of standard linux distros since that article was authored and hence that section has been removed)
Zoneminder is very tweakable and it's possible to tune it to compromise. The following are good things to try, in no particular order:
- If your camera allows you to change image size, think whether you can get away with smaller images. Smaller pics = less load.
320x240is usually ok for close-up corridor shots. - Go Black and White. Colour pictures use twice to three times the CPU, memory and diskspace but give little benefit to identification.
- Reduce frames per second. Halve the fps, halve the workload. If your camera supports fps throttling (Axis do), try that โ saves ZM having to drop frames from a stream.
2-5fps seems to be widely used. - Experiment with using jpeg instead of mjpeg. Some users have reported it gives better performance, but YMMV.
- Tweak the zones. Keep them as small and as few as possible. Stick to one zone unless you really need more. Read this <https://wiki.zoneminder.com/index.php/Understanding_ZoneMinder%27s_Zoning_system_for_Dummies> for an easy to understand explanation along with the official Zone guide.
- Schedule. If you are running a linux system at near capacity, you'll need to think carefully about things like backups and scheduled tasks.
updatedbโ the process which maintains a file database so thatlocateworks quickly, is normally scheduled to run once a day and if on a busy system can create a heavy increase on the load. The same is true for scheduled backups, especially those which compress the files. Re-schedule these tasks to a time when the cpu is less likely to be busy, if possible โ and also use thenicecommand to reduce their priority. (crontaband/etc/cron.daily/are good places to start) - Reduce clutter on your PC. Don't run X unless you really need it, the GUI is a huge overhead in both memory and cpu.
More expensive options:
- Increase RAM. If your system is having to use disk swap it will HUGELY impact performance in all areas. Again,
htopis a good monitor โ but first you need to understand that because Linux is using all the memory, it doesn't mean it needs it all โ linux handles ram very differently to Windows/DOS and caches stuff.htopwill show cached ram as a different colour in the memory graph. Also check that you're actually using a high memory capable kernel โ many kernels don't enable high memory by default. - Faster CPU. Simple but effective. Zoneminder also works very well with multiple processor systems out of the box (if SMP is enabled in your kernel). The load of different cameras is spread across the processors.
- Try building Zoneminder with processor specific instructions that are optimised to the system it will be running on, also increasing the optimisation level of GCC beyond
-O2will help. This topic is beyond the scope of this document.
Processor specific commands can be found in the GCC manual <https://gcc.gnu.org/onlinedocs/gcc/> along with some more options that may increase performance.
๐ What about disks and bandwidth? ๐
A typical 100mbit LAN will cope with most setups easily. If you're feeding from cameras over smaller or internet links, obviously fps will be much lower.
Disk and Bandwidth calculators are referenced in How much Hard Disk Space / Bandwidth do I need for ZM?.
โญ How do I build for X10 support? โญ
You do not need to rebuild ZM for X10 support. You will need to install the perl module and switch on X10 in the options, then restart. Installing the perl module is covered in the README amongst other places but in summary, do:
perl -MCPAN -eshell install X10::ActiveHome quit
๐ Extending Zoneminder ๐
๐ How can I get ZM to do different things at different times of day or week? ๐
If you want to configure ZoneMinder to do motion detection during the day and just record at night, for example, you will need to use ZoneMinder 'run states'. A run state is a particular configuration of monitor functions that you want to use at any time.
To save a run state you should first configure your monitors for Modect, Record, Monitor etc as you would want them during one of the times of day. Then click on the running state link at the top of the Console view. This will usually say 'Running' or 'Stopped'. You will then be able to save the current state and give it a name, 'Daytime' for example. Now configure your monitors how you would want them during other times of day and save that, for instance as 'Nighttime'.
Now you can switch between these two states by selecting them from the same dialog you saved them, or from the command line from issue the command zmpkg.pl <run state>, for example zmpkg.pl Daytime.
The final step you need to take, is scheduling the time the changes take effect. For this you can use cron <https://en.wikipedia.org/wiki/Cron>. A simple entry to change to the Daylight state at at 8am and to the nighttime state at 8pm would be as follows,
0 8 * * * root /usr/local/bin/zmpkg.pl Daytime
0 20 * * * root /usr/local/bin/zmpkg.pl Nighttime
On Ubuntu 7.04 and possibly others, look in /usr/bin not just /usr/local/bin for the zmpkg.pl file.
Although the example above describes changing states at different times of day, the same principle can equally be applied to days of the week or other more arbitrary periods. ๐๏ธ
๐ง How can I use ZoneMinder to trigger something else when there is an alarm? ๐ง
ZoneMinder includes a perl API which means you can create a script to interact with the ZM shared memory data and use it in your own scripts to react to ZM alarms or to trigger ZM to generate new alarms. Full details are in the README or by doing perldoc ZoneMinder etc.
ZoneMinder provides a sample alarm script called zmalarm.pl <https://github.com/ZoneMinder/zoneminder/blob/master/utils/zm-alarm.pl> that you can refer to as a starting point.
๐ Trouble Shooting ๐
Here are some things that will help you track down whats wrong. This is also how to obtain the info that we need to help you on the forums.
๐ What logs should I check for errors? ๐
ZoneMinder creates its own logs and are usually located in the /var/log/ directory. Refer to the logging discussion in Options - Logging <> for more details on where logs are stored and how to enable various log levels.
Since ZM is dependent on other components to work, you might not find errors in ZM but in the other components.
/var/log/messagesand/or/var/log/syslog/var/log/dmesg/var/log/httpd/error_log(RedHat/Fedora) or/var/log/apache2/error_log/var/log/mysqld.log(Errors here don't happen very often but just in case)
If ZM is not functioning, you should always be able to find an error in at least one of these logs. Use the tail command to get info from the logs. This can be done like so:
tail -f /var/log/messages /var/log/httpd/error_log
/var/log/zm/zm*.log
This will append any data entered to any of these logs to your console screen (-f). To exit, hit [ctrl -c]. ๐
How can I trouble shoot the hardware and/or software? ๐งโจ
Okay bestie, here are the commands that spill all the tea on your hardware. Some of them are distro-dependent, so if one ghosts you, thatโs why. ๐
lspci -vvโ returns lots of detailed info. Check for conflicting interrupts or port assignments. You can sometimes alter interrupts/ports in BIOS. Try a different PCI slot to get a clue if itโs a hardware conflict. (Command provided by thepciutilspackage.) ๐scanpci -vโ gives you information from your hardware EPROM.lsusb -vvโ returns lots of detail about USB devices. (Command provided by theusbutilspackage.) ๐dmesgโ shows you how your hardware initialized (or didnโt) on boot-up. You will get the most use out of this one. โญv4l-infoโ to see how the driver is talking to the card. Look for unusual values. ๐modinfo bttvโ somebttvdriver stats.zmu -m 0 -q -vโ returns various information regarding a monitor configuration.ipcsโ provides information on the IPC facilities for which the calling process has read access.ipcrmโ theipcrmcommand can be used to remove an IPC object from the kernel.cat /proc/interruptsโ this will display what interrupts your hardware is using. โก
Why am I getting a 403 access error with my web browser when trying to access http //localhost/zm? ๐ญ
The Apache web server needs to have the right permissions and configuration to be able to read the ZoneMinder files. Check the forums for a solution, and edit the Apache configuration and change directory permissions to give Apache the right to read the ZoneMinder files. Depending on your ZoneMinder configuration, you would use the zm user and group that ZoneMinder was built with, such as wwwuser and www. ๐
Why am I getting broken images when trying to view events? ๐ผ๏ธ๐
ZoneMinder and the Apache web server need to have the right permissions. Check this forum topic <https://forums.zoneminder.com/viewtopic.php?p=48754> and similar ones:
I can review events for the current day, but ones from yesterday and beyond error out ๐ตโ๐ซ
If youโve checked that the www-data user has permissions to the storage folders, maybe your php.iniโs timezone setting is incorrect. They _must_ match for certain playback functions.
If youโre using Linux, this can be found using the following command:
timedatectl | grep "Time zone"
If using FreeBSD, you can use this one-liner:
cd /usr/share/zoneinfo/ && find * -type f -exec cmp -s {} /etc/localtime \; -print;
Once you know what timezone your system is set to, make sure you set the right time zone in ZM (available in Options->System->TimeZone). ๐
Why is the image from my color camera appearing in black and white? ๐ค๐ค
If you recently upgraded to ZoneMinder 1.26, there is a per-camera option that defaults to black and white and can be mis-set if your upgrade didnโt happen right. See this thread: <https://forums.zoneminder.com/viewtopic.php?f=30&t=21344>
This may occur if you have an NTSC analog camera but have configured the source in ZoneMinder as PAL for the Device Format under the source tab. You may also be misled because zmu can report the video port as being PAL when the camera is actually NTSC. Confirm the format of your analog camera by checking its technical specifications, possibly found with the packaging it came in, on the manufacturerโs website, or even on the retail website where you purchased the camera. Change the Device Format setting to NTSC and set it to the lowest resolution of 320 x 240. If you have confirmed that the camera itself is NTSC format, but donโt get a picture using the NTSC setting, consider increasing the shared memory kernel.shmall and kernel.shmmax settings in /etc/sysctl.conf to a larger value such as 268435456. This is also the reason you should start with the 320x240 resolution, so as to minimize the potential of memory problems which would interfere with your attempts to troubleshoot the device format issue. Once you have obtained a picture in the monitor using the NTSC format, then you can experiment with raising the resolution. ๐ธ
Why do I only see blue screens with a timestamp when monitoring my camera? ๐โฐ
If this camera is attached to a capture card, then you may have selected the wrong Device Source or Channel when configuring the monitor in the ZoneMinder console. If you have a capture card with 2 D-sub style inputs (looks like a VGA port) to which you attach a provided splitter that splits off multiple cables, then the splitter may be attached to the wrong port. For example, PV-149 capture cards have two D-sub style ports labeled as DB1 and DB2, and come packaged with a connector for one of these ports that splits into 4 BNC connectors. The initial four video ports are available with the splitter attached to DB1. ๐ฅ
Why do I only see black screens with a timestamp when monitoring my camera? ๐คโฐ
In the monitor windows where you see the black screen with a timestamp, select settings and enter the Brightness, Contrast, Hue, and Color settings reported for the device by zmu -d <device_path> -q -v. 32768 may be appropriate values to try for these settings. After saving the settings, select Settings again to confirm they saved successfully. ๐๏ธ
How do I repair the MySQL/MariaDB Database? ๐๏ธ๐ง
There are two ways to go about this. In most cases you can run from the command prompt ->
mysqlcheck --all-databases --auto-repair -p your_database_password -u your_databse_user
If that does not work then you will have to make sure that ZoneMinder is stopped then run the following (nothing should be using the database while running this and you will have to adjust for your correct path if it is different):
myisamchk --silent --force --fast --update-state -O key_buffer=64M -O sort_buffer=64M -O read_buffer=1M -O write_buffer=1M /var/lib/mysql/*/*.MYI
How do I repair the MySQL/MariaDB Database when the CLI fails? ๐ค
In Ubuntu, the commands listed above do not seem to work. However, actually doing it by hand from within MySQL/MariaDB does. (But that is beyond the scope of this document.) But that got me thinkingโฆ And phpmyadmin does work. Bring up a terminal.
sudo apt-get install phpmyadmin
Now go to http://zoneminder_IP/ and stop the ZM service. Continue to http://zoneminder_IP/phpmyadmin and select the zoneminder database. Select any tables marked โin useโ and pick the action โrepareโ to fix. Restart the zoneminder service from the web browser. Remove or disable the phpmyadmin tool, as it is not always the most secure thing around, and opens your database wide to any skilled hacker.
sudo apt-get remove phpmyadmin
Careful, bestie: phpmyadmin is not always the most secure thing around, and it opens your database wide to any skilled hacker. Remove or disable it when youโre done. ๐จ
I upgraded my distribution and ZM stopped working ๐ญ
Some possibilities (incomplete list and subject to correction):
/usr/local/bin/zmfix: /usr/lib/libmysqlclient.so.15: version `MYSQL_5.0' not found (required by /usr/local/bin/zmfix)
:: Solution: Recompile and reinstall ZoneMinder. Any time you update a major version that ZoneMinder depends on, you need to recompile ZoneMinder. ๐
Zoneminder doesnโt start automatically on boot ๐ด
Check the list for log entries like โzmfix[766]: ERR [Canโt connect to server: Canโt connect to local MySQL server through socket โ/var/run/mysqld/mysqld.sockโ (2)] โ. What can happen is that zoneminder is started too quickly after MySQL/MariaDB and tries to contact the database server before itโs ready. Zoneminder gets no answer and aborts. August 2010 - Ubuntu upgrades seem to be leaving several systems in this state. One way around this is to add a delay to the zoneminder startup script allowing MySQL/MariaDB to finish starting. โSimply adding sleep 15 in the line above zmfix -a in the /etc/init.d/zoneminder file fixed my ZoneMinder startup problems!โ - credit to Pada. โณ
Remote Path setup for Panasonic and other Camera ๐ท
On adding or editing the source you can select the preset link for the parameters for the specified camera. In version 1.23.3 presets for BTTV, Axis, Panasonic, GadSpot, VEO, and BlueNet are available. Selecting the presets ZM fills up the required value for the remote path variable. โจ
Why do I get repeated/ mixed/unstable/ blank monitors on bt878-like cards (a.k.a. PICO 2000) ๐ต
Please have a check at Pico2000;
What causes โInvalid JPEG file structure: two SOI markersโ from zmc (1.24.x) ๐จ
Some settings that used to be global only are now per camera. On the Monitor Source tab, if you are using Remote Protocol โHTTPโ and Remote Method โSimpleโ, try changing Remote Method to โRegexpโ. ๐
Miscellaneous ๐
I see ZoneMinder is licensed under the GPL. What does that allow or restrict me in doing with ZoneMinder? โ๏ธ
The ZoneMinder license is described at the end of the documentation and consists of the following section:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
This means that ZoneMinder is licensed under the terms described here <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>. There is a comprehensive FAQ covering the GPL at <https://www.gnu.org/licenses/gpl-faq.html> but in essence you are allowed to redistribute or modify GPL licensed software provided that you release your distribution or modifications freely under the same terms. You are allowed to sell systems based on GPL software. You are not allowed to restrict or reduce the rights of GPL software in your distribution however. Of course if you are just making modifications for your system locally you are not releasing changes so you have no obligations in this case. I recommend reading the GPL FAQ for more in-depth coverage of this issue. ๐
Can I use ZoneMinder as part of my commercial product? ๐ผ
The GPL license allows you to produce systems based on GPL software provided your systems also adhere to that license and any modifications you make are also released under the same terms. The GPL does not permit you to include ZoneMinder in proprietary systems (see <https://www.gnu.org/licenses/gpl-faq.html#GPLInProprietarySystem> for details). If you wish to include ZoneMinder in this kind of system then you will need to license ZoneMinder under different terms. This is sometimes possible and you will need to contact me for further details in these circumstances. ๐
๐ฌ I am having issues with zmNinja and/or Event Notification Server
Okay so real talk: zmNinja and the Event Notification Server are 3rd party solutions, bestie. Not ours. The developer keeps exhaustive documentation and FAQs over at https://zmninja.readthedocs.io/en/latest/. Please, please direct your questions there ๐
๐ซถ CONTRIBUTING
Source is hosted at GitHub: https://github.com/ZoneMinder/ZoneMinder/
Report issues / questions / feature requests on GitHub Issues: https://github.com/ZoneMinder/ZoneMinder/issues
Pull requests are very welcome! Like, genuinely. If you'd like to contribute, here's the whole vibe, step by step:
- Fork the repo ๐ด
- Open an issue at our GitHub Issues Tracker:
https://github.com/ZoneMinder/ZoneMinder/issues. Describe the bug that you've found, or the feature which you're asking for. Jot down the issue number (e.g.456) - Create your feature branch (
git checkout -b 456-my-new-feature) - Commit your changes (
git commit -m 'Added some feature'). It is preferred that you 'commit early and often' instead of bunching all changes into a single commit. iykyk - Push your branch to your fork on github (
git push origin 456-my-new-feature) - Create new Pull Request
- The team will then review, discuss and hopefully merge your changes. manifesting it for you โจ
Welcome to ZoneMinder's documentation ๐ Please navigate to one of the links below.
If you are facing issues that are not covered in the documentation, please feel free to check the ZoneMinder Forums at https://forums.zoneminder.com/viewforum.php?f=26 โ or join the ZoneMinder-Chat Slack channel at https://join.slack.com/t/zoneminder-chat/shared_invite/enQtNTU0NDkxMDM5NDQwLTdhZmQ5Y2M2NWQyN2JkYTBiN2ZkMzIzZGQ0MDliMTRmM2FjZWRlYzUwYTQ2MjMwMTVjMzQ1NjYxOTdmMjE2MTE if you prefer real time interaction ๐ฆ
- User Guide
<>โ guide to setting up ZoneMinder for the first time, plus detailed guides for using the ZoneMinder front end. ๐ - API
<>โ information on using the CakePHP based API for interfacing to ZoneMinder. - FAQ
<>โ Frequently Asked Questions. - Contributing
<>โ how to contribute to ZoneMinder. As a community project we always need help, and no, you don't need to be a coder to test or update documentation. iconic behavior honestly ๐ - Event Notification Server and Machine Learning hooks
https://zmeventnotification.readthedocs.io/en/latest/index.htmlโ documentation for the 3rd party Event Notification Server and Machine Learning for Object/People/Face detection. ๐ฅ - Index
<>๐ - Module Index
<>๐ - Search Page
<>๐
๐ธ Author
https://github.com/ZoneMinder/ZoneMinder/graphs/contributors
๐ Copyright
2014, https://github.com/ZoneMinder/ZoneMinder/graphs/contributors
And that's the whole page, bestie โ every last crumb of it ๐ซถ This is ZONEMINDER(1), dated Feb 01, 2026, and you just read the entire thing like a main character. Go set up some cameras, go fork the repo, go be the contributor the changelog deserves ๐โจ๐ฆ
๐ฆ where this page comes from
- ubuntu resolute: zoneminder 1.36.37+dfsg1-1 ยท GPL-2.0-or-later
- ubuntu stonking: zoneminder 1.36.37+dfsg1-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms