Updated for v0.9.7
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@284 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
f5eb97821f
commit
116128227b
551
README
551
README
|
@ -1,11 +1,11 @@
|
|||
ZONE MINDER v0.9.6
|
||||
ZONE MINDER v0.9.7
|
||||
==================
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Welcome to ZoneMinder, the new all-in-one Linux GPL'd security camera solution.
|
||||
A few months back my garage was burgled and they stole my wine and power tools!
|
||||
A few months back my garage was burgled and my wine and power tools were nicked!
|
||||
I realised shortly after that if I'd just had a camera overlooking the door then
|
||||
at least I'd have know exactly when and who did the dirty deed. And so
|
||||
ZoneMinder was born. It's still a baby but hopefully it can grow up to be
|
||||
|
@ -47,8 +47,8 @@ please let me know.
|
|||
Requirements
|
||||
============
|
||||
|
||||
ZM needs a couple of things to work. Firstly, it uses MySQL so you'll need that,
|
||||
in order to compile you need to make sure you have a development installation
|
||||
ZM needs a couple of things to work. Firstly, it uses MySQL so you'll need that.
|
||||
In order to compile you need to make sure you have a development installation
|
||||
and not just a runtime. Next it does things with JPEGs so you'll need at least
|
||||
libjpeg.a which I think come as standard nowadays. It also uses the netpbm
|
||||
utilities in a very limited way to generate thumbnails under certain
|
||||
|
@ -73,47 +73,67 @@ feedback on other distributions.
|
|||
Building
|
||||
========
|
||||
|
||||
Before you start building you have a couple of things to do. Firstly you'll have
|
||||
to create your ZoneMinder database and users. You'll need to identify these in
|
||||
zmcfg.h and in index.php. You'll notice that in zmcfg.h there are two sets of
|
||||
users and passwords. This is because the Streaming server and Utility binaries
|
||||
require only read access to the database so you may wish to create both a full
|
||||
access user and a limited access user. You can of course set both to the full
|
||||
access user. The included schema (zmschema.sql) can be used to actually create
|
||||
the tables required. The database is usually called 'zm'. If you are upgrading
|
||||
from a previous version you can use zmalter.sql to upgrade your database and
|
||||
make the necessary changes. ZM also needs to know where it stores its events
|
||||
relative to the web root directory in zmcfg.h and where in full path terms in
|
||||
zmconfig.php. There are also several other paths in index.php but these can wait
|
||||
until later.
|
||||
The first thing you need to do is run the included configure script to define
|
||||
some initial configuration, just type
|
||||
|
||||
So to continue, just type
|
||||
./configure --with-mysql=<your MySQL root> --with-webdir=<your web directory> --
|
||||
with-cgidir=<your cgi directory>
|
||||
|
||||
./configure --with-webdir=<your web directory> --with-cgidir=<your cgi directory> --with-mysql=<your Mysql root>
|
||||
|
||||
where --with-webdir is the directory to which you want to install the PHP files,
|
||||
and --with-cgidir is the directory to which you want to install CGI files.
|
||||
There are also two further arguments you can add if your web user and group
|
||||
are not apache and apache. These are --with-webuser and --with-webgroup. Type
|
||||
where –with-mysql identifies where you have installed MySQL (usually /usr), --
|
||||
with-webdir is the directory to which you want to install the PHP files, and --
|
||||
with-cgidir is the directory to which you want to install CGI files. These
|
||||
directories could be /var/www/html/zm and /var/www/cgi-bin for example. There
|
||||
are also two further arguments you can add if your web user and group are not
|
||||
both ‘apache’. These are --with-webuser and --with-webgroup. Type
|
||||
./configure --help for details.
|
||||
|
||||
That’s the build configuration sorted out. The next thing you have to do is do a
|
||||
little more runtime specific configuration. ZoneMinder config is scattered
|
||||
around various files in the distribution so to make things easier for you there
|
||||
is a ZoneMinder configuration utility included. Type
|
||||
|
||||
./zmconfig.pl
|
||||
|
||||
to get it started. It is an interactive utility and will prompt you by asked you
|
||||
various questions. For most questions typing ‘?’ will give you additional help
|
||||
if you need it. Once you’ve answered all the questions it will write out a
|
||||
configuration file ‘zmconfig.txt’ and then process various files to substitute
|
||||
the information in them. If you run it again it will remember your answers from
|
||||
before by reading ‘zmconfig.txt’ before it starts. You can also edit this file
|
||||
directly to change values and if you do you can run zmconfig in non-interactive
|
||||
mode by typing
|
||||
|
||||
./zmconfig.pl –noi
|
||||
|
||||
which will just read your file and do the substations with no questions asked.
|
||||
|
||||
Among the first questions zmconfig.pl asks you are to do with the database and
|
||||
the next thing you should do is create it and the associated database users. You
|
||||
may notice that there are two sets of users and passwords. This is because the
|
||||
Streaming server and Utility binaries require only read access to the database
|
||||
so you may wish to create both a full access user and a limited access user. You
|
||||
can of course set both to the full access user. The included schema
|
||||
(zmschema.sql) can be used to actually create the tables required. The database
|
||||
is usually called 'zm'. If you are upgrading from a previous version you can use
|
||||
zmalter-x.y.z.sql to upgrade your database and make the necessary changes where
|
||||
x.y.z identifies the version of ZoneMinder you had installed previously. For a
|
||||
new installation the simplest way to create your database and users is as
|
||||
follows,
|
||||
|
||||
mysql mysql < zmschema.sql
|
||||
mysql mysql
|
||||
grant select,insert,update,delete on <your database name>.* to '<your first
|
||||
username>' identified by '<your first password>';
|
||||
grant select on <your database name>.* to '<your second username>' identified by
|
||||
'<your second password>'
|
||||
quit
|
||||
mysqladmin reload
|
||||
|
||||
Though you may need to supply a username and password to the mysql commands to
|
||||
give yourself sufficient privileges to perform the required commands.
|
||||
|
||||
Then just type 'make' and off you go.
|
||||
|
||||
I know what you are going to say next, it doesn't work. I hope it does but this
|
||||
is my first type with autoconf and quite honestly I haven't a clue what I'm
|
||||
doing so if you do get any build problems then just let me know and I'll try and
|
||||
tell you how to fix them. Alternatively if you are an automake/autoconf expert
|
||||
then please let me know what to do!
|
||||
|
||||
There are a couple of files in the package that come from other packages, this
|
||||
is just to simplify the build and reduce dependencies on other packages.
|
||||
Anything ZM specific is named as such.
|
||||
|
||||
It is possible to rebuild the whole thing from the enclosed automake files but
|
||||
if you do you will have to ensure that the installation part for the php and
|
||||
cgi files in the src/Makefile.in and web/Makefile.in is reconstructed, as it
|
||||
is not present by default.
|
||||
|
||||
|
||||
Installation
|
||||
============
|
||||
|
@ -122,7 +142,8 @@ Once the build has completed you should have several shiny new binaries. I will
|
|||
now briefly describe what each of them do.
|
||||
|
||||
zmc - This is the ZoneMinder Capture daemon. This binary's job is to sit on a
|
||||
video device and such frames off it as fast as possible, this should run at more
|
||||
video device and such frames off it as fast as possible, this should run
|
||||
at more
|
||||
or less constant speed.
|
||||
zma - This is the ZoneMinder Analysis daemon. This is the component that goes
|
||||
through the captured frames and checks them for alarming events. It generally
|
||||
|
@ -132,40 +153,54 @@ zms - This is the ZoneMinder Streaming server. The web interface connects with
|
|||
this to get real-time or historical streamed images.
|
||||
zmu - This is the ZoneMinder Utility. It's basically a handy command line
|
||||
interface to several useful functions. Not really meant to be used by anyone
|
||||
except the web page (there's no 'help' in it yet) but can be if necessary.
|
||||
except the web page (there's only limited 'help' in it so far) but can be if
|
||||
necessary.
|
||||
zmfix – This is a small binary that exists only to ensure that the video device
|
||||
files can be read by the main capture daemons. It is often the case that these
|
||||
device files are set to be accessible by root only on boot. This binary runs
|
||||
setuid and ensures that they have appropriate permissions. This is not a daemon
|
||||
and runs only on system start and then exits.
|
||||
|
||||
As well as this there are the web PHP files in the web directory and some perl
|
||||
scripts in the scripts directory, only one of which is actually required for
|
||||
a minimal installation. These scripts all have some configuration at the top
|
||||
of the files which should be viewed and amended if necesary and are as follows.
|
||||
As well as this there are the web PHP files in the web directory and some perl
|
||||
scripts in the scripts directory, only one of which may actually be used in a
|
||||
minimal installation. These scripts all have some configuration at the top of
|
||||
the files which should be viewed and amended if necessary and are as follows.
|
||||
|
||||
zmdc.pl - This is the ZoneMinder Daemon Control. This is used by the web
|
||||
interface to control the execution of the capture and analysis daemons amongst
|
||||
interface to control the execution of the capture and analysis daemons amongst
|
||||
others. You should not need to run this script yourself.
|
||||
zmfilter.pl - This script control the execution of saved filters and will be
|
||||
started and stopped by the web interface based on whether there are filters
|
||||
that have been defined to be autonomous. This script is also responsible for
|
||||
the automatic uploading of events to a 3rd party server so you will need to
|
||||
modify it to suit your confguration.
|
||||
zmaudit.pl - This script is used to check the consistency of the event file
|
||||
system and database. It can delete orphaned events, ie. ones that appear in
|
||||
one location and not the other as well as checking that all the various event
|
||||
related tables are in line. It can be run interactively or in batch mode either
|
||||
from the command line or a cron job or similar. In the zmconfig.php there is
|
||||
an option to specify fast event deletes where the web interface only deletes
|
||||
the event entry from the database itself. If this is set then it is this
|
||||
script that tidies up the rest.
|
||||
zmx10.pl - This is an option script that can be used to initiate and monitor
|
||||
X10 Home Automation style events and interface with an alarm system either by
|
||||
the generation of X10 signals on ZM events or by initiating ZM monitoring and
|
||||
capture on receipt of X10 signals from elsewhere, for instance the triggering
|
||||
of an X10 PIR.
|
||||
zmfilter.pl - This script control the execution of saved filters and will be
|
||||
started and stopped by the web interface based on whether there are filters that
|
||||
have been defined to be autonomous. This script is also responsible for the
|
||||
automatic uploading of events to a 3rd party server.
|
||||
zmaudit.pl - This script is used to check the consistency of the event file
|
||||
system and database. It can delete orphaned events, i.e. ones that appear in one
|
||||
location and not the other as well as checking that all the various event
|
||||
related tables are in line. It can be run interactively or in batch mode either
|
||||
from the command line or a cron job or similar. In the zmconfig.pl there is an
|
||||
option to specify fast event deletes where the web interface only deletes the
|
||||
event entry from the database itself. If this is set then it is this script that
|
||||
tidies up the rest.
|
||||
zmx10.pl - This is an option script that can be used to initiate and monitor X10
|
||||
Home Automation style events and interface with an alarm system either by the
|
||||
generation of X10 signals on ZM events or by initiating ZM monitoring and
|
||||
capture on receipt of X10 signals from elsewhere, for instance the triggering of
|
||||
an X10 PIR.
|
||||
zmwatch.pl – This is a simple script purely designed to keep an eye on the
|
||||
capture daemons and restart them if they lockup. It has been known for sync
|
||||
problems in the video drivers to cause this so this script makes sure that
|
||||
nothing important gets missed.
|
||||
|
||||
Finally, check zmconfig.php in the web directory and amend any configuration
|
||||
necessary in there.
|
||||
necessary in there. Most will have already been done by the configuration
|
||||
utilities.
|
||||
|
||||
At this stage typing 'make install' will install these everything to the desired
|
||||
locations.
|
||||
locations. The installation routine will copy the binaries and scripts to your
|
||||
chosen install location, usually /usr/local/bin and then move zms to your cgi-
|
||||
bin area. It will then copy the web files to your chosen directory and ensure
|
||||
they have the right permissions. Finally it tries to link zm.php to index.php
|
||||
but will not overwrite an existing file if it exists.
|
||||
|
||||
Start your web browser and point it at zm.php and off you go.
|
||||
|
||||
|
@ -177,39 +212,139 @@ To start with you should see the ZM Console window, this will resize itself to
|
|||
avoid being too intrusive on your desktop. Along the top there is a set of links
|
||||
to configure your bandwidth, this allows you to optimise your settings depending
|
||||
on where you are and the actual options relating to this are defined at the top
|
||||
of the index.php file. If you are using a browser on the same machine or network
|
||||
then choose high, over a cable or DSL link maybe choose medium and over a dialup
|
||||
choose low. You can experiment to see which is best. This setting is retained on
|
||||
a per machine basis with a persistent cookie.
|
||||
of the zmconfig.php file. If you are using a browser on the same machine or
|
||||
network then choose high, over a cable or DSL link maybe choose medium and over
|
||||
a dialup choose low. You can experiment to see which is best. This setting is
|
||||
retained on a per machine basis with a persistent cookie.
|
||||
|
||||
Defining Monitors
|
||||
-----------------
|
||||
To use ZM properly you need to define at least one Monitor. Essentially a
|
||||
monitor is attached to a camera and will continually check it for motion
|
||||
detection and such like. So, next click 'Add New Monitor' to bring up the
|
||||
dialog. First choose a name for it, anything you like. The next field is
|
||||
'Function' which essentially defines what the monitor is doing. This can be
|
||||
dialog. The options you have are as follows,
|
||||
|
||||
Name - First choose a name for it, anything you like.
|
||||
Function - This essentially defines what the monitor is doing. This can be
|
||||
'None' meaning the monitor is currently disabled, 'Passive' meaning you can
|
||||
watch the streams coming from the camera but no alarms or events will be
|
||||
generated, or 'Active' meaning all the images will be analysed as well as the
|
||||
stream being available to watch. Generally you'll want 'Active' but for now
|
||||
leave this at 'None'. Next enter the device number that your camera is attached
|
||||
to. If it's /dev/video0 enter '0' etc. Some video devices, e.g. BTTV cards
|
||||
support multiple cameras so in the Channel box choose the appropriate channel,
|
||||
or leave it at zero if you're using a USB camera or one without channels. Next
|
||||
enter the video format, and dimensions of the video stream your camera will
|
||||
stream being available to watch. If you have specified X10 support then X10 is
|
||||
also available as an option which means that the monitor is generally passive
|
||||
but may go active on receipt of X10 commands. Generally you'll want 'Active' but
|
||||
for now leave this at 'None'.
|
||||
Device Number/Channel - Enter the device number that your camera is attached to,
|
||||
if its /dev/video0 enter '0' etc. Some video devices, e.g. BTTV cards support
|
||||
multiple cameras so in the Channel box choose the appropriate channel, or leave
|
||||
it at zero if you're using a USB camera or one without channels.
|
||||
Device Format - Now enter the video format of the video stream. This is defined
|
||||
in various system files but the two most common are 1 for PAL and 2 for NTSC.
|
||||
Device Width/Height - The dimensions of the video stream your camera will
|
||||
supply. If your camera supports several just enter the one you'll want to use
|
||||
for this application, you can always change it later. However I would recommend
|
||||
starting with no larger than 352x288 and then perhaps increasing and seeing how
|
||||
performance is affected. This size should be adequate in most cases. Finally
|
||||
enter the colour depth. ZM supports both greyscale and 24 bit colour, so enter 1
|
||||
or 3 here. Currently it doesn't support any of the more esoteric formats, like
|
||||
15 bit etc. Click 'update' to add your monitor.
|
||||
performance is affected. This size should be adequate in most cases.
|
||||
Device Colour Depth - Finally for the video part of the configuration enter the
|
||||
colour depth. ZM supports both greyscale and 24 bit colour, so enter 1 or 3
|
||||
here. Currently it doesn't support any of the more esoteric formats, like 15 bit
|
||||
etc.
|
||||
Timestamp Label Format - This relates to the timestamp that is applied to each
|
||||
frame. It is a sprintf style string. It is actually passed through sprintf and
|
||||
then through print to add the monitor name so a format of ‘%%s - %y/%m/%d
|
||||
%H:%M:%S’ would be recommended though you can modify it if necessary.
|
||||
Timestamp Label X/Y - The X and Y values determine where to put the timestamp a
|
||||
value of 0 for the X value will put it on the left side of the image and a Y
|
||||
value of the height you supplied earlier minus 8 will place it on the bottom of
|
||||
the image.
|
||||
Image Buffer Size – This option determines how many frames are held in the ring
|
||||
buffer at any one time. It can be any value you like with a couple of provisos,
|
||||
(see next options). However it is stored in shared memory and making it too
|
||||
large especially for large images with a high colour depth can use a lot of
|
||||
memory. A value of no more than 100 is usually ok.
|
||||
Warmup Frames – This specifies how many frames the analysis daemon should
|
||||
process but not examine when it starts. This allows it to generate an accurate
|
||||
reference image. I use a value of 25 here, too high and it will take a long time
|
||||
to start, too low and you will get false alarms when the analysis daemon starts
|
||||
up.
|
||||
Pre/Post Event Image Buffer – These options determine how many frames from
|
||||
before and after an event should be preserved with it. This allows you to view
|
||||
what happened immediately prior and subsequent to the event. A value of 10 for
|
||||
both of these will get you started.
|
||||
FPS Report Interval – How often the current performance in terms of Frames Per
|
||||
Second is output to the system log. Not used in any functional way so set it to
|
||||
maybe 1000 for now. If you watch /var/log/messages (normally) you will see this
|
||||
value being emitted at the frequency you specify.
|
||||
Reference Image Blend %ge – Each analysed image in ZoneMinder is a composite of
|
||||
previous images and is formed by applying the current image as a certain
|
||||
percentage of the previous reference image. Thus, if we entered the recommended
|
||||
value of 10 here, each images part in the reference image will diminish by a
|
||||
factor of 0.9 each time round. So a typical reference image will be 10% the
|
||||
previous image, 9% the one before that and then 8.1%, 7.2%, 6.5% and so on of
|
||||
the rest of the way. An image will effectively vanish around 25 images later
|
||||
than when it was added. This blend value is what is specified here and if higher
|
||||
will make slower progressing events less detectable as the reference image would
|
||||
change more quickly. Similarly events will be deemed to be over much sooner as
|
||||
the reference image adapts to the new images more quickly. In signal processing
|
||||
terms the higher this value the steeper the event attack and decay of the
|
||||
signal. It depends on your particular requirements what the appropriate value
|
||||
would be for you but start with 10 here and adjust it later if necessary.
|
||||
X10 Activation String – This option is only available if you have specified X10
|
||||
support in the configuration. If you have then this contents of this field
|
||||
determine when a monitor starts and stops being Active if its function is set to
|
||||
X10. Basically what this means is that a monitor with a Function of X10 normally
|
||||
acts as it is Passive, i.e. you can watch the video stream but no analysis is
|
||||
done. On receipt of the appropriate X10 signal however it effectively changes to
|
||||
Active mode and starts to analyse images until an X10 signal changes it back to
|
||||
Passive again. The format of this string is as follows,
|
||||
n : If you simply enter a number then the monitor will be activated when
|
||||
an X10 ON signal for that unit code is detected and will be deactivated when an
|
||||
OFF signal is detected.
|
||||
!n : This inverts the previous mode, e.g. !5 means that the monitor is
|
||||
activated when an OFF signal for unit code 5 is detected and deactivated by an
|
||||
ON.
|
||||
n+ : Entering a unit code followed by + means that the monitor is
|
||||
activated on receipt of a ON signal for that unit code but will ignore the OFF
|
||||
signal and as such will not be deactivated by this instruction. If you prepend a
|
||||
‘!’ as per the previous definition it similarly inverts the mode, i.e. the ON
|
||||
signal deactivates the monitor.
|
||||
n+<seconds> : As per the previous mode except that the monitor will
|
||||
deactivate itself after the given number of seconds.
|
||||
n- : Entering a unit code followed by - means that the monitor is
|
||||
deactivated on receipt of a OFF signal for that unit code but will ignore the ON
|
||||
signal and as such will not be activated by this instruction. If you prepend a
|
||||
‘!’ as per the previous definition it similarly inverts the mode, i.e. the OFF
|
||||
signal activates the monitor.
|
||||
n+<seconds> : As per the previous mode except that the monitor will
|
||||
activate itself after the given number of seconds.
|
||||
You can also combine several of these expressions to by separating them with a
|
||||
comma to create multiple circumstances of activation. However for now leave this
|
||||
blank.
|
||||
X10 Input Alarm String – This has the same format as the previous field but
|
||||
instead of activating the monitor with will cause a forced alarm to be generated
|
||||
and an event recorded if the monitor is Active. The same definition as above
|
||||
apply except that for activated read alarmed and for deactivated read
|
||||
unalarmed(!). Again leave this blank for now.
|
||||
X10 Output Alarm String – This X10 string also has the same format as the two
|
||||
above options. However it works in a slightly different way. Instead of
|
||||
ZoneMinder reacting to X10 events this option controls how ZoneMinder emits X10
|
||||
signals when the current monitor goes into or comes out of the alarm state. Thus
|
||||
just entering a number will cause the ON signal for that unit code to be sent
|
||||
when going into alarm state and the OFF signal when coming out of alarm state.
|
||||
Similarly 7+30 will send the unit code 7 ON signal when going into alarm state
|
||||
and the OFF signal 30 seconds later regardless of state. The combination of the
|
||||
X10 instruction allows ZoneMinder to react intelligently to, and also assume
|
||||
control of, other devices when necessary. However the indiscriminate use of the
|
||||
Input Alarm and Output Alarm signals can cause some horrendous race conditions
|
||||
such as a light going on in response to an alarm which then causes an alarm
|
||||
itself and so on. Thus some circumspection is required here. Leave this blank
|
||||
for now anyway.
|
||||
|
||||
Finally, click 'update' to add your monitor.
|
||||
|
||||
On the main console listing you will now see your monitor and some of its vital
|
||||
statistics. Each column is also a link and you get to other functions of ZM by
|
||||
choosing the appropriate one. For the most part I'll describe them left to right
|
||||
but lets start with the Device column which you'll see showing red. This means
|
||||
but let’s start with the Device column which you'll see showing red. This means
|
||||
that that device has no zmc (capture) daemon running on it, if it were orange it
|
||||
would mean that a zmc daemon was running but no zma (analysis) daemon and green
|
||||
means both are running. In our case it is red because we defined the Monitor to
|
||||
|
@ -231,8 +366,7 @@ You can now add further monitors if you have cameras set up to support them.
|
|||
Once you have one or more monitors you may notice a 'Scan' link appears which
|
||||
allows you to cycle through a shot from each of your monitors (unless they are
|
||||
switched off) and get a still image from each in turn. Clicking on the image
|
||||
will take you to the monitor watch window, which will be discussed shortly.
|
||||
|
||||
will take you to the monitor watch window, which will be discussed shortly.
|
||||
Returning to the main console window, if you click the Id of your monitor in the
|
||||
listing then you will have the opportunity to edit any of the settings your
|
||||
originally defined your monitor to have.
|
||||
|
@ -248,19 +382,21 @@ In the default case this will cover the whole image and will be red. Beneath
|
|||
that 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. As you can see
|
||||
there are quite a few, so now is a good time to go through them.
|
||||
there are quite a few, so now is a good time to go through them. The options are
|
||||
as follows.
|
||||
|
||||
Firstly the zone Name appears, you can change this to be more representative if
|
||||
you like, though it isn't used much except for logging and debugging. After that
|
||||
is the zone Type, this is one of the more important concepts in ZM and there are
|
||||
four to choose from. The one you'll use most and which will be set for your
|
||||
default zone if 'Active'. This means that this zone will trigger an alarm on any
|
||||
events that occur within that meet the selection criteria. The next two options
|
||||
I'll cover shortly but the one at the bottom is Inactive, which is the opposite
|
||||
of Active. In this zone type no alarms will ever be reported. Create an Inactive
|
||||
zone to cover any areas in which nothing notable will ever happen or where you
|
||||
get constant false alarms that don't relate to what you are trying to monitor.
|
||||
An Inactive zone can overlay other zone types and will be processed first.
|
||||
four to choose from. The one you'll use most often and which will be set for
|
||||
your default zone if 'Active'. This means that this zone will trigger an alarm
|
||||
on any events that occur within that meet the selection criteria. The next two
|
||||
options I'll cover shortly but the one at the bottom is Inactive, which is the
|
||||
opposite of Active. In this zone type no alarms will ever be reported. Create an
|
||||
Inactive zone to cover any areas in which nothing notable will ever happen or
|
||||
where you get constant false alarms that don't relate to what you are trying to
|
||||
monitor. An Inactive zone can overlay other zone types and will be processed
|
||||
first.
|
||||
|
||||
The next option is Inclusive and you'd use this zone type for any zones that you
|
||||
want to trigger an alarm only if at least one other Active zone has already
|
||||
|
@ -312,22 +448,11 @@ Motion Detection
|
|||
The options that follow are all related to motion detection and now would be a
|
||||
good time to describe how that works. Once a stream of images starts coming
|
||||
through the zma daemon will begin analysing them initially there will be a warm-
|
||||
up period where it does nothing except start to build up a reference image. This
|
||||
image is a composite of the previous images and by default is formed of by
|
||||
applying the current image as 10% of the previous reference image. Thus each
|
||||
images part in the reference image will diminish by a factor of 0.9 each time
|
||||
round. So a typical reference image will be 10% the previous image, 9% the one
|
||||
before that and then 8.1, 7.2, 6.5 and so on of the rest of the way. An image
|
||||
will effectively vanish around 25 images later than when it was added. This
|
||||
blend value of 10% can be varied and if higher will make slower progressing
|
||||
events less detectable as the reference image would change more quickly,
|
||||
similarly events will be deemed to be over much sooner as the reference image
|
||||
adapts to the new images more quickly. In signal processing terms the higher
|
||||
this value the steeper the event attack and decay of the signal. It depends on
|
||||
your particular requirements what the appropriate value would be for you.
|
||||
up period where it does nothing except start to build up a reference image. How
|
||||
this is done was explained above.
|
||||
|
||||
So to go back to the settings, the next one is an alarm threshold, this
|
||||
represents the difference in value between a pixel and it's predecessor. For
|
||||
So to go back to the settings, the next one is an alarm threshold; this
|
||||
represents the difference in value between a pixel and its predecessor. For
|
||||
greyscale images this is simple but for colour images the colours are averaged
|
||||
first, originally this used an RMS (root mean squared) algorithm but calculating
|
||||
square roots mugs performance and does not seem to improve detection. Using an
|
||||
|
@ -389,7 +514,7 @@ 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. By default if you have minimised this window or opened other windows in
|
||||
front it will pop up to the front if it goes to Alarm state. This behaviour can
|
||||
be turned off in configuration at the top of the index.php file. You can also
|
||||
be turned off in configuration at the top of the zmconfig.php file. You can also
|
||||
specify a sound file in the configuration, which will be played when an alarm
|
||||
occurs to alert you to the fact if you are not in front of your computer. This
|
||||
should be a short sound of only a couple of seconds ideally. Note that as the
|
||||
|
@ -397,24 +522,25 @@ status is refreshed every few seconds it is possible for this not to alert you
|
|||
to every event that takes place, so you shouldn't rely on it for this purpose if
|
||||
you expect very brief events. Alternatively you can decrease the refresh
|
||||
interval for this window in the configuration though having too frequently
|
||||
refreshing may impact on performance. Below the status is a list of recent
|
||||
events that have occurred, by default this is a listing of just the last 12 but
|
||||
clicking on 'All' will give you a full list and 'Archive' will take you to the
|
||||
event archive for this monitor, more on this later. Clicking on any of the
|
||||
column headings will sort the events appropriately. From here you can also
|
||||
delete events if you wish. The events themselves are listed with the event id,
|
||||
and event name (which you can change), the time that the event occurred, the
|
||||
length of the event including any preamble and post amble frames, the number of
|
||||
frames comprising the event with the number that actually contain an alarm in
|
||||
brackets and finally a score. This column lists the average score per alarm
|
||||
frame as well as the maximum score that any alarm frame had. The score is an
|
||||
arbitrary value that essentially represents the percentage of pixels in the zone
|
||||
that are in blobs divided by the number of blobs and then divided by the size of
|
||||
the zone. This gives a nominal maximum of 100 for a zone and the totals for each
|
||||
zone are added together, Active zones scores are added unchanged, Inclusive
|
||||
zones are halved first and Exclusive zones are doubled. In reality values are
|
||||
likely to be much less than 100 but it does give a simple indication of how
|
||||
major the event was.
|
||||
refreshing may impact on performance.
|
||||
|
||||
Below the status is a list of recent events that have occurred, by default this
|
||||
is a listing of just the last 12 but clicking on 'All' will give you a full list
|
||||
and 'Archive' will take you to the event archive for this monitor, more on this
|
||||
later. Clicking on any of the column headings will sort the events
|
||||
appropriately. From here you can also delete events if you wish. The events
|
||||
themselves are listed with the event id, and event name (which you can change),
|
||||
the time that the event occurred, the length of the event including any preamble
|
||||
and post amble frames, the number of frames comprising the event with the number
|
||||
that actually contain an alarm in brackets and finally a score. This column
|
||||
lists the average score per alarm frame as well as the maximum score that any
|
||||
alarm frame had. The score is an arbitrary value that essentially represents the
|
||||
percentage of pixels in the zone that are in blobs divided by the number of
|
||||
blobs and then divided by the size of the zone. This gives a nominal maximum of
|
||||
100 for a zone and the totals for each zone are added together, Active zones
|
||||
scores are added unchanged, Inclusive zones are halved first and Exclusive zones
|
||||
are doubled. In reality values are likely to be much less than 100 but it does
|
||||
give a simple indication of how major the event was.
|
||||
|
||||
Filtering Events
|
||||
----------------
|
||||
|
@ -424,7 +550,7 @@ 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 it's own window. Thus if you clicked on a 'day' total the filter
|
||||
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
|
||||
|
@ -434,18 +560,20 @@ refresh automatically, rather only on request. Other than that, you can choose
|
|||
to view events here or delete them as before. 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
|
||||
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 filter comprised of many expressions you will
|
||||
'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. 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
|
||||
as desired.
|
||||
|
||||
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.zend.com/manual/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. The other elements you can filter
|
||||
|
@ -459,7 +587,7 @@ whether you want this filter automatically applied in order to delete events or
|
|||
upload events via ftp to another server. This functionality is explained in more
|
||||
detail elsewhere. 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 it's own is
|
||||
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.
|
||||
|
||||
|
@ -479,32 +607,33 @@ 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 it's detail
|
||||
and scroll through the various images that make up 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). 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 experimental
|
||||
and not likely to be highly useful. It uses the Berkeley MPEG encoder and will
|
||||
generate a short video which will be downloaded to your browsing machine to
|
||||
view. Due to the relatively slow frame rate that ZM will capture at and the high
|
||||
minimum frame rate that the encoder uses, each image is included twice. This has
|
||||
the useful effect of making the video watchable and not too quick while having
|
||||
the unfortunate side effect of increasing file size and generation time.
|
||||
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. I will be the first to admit that this area of the package is not
|
||||
particularly well implemented and needs work, and probably a better encoder.
|
||||
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. 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 experimental and not likely to
|
||||
be highly useful. It uses the Berkeley MPEG encoder and will generate a short
|
||||
video which will be downloaded to your browsing machine to view. Due to the
|
||||
relatively slow frame rate that ZM will capture at and the high minimum frame
|
||||
rate that the encoder uses, each image is included twice. This has the useful
|
||||
effect of making the video watchable and not too quick while having the
|
||||
unfortunate side effect of increasing file size and generation time. 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. I will be the
|
||||
first to admit that this area of the package is not particularly well
|
||||
implemented and needs work, and probably a better encoder.
|
||||
|
||||
That pretty much is it for the tour. You should experiment with the various
|
||||
setting to get the results you think are right for your. Naturally letting
|
||||
|
@ -515,7 +644,7 @@ the first place or ensure that you housekeep them strictly.
|
|||
Have fun, please report any bugs or features you'd like to see and hopefully ZM
|
||||
can be your camera monitoring friend!
|
||||
|
||||
Philip Coombes (philip.coombes@zoneminder.com) - December 2002
|
||||
Philip Coombes (philip.coombes@zoneminder.com) - January 2003
|
||||
|
||||
|
||||
Troubleshooting
|
||||
|
@ -533,12 +662,7 @@ Some things to check.
|
|||
make sure that you have the correct settings. Use xawtv or something like that
|
||||
to check for settings that work. If you can't get them to work with that then
|
||||
the likelihood is they won't work with ZM.
|
||||
2. Device permissions. Since the ZM daemons are started by your web server, you
|
||||
need to ensure that your video devices can be opened by the associated user,
|
||||
usually apache or web. It is often the case that these files are created with
|
||||
read access by root only (and sometimes reset on a reboot) so you might need to
|
||||
chmod a+r /dev/video0 etc. to make them readable.
|
||||
3. Web server. Ensure that your web server can serve PHP files. It's also
|
||||
2. Web server. Ensure that your web server can serve PHP files. It's also
|
||||
possible that your php.ini file may have some settings which break ZM, I'm not a
|
||||
PHP guru but setting safe mode may prevent your PHP files from running certain
|
||||
programs. You may have to set configuration to allow this. Also since the
|
||||
|
@ -546,7 +670,7 @@ daemons are started by your web server, if it dies or is shut down then the
|
|||
daemons may disappear. In this version the daemons are run under the control of
|
||||
a script which should trap expected signals but it is possible this doesn't
|
||||
cover all circumstances.
|
||||
4. Use debug. ZM has various debug in it that by default will go into your
|
||||
3. Use debug. ZM has various debug in it that by default will go into your
|
||||
system log (via syslog). These will be of the form of
|
||||
"Sep 14 14:50:11 localhost zma-0[1975]: INF [Front: 221000 - Processing at 4.26
|
||||
fps ]"
|
||||
|
@ -573,42 +697,42 @@ http://www.zoneminder.com/downloads/noIEClick.reg
|
|||
Whats New
|
||||
=========
|
||||
|
||||
Release 0.9.5 - Yes, a big jump in release number but a lot of changes too. Now
|
||||
Release 0.9.7 - Yes, a big jump in release number but a lot of changes too. Now
|
||||
somewhat more mature, not really an alpha any more, and a lot of bugs fixed too.
|
||||
- Added zmconfig.pl script to help with configuration.
|
||||
- Revamped to work better with configure scripts
|
||||
- Monitors now have more configuration options, including some that
|
||||
were statically defined before such as location and format of the
|
||||
image timestamps.
|
||||
- Removed Alarms table from schema as not required, never was actually..
|
||||
- Monitors now have more configuration options, including some that were
|
||||
statically defined before such as location and format of the image timestamps.
|
||||
- Removed Alarms table from schema as not required, never was actually...
|
||||
- Added a number of new scripts, see the scripts directory
|
||||
- Added Fast delete to PHP files. This allows the web interface to only
|
||||
delete the event entries themselves for speed and them have the zmaudit
|
||||
script periodically tidy up the rest.
|
||||
- Added event filter to enable bulk viewing, upload or deletion of events
|
||||
- Added Fast delete to PHP files. This allows the web interface to only delete
|
||||
the event entries themselves for speed and then have the zmaudit script
|
||||
periodically tidy up the rest.
|
||||
- Added event filter to enable bulk viewing, upload or deletion of events
|
||||
according to various attributes. Filter can be saved and edited.
|
||||
- Added last event id to shared memory for auto-filtering etc.
|
||||
- Changed zmu -i option to write to monitor named image file.
|
||||
- Made shared memory management somewhat more sensible.
|
||||
- Now stores DB times as localtime rather than UTC avoiding daylight
|
||||
saving related bugs.
|
||||
- Now stores DB times as localtime rather than UTC avoiding daylight saving
|
||||
related bugs.
|
||||
- Fixed bug with inactive zones and added more debug.
|
||||
- Changed main functions to return int.
|
||||
- Added help and usage to zmu.
|
||||
- Fixed browser acceptance problem, more easily defaults to HTML.
|
||||
- Split out the PHP files into a bunch with specific functions rather
|
||||
than one monolithic one.
|
||||
- Split out the PHP files into a bunch with specific functions rather than one
|
||||
monolithic one.
|
||||
- Fixed NetPBM paths and changed _SERVER to HTTP_SERVER_VARS.
|
||||
- Added HUP signal on zone deletion.
|
||||
- Added NETPBM_DIR and conditional netpbm stuff.
|
||||
- Removed hardcoded window sizes, all popup window dimensions can be
|
||||
specified in zmconfig.php
|
||||
- Changed form methods to 'get' from 'post' to avoid resubmit warnings
|
||||
all the time.
|
||||
- Removed hard coded window sizes, all popup window dimensions can be specified
|
||||
in zmconfig.php
|
||||
- Changed form methods to 'get' from 'post' to avoid resubmit warnings all the
|
||||
time.
|
||||
- Added conditional sound to alarm on web interface.
|
||||
- Fixed syntax error when adding default monitor.
|
||||
- Some of the web views have changed slightly to accomdate the separate
|
||||
events view.
|
||||
- And much much more, probably.
|
||||
- Some of the web views have changed slightly to accommodate the separate events
|
||||
view.
|
||||
- And much much more, probably...
|
||||
|
||||
Release 0.0.1 - Initial release, therefore nothing new.
|
||||
|
||||
|
@ -634,9 +758,9 @@ precisely define and see where your zone is going to go. Not critical but handy
|
|||
but a bugger to do.
|
||||
6. Zone Definitions - Allow zones to be defined according to a colour coded
|
||||
bitmap or as polygons. Currently all zones are rectangular this would add a bit
|
||||
of flexibility. Would need a bit of a rewrite though. 20. This will incur a
|
||||
slight penalty on startup and a very slight one on processing for all reasonably
|
||||
shaped zones.
|
||||
of flexibility. Would need a bit of a rewrite though. This will incur a slight
|
||||
penalty on startup and a very slight one on processing for all reasonably shaped
|
||||
zones.
|
||||
7. Security - I think I need to give the php file a bit of a good going over as
|
||||
I'm sure it's not done in the most secure way regarding passing things onto
|
||||
command line, exposing file paths and other stuff. I'm a bit of a PHP novice, as
|
||||
|
@ -645,53 +769,47 @@ I'm sure you can tell so might need help here. I should have done it in perl!
|
|||
be handy. A bit more help full stop actually.
|
||||
9. WAP interface - A bit of a crusade of mine I'm afraid. I'd like to put a WML
|
||||
interface on to allow you to view event listing and perhaps the most significant
|
||||
image from each event on your phone. Also simple management. In version 0.9.5
|
||||
image from each event on your phone. Also simple management. In version 0.9.7
|
||||
there is a very basic crude initial version that probably won't work with your
|
||||
phone but its there as a testbed. Note, temporary WAP files are not tidied up
|
||||
properly so don't use it for extanded periods of time at present.
|
||||
phone but its there as a testbed.
|
||||
10. Email and SMS notifications - As with the FTP uploads, probably event the
|
||||
same daemon to let you know when something happens, perhaps configurable to
|
||||
report only certain types of events.
|
||||
11. Templatise the php file. Personally I hate mixing up HTML and logic, perhaps
|
||||
use Smarty or something and separate the screens out from the rest.
|
||||
12. Automatic device configuration - Video 4 Linux supports various device
|
||||
report only certain types of events. This will be a new sort of filter in the
|
||||
next version.
|
||||
11. Automatic device configuration - Video 4 Linux supports various device
|
||||
queries, it should be possible to get most of the device capability information
|
||||
from the device itself.
|
||||
13. Extend the X-10 integration - A handy feature would be to allow a generated
|
||||
event to trigger some other action perhaps to an attached X-10 interface, for
|
||||
instance turn lights on or make a dog barky noise!
|
||||
14. Extend the API. Well ok it's not really got an API yet but the image data is
|
||||
12. Extend the API. Well ok it's not really got an API yet but the image data is
|
||||
held in shared memory in a very simple format. In theory you could use the
|
||||
capture daemon to gab the images and other things could read them from memory or
|
||||
the analysis daemon could read images from elsewhere. Either way this should be
|
||||
done through an API, and would need a library I think. Also the zmu utility
|
||||
could probably do a whole lot more to enable other things to manage when the
|
||||
daemons become active etc.
|
||||
15. Access control should probably be built in rather than relying on .htaccess
|
||||
13. Access control should probably be built in rather than relying on .htaccess
|
||||
etc.
|
||||
16. I've got lots of ideas for enhancing the motion detection part with optional
|
||||
14. I've got lots of ideas for enhancing the motion detection part with optional
|
||||
algorithms etc. Just got to find the time somewhere!
|
||||
17. Create .rpm packages (as there can be several dependencies) and maybe other
|
||||
15. Create .rpm packages (as there can be several dependencies) and maybe other
|
||||
types of packages also, e.g. for Debian distributions.
|
||||
18. Allow ZM to 'train' itself by allowing the user to select events that are
|
||||
16. Allow ZM to 'train' itself by allowing the user to select events that are
|
||||
considered important and to discard those that should be ignored. ZM will
|
||||
interpolate, add a bit of magic, and recommend settings that will support this
|
||||
selection automatically thereafter.
|
||||
19. Add quotes to all PHP array references. I should have done it in the first
|
||||
selection automatically thereafter. The hooks for this are already in to some
|
||||
extent.
|
||||
17. Add quotes to all PHP array references. I should have done it in the first
|
||||
place but I'm a perl person really and it kind of bugs me that you have to.
|
||||
|
||||
|
||||
Bugs
|
||||
====
|
||||
|
||||
1. Sometimes there is a sync error and very rarely a capture daemon just stops.
|
||||
Probably need a watchdog to restart it when this happens.
|
||||
2. I'm not sure if this is a bug or by design but the timestamp is added to the
|
||||
1. I'm not sure if this is a bug or by design but the timestamp is added to the
|
||||
image by the capture daemon. I _think_ this isn't necessary as it may contribute
|
||||
to alarms, plus the time is associated with the image anyway. So I think this
|
||||
should be moved to the analysis daemon.
|
||||
|
||||
Probably a bucket load more, just fire them at me.
|
||||
Probably bucket loads more, just fire them at me.
|
||||
|
||||
|
||||
Non-Bugs
|
||||
|
@ -726,3 +844,4 @@ You should have received a copy of the GNU General Public License along with
|
|||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue