Merge branch '1013-document-migration' of https://github.com/pliablepixels/ZoneMinder into pliablepixels-1013-document-migration
Conflicts: docs/userguide/filterevents.rst
|
@ -0,0 +1,13 @@
|
|||
@import url("default.css");
|
||||
|
||||
div.admonition-note {
|
||||
border-top: 2px solid red;
|
||||
border-bottom: 2px solid red;
|
||||
border-left: 2px solid red;
|
||||
border-right: 2px solid red;
|
||||
background-color: #ff6347
|
||||
}
|
||||
|
||||
img {
|
||||
border: 1px solid black !important;
|
||||
}
|
35
docs/api.rst
|
@ -1,5 +1,5 @@
|
|||
API
|
||||
^^^
|
||||
====
|
||||
|
||||
This document will provide an overview of ZoneMinder's API. This is work in progress.
|
||||
|
||||
|
@ -13,10 +13,24 @@ 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.
|
||||
|
||||
Examples
|
||||
^^^^^^^^
|
||||
Security
|
||||
^^^^^^^^^
|
||||
The APIs tie into ZoneMinder's existing security model. This means if you have
|
||||
OPT_AUTH enabled, you need to log into ZoneMinder using the same browser you plan to
|
||||
use the APIs from. If you are developing an app that relies on the API, you need
|
||||
to do a POST login from the app into ZoneMinder before you can access the API.
|
||||
|
||||
Here be a list of examples. Some results may be truncated.
|
||||
This means if you plan to use cuRL to experiment with these APIs, you first need to do
|
||||
|
||||
::
|
||||
|
||||
curl -d "username=XXXX&password=YYYY&action=login&view=console" http://yourzmip/zm/index.php -c cookies.txt
|
||||
|
||||
replacing *XXXX* and *YYYY* with your username and password, respectively.
|
||||
Then for each of the examples below, add a ``-c cookies.txt`` at the end of the requests.
|
||||
|
||||
Examples (please read security notice above)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You will see each URL ending in either ``.xml`` or ``.json``. This is the
|
||||
format of the request, and it determines the format that any data returned to
|
||||
|
@ -27,8 +41,10 @@ you will be in. I like json, however you can use xml if you'd like.
|
|||
API Version
|
||||
^^^^^^^^^^^
|
||||
To retrieve the API version:
|
||||
|
||||
::
|
||||
http://server/zm/api/host/getVersion.json
|
||||
|
||||
curl http://server/zm/api/host/getVersion.json
|
||||
|
||||
|
||||
Return a list of all monitors
|
||||
|
@ -36,20 +52,21 @@ Return a list of all monitors
|
|||
|
||||
::
|
||||
|
||||
curl -XGET http://server/zm/api/monitors.json
|
||||
curl http://server/zm/api/monitors.json
|
||||
|
||||
Retrieve monitor 1
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
::
|
||||
|
||||
curl -XGET http://server/zm/api/monitors/1.json
|
||||
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]:true"
|
||||
|
@ -98,7 +115,7 @@ Return a list of all events
|
|||
|
||||
::
|
||||
|
||||
curl -XGET http://server/zm/api/events.json
|
||||
http://server/zm/api/events.json
|
||||
|
||||
|
||||
Note that events list can be quite large and this API (as with all other APIs in ZM)
|
||||
|
|
|
@ -130,6 +130,7 @@ html_theme_options = {
|
|||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_style='zmstyles.css'
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
Contributing
|
||||
============
|
||||
Source hosted at `GitHub <https://github.com/ZoneMinder/ZoneMinder/>`__
|
||||
Report issues/questions/feature requests on `GitHub Issues <https://github.com/ZoneMinder/ZoneMinder/issues>`__
|
||||
|
||||
1. Check for `open issues <https://github.com/ZoneMinder/ZoneMinder/issues/>`_ or open a fresh issue to start a discussion around a feature idea or a bug.
|
||||
2. Fork the ZoneMinder repository on Github to start making your changes.
|
||||
3. Send a pull request and bug the maintainer until it gets merged and published. Stop by the #zoneminder channel on irc.freenode.net.
|
||||
Pull requests are very welcome! If you would like to contribute, please follow the following steps.
|
||||
|
||||
* 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.
|
||||
* 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.
|
||||
|
|
763
docs/faq.rst
|
@ -1,60 +1,743 @@
|
|||
FAQ
|
||||
===
|
||||
=====
|
||||
|
||||
This is the FAQ page. Feel free to contribute any FAQs that you think are missing.
|
||||
This is the FAQ page. Feel free to contribute any FAQs that you think are missing.
|
||||
|
||||
Why can't I view all of my monitors in Montage view?
|
||||
----------------------------------------------------
|
||||
|
||||
1. You will most likely need to increase `mysql_max_connections` in my.cnf.
|
||||
2. If using Firefox, you may need to increase `network.http.max-persistent-connections-per-server` in `about:config`.
|
||||
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, choose one of the event counts from the console page, for instance events in the last hour, for one of your monitors. **Note** that this filter is automatically enabled if you do a frresh 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 any of your Events of any of your monitors.
|
||||
This will bring up an event listing and a filter window.
|
||||
|
||||
In the filter window there is a drop down select box labeled 'Use Filter', that lets your 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).
|
||||
|
||||
Then click on 'Save' which will bring up a new window. Make sure the 'Automatically delete' box is checked and press save to save your filter. This will then run in the background to keep your disk within those limits.
|
||||
|
||||
After you've done that, you changes will automatically be loaded into zmfilter within a few minutes.
|
||||
|
||||
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 "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 3. 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.
|
||||
|
||||
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 your are trying to do a lot of events at once. It is recommended that you 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.
|
||||
|
||||
|
||||
|
||||
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 recommended 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 not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.
|
||||
|
||||
|
||||
|
||||
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 Memory = 1.2 * ((image-width*image-height*image buffer size*target color space*number of cameras/8/1024/1024 )
|
||||
|
||||
Where:
|
||||
* image-width and image-height are 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 monitor
|
||||
* image buffer size is 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 monitor
|
||||
* target color space is the color depth - 8bit, 24bit or 32bit. It's again in the source tab of each monitor
|
||||
The 1.2 at the start is basically adding 20% on top of the calculation to account for image/stream overheads (this is an estimate)
|
||||
|
||||
So let's do the math. If we have 4 cameras running at 1280x960 with 32bit color space and one camera running at 640x480 with 8bit greyscale color space, the system would require:
|
||||
|
||||
``1.2 * ((1280*960*50*32*4/8/1024/1024 ) + (640 *480 *50*8/8 /1024/1024))``
|
||||
|
||||
Or, around 900MB 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
|
||||
|
||||
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.
|
||||
|
||||
|
||||
(**Note**: Mapped memory is applicable when you install ZoneMinder with mapped memory support, which is the default mode. If you have specifically disabled mapped memory then please see the next FAQ enty on how to increase shared memory)
|
||||
|
||||
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
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/sda1 226G 96G 119G 45% /
|
||||
none 4.0K 0 4.0K 0% /sys/fs/cgroup
|
||||
udev 1.8G 4.0K 1.8G 1% /dev
|
||||
tmpfs 371M 816K 370M 1% /run
|
||||
none 5.0M 0 5.0M 0% /run/lock
|
||||
tmpfs 2.6G 923M 1.7G 36% /run/shm
|
||||
none 100M 0 100M 0% /run/user
|
||||
|
||||
|
||||
The key item here is tmpfs --> the example above shows we have allocated 1.7G of mapped memory space of which 36% is used which is a healthy number. If you are seeing this to go beyond 70% you should probaby increase mapped memory
|
||||
|
||||
|
||||
If you want to increase this limit to 70% of your memory, add the following to ``/etc/fstab``
|
||||
``tmpfs /run/shm tmpfs defaults,noexec,nosuid,size=70% 0 0``
|
||||
|
||||
|
||||
What does a 'Can't shmget: Invalid argument' error in my logs mean? (and my camera does not display at higher resolutions)
|
||||
--------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
(*Note*: This is applicable for systems that have mapped memory disabled in ZoneMinder. By default, Mapped memory is enabled and unless you have disabled it manually, please refer to the "Math for Memory" question above and how to increase mapped memory limits)
|
||||
|
||||
This error is discussed in the README in the following excerpt:-
|
||||
''...this is caused by an attempt to allocate an amount of shared memory greater than your system can handle. The size it requests is based on the following formula, ``ring buffer size x image width x image height x 3 (for 24 bit images) + a bit of overhead``.
|
||||
|
||||
So, for example:
|
||||
|
||||
::
|
||||
|
||||
384x288 capture resolution, that makes: 110 592 pixels
|
||||
in 24 bit color that's x24 = 2 654 208 bits per frame
|
||||
by 80 frames ring buffer x80 = 212 336 640 bits per camera
|
||||
by 4 cameras x4 = 849 346 560 bits.
|
||||
Plus 10% overhead = 934 281 216 bits
|
||||
That's 116 785 152 bytes, and
|
||||
= 114 048 kB, respectively 111.38 MB.
|
||||
If my shared memory is set to 134 217 728, which is exactly 128MB,
|
||||
that means I shouldn't have any problem.
|
||||
(Note that 1 byte = 8 bits and 1kbyte = 1024bytes, 1MB = 1024 kB)
|
||||
|
||||
If for instance you were using 24bit 640x480 then this would come to about 92Mb if you are using the default buffer size of 100. If this is too large then you can either reduce the image or buffer sizes or increase the maximum amount of shared memory available. If you are using RedHat then you can get details on how to change these settings `here <http://www.redhat.com/docs/manuals/database/RHDB-2.1-Manual/admin_user/kernel-resources.html>`__
|
||||
|
||||
You should be able to use a similar procedure with other distributions to modify the shared memory pool without kernel recompilations though in some cases this may be necessary. Note, this error also sometimes occurs if you have an old shared memory segment lying around from a previous run that is too small. Use the ipcs and ipcrm system commands to check and remove it if necessary.'"
|
||||
|
||||
You can often find out how many 4KB shared memory pages are available by typing the following :-
|
||||
|
||||
::
|
||||
|
||||
# cat /proc/sys/kernel/shmall
|
||||
2097152
|
||||
|
||||
In recent kernels the shmall is set to 2097152 memory pages multiplied by 4096 bytes per page for a total of 8 GB of shared memory available. You only need to increase the shmall value if you have a computer with more than 8GB of memory and wish to use more of it for shared memory usage, such as large databases.
|
||||
|
||||
The most shared memory bytes you can allocate in one go :-
|
||||
|
||||
::
|
||||
|
||||
# cat /proc/sys/kernel/shmmax
|
||||
33554432
|
||||
|
||||
In recent kernels the shmmax is set to 33554432 bytes for only 32 MB of maximum shared memory allocatable at a time, hardly enough for ZoneMinder to go above 320 x 240 x 24-bit resolution at 40 frames in the buffer if it is using the /dev/shm shared memory device, so this value needs to be increased. If you are using ZoneMinder with the memory mapped (mmap) compile time option then this doesn't affect you.
|
||||
|
||||
To change the value to 128 MB temporarily during this kernel execution type (for example) :-
|
||||
``echo 536870912 >/proc/sys/kernel/shmmax``
|
||||
|
||||
*Be sure to restart ZoneMinder after this.*
|
||||
|
||||
However be aware that sometimes you will only need to change the shmmax value as shmall is often large enough. Also changing these values in this way is only effective until your machine is rebooted.
|
||||
|
||||
To change them permanently you will need to edit ``/etc/sysctl.conf`` and add the following lines (for example) :-
|
||||
``kernel.shmmax = 536870912``
|
||||
|
||||
Or if your distribution has the ``/etc/sysctl.d/`` folder you can create a file in this folder without modifying the ``/etc/sysctl.d`` so you won't lose the changes during distro upgrades :-
|
||||
```echo kernel.shmmax = 536870912 >/etc/sysctl.d/60-kernel-shm.conf```
|
||||
|
||||
To load these settings in the sysctl.conf file type:
|
||||
``sysctl -p``
|
||||
|
||||
To check your shared memory settings type:
|
||||
``ipcs -l``
|
||||
|
||||
Note that with Megapixel cameras like the Axis 207mw becoming cheaper and more attractive, the above memory settings are not adequate. To get Zoneminder working with a full 1280x1024 resolution camera in full color, increase ``134217728`` (128 MB) to, for example, ``268435456`` (256 MB) and multiple this value by each camera.
|
||||
|
||||
These changes will now also be set the next time your machine is restarted.
|
||||
|
||||
Versions 1.24.x of ZoneMinder also allows you to use an alternate method of shared memory allocation, `Mmap mapped memory <http://en.wikipedia.org/wiki/Mmap>`__ . This requires less configuration and can be simpler to use. Mapped memory allows you to use a special type of file as the placeholder for your memory and this file is 'mapped' into memory space for easy and fast access.
|
||||
|
||||
To enable mapped memory in ZoneMinder you need add add the --enable--mmap=yes switch to your configure line. By default mapped memory files are created in /dev/shm which on most distributions is a dedicated pseudo-partition containing memory formatted as a filesystem. If your system uses a different path then this can be changed in ZoneMinder in Options->paths->PATH_MAP. It uses a filesystem type called `tmpfs <http://en.wikipedia.org/wiki/Tmpfs>`__. If you type ``df -h`` you should see this area and the size of memory it currently allows. To increase size for tmpfs you need to edit /etc/default/tmpfs. Search for:
|
||||
``SHM_SIZE=128M``
|
||||
and change to something like
|
||||
``SHM_SIZE=1G``
|
||||
then reboot the system. You could possibly need to change RUN_SIZE, too.
|
||||
|
||||
It is important that you do not use a disk based filesystem for your memory mapped files as this will cause memory access to be extremely slow. ZoneMinder creates files called .zm.mmap.<monitor id> in the mapped memory filesystem.
|
||||
|
||||
Mapped memory is subject to the same limitations in terms of total memory as using more traditional shared memory but does not require any configuration per allocation or chunk. In future versions of ZoneMinder this will be the default shared memory storage method.
|
||||
|
||||
Another good article about shared memory settings can be found `here <http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.uprun.doc/doc/t0008238.htm>`__ .
|
||||
|
||||
The essential difference was that the kernel.shmall setting is NOT in a direct memory setting in KB but in pages of memory. it is Max Pages of memory
|
||||
|
||||
*For example:* If you want to allocate a maximum memory setting to 8GB you have to convert it to the number of pages (or segments).
|
||||
with a page size of 4096.
|
||||
kernel.shmall = 8000x1024x1024/4096
|
||||
``kernel.shmall = 2097152``
|
||||
NOT 8388608000 as would be suggested in the RedHat article linked above.
|
||||
|
||||
shmmax is the max amount to allocate in one request -
|
||||
this is is an actual memory size (as opposed to pages) set to 4GB
|
||||
``kernel.shmmax = 4294967296``
|
||||
|
||||
The ``/etc/sysctl.conf`` would have these lines
|
||||
|
||||
::
|
||||
|
||||
kernel.shmall = 2097152
|
||||
kernel.shmmax = 4294967296</pre>
|
||||
|
||||
As above, reload your sysctl.conf with ``sysctl -p`` and check that the settings are correct with ``ipcs -l``.
|
||||
|
||||
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 create the initial zones you can choose from a number of preset values for sensitivity etc. Whilst these are usually a good starting point they are not always suitable for all situations and you will probably need to tweak the values for your specific circumstances. The meanings of the various settings are described in the documentation (`here <http://www.zoneminder.com/wiki/index.php/Documentation#Defining_Zones>`__) however if you believe you have sensible settings configured then there are two diagnostic approaches you can use.
|
||||
|
||||
Another user contributed illustrated Zone definition guide can be found here: `An illustrated guide to Zones <http://www.zoneminder.com/wiki/index.php/Understanding_ZoneMinder%27s_Zoning_system_for_Dummies>`__
|
||||
|
||||
Event Statistics
|
||||
^^^^^^^^^^^^^^^^^
|
||||
The first technique is to use event statistics. Firstly you should ensure they are switched on in Options->Logging->RECORD_EVENT_STATS. This will then cause the raw motion detection statistics for any subsequently generated events to be written to the DB. These can then be accessed 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 give you an idea of what 'real world' values are being generated.
|
||||
|
||||
Note that if you are investigating why events 'do not' happen then these will not be saved and so 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 to adjust back to 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 are happy you can switch them off again. However it is perfectly feasible to keep them permanently on if your system is able to cope which will allow you to review your setting periodically.
|
||||
|
||||
Diagnostic Images
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
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.
|
||||
|
||||
There are two kinds of diagnostic images which are and 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 are 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 identicial 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 aggrageted 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 are 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. This 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 is necessary to slow down capture even further as 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. This requires no capture or processing unless you do an explicit capture via the J or ctrl-J keys for instance. Some cards or drivers do not support the frame grabber interface at all so 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
|
||||
|
||||
1) You are using Internet Explorer and are trying to view multi-part jpeg streams. IE does not support these streams directly, unlike most other browsers. You will need to install Cambozola or another multi-part jpeg aware pluging to view them. To do this you will need to obtain the applet from the Downloads page and install the cambozola.jar file in the same directly as the ZoneMinder php files. Then find the ZoneMinder Options->Images page and enable ZM_OPT_CAMBOZOLA and enter the web path to the .jar file in ZM_PATH_CAMBOZOLA. This will ordinarily just be cambozola.jar. Provided (Options / B/W tabs) WEB_H_CAN_STREAM is set to auto and WEB_H_STREAM_METHOD is set to jpeg then 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 to chmod (''-rwxrwxr-x'') your (''usr/share/zoneminder/'') cambozola.jar:
|
||||
|
||||
::
|
||||
|
||||
sudo chmod 775 cambozola.jar
|
||||
|
||||
Once I did this, images started to stream for me.
|
||||
|
||||
2) The other common cause for being unable to view streams is that you have installed the ZoneMinder cgi binaries (zms and nph-zms) in a different directory than your web server is expecting. Make sure that the --with-cgidir option you use to the ZoneMinder configure script is the same as the CGI directory configure for your web server. If you are using Apache, which is the most common one, then in your httpd.conf file there should be a line like ``ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"`` where the last directory in the quotes is the one you have 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 will need to restart apache for the changes to take effect. If you still cannot see stream reliably then try changing Options->Paths->ZM_PATH_ZMS to just use zms if nph-zms is specified, or vice versa. Also check in your apache error logs.
|
||||
|
||||
I have several monitors configured but when I load the Montage view in FireFox why can I only see two? or, Why don't all my cameras display when I use the Montage view in FireFox?
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
By default FireFox only supports a small number of simultaneous connections. Using the montage view usually requires one persistent connection for each camera plus intermittent connections for other information such as statuses.
|
||||
|
||||
You will need to increase the number of allowed connections to use the montage view with more than a small number of cameras. Certain FireFox extensions such as FasterFox may also help to achieve the same result.
|
||||
|
||||
To resolve this situation, follow the instructions below:
|
||||
|
||||
Enter ``about:config`` in the address bar
|
||||
|
||||
scroll down to
|
||||
``browser.cache.check_doc_frequency 3``
|
||||
change the 3 to a 1
|
||||
|
||||
::
|
||||
|
||||
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
|
||||
|
||||
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 performace 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 if RGB24 or greyscale is quicker. Put your monitors into 'Monitor' mode so that only the capture daemons are running and monitor the process load of these (the 'zmc' processes) using top. Try it with various palettes to see if it makes a difference.
|
||||
* Big image sizes. A image of 640x480 requires at least four times the processing of a 320x240 image. 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 over 320 (NTSC) or 352 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 25fps when 5-10fps would 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 minimumzone thresholds are set to sensible values and experiment by switching RECORD_EVENT_STATS on 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_STATS will prevent the statistics being written to the database which saves some time. Other settings which might make a difference are ZM_FAST_RGB_DIFFS, ZM_OPT_FRAME_SERVER and the JPEG_xxx_QUALITY ones.
|
||||
|
||||
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 excel sheet <http://www.jpwilson.eu/ZM_Utils/ZM%20storage%20calc%20sheet.xls>`__ or `this online excel sheet <https://docs.google.com/spreadsheets/d/1G2Er8fZ_lWQv9QV8qf9yGCMkiUG03a-UwgLLxzCL0OY/edit#gid=49279749>`__ (both are user contributed excel sheets)
|
||||
|
||||
Or go to `this link <http://www.axis.com/products/video/design_tool/index.html>`__ 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 (`link <http://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 performaing 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.
|
||||
|
||||
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. 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'.
|
||||
|
||||
You may also consider to use the web server security, for example, htaccess files under Apache, or mod_auth.
|
||||
To Manage Users:
|
||||
In main console, go to Options->Users.
|
||||
|
||||
1. In the console, click on Options.
|
||||
2. Check the box next to "ZM_OPT_USE_AUTH".
|
||||
3. Click Save
|
||||
4. You will immediately be asked to login. The username is 'admin' and the password is 'admin'.
|
||||
You may also consider to use the web server security, for example, htaccess files under Apache scope; You may even use this as an additional/redundant security on top of Zoneminders built-in security features;
|
||||
|
||||
To Manage Users
|
||||
---------------
|
||||
Why does ZM stop recording once I have 32000 events for my monitor?
|
||||
------------------------------------------------------------------------
|
||||
Storing more than 32k files in a single folder is a limitation of some filesystems. To avoid this, enable USE_DEEP_STORAGE under Options.
|
||||
|
||||
1. In main console, go to Options->Users.
|
||||
USE_DEEP_STORAGE is now the default for new ZoneMinder systems so this limitation should only apply to users upgrading from a previous version of ZoneMinder.
|
||||
|
||||
The "Zones" view for a Monitor is blank (I can't see / setup a Zone)
|
||||
--------------------------------------------------------------------
|
||||
Versions of ZM from 1.23.0 onwards allow you to have a deeper filesystem with fewer files per individual directory. As well as not being susceptible to the 32k limit, this is also somewhat faster.
|
||||
|
||||
Snapshots and Zones images are stored in the `images` directory in your webroot.
|
||||
Ensure that the `images` directory is writable by the user which ZoneMinder is
|
||||
running as. If the `images` directory is a symlink, ensure that your web server
|
||||
has access to that directory as well.
|
||||
If you have upgraded from a previous version of ZoneMinder and this option is not already enabled, it is very important to follow the steps below to enable it on an existing system. Failure to properly follow these steps **WILL RESULT IN LOSS OF YOUR DATA!**
|
||||
|
||||
How do the 3 AlarmCheckMethods interact?
|
||||
----------------------------------------
|
||||
::
|
||||
|
||||
In example, if I set the alarm % to 5-10% and the filtered and blob to 1-100%, what happens?
|
||||
# Stop ZoneMinder
|
||||
# Backup your event data and the dB if you have the available storage
|
||||
# Enable USE_DEEP_STORAGE under Options.
|
||||
# From the command line, run "sudo zmupdate.pl --migrate-events"
|
||||
# Monitor the output for any events that fail to convert.
|
||||
# After the conversion completes, you can restart ZoneMinder
|
||||
|
||||
1. If any of the min/max values is 0, the check that the value is applied to is skipped.
|
||||
2. If you have a min-alarmed area and you're below that, then it quits.
|
||||
3. If you have a max-alarmed area and you're above that, then it quits.
|
||||
4. If you're on filtered or blobs
|
||||
Note that you can re-run the migrate-events command if any error messages scroll off the screen.
|
||||
|
||||
1. and have a min filtered area that you're below then it quits
|
||||
2. and have a max filtered area that you're above then it quits
|
||||
You can read about the lack of a limit in the number of sub-directories in the ext4 filesystem at: `this link <http://kernelnewbies.org/Ext4>`__
|
||||
and see what tools may assist in your use of this filesystem `here <http://ext4.wiki.kernel.org/index.php/Ext4_Howto>`__
|
||||
If you search for ext3 or reiserfs on the forums you will find various threads on this issue with guidance on
|
||||
how to convert.
|
||||
|
||||
5. If you're on blobs
|
||||
Managing system load (with IP Cameras in mind)
|
||||
----------------------------------------------------
|
||||
|
||||
1. any blob smaller than the min blob area (if set) is discarded
|
||||
2. any blob larger than the max blob area (if set) is discarded
|
||||
3. If there are less remaining blobs than the minimum-blobs, then it quits.
|
||||
4. If there are more remaining blobs than the maximum-blobs, then it quits.
|
||||
Introduction
|
||||
^^^^^^^^^^^^^^^
|
||||
Zoneminder is a superb application in every way, but it does a job that needs a lot of horsepower especially when using multiple IP cameras. IP Cams require an extra level of processing to analogue cards as the jpg or mjpeg images need to be decoded before analysing. This needs grunt. If you have lots of cameras, you need lots of grunt.
|
||||
|
||||
Why do ZM need so much grunt?
|
||||
Think what Zoneminder is actually doing. In modect mode ZM is:
|
||||
1. Fetching a jpeg from the camera. (Either in single part or multipart stream)
|
||||
2. Decoding the jpeg image.
|
||||
3. Comparing the zoned selections to the previous image or images and applying rules.
|
||||
4. If in alarm state, writing that image to the disk and updating the mysql database.
|
||||
|
||||
If you're capturing at five frames per second, the above is repeated five times every second, multiplied by the number of cameras. Decoding the images is what takes the real power from the processor and this is 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). 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, 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 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" - which 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 that 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 - such as 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 <http://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. 320x240 is 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-5 fps 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 <http://www.zoneminder.com/wiki/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 that 'locate' works 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 the "nice" command to reduce their priority. (crontab and /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, htop is 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. htop will 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 -O2 will help.
|
||||
|
||||
::
|
||||
|
||||
./configure CFLAGS="-g -O3 -march=athlon-xp -mtune=athlon-xp" CXXFLAGS="-g -O3 -march=athlon-xp -mtune=athlon-xp"
|
||||
|
||||
The above command is optimised for an Athlon XP cpu so you will need to use the specific processor tag for your cpu, also the compiler optimisation has been increased to -O3.
|
||||
|
||||
You also need to put in your normal ./configure commands as if you were compiling with out this optimisation.
|
||||
|
||||
A further note is that the compile must be performed on the system that Zoneminder will be running on as this optimisation will make it hardware specific code.
|
||||
|
||||
Processor specific commands can be found in the GCC manual along with some more options that may increase performanc.
|
||||
`<http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options>`__
|
||||
|
||||
The below command has been used to compile Zoneminder on a Athlon XP system running CentOS 5.5 and along with the libjpeg-turbo modification to reduce the CPU load in half, libjpeg-turbo reduced the load by 1/3 before the processor optimisation.
|
||||
::
|
||||
|
||||
./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin CFLAGS="-g -O3 -march=athlon-xp -mtune=athlon-xp" CXXFLAGS="-D__STDC_CONSTANT_MACROS -g -O3 -march=athlon-xp -mtune=athlon-xp" --enable-mmap --sysconfdir=/etc/zm
|
||||
|
||||
The following command has been used to compile Zoneminder 1.25 on a CentOS 6.0 system, the native command should choose the processor automatically during compile time, this needs to be performed on the actual system!!.
|
||||
|
||||
::
|
||||
|
||||
CFLAGS="-g -O3 -march=native -mtune=native" CXXFLAGS="-D__STDC_CONSTANT_MACROS -g -O3 -march=native -mtune=native" ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=your_zm_user ZM_DB_PASS=your_zm_password ZM_SSL_LIB=openssl
|
||||
|
||||
|
||||
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 on the Zoneminder wiki here: http://www.zoneminder.com/wiki/index.php/FAQ#How_much_Hard_Disk_Space_.2F_Bandwidth_do_I_need_for_ZM.3F
|
||||
|
||||
|
||||
Building ZoneMinder
|
||||
--------------------
|
||||
|
||||
When running configure I am getting a lot of messages about not being able to compile the ffmpeg libraries
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you see output from configure that looks like this
|
||||
|
||||
::
|
||||
|
||||
checking libavcodec/avcodec.h usability... no
|
||||
checking libavcodec/avcodec.h presence... yes
|
||||
configure: WARNING: libavcodec/avcodec.h: present but cannot be compiled
|
||||
configure: WARNING: libavcodec/avcodec.h: check for missing
|
||||
prerequisite headers?
|
||||
configure: WARNING: libavcodec/avcodec.h: see the Autoconf documentation
|
||||
configure: WARNING: libavcodec/avcodec.h: section "Present But
|
||||
Cannot Be Compiled"
|
||||
configure: WARNING: libavcodec/avcodec.h: proceeding with the compiler's
|
||||
result
|
||||
configure: WARNING: ## ------------------------------------- ##
|
||||
configure: WARNING: ## Report this to support@zoneminder.com ##
|
||||
configure: WARNING: ## ------------------------------------- ##</pre>
|
||||
|
||||
then it is caused not by the ZoneMinder build system but ffmpeg itself. However there is a workaround you can use which is to add ``CPPFLAGS=-D__STDC_CONSTANT_MACROS``
|
||||
|
||||
to the ZoneMinder ``./configure`` command which should solve the issue. However this is not a proper 'fix' as such, which can only come from the ffmpeg project itself.
|
||||
|
||||
I cannot build ZoneMinder and am getting lots of undefined C++ template errors
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
This is almost certainly due to the 'ccache' package which attempts to speed up compilation by caching compiled objects. Unfortunately one of the side effects is that it breaks the GNU g++ template resolution method that ZoneMinder uses in building by prevent files getting recompiled. The simplest way around this is to remove the ccache package using your distros package manager.
|
||||
|
||||
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 <http://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``, ``perldoc ZoneMinder::SharedMem`` etc.
|
||||
Below is an example script that checks all monitors for alarms and when one occurs, prints a message to the screen. You can add in your own code to make this reaction a little more useful.
|
||||
|
||||
::
|
||||
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
use ZoneMinder;
|
||||
|
||||
$| = 1;
|
||||
|
||||
zmDbgInit( "myscript", level=>0, to_log=>0, to_syslog=>0, to_term=>1 );
|
||||
|
||||
my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );
|
||||
|
||||
my $sql = "select M.*, max(E.Id) as LastEventId from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Function != 'None' group by (M.Id)";
|
||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
|
||||
my $res = $sth->execute() or die( "Can't execute '$sql': ".$sth->errstr() );
|
||||
my @monitors;
|
||||
while ( my $monitor = $sth->fetchrow_hashref() )
|
||||
{
|
||||
push( @monitors, $monitor );
|
||||
}
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
foreach my $monitor ( @monitors )
|
||||
{
|
||||
next if ( !zmMemVerify( $monitor ) );
|
||||
|
||||
if ( my $last_event_id = zmHasAlarmed( $monitor, $monitor->{LastEventId} ) )
|
||||
{
|
||||
$monitor->{LastEventId} = $last_event_id;
|
||||
print( "Monitor ".$monitor->{Name}." has alarmed\n" );
|
||||
#
|
||||
# Do your stuff here
|
||||
#
|
||||
}
|
||||
}
|
||||
sleep( 1 );
|
||||
}
|
||||
|
||||
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 ``/tmp`` directory.
|
||||
|
||||
The ZoneMinder logs for the RPM packages are located in ``/var/log/zm``.
|
||||
|
||||
Depending on your problem errors can show up in any of these logs but, usually the logs of interest are ``zmdc.log`` and ``zmpkg.log`` if ZM is not able to start.
|
||||
|
||||
Now since ZM is dependent on other components to work, you might not find errors in ZM but in the other components.
|
||||
|
||||
::
|
||||
|
||||
*/var/log/messages and/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].
|
||||
|
||||
|
||||
More verbose logging for the ZoneMinder binaries is available by enabling the debug option from the control panel and will be placed in the path you have configured for the debug logs. Output can be limited to a specific binary as described in the Debug options page under the "?" marks.
|
||||
|
||||
How can I trouble shoot the hardware and/or software?
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Here are some commands to get information about your hardware. Some commands are distribution dependent.
|
||||
* ``[[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 is HW conflict (comand provided by the pciutils package).
|
||||
* ``[[scanpci]] -v`` -- Gives you information from your hardware EPROM
|
||||
* ``[[lsusb]] -vv`` -- Returns lots of detail about USB devices (camand provided by usbutils package).
|
||||
* ``[[dmesg]]`` -- Shows you how your hardware initialized (or didn't) on boot-up. You will get the most use of this.
|
||||
* ``[[v4l-info]]`` -- to see how driver is talking to card. look for unusual values.
|
||||
* ``[[modinfo bttv]]`` -- some bttv driver 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 acccess.
|
||||
* ``[[ipcrm]] `` -- The ipcrm command can be used to remove an IPC object from the kernel.
|
||||
* ``cat /proc/interrupts`` -- This will dispaly 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 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 and similar ones:
|
||||
http://www.zoneminder.com/forums/viewtopic.php?p=48754#48754
|
||||
|
||||
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: http://www.zoneminder.com/forums/viewtopic.php?f=30&t=21344
|
||||
|
||||
This may occur if you have a NTSC analog camera but have configured the source in ZoneMinder as PAL for the Device Format under the source tab. You may also be mislead 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 it's technical specifications, possibly found with the packaging it came in, on the manufacturers 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 connecters. 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.
|
||||
|
||||
I am getting messages about a backtrace in my logs, what do I do?
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
If you are seeing entries in your log like the following
|
||||
|
||||
::
|
||||
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6 [0x3347230210]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6(memset+0xce) [0x334727684e]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x40ee9a]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x419946]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma [0x4213cf]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma(cos+0x35c) [0x404674]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /lib64/libc.so.6(__libc_start_main+0xf4) [0x334721da44]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: ERR [Backtrace: /usr/local/bin/zma(cos+0xd1) [0x4043e9]]
|
||||
Jan 11 20:25:22 localhost zma_m2[19051]: INF [Backtrace complete]</pre>
|
||||
|
||||
then you can help diagnose the problem by running a special command to translate the hex addresses into helpful information. This command is called addr2line and you can type 'man addr2line' for more information.
|
||||
Basically addr2line takes two sets of parameters, the first is the name of the binary file, and the second is a list of addresses. Both of these pieces of information are displayed in the logs. The filename is the first part after the 'Backtrace:' tag, in this case /usr/local/bin/zma, though it may well be different in your case. Some of the lines refer to libraries rather than the zma executable but those can be ignored for now, the important part is noting which ZM binary is involved. The binary file is passed in following the -e flag. The addresses to pass to addr2line are those contained in the '[]' pairs. Again you can ignore those that are on a line that refers to a library but it will not hurt if you include them.
|
||||
So in the example above, the command would be ``addr2line -e /usr/local/bin/zma 0x40ee9a 0x419946 0x4213cf 0x404674 0x4043e9``
|
||||
This should then dump out a more symbolic list containing source file names and line numbers, and it is this information which will be helpful if posted to the forums. Sometimes addr2line fails to produce useful output. This is usually because either the problem is so severe that it has corrupted the stack and prevented useful information from being displayed, or that you have either compiled ZM without the -g flag for debug, or you have stripped the binaries of symbol information after installation. This this case you would need to rebuild temporarily with debug enabled for the information to be useful.
|
||||
|
||||
|
||||
This error some times happens when a linked camera looses its link or it is corrupted by the user or some other system event, try deleting the affected cameras and recreating them in the Zoneminder console.
|
||||
|
||||
How do I repair the MySQL Database?
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
There is 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 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 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 and 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``
|
||||
|
||||
I upgraded by distribution and ZM stopped working
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Some possibilties (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 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 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 <http://www.gnu.org/copyleft/gpl.html>`__. There is a comprehensive FAQ covering the GPL at http://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 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 http://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.
|
||||
|
||||
If AlarmedPixels is selected, you can only enter min/max pixel threshold and
|
||||
min/max alarmed area. If FilteredPixels is selected, the Blob options are
|
||||
disabled. The Blob check method allows you to specify all options. Filtered
|
||||
adds more checks than alarmed, and blobs adds more checks than filtered. The
|
||||
final 'score' is calculated using final check method.
|
||||
|
|
After Width: | Height: | Size: 67 KiB |
|
@ -1,21 +1,130 @@
|
|||
Ubuntu
|
||||
======
|
||||
|
||||
PPA Install
|
||||
-----------
|
||||
Follow these instructions to install current release version on Ubuntu.:
|
||||
Option A: Install a ready made package
|
||||
---------------------------------------
|
||||
|
||||
Installation procedure (common for all versions of Ubuntu)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
It is important that you first apply any system software upgrades first to Ubuntu, especially if you have just created a new image of Ubuntu.
|
||||
Not doing this may cause the PPA process to fail and complain about various unmet dependencies.
|
||||
|
||||
If you also plan to install the database in the same server (which is typically the case), first do:
|
||||
|
||||
::
|
||||
|
||||
sudo apt-get install mysql-server
|
||||
|
||||
This will ask you for a user and password to configure for Zoneminder.
|
||||
Note that when you install the PPA, it will also create a username of zmuser and a password of zmpass irrespective of what you select at this stage
|
||||
|
||||
Now add the ppa repository path:
|
||||
|
||||
::
|
||||
|
||||
sudo apt-add-repository ppa:iconnor/zoneminder
|
||||
|
||||
Once you have updated the repository then update and install the package.:
|
||||
|
||||
::
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install zoneminder
|
||||
|
||||
|
||||
|
||||
Build Package From Source
|
||||
-------------------------
|
||||
|
||||
Post Install steps for Ubuntu 15.x or newer (systemd)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
sudo /usr/bin/zmupdate.pl
|
||||
sudo systemctl enable zoneminder
|
||||
sudo a2enconf zoneminder
|
||||
sudo service apache2 reload
|
||||
systemctl restart zoneminder
|
||||
|
||||
You should now be able to view the zoneminder interface at ``http://localhost/zm`` (replace localhost with your server IP if you are accessing it remotely)
|
||||
|
||||
.. image:: images/zm_first_screen_post_install.png
|
||||
|
||||
|
||||
|
||||
|
||||
Post install steps for Ubuntu 14.x or older (SystemV)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Suggested changes to MySQL (Optional but recommended)
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
For most of you Zoneminder will run just fine with the default MySQL settings. There are a couple of settings that may, in time, provide beneficial especially if you have a number of cameras and many events with a lot of files. One setting we recommend is the "innodb_file_per_table" This will be a default setting in MySQL 5.6 but should be added in MySQL 5.5 which comes with Ubuntu 14.04. A description can be found here: http://dev.mysql.com/doc/refman/5.5/en/innodb-multiple-tablespaces.html
|
||||
|
||||
To add "innodb_file_per_table" edit the my.cnf file:
|
||||
|
||||
``vi /etc/mysql/my.cnf``
|
||||
Under [mysqld] add
|
||||
``innodb_file_per_table``
|
||||
|
||||
Save and exit.
|
||||
|
||||
Restart MySQL
|
||||
``service mysql restart``
|
||||
|
||||
Adding a sleep for mysql dependency (Ubuntu 14.x and below only)
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
We recommend you add a "sleep" command just after ``start() {`` in ``/etc/init.d/zoneminder`` to make sure mysql starts before ZoneMinder does. To do this,
|
||||
simply modify ``/etc/init.d/zoneminder`` at around line 25 (where you will find the start function) to look like this:
|
||||
|
||||
::
|
||||
|
||||
start() {
|
||||
echo -n "Making sure mysql started... Sleeping for 10 seconds..."
|
||||
sleep 10
|
||||
echo -n "Starting $prog: "
|
||||
|
||||
Making Apache aware of ZoneMinder
|
||||
""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
Next, we need to make sure apache knows about zoneminder's configuration for apache.
|
||||
|
||||
::
|
||||
|
||||
ln -s /etc/zm/apache.conf /etc/apache2/conf-available/zoneminder.conf
|
||||
|
||||
If you are upgrading from an old version:
|
||||
|
||||
::
|
||||
|
||||
sudo /usr/bin/zmupdate.pl
|
||||
|
||||
Then look for ``/etc/apache2/conf-enable/zm.conf`` - if you have it, please remove it
|
||||
|
||||
::
|
||||
|
||||
a2enconf zoneminder
|
||||
adduser www-data video
|
||||
|
||||
|
||||
lets make sure we restart apache:
|
||||
|
||||
::
|
||||
|
||||
service apache2 restart
|
||||
|
||||
|
||||
You should now be able to view the zoneminder interface at ``http://localhost/zm`` (replace localhost with your server IP if you are accessing it remotely)
|
||||
|
||||
.. image:: images/zm_first_screen_post_install.png
|
||||
|
||||
|
||||
Finally, in the zoneminder web interface, go to Options->Paths, change PATH_ZMS to ``/zm/cgi-bin/nph-zms``
|
||||
|
||||
|
||||
Option B: Build Package From Source
|
||||
-------------------------------------------
|
||||
|
||||
A fresh build based on master branch running Ubuntu 1204 LTS. Will likely work for other versions as well.::
|
||||
|
||||
|
|
|
@ -11,11 +11,39 @@ Control Scripts
|
|||
|
||||
It should be emphasised that the control and capability elements of ZoneMinder are not intended to be able to support every camera out of the box. Some degree of development is likely to be required for many cameras.
|
||||
|
||||
Controlling Monitors
|
||||
====================
|
||||
|
||||
If you have defined your system as having controllable monitors and you are looking at a monitor that is configured for control, then clicking on the ‘Control’ link along the top of the window will change the short event listing area to a control area. The capabilities you have defined earlier determine exactly what is displayed in this window. Generally you will have a Pan/Tilt control area along with one or subsidiary areas such as zoom or focus control to the side. If you have preset support then these will be near the bottom of the window. The normal method of controlling the monitor is by clicking on the appropriate graphics which then send a command via the control script to the camera itself. This may sometimes take a noticeable delay before the camera responds.
|
||||
|
||||
It is usually the case that the control arrows are sensitive to where you click on them. If you have a camera that allows different speeds to be used for panning or zooming etc then clicking near the point of the arrow will invoke the faster speed whilst clicking near the base of the arrow will be slower. If you have defined continuous motion then ongoing activities can be stopped by clicking on the area between the arrows, which will either be a graphic in the case of pan/tilt controls or a word in the case of zoom and focus controls etc.
|
||||
|
||||
Certain control capabilities such as mapped motion allow direct control by clicking on the image itself when used in browsers which support streamed images directly. Used in this way you can just click on the area of the image that interests you and the camera will centre on that spot. You can also use direct image control for relative motion when the area of the image you click on defines the direction and the distance away from the centre of the image determines the speed. As it is not always very easy to estimate direction near the centre of the image, the active area does not start until a short distance away from the centre, resulting in a ‘dead’ zone in the middle of the image.
|
||||
|
||||
Control Flow
|
||||
^^^^^^^^^^^^
|
||||
Having a basic understanding of how camera control works in ZoneMinder will go a long way in debugging issues in the future. It is important to note that many of the 'camera control' scripts are user contributed and it is entirely possible that they break in a future version upgrade.
|
||||
|
||||
* ZoneMinder relies on 'control protocols' for specific camera models. These 'control' protocols are nothing but perl packages located in ``/usr/share/perl5/ZoneMinder/Control/`` (in Ubuntu distributions) that are invoked by ZoneMinder when you invoke a PTZ operation
|
||||
|
||||
* When you associate a 'protocol' for PTZ for a camera, you are effectively letting ZoneMinder know where to locate the perl file that will eventually control the camera movement
|
||||
|
||||
* Let's for example, assume that you are configuring a Foscam 9831W camera and have associated the '9831w' protocol to that camara. This basically means when you move the camera via ZoneMinder, it will pass on the movements to FI9831w.pm in ``/usr/share/perl5/ZoneMinder/Control/``
|
||||
|
||||
* ZoneMinder also maintains protocol configuration parameters in a table called ``Controls`` in the DB. This table is used to store parameters like whether the camera supports continuous move, zoom etc.
|
||||
|
||||
* The ``Controls`` table is used by ZoneMinder to build its PTZ web interface. For example, an FI9831W camera does not support Zoom --> so when you open the PTZ interface of ZoneMinder via the Web Console and navigate to the FI9831W camera, the Zoom option will not be shown. It knows not to show this because the ``Control`` table entry for FI9831W specifies it does not support Zoom. Note that you edit these parameters via Source->Control->Control Type->Edit in the web console
|
||||
|
||||
* If you ever look at any of the control protocol files, you will notice it has functions like ``moveRelUp`` or ``moveConLeft`` etc. -> 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 accordinfly 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 forms fields below. In the case of the capabilities table there are a large number of settings and tabs, the mean and use of these are briefly explained below.
|
||||
|
||||
|
||||
|
||||
Main Tab
|
||||
--------
|
||||
Name
|
||||
|
|
|
@ -3,6 +3,12 @@ Components
|
|||
|
||||
ZoneMinder is not a single monolithic application but is formed from several components. 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:: images/zm-system-overview.jpg
|
||||
|
||||
A brief description of each of the principle components follows.
|
||||
|
||||
Binaries
|
||||
|
@ -26,10 +32,10 @@ As well as this there are the web PHP files in the web directory. Currently thes
|
|||
Original ZoneMinder skin
|
||||
**Flat**
|
||||
An updated version of classic skin, retaining the same layout with a more modern style
|
||||
**XMl**
|
||||
Used by eyeZM as an interfacing skin
|
||||
**XML**
|
||||
Displays certain views as XML. Used by eyeZM as an interfacing skin (Note that eyeZM no longer seems to work with later versions of Zoneminder). New developers of 3rd party clients should use the API instead (:doc:`../api`)
|
||||
**Mobile**
|
||||
[Check status and purpose]
|
||||
A skin that displays views in a more condensed and single page format, likely suitable for smaller mobile devices, should one choose to access the ZoneMinder console using such devices. Note that there are also third party mobile clients one could use (:doc:`mobile`)
|
||||
|
||||
Perl
|
||||
----
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
Controlling Monitors
|
||||
====================
|
||||
|
||||
If you have defined your system as having controllable monitors and you are looking at a monitor that is configured for control, then clicking on the ‘Control’ link along the top of the window will change the short event listing area to a control area. The capabilities you have defined earlier determine exactly what is displayed in this window. Generally you will have a Pan/Tilt control area along with one or subsidiary areas such as zoom or focus control to the side. If you have preset support then these will be near the bottom of the window. The normal method of controlling the monitor is by clicking on the appropriate graphics which then send a command via the control script to the camera itself. This may sometimes take a noticeable delay before the camera responds.
|
||||
|
||||
It is usually the case that the control arrows are sensitive to where you click on them. If you have a camera that allows different speeds to be used for panning or zooming etc then clicking near the point of the arrow will invoke the faster speed whilst clicking near the base of the arrow will be slower. If you have defined continuous motion then ongoing activities can be stopped by clicking on the area between the arrows, which will either be a graphic in the case of pan/tilt controls or a word in the case of zoom and focus controls etc.
|
||||
|
||||
Certain control capabilities such as mapped motion allow direct control by clicking on the image itself when used in browsers which support streamed images directly. Used in this way you can just click on the area of the image that interests you and the camera will centre on that spot. You can also use direct image control for relative motion when the area of the image you click on defines the direction and the distance away from the centre of the image determines the speed. As it is not always very easy to estimate direction near the centre of the image, the active area does not start until a short distance away from the centre, resulting in a ‘dead’ zone in the middle of the image.
|
|
@ -3,7 +3,15 @@ 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.
|
||||
|
||||
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.
|
||||
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:: images/definemonitor-monitor.png
|
||||
:width: 600px
|
||||
|
||||
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:: images/definemonitor-preset.png
|
||||
:width: 600px
|
||||
|
||||
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,
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
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 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 which contains an image from your camera overlain with a stippled pattern representing your zone. In the default case this will cover 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.
|
||||
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 (the 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 which contains an image from your camera overlain with a stippled pattern representing your zone. In the default case this will cover 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.
|
||||
|
||||
|
@ -40,7 +42,11 @@ Units
|
|||
* 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
|
||||
[[File:Zone - Region sample.jpg|frame|right|The sample region shown to the right shows a region defined by 6 control points. The shape of the region causes the check methods to ignore the sidewalk and areas of the porch wall that receive changing sunlight; two conditions that are not of interest in this zone.]]
|
||||
|
||||
.. image:: images/define-zone-region-sample.jpg
|
||||
|
||||
The sample region shown to the right shows a region defined by 6 control points. The shape of the region causes the check methods to ignore the sidewalk and areas of the porch wall that receive changing sunlight; two conditions that are not of interest in this zone.
|
||||
|
||||
A region is a part of the captured image that is 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. This can be done by dragging the control points in the reference image around, or by altering the coordinates found in the controls below the reference image. Clicking on a control point in the reference image highlights the 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. It is possible to accidentally place a control point outside of the valid coordinates of the image. This will prevent the monitor from working properly. 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
|
||||
|
@ -71,8 +77,13 @@ 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
|
||||
File:Zone - 1 blob example.jpg|frame|right|This captured frame 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.
|
||||
|
||||
.. image:: images/define-zone-blob.jpg
|
||||
|
||||
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 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. This is 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.
|
||||
|
||||
Min/Max Blob Area
|
||||
|
@ -88,3 +99,7 @@ Overload Frame Ignore Count
|
|||
* 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.
|
||||
|
||||
Other information
|
||||
-----------------
|
||||
Refer to `this <http://www.zoneminder.com/wiki/index.php/Understanding_ZoneMinder%27s_Zoning_system_for_Dummies>`__ user contributed Zone guide for additional information will illustrations if you are new to zones and need more help.
|
||||
|
||||
|
|
|
@ -1,54 +1,112 @@
|
|||
Filtering Events
|
||||
================
|
||||
|
||||
The other columns on the main console window contain various event totals for your monitors over the last hour, day, week and month as well as a grand total and a total for events that you may have archived for safekeeping. Clicking on one of these totals or on the 'All' or 'Archive' links from the monitor window described above will present you with a new display. This is the full event window and contains a list of events selected according to a filter which will also pop up in its own window. Thus if you clicked on a 'day' total the filter will indicate that this is the period for which events are being filtered. The event listing window contains a similar listing to the recent events in the monitor window. The primary differences are that the frames and alarm frames and the score and maximum score are now broken out into their own columns, all of which can be sorted by clicking on the heading. Also this window will not refresh automatically, rather only on request. Other than that, you can choose to view events here or delete them as before.
|
||||
Filters allow you to define complex conditions with associated actions in ZoneMinder. Examples could include:
|
||||
|
||||
The other window that appeared is a filter window. You can use this 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; you first 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. You then select what you want to filter on and how the expressions relate by choosing whether they are 'and' or 'or' relationships. For filters comprised of many expressions you will also get the option to bracket parts of the filter to ensure you can express it as desired. Then if you like choose how you want your results sorted and whether you want to limit the amount of events displayed.
|
||||
* Send an email each time a new event occurs for a specific monitor
|
||||
* Delete events that are more than 10 days old
|
||||
|
||||
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.
|
||||
And many more.
|
||||
|
||||
All of the preceding elements take a very flexible free format of dates and time based on the PHP strtotime function (http://www.php.net/manual/en/function.strtotime.php). This allows values such as 'last Wednesday' etc to be entered. I 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 are 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.
|
||||
The filter window can be accessed from various views, one of which is to simply tap on the filter button in the main web view:
|
||||
|
||||
The other things you can filter on are all fairly self explanatory, except perhaps for 'Archived' which you can use to include or exclude Archived events. In general you'll probably do most filtering on un-archived events. There are also two elements, Disk Blocks and Disk Percent which don’t directly relate to the events themselves but to the disk partition on which the events are stored. These allow you to specify an amount of disk usage either in blocks or in percentage as returned by the ‘df’ command. They relate to the amount of disk space used and not the amount left free. Once your filter is specified, clicking 'submit' will filter the events according to your specification. As the disk based elements are not event related directly if you create a filter and include the term ‘DiskPercent > 95’ then if your current disk usage is over that amount when you submit the filter then all events will be listed whereas if it is less then none at all will. As such the disk related terms will tend to be used mostly for automatic filters (see below). If you have created a filter you want to keep, you can name it and save it by clicking 'Save'.
|
||||
.. image:: images/filter-button.png
|
||||
:width: 600px
|
||||
|
||||
If you do this then the subsequent dialog will also allow you specify whether you want this filter automatically applied in order 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 intended for mobile phones or pagers) have a format defined in the Options screen, and may include a variety of tokens that can be substituted for various details of the event that caused them. This includes links to the event view or the filter as well as the option of attaching images or videos to the email itself. Be aware that tokens that represent links may require you to log in to access the actual page, and sometimes may function differently when viewed outside of the general ZoneMinder context. The tokens you can use are as follows.
|
||||
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; you first 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. You then select what you want to filter on and how the expressions relate by choosing whether they are 'and' or 'or' relationships. For filters comprised of many expressions you will also get the option to bracket parts of the filter to ensure you can express it as desired. Then if you like choose how you want your results sorted and whether you want to limit the amount of events displayed.
|
||||
|
||||
: %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
|
||||
: %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
|
||||
|
||||
Finally you can also specify a script which is run on each matched event. This script should be readable and executable by your web server user. It will get run once per event and 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 event id and perform any action you wish. 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 contains is entirely up to you however.
|
||||
Here is what the filter window looks like
|
||||
|
||||
Filtering is a powerful mechanism you can use to eliminate events that fit a certain pattern however in many cases modifying the zone settings will better address this. Where it 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 are 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. Be warned however that if you use this strategy then 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 do not do this then the first pass when the disk usage is high will match, and then delete, all events unless you have 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 you sure you check the ‘Delete all matches’ option. This will then run in the background and ensure that your disk does not fill up with events.
|
||||
.. image:: images/filter-filterview.png
|
||||
:width: 800px
|
||||
|
||||
* *A*: This is a dropdown list where you can select pre-defined filters. You will notice that ZoneMinder comes with a PurgeWhenFull filter that is configured to delete events if you reach 95% of disk space.
|
||||
* *B* and *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 is where you specify what needs to happen when the conditions match:
|
||||
* Archive all matches: sets the archive field to 1 in 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
|
||||
* Email details of all matches: Sends an email to the configured address with details about the event.
|
||||
The email can be customized as per TBD
|
||||
* Execute command on all matches: Allows you to execute any arbitrary command on the matched events
|
||||
* Delete all matches: Deletes all the matched events
|
||||
* *E*: Use 'Submit' 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 (http://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 are 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.
|
||||
|
||||
The other things you can filter on are all fairly self explanatory, except perhaps for 'Archived' which you can use to include or exclude Archived events. In general you'll probably do most filtering on un-archived events. There are also two elements, Disk Blocks and Disk Percent which don’t directly relate to the events themselves but to the disk partition on which the events are stored. These allow you to specify an amount of disk usage either in blocks or in percentage as returned by the ‘df’ command. They relate to the amount of disk space used and not the amount left free. Once your filter is specified, clicking 'submit' will filter the events according to your specification. As the disk based elements are not event related directly if you create a filter and include the term ‘DiskPercent > 95’ then if your current disk usage is over that amount when you submit the filter then all events will be listed whereas if it is less then none at all will. As such the disk related terms will tend to be used mostly for automatic filters (see below). If you have created a filter you want to keep, you can name it and save it by clicking 'Save'.
|
||||
|
||||
If you do this then the subsequent dialog will also allow you specify whether you want this filter automatically applied in order 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 intended for mobile phones or pagers) have a format defined in the Options screen, and may include a variety of tokens that can be substituted for various details of the event that caused them. This includes links to the event view or the filter as well as the option of attaching images or videos to the email itself. Be aware that tokens that represent links may require you to log in to access the actual page, and sometimes may function differently when viewed outside of the general ZoneMinder context. 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
|
||||
* %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
|
||||
* %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
|
||||
|
||||
Finally you can also specify a script which is run on each matched event. This script should be readable and executable by your web server user. It will get run once per event and 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 event id and perform any action you wish. 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 contains is entirely up to you however.
|
||||
|
||||
Filtering is a powerful mechanism you can use to eliminate events that fit a certain pattern however in many cases modifying the zone settings will better address this. Where it 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 are 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. Be warned however that if you use this strategy then 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 do not do this then the first pass when the disk usage is high will match, and then delete, all events unless you have 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 you sure you check the ‘Delete all matches’ option. This will then run in the background and ensure that your disk does not fill up with events.
|
||||
|
||||
|
||||
Saving filters
|
||||
-----------------
|
||||
|
||||
.. image:: images/filter-save.png
|
||||
:width: 400px
|
||||
|
||||
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. For example, if you want to be notified of new events by email, you sould make sure this is checked. Filters that are configured to run in the background have a "*" next to it.
|
||||
|
||||
For example:
|
||||
|
||||
.. image:: images/filter-choosefilter.png
|
||||
:width: 400px
|
||||
|
||||
How filters actually work
|
||||
--------------------------
|
||||
It is useful to know how filters actually work behind the scenes in ZoneMinder, in the event you find your filter not functioning as intended:
|
||||
|
||||
* the primary filter processing process in ZoneMinder is a perl file called ``zmfilter.pl``
|
||||
* zmfilter.pl runs every FILTER_EXECUTE_INTERVAL seconds (default is 20s, can be changed in Options->System)
|
||||
* in each run, it goes through all the filters which are marked as "Run in Background" and if the conditions match performs the specified action
|
||||
* zmfilter.pl also reloads all the filters every FILTER_RELOAD_DELAY seconds (default is 300s/5mins, can be changed in Options->System)
|
||||
* So if you have just created a new filter, zmfilter will not see it till the next FILTER_RELOAD_DELAY cycle
|
||||
* This is also important if you are using "relative times" like 'now' - see :ref:`relative_caveat`
|
||||
|
||||
|
||||
Relative items in date strings
|
||||
|
@ -56,6 +114,7 @@ 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 year
|
||||
* 1 year ago
|
||||
|
@ -75,6 +134,8 @@ When a relative item causes the resulting date to cross a boundary where the clo
|
|||
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
|
||||
|
@ -103,6 +164,9 @@ You use "less than" to indicate that you want to match events before the specifi
|
|||
|
||||
You should always test your filters before enabling any actions based on them to make sure they consistently return the results you want. You can use the submit button to see what events are returned by your query.
|
||||
|
||||
|
||||
.. _relative_caveat:
|
||||
|
||||
Caveat with Relative items
|
||||
--------------------------
|
||||
|
||||
|
@ -111,3 +175,12 @@ One thing to remember if you specify relative dates like "now" or "1 minute ago"
|
|||
This may cause confusion in the following cases, 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.pl will 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 zmfilter converts that relative time to an absolute date only when it reloads filters, which is dictated by the FILTER_RELOAD_DELAY duration. 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
|
||||
|
|
|
@ -3,6 +3,142 @@ Getting Started
|
|||
|
||||
Having followed the :doc:`/installationguide/index` for your distribution you should now be able to load the ZoneMinder web frontend. By default this will be with the Classic skin, below is an example of the page you should now see.
|
||||
|
||||
To add cameras to the system you need to create a Monitor for each camera. Click 'Add New Monitor' to bring up the dialog.
|
||||
.. image:: ../installationguide/images/zm_first_screen_post_install.png
|
||||
|
||||
[To be completed, removing tutorial style documentation from wiki documentation and putting first time user guide here]
|
||||
|
||||
Enabling Authentication
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
We strongly recommend enabling authentication right away. There are some situations where certain users don't enable authentication, such as instances where the server is in a LAN not 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.
|
||||
|
||||
* Click on the Options link on the top right corner of the web interface
|
||||
* You will now be presented with a screen full of options. Click on the "System" tab
|
||||
|
||||
.. image:: images/getting-started-enable-auth.png
|
||||
|
||||
* The relevant portions to change are marked in red above
|
||||
* Enable OPT_USE_ATH - 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 please don't use the same value in the example.
|
||||
* The other options highlighed above should already be set, but if not, please make sure they are
|
||||
|
||||
* 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:: images/getting-started-login.png
|
||||
|
||||
.. NOTE:: The default login/password is "admin/admin"
|
||||
|
||||
|
||||
Switching to flat theme
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
What 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_DEFAULT as shown below
|
||||
|
||||
.. image:: images/getting-started-flat-css.png
|
||||
|
||||
* Click Save at the bottom
|
||||
|
||||
Now, switch to the "Display" tab and also select "Flat" there like so:
|
||||
|
||||
.. image:: images/getting-started-flat-css-2.png
|
||||
|
||||
Your screen will now look like this:
|
||||
|
||||
|
||||
Congratulations! You now have a modern looking interface.
|
||||
|
||||
.. image:: images/getting-started-modern-look.png
|
||||
|
||||
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.
|
||||
Obviously, this does not reflect your current web console - which is essentially void of any useful information till now,
|
||||
as we are yet to add things. Let's take a small break and understand what the various functions are before we configure our
|
||||
own empty screen.
|
||||
|
||||
.. image:: images/getting-started-understand-console.png
|
||||
|
||||
* **A**: This is the username that is logged in. You are logged in as 'admin' here
|
||||
* **B**: Click here to explore the various options of ZoneMinder and how to configure them. You already used this to enable authentication and change style above. Over time, you will find this to have many other things you will want to customize.
|
||||
* **C**: This link, when clicked, opens up a color coded log window of what is going on in Zoneminder and often gives you good insight into what is going wrong or right. Note that the color here is red - that is an indication that some error occurred in ZoneMinder. You should click it and investigate.
|
||||
* **D**: 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.
|
||||
* **E**: 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 continously a reason for triggering a record? Probably not - in that case, you'd leave the fan out while making your zones.
|
||||
* **F**: This is the "source" column that tells you the type of the camera - if its an IP camera, a USB camera or more. In this example, they are all IP cameras. Note the color red on item F ? Well that means there is something wrong with that camera. No wonder the log also shows red. Good indication for you to tap on logs and investigate
|
||||
* **G**: This defines how Zoneminder will record events. There are various modes. In brief 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 anytime, Modect = Don't record till an externa entity via zmtrigger tells Zoneminder to (this is advanced usage).
|
||||
* **H**: If you click on these links you can view a "Montage" of all your configured monitors or cycle through each one
|
||||
|
||||
|
||||
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.
|
||||
|
||||
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 <http://www.zoneminder.com/wiki/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 foums <http://www.zoneminder.com/forums/>`__.
|
||||
|
||||
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 new monitor" button below:
|
||||
|
||||
.. image:: images/getting-started-modern-look.png
|
||||
|
||||
This brings up the new monitor window:
|
||||
|
||||
.. image:: images/getting-started-add-monitor-general.png
|
||||
:width: 800px
|
||||
|
||||
* 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 'Remote'.
|
||||
|
||||
.. NOTE::
|
||||
As a thumb rule, if you have a camera accessible via IP and it does HTTP or RTSP,
|
||||
start with Remote, then try FFMpeg and libvlc if it doesn't work (:doc:`/userguide/definemonitor`
|
||||
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
|
||||
<http://www.zoneminder.com/wiki/index.php/How_to_use_ZoneMinder_with_cameras_it_may_not_directly_support>`__ to see how file can be used for leisure reading.
|
||||
|
||||
* Let's leave the Function as 'Monitor' just so we can use this as an example to change it later another way. Practically, feel free to select your mode right now - Modect, Record etc depending on what you want ZoneMinder to do with this camera
|
||||
|
||||
* We've put in MaxFPS and AlarmFPS as 20 here. **You can leave this empty too**. Whatever you do here, *it's important to make sure these values are higher than the FPS of the camera*. The reason we've added a value here is that as of Aug 2015, if a camera goes offline, ZoneMinder eats up a lot of CPU trying to reach it and putting a larger value here than the actual FPS helps in that specific situation.
|
||||
|
||||
.. NOTE::
|
||||
We strongly recommend not putting in a lower FPS here that the one configured inside your camera.
|
||||
Zoneminder should not be used to manage camera frame rate. That always causes many problems. It's
|
||||
much better you set the value directly in-camera and either leave this blank or specify a higher FPS
|
||||
here. In this case, our actual camera FPS is 3 and we've set this value here to 10.
|
||||
|
||||
* We are done for the General tab. Let's move to the next tab
|
||||
|
||||
.. image:: images/getting-started-add-monitor-source.png
|
||||
:width: 800px
|
||||
|
||||
* Let's select a protocol of RTSP and a remote method of RTP/RTSP (this is an RTSP camera)
|
||||
* The other boxes are mostly self-explanatory
|
||||
|
||||
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:: images/getting-started-add-monitor-orange.png
|
||||
|
||||
If you want to change its mode from Monitor to say, Modect (Motion Detect), later all you need to do is click on the Function column that says 'Monitor' and change it to 'Modect' like so:
|
||||
|
||||
|
||||
.. image:: images/getting-started-add-monitor-modect.png
|
||||
|
||||
and we now have:
|
||||
|
||||
.. image:: images/getting-started-add-monitor-modect-ready.png
|
||||
|
||||
And then, finally, to see if everything works, lets click on the monitor name ('Garage' in this example) and that should bring up a live feed just like this:
|
||||
|
||||
.. image:: images/getting-started-add-monitor-live.png
|
||||
|
||||
|
||||
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 :doc:`/userguide/definemonitor` for many other customization details.
|
||||
|
|
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 115 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 154 KiB |
After Width: | Height: | Size: 306 KiB |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 179 KiB |
After Width: | Height: | Size: 166 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 169 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 665 KiB |
After Width: | Height: | Size: 59 KiB |
|
@ -9,7 +9,6 @@ User Guide
|
|||
definemonitor
|
||||
definezone
|
||||
viewmonitors
|
||||
controlmonitor
|
||||
filterevents
|
||||
viewevents
|
||||
options
|
||||
|
|
|
@ -19,24 +19,33 @@ The syslog service uses the concept of priorities and facilities where the forme
|
|||
|
||||
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::
|
||||
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:
|
||||
|
||||
<pre># Save ZoneMinder messages to zm.log
|
||||
local1.* /var/log/zm/zm.log</pre>
|
||||
::
|
||||
|
||||
which will ensure that all messages produced with the local1 facility are routed to fhe /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::
|
||||
# Save ZoneMinder messages to zm.log
|
||||
local1.* /var/log/zm/zm.log
|
||||
|
||||
<pre># Log anything (except mail) of level info or higher.
|
||||
which will ensure that all messages produced with the local1 facility are routed to fhe /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</pre>
|
||||
*.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::
|
||||
by default. To remove ZoneMinder messages altogether from this file you can modify this line to look like:
|
||||
|
||||
<pre>*.info;local1.!*;mail.none;news.none;authpriv.none;cron.none /var/log/messages</pre>
|
||||
::
|
||||
|
||||
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.!*;mail.none;news.none;authpriv.none;cron.none /var/log/messages
|
||||
|
||||
<pre>*.info;local1.!*;local1.warning;mail.none;news.none;authpriv.none;cron.none /var/log/messages</pre>
|
||||
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.
|
||||
|
||||
|
@ -50,15 +59,17 @@ Once you have debug being logged you can modify the level by sending USR1 and US
|
|||
|
||||
If you wish to 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 wish to see, and the ZM_DBG_PRINT environment variable to 1 to output the debug directly to your terminal.
|
||||
|
||||
All ZoneMinder logs can now be rotated by logrotate. A sample logrotate config file is shown below.::
|
||||
All ZoneMinder logs can now be rotated by logrotate. A sample logrotate config file is shown below:
|
||||
|
||||
<pre>/var/log/zm/*.log {
|
||||
::
|
||||
|
||||
/var/log/zm/*.log {
|
||||
missingok
|
||||
notifempty
|
||||
sharedscripts
|
||||
postrotate
|
||||
/usr/local/bin/zmpkg.pl logrot 2> /dev/null > /dev/null || true
|
||||
endscript
|
||||
}</pre>
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
Mobile Devices
|
||||
==============
|
||||
|
||||
* After 1.24.x, access to the "light" interface changed to http://xxx.xxx.xxx.xxx/zm/index.php?skin=mobile ; You may find that you have a directory named "skins" under ZoneMinder base dir, so you may use one of the existent skins as a base to adapt to your needs;
|
||||
Here are some options for using ZoneMinder on Mobile devices:
|
||||
|
||||
Type this in your mobile browser: http://xxx.xxx.xxx.xxx/zm/index.php?format=xhtml (deprecated)
|
||||
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
|
||||
* ZoneMinder also has a "mobile skin" that offers limited functionality (not all views are present in this skin). You can point your mobile browser to ``http://yourzoneminderip/zm/index.php?skin=mobile`` and bookmark it
|
||||
|
||||
ZoneMinder has always had a minimal WML (Wireless Markup Language) capability to allow it to function on mobile phones and similar devices. However as of 1.20.0 this is now deprecated and has been replaced with a new XHTML – Mobile Profile mode as well as the default HTML4. XHTML-MP is a small, and limited, version of XHTML intended for mobile devices and is based on XHTML Basic. It does not contain scripting or other dynamic elements and essentially is a subset of HTML as most people know it.
|
||||
Third party mobile clients
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
* zmNinja (`source code <https://github.com/pliablepixels/zmNinja>`__, needs APIs to be installed to work)
|
||||
* Currently in free beta testing for iOS and Android. Will be in app/play store as soon as ZM 1.29 is launched
|
||||
* zmView (limited, free) and zmView Pro (more features, paid) - `website <http://html5-clouds.com/?q=node/55>`__
|
||||
|
||||
The ZoneMinder XHTML-MP interface allows you to log into your installation via your phone or mobile devices and perform a limited number of tasks. These include viewing recent events, and monitoring live streams. However unlike the full interfaces these elements are presented as still images requiring manual refreshing. For now the XHTML-MP interface is presented as a prototype interface; rather than one offering full capabilities. As such, please feel free to make comments or offer suggestions via the forums on http://www.zoneminder.com.
|
||||
Discontinued clients
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
The following are a list of clients that do not work and have not been updated:
|
||||
|
||||
As well as XHTML-MP, ideally I’d like to be able to offer a WML2.0 interface. WML2.0 is a blending of WML1.3, which is traditional WAP, and XHTML. As such it offers the scripting that WML has traditionally included plus the better control of mark-up that is the realm of XHTML. Unfortunately so far I’m unaware of any devices that support WML2.0 even if they say they are WAP2 compliant; certainly I’ve never had a phone that does. If you find out that a particular phone does support this then please let me know (or better still send me the phone!).
|
||||
|
||||
If you wish to use the XHTML-MP interface to ZoneMinder there is no extra configuration required to enable it per se. However ZoneMinder needs to be able to figure out what kind of content to deliver to particular browsers, so you have two choices. You can edit zm.php and include a definition that corresponds to your phone, describing a small number of basic capabilities, you will see a couple of examples already there, or you can use the comprehensive open source WURFL package available from http://wurfl.sourceforge.net/. You will need to download both the WURFL php files and the wurfl.xml file itself. WURFL is a resource containing information on the capabilities of a huge number of mobile phones, devices and browsers. Thus once it has matched your phone it can determine various capabilities it may possess. This means that ZoneMinder itself only has to deal with these capabilities and not the individual phone types. If you prefer you can also add the format=xHTML url parameter when you load ZoneMinder to force the xHTML format and skip the automatic determination altoghether.
|
||||
|
||||
To use WURFL you should install the php files in the same directory as ZoneMinder and then create a ‘wurfl’ sub-directory and ensure it is readable and writeable (or preferably owned by) your web server user. You should put the wurfl.xml file in there. One other thing you may need to change, as the xml file is quite large, is the ‘memory_limit’ setting in php.ini as the default setting of 8Mb may be too small. Once you’ve done this you should find that your phone or device is recognised and if it can support XHTML-MP it will receive that interface. If your phone is very new, or you are using an old version of the XML file you might find that it is not present however. The WURFL library uses a caching strategy to avoid reloading the whole XML file each time so check if a sensible looking cache file has been created in the ‘wurfl’ sub-directory also check the wurfl.log in the same place.
|
||||
|
||||
The WURFL is a third party application and as such I am unable to offer support directly for it. If you feel your device is missing or incorrectly represented please contact the authors via their own channels. If on the other hand you have any comments on ZoneMinder on your device specifically please let me know and I would be pleased to hear about it.
|
||||
|
||||
As support for cookies in mobile devices is patchy at best, the groups feature is not fully implemented in the XHTML-MP views. Instead if there is a group called ‘Mobile’ already defined then that group will always be effective, if not then all monitors available to the logged in user will be visible,
|
||||
* eyeZM
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
Options - eyeZM
|
||||
---------------
|
||||
|
||||
.. NOTE::
|
||||
eyeZM does not seem to be actively maintained by the developers and does not work with later versions of ZoneMinder.
|
||||
|
||||
|
||||
.. image:: images/Options_eyezm.png
|
||||
|
||||
EYEZM_DEBUG - Enable or Disable extra debugging from the eyeZm Plugin. Extra debugging information will be displayed in it's own file (EYEZM_LOG_TO_FILE is set), or your Apache error log
|
||||
|
@ -19,4 +23,4 @@ EYEZM_H264_DEFAULT_EVBR - Default bit-rate to use with FFMPEG for H264 event vie
|
|||
|
||||
EYEZM_H264_TIMEOUT - Timeout (sec) to wait for H264 stream to start before terminating. The eyeZm Plugin will attempt to spawn an H264 stream when requested, and require that it complete within the timeout specified. If you have a slow system or find through the logs that the H264 stream is not starting because the timeout is expiring, even though FFMPEG is running, try increasing this value. If you have a fast system, decreasing this value can improve the responsiveness when there are issues starting H264 streams.
|
||||
|
||||
EYEZM_SEG_DURATION - Segment duration used for streaming using HTTP-5 Streaming protocol. The HTTP-5 Live Streaming Protocol segments the input video stream into small chunks of a duration specified by this parameter. Increasing the segment duration will help with choppy connections on the other end, but will increase the latency in starting a stream.
|
||||
EYEZM_SEG_DURATION - Segment duration used for streaming using HTTP-5 Streaming protocol. The HTTP-5 Live Streaming Protocol segments the input video stream into small chunks of a duration specified by this parameter. Increasing the segment duration will help with choppy connections on the other end, but will increase the latency in starting a stream.
|
||||
|
|
|
@ -1,13 +1,36 @@
|
|||
Viewing Events
|
||||
==============
|
||||
From the monitor or filtered events listing you can now click on an event to view it in more detail. 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.
|
||||
|
||||
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:: images/viewevents-main.png
|
||||
|
||||
|
||||
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 of 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.
|
||||
|
||||
You will notice for the first time that alarm images now contain an overlay outlining the blobs that represent the alarmed area. This outline is in the colour defined for that zone and lets you see what it was that caused the alarm. Clicking on one of the thumbnails will take you to a full size window where you can see the image in all its detail and scroll through the various images that make up the event. If you have the ZM_RECORD_EVENT_STATS option on, you will be able to click the 'Stats' link here and get some analysis of the cause of the event. Should you determine that you don't wish to keep the event, clicking on Delete will erase it from the database and file system. Returning to the event window, other options here are renaming the event to something more meaningful, refreshing the window to replay the event stream, deleting the event, switching between streamed and still versions of the event (if supported) and generating an MPEG video of the event (if supported).
|
||||
Here is an example of viewing an event stream:
|
||||
|
||||
.. image:: images/viewevents-stream.png
|
||||
:width: 650px
|
||||
|
||||
* **A**: Administrative Event options on the event including viewing individual frames
|
||||
* **B**: The actual image stream
|
||||
* **C**: Navigation control
|
||||
* **D**: You can switch between watching a single event or Continous mode (where it advances to the next event after playback is complete)
|
||||
* **E**: Event progress bar - how much of the current event has been played back
|
||||
|
||||
You will notice for the first time that alarm images now contain an overlay outlining the blobs that represent the alarmed area. This outline is in the colour defined for that zone and lets you see what it was that caused the alarm. Clicking on one of the thumbnails will take you to a full size window where you can see the image in all its detail and scroll through the various images that make up the event. If you have the ZM_RECORD_EVENT_STATS option on, you will be able to click the 'Stats' link here and get some analysis of the cause of the event.
|
||||
|
||||
More details on the Administrative Event options (A)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Should you determine that you don't wish to keep the event, clicking on Delete will erase it from the database and file system. Returning to the event window, other options here are renaming the event to something more meaningful, refreshing the window to replay the event stream, deleting the event, switching between streamed and still versions of the event (if supported) and generating an MPEG video of the event (if supported).
|
||||
|
||||
These last two options require further explanation. Archiving an event means that it is kept to one side and not displayed in the normal event listings unless you specifically ask to view the archived events. This is useful for keeping events that you think may be important or just wish to protect. Once an event is archived it can be deleted or unarchived but you cannot accidentally delete it when viewing normal unarchived events.
|
||||
|
||||
The final option of generating an MPEG video is still somewhat experimental and its usefulness may vary. It uses the open source ffmpeg encoder to generate short videos, which will be downloaded to your browsing machine or viewed in place. When using the ffmpeg encoder, ZoneMinder will attempt to match the duration of the video with the duration of the event. Ffmpeg has a particularly rich set of options and you can specify during configuration which additional options you may wish to include to suit your preferences. In particular you may need to specify additional, or different, options if you are creating videos of events with particularly slow frame rates as some codecs only support certain ranges of frame rates. A common value for FFMPEG_OUTPUT_OPTIONS under Options > Images might be '-r 25 -b 800k' for 25 fps and 800 kbps. Details of these options can be found in the [http://ffmpeg.org/ffmpeg-doc.html documentation] for the encoders and is outside the scope of this document.
|
||||
The final option of generating an MPEG video is still somewhat experimental and its usefulness may vary. It uses the open source ffmpeg encoder to generate short videos, which will be downloaded to your browsing machine or viewed in place. When using the ffmpeg encoder, ZoneMinder will attempt to match the duration of the video with the duration of the event. Ffmpeg has a particularly rich set of options and you can specify during configuration which additional options you may wish to include to suit your preferences. In particular you may need to specify additional, or different, options if you are creating videos of events with particularly slow frame rates as some codecs only support certain ranges of frame rates. A common value for FFMPEG_OUTPUT_OPTIONS under Options > Images might be ``'-r 25 -b 800k'`` for 25 fps and 800 kbps. Details of these options can be found in the `documentation <http://ffmpeg.org/ffmpeg-doc.html>`__ for the encoders and is outside the scope of this document.
|
||||
|
||||
Building an MPEG video, especially for a large event, can take some time and should not be undertaken lightly as the effect on your host box of many CPU intensive encoders will not be good. However once a video has been created for an event it will be kept so subsequent viewing will not incur the generation overhead. Videos can also be included in notification emails, however care should be taken when using this option as for many frequent events the penalty in CPU and disk space can quickly mount up.
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
Viewing Monitors
|
||||
================
|
||||
|
||||
As this point you should have one or more Monitors running with one or more Zones each. Returning to the main Console window you will see your monitors listed once more. The columns not explored so far are the Monitor name, and various event totals for certain periods of time. Clicking on any of the event totals will bring up a variation on the same window but click on the Monitor name for now. If it is not a link then this means that that monitor is not running so ensure that you have started ZoneMinder and that your Monitor function is not set to ‘None’. If the link works, clicking on it will pop another window up which should be scaled to contain a heading, an image from your monitor, a status and a list of recent events if any have been generated.
|
||||
ZoneMinder allows you to view a live feed of your configured monitors. Once can access this view by clicking on the "Name" column of any of the monitors
|
||||
|
||||
Depending on whether you are able to view a streamed image or not the image frame will either be this stream or a series of stills. You have the option to change from one to the other (if available) at the centre of the top heading. Also along the top are a handful of other links. These let you change the scale of the image stream, modify image settings (for local devices) or close the window. If you have cameras that can be controlled, a ‘Control’ link should also be present which is described below.
|
||||
.. image:: images/viewmonitor-main.png
|
||||
:width: 500px
|
||||
|
||||
|
||||
Clicking on the name produces a view similar to this:
|
||||
|
||||
.. image:: images/viewmonitor-stream.png
|
||||
:width: 500px
|
||||
|
||||
The image should be self-explanatory but if it looks like garbage it is possible that the video configuration is wrong so look in your system error log and check for or report anything unusual. The centre of the window will have a tiny frame that just contains a status; this 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 and Alert means that an alarm has happened and the monitor is ‘cooling down’, if another alarm is generated in this time it will just become part of the same event. These indicators are colour coded in green, red and amber.
|
||||
|
||||
|
|