From 51b4c27b27422347963db122c52658396b6ebd07 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Fri, 14 Dec 2018 17:30:45 -0500 Subject: [PATCH 01/47] foscam r2c ptz --- .../lib/ZoneMinder/Control/FOSCAMR2C.pm | 370 ++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm new file mode 100644 index 000000000..ac47fb953 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm @@ -0,0 +1,370 @@ +# Modified on Jun 19 2016 by PP +# Changes made +# - modified command to work properly and pick up credentials from Control Device +# - the old script did not stop moving- added autostop +# (note that mjpeg cameras have onestep but that is too granular) +# - You need to set "user=xxx&pwd=yyy" in the ControlDevice field (NOT usr like in Foscam HD) + +# ========================================================================== +# +# ZoneMinder Foscam FI8918W IP Control Protocol Module, $Date: 2009-11-25 09:20:00 +0000 (Wed, 04 Nov 2009) $, $Revision: 0001 $ +# Copyright (C) 2001-2008 Philip Coombes +# +# Modified for use with Foscam FI8918W IP Camera by Dave Harris +# Modified Feb 2011 by Howard Durdle (http://durdl.es/x) to: +# fix horizontal panning, add presets and IR on/off +# use Control Device field to pass username and password +# Modified May 2014 by Arun Horne (http://arunhorne.co.uk) to: +# use HTTP basic auth as required by firmware 11.37.x.x upward +# Modified for use with Foscam R2C IP Camera by Erik Schoepplenberg +# +# 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. +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# ========================================================================== +# +# This module contains the implementation of the Foscam R2C camera control +# protocol +# + +package MyAgent; + +use base 'LWP::UserAgent'; + + +package ZoneMinder::Control::FOSCAMR2C; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# Foscam R2C IP Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); +use DBI; +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + my $logindetails = ""; + bless( $self, $class ); + srand( time() ); + return $self; +} + +our $AUTOLOAD; + +sub AUTOLOAD +{ + my $self = shift; + my $class = ref($self) || croak( "$self not object" ); + my $name = $AUTOLOAD; + $name =~ s/.*://; + if ( exists($self->{$name}) ) + { + return( $self->{$name} ); + } + Fatal( "Can't access $name member of object of class $class" ); +} +our $stop_command; + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + $self->{ua} = MyAgent->new; + $self->{ua}->agent( "ZoneMinder Control Agent/" ); + + $self->{state} = 'open'; +} + +sub close +{ + my $self = shift; + $self->{state} = 'closed'; +} + +sub printMsg +{ + my $self = shift; + my $msg = shift; + my $msg_len = length($msg); + + Debug( $msg."[".$msg_len."]" ); +} + +sub sendCmd +{ + my $self = shift; + my $cmd = shift; + my $result = undef; + printMsg( $cmd, "Tx" ); + + # PP Old cameras also support onstep=1 but it is too granular. Instead using moveCon and stop after interval + # PP - cleaned up URL to take it properly from Control device + # Control device needs to be of format user=xxx&pwd=yyy + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd"."&".$self->{Monitor}->{ControlDevice}); + print ("Sending $req\n"); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error REALLY check failed:'".$res->status_line()."'" ); + Error ("Cmd:".$req); + } + + return( $result ); +} + +sub reset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzReset"; + $self->sendCmd( $cmd ); +} + +# PP - in all move operations, added auto stop after timeout + +#Up Arrow +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveUp"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Down Arrow +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveDown"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Left Arrow +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveLeft"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Right Arrow +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveRight"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Diagonally Up Right Arrow +sub moveConUpRight +{ + my $self = shift; + Debug( "Move Diagonally Up Right" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveTopRight"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); + +} + +#Diagonally Down Right Arrow +sub moveConDownRight +{ + my $self = shift; + Debug( "Move Diagonally Down Right" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveBottomRight"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Diagonally Up Left Arrow +sub moveConUpLeft +{ + my $self = shift; + Debug( "Move Diagonally Up Left" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveTopLeft"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Diagonally Down Left Arrow +sub moveConDownLeft +{ + my $self = shift; + Debug( "Move Diagonally Down Left" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzMoveBottomLeft"; + $self->sendCmd( $cmd ); + $self->autoStop( $self->{Monitor}->{AutoStopTimeout} ); +} + +#Stop +sub moveStop +{ + my $self = shift; + Debug( "Move Stop" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzStopRun"; + $self->sendCmd( $cmd ); +} + +# PP - imported from 9831 - autostop after usleep +sub autoStop +{ + my $self = shift; + my $autostop = shift; + if( $autostop ) + { + Debug( "Auto Stop" ); + usleep( $autostop ); + my $cmd = "CGIProxy.fcgi?cmd=ptzStopRun"; + $self->sendCmd( $cmd ); + } +} + +#Move Camera to Home Position +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "decoder_control.cgi?command=25"; + $self->sendCmd( $cmd ); +} + +#Set preset +sub presetSet +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); + my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); + $sth->execute(); + my $ref = ($sth->fetchrow_hashref()); + my $label = $ref->{'Label'}; + $sth->finish(); + Debug( "Set Preset $preset with cmd $label" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzAddPresetPoint&name=$label"; + $self->sendCmd( $cmd ); + + +} + +#Goto preset +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); + my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); + $sth->execute(); + my $ref = ($sth->fetchrow_hashref()); + my $label = $ref->{'Label'}; + $sth->finish(); + Debug( "Goto Preset $preset with cmd $label" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=$label"; + $self->sendCmd( $cmd ); +} + +#Turn IR on +sub wake +{ + my $self = shift; + Debug( "Wake - IR on" ); + my $cmd = "CGIProxy.fcgi?cmd=openInfraLed"; + $self->sendCmd( $cmd ); +} + +#Turn IR off +sub sleep +{ + my $self = shift; + Debug( "Sleep - IR off" ); + my $cmd = "CGIProxy.fcgi?cmd=closeInfraLed"; + $self->sendCmd( $cmd ); +} + +1; +__END__ + +=head1 R2C + +ZoneMinder::Database - Perl extension for FOSCAM R2C + +=head1 SYNOPSIS + +Control script for Foscam R2C cameras. + +=head1 DESCRIPTION + +You need to set "user=xxx&pwd=yyy" in the ControlDevice field +of the control tab for that monitor. +Auto TimeOut should be 1. Don't set it to less - processes +start crashing :) +NOTE: unlike HD foscam cameras, this one uses "user" not "usr" +in the control device + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +=head1 AUTHOR + +Philip Coombes, Ephilip.coombes@zoneminder.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2001-2008 Philip Coombes + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.3 or, +at your option, any later version of Perl 5 you may have available. + + +=cut + From 180a4b07b17d6bde72b61f117f29faa26d1311a4 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Fri, 14 Dec 2018 19:13:41 -0500 Subject: [PATCH 02/47] foscam r2c ptz --- scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm index ac47fb953..563eb174f 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm @@ -64,7 +64,8 @@ our $VERSION = $ZoneMinder::Base::VERSION; use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); -use DBI; +use ZoneMinder::Database qw(zmDbConnect); + use Time::HiRes qw( usleep ); sub new @@ -277,7 +278,7 @@ sub presetSet my $self = shift; my $params = shift; my $preset = $self->getParam( $params, 'preset' ); - my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); + my $dbh = zmDbConnect(1); my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); $sth->execute(); my $ref = ($sth->fetchrow_hashref()); @@ -296,7 +297,7 @@ sub presetGoto my $self = shift; my $params = shift; my $preset = $self->getParam( $params, 'preset' ); - my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); + my $dbh = zmDbConnect(1); my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); $sth->execute(); my $ref = ($sth->fetchrow_hashref()); From 4937a68650aeafaff78559f27818616ecd4dfbce Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 27 Dec 2018 14:27:43 -0500 Subject: [PATCH 03/47] Update area when editing x and y coords --- web/skins/classic/views/js/zone.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/skins/classic/views/js/zone.js b/web/skins/classic/views/js/zone.js index bfcd91943..d42b3d807 100644 --- a/web/skins/classic/views/js/zone.js +++ b/web/skins/classic/views/js/zone.js @@ -347,6 +347,7 @@ function updateX( index ) { zone['Points'][index].x = x; var Point = $('zonePoly').points.getItem(index); Point.x = x; + updateArea(); } function updateY( index ) { @@ -359,6 +360,7 @@ function updateY( index ) { zone['Points'][index].y = y; var Point = $('zonePoly').points.getItem(index); Point.y = y; + updateArea(); } function saveChanges( element ) { From 101f24feb5b1679254a1dbbc77eb172c4e5f8eb8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 27 Dec 2018 14:28:14 -0500 Subject: [PATCH 04/47] Update area when editing x and y coords (#2366) --- web/skins/classic/views/js/zone.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/skins/classic/views/js/zone.js b/web/skins/classic/views/js/zone.js index bfcd91943..d42b3d807 100644 --- a/web/skins/classic/views/js/zone.js +++ b/web/skins/classic/views/js/zone.js @@ -347,6 +347,7 @@ function updateX( index ) { zone['Points'][index].x = x; var Point = $('zonePoly').points.getItem(index); Point.x = x; + updateArea(); } function updateY( index ) { @@ -359,6 +360,7 @@ function updateY( index ) { zone['Points'][index].y = y; var Point = $('zonePoly').points.getItem(index); Point.y = y; + updateArea(); } function saveChanges( element ) { From c128998c2080642317d4e34cb5eed5fc3edb88b8 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Thu, 27 Dec 2018 18:16:52 -0600 Subject: [PATCH 05/47] Update redhat.rst --- docs/installationguide/redhat.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/installationguide/redhat.rst b/docs/installationguide/redhat.rst index 12d9ed769..71b4f5278 100644 --- a/docs/installationguide/redhat.rst +++ b/docs/installationguide/redhat.rst @@ -197,7 +197,7 @@ If you have previsouly cloned the ZoneMinder git repo and wish to update it to t :: - cd ~\ZoneMinder + cd ~/ZoneMinder git pull origin master Get the crud submodule tarball: @@ -210,14 +210,14 @@ At this point, you can make changes to the source code. Depending on what you wa :: - cd ~\ZoneMinder + cd ~/ZoneMinder git checkout -b mynewbranch Again, depending on what you want to do with those changes, you may want to commit your changes: :: - cd ~\ZoneMinder + cd ~/ZoneMinder git add . git commit @@ -231,7 +231,7 @@ Scroll down until you see the Version field. Note the value, which will be in th :: - cd ~\ZoneMinder + cd ~/ZoneMinder git archive --prefix=ZoneMinder-1.31.1/ -o ~/rpmbuild/SOURCES/zoneminder-1.31.1.tar.gz HEAD Replace "1.31.1" with the Version shown in the rpm specfile. @@ -240,7 +240,7 @@ From the root of the local ZoneMinder git repo, execute the following: :: - cd ~\ZoneMinder + cd ~/ZoneMinder rpmbuild -bs --nodeps distros/redhat/zoneminder.spec This step will create a source rpm and it will tell you where it was saved. For example: From 6e7ecf4e89eed6d4a3e57bc865ef9352a9a5b9bf Mon Sep 17 00:00:00 2001 From: Jonathan Meredith <35303639+jimender2@users.noreply.github.com> Date: Thu, 27 Dec 2018 22:20:24 -0500 Subject: [PATCH 06/47] Fix spelling mistake Changed his to this --- docs/userguide/options/options_images.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/userguide/options/options_images.rst b/docs/userguide/options/options_images.rst index 3e8598425..1b17d8336 100644 --- a/docs/userguide/options/options_images.rst +++ b/docs/userguide/options/options_images.rst @@ -23,7 +23,7 @@ MPEG_LIVE_FORMAT - When using MPEG mode ZoneMinder can output live video. Howeve MPEG_REPLAY_FORMAT - When using MPEG mode ZoneMinder can replay events in encoded video format. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player and 'mpg', or 'avi' etc should work under Linux. If you know any more then please let me know! If this option is left blank then live streams will revert to being in motion jpeg format -RAND_STREAM - Some browsers can cache the streams used by ZoneMinder. In order to prevent his a harmless random string can be appended to the url to make each invocation of the stream appear unique. +RAND_STREAM - Some browsers can cache the streams used by ZoneMinder. In order to prevent this a harmless random string can be appended to the url to make each invocation of the stream appear unique. OPT_CAMBOZOLA - Cambozola is a handy low fat cheese flavoured Java applet that ZoneMinder uses to view image streams on browsers such as Internet Explorer that don't natively support this format. If you use this browser it is highly recommended to install this from http://www.charliemouse.com/code/cambozola/ however if it is not installed still images at a lower refresh rate can still be viewed. From 265a73ab29402f821da16c7cc4583c5b2e04fce5 Mon Sep 17 00:00:00 2001 From: Jonathan Meredith <35303639+jimender2@users.noreply.github.com> Date: Thu, 27 Dec 2018 22:26:07 -0500 Subject: [PATCH 07/47] Spelling mistake fix Changed his to this --- scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 27d993894..846a62f82 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -659,7 +659,7 @@ our @options = ( description => 'Add a random string to prevent caching of streams', help => q` Some browsers can cache the streams used by ZoneMinder. In - order to prevent his a harmless random string can be appended + order to prevent this a harmless random string can be appended to the url to make each invocation of the stream appear unique. `, type => $types{boolean}, From fb37fc48e19eb644e41fbde28eebe831cc8aa05a Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 28 Dec 2018 09:38:39 -0600 Subject: [PATCH 08/47] update viewImagePatch (#2370) --- web/includes/functions.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 8baf30921..f4a9b3395 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -845,13 +845,7 @@ function getImageSrc( $event, $frame, $scale=SCALE_BASE, $captureOnly=false, $ov } function viewImagePath( $path, $querySep='&' ) { - if ( strncmp( $path, ZM_DIR_IMAGES, strlen(ZM_DIR_IMAGES) ) == 0 ) { - // Thumbnails - return( $path ); - } elseif ( strpos( ZM_DIR_EVENTS, '/' ) === 0 ) { - return( '?view=image'.$querySep.'path='.$path ); - } - return( ZM_DIR_EVENTS.'/'.$path ); + return( '?view=image'.$querySep.'path='.$path ); } function createListThumbnail( $event, $overwrite=false ) { From a0299099729199439a0bb8f7e7e38061b04b0244 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 28 Dec 2018 09:46:13 -0600 Subject: [PATCH 09/47] fix path to thumb and anal images (#2367) --- web/includes/Event.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/web/includes/Event.php b/web/includes/Event.php index 27d9ae015..a4f389aca 100644 --- a/web/includes/Event.php +++ b/web/includes/Event.php @@ -414,15 +414,13 @@ class Event { if ( ! file_exists($captPath) ) { Error( "Capture file does not exist at $captPath" ); } - $thumbCaptPath = ZM_DIR_IMAGES.'/'.$this->{'Id'}.'-'.$captImage; - //echo "CI:$captImage, CP:$captPath, TCP:$thumbCaptPath
"; + //echo "CI:$captImage, CP:$captPath, TCP:$captPath
"; $analImage = sprintf( '%0'.ZM_EVENT_IMAGE_DIGITS.'d-analyse.jpg', $frame['FrameId'] ); $analPath = $eventPath.'/'.$analImage; - $thumbAnalPath = ZM_DIR_IMAGES.'/'.$this->{'Id'}.'-'.$analImage; - //echo "AI:$analImage, AP:$analPath, TAP:$thumbAnalPath
"; + //echo "AI:$analImage, AP:$analPath, TAP:$analPath
"; $alarmFrame = $frame['Type']=='Alarm'; @@ -440,8 +438,8 @@ class Event { $fraction = sprintf( '%.3f', $scale/SCALE_BASE ); $scale = (int)round( $scale ); - $thumbCaptPath = preg_replace( '/\.jpg$/', "-$scale.jpg", $thumbCaptPath ); - $thumbAnalPath = preg_replace( '/\.jpg$/', "-$scale.jpg", $thumbAnalPath ); + $thumbCaptPath = preg_replace( '/\.jpg$/', "-$scale.jpg", $captPath ); + $thumbAnalPath = preg_replace( '/\.jpg$/', "-$scale.jpg", $analPath ); if ( $isAnalImage ) { $imagePath = $analPath; From 893048c306c68e15df4d3ed9f167c48eb6d94ac6 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 28 Dec 2018 09:46:27 -0600 Subject: [PATCH 10/47] remove option to build with no ffmpeg (#2365) --- CMakeLists.txt | 252 ++++++++++++++++++++++++------------------------- INSTALL | 1 - 2 files changed, 123 insertions(+), 130 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0d037099..602549ab9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,8 +186,6 @@ set(ZM_MYSQL_ENGINE "InnoDB" CACHE STRING set(ZM_NO_MMAP "OFF" CACHE BOOL "Set to ON to not use mmap shared memory. Shouldn't be enabled unless you experience problems with the shared memory. default: OFF") -set(ZM_NO_FFMPEG "OFF" CACHE BOOL - "Set to ON to skip ffmpeg checks and force building ZM without ffmpeg. default: OFF") set(ZM_NO_LIBVLC "OFF" CACHE BOOL "Set to ON to skip libvlc checks and force building ZM without libvlc. default: OFF") set(ZM_NO_CURL "OFF" CACHE BOOL @@ -518,141 +516,137 @@ endif(MP4V2_LIBRARIES) set(PATH_FFMPEG "") set(OPT_FFMPEG "no") -# Do not check for ffmpeg if ZM_NO_FFMPEG is on -if(NOT ZM_NO_FFMPEG) - # avformat (using find_library and find_path) - find_library(AVFORMAT_LIBRARIES avformat) - if(AVFORMAT_LIBRARIES) - set(HAVE_LIBAVFORMAT 1) - list(APPEND ZM_BIN_LIBS "${AVFORMAT_LIBRARIES}") - find_path(AVFORMAT_INCLUDE_DIR "libavformat/avformat.h" /usr/include/ffmpeg) - if(AVFORMAT_INCLUDE_DIR) - include_directories("${AVFORMAT_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${AVFORMAT_INCLUDE_DIR}") - endif(AVFORMAT_INCLUDE_DIR) - mark_as_advanced(FORCE AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIR) - check_include_file("libavformat/avformat.h" HAVE_LIBAVFORMAT_AVFORMAT_H) - set(optlibsfound "${optlibsfound} AVFormat") - else(AVFORMAT_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} AVFormat") - endif(AVFORMAT_LIBRARIES) +# avformat (using find_library and find_path) +find_library(AVFORMAT_LIBRARIES avformat) +if(AVFORMAT_LIBRARIES) + set(HAVE_LIBAVFORMAT 1) + list(APPEND ZM_BIN_LIBS "${AVFORMAT_LIBRARIES}") + find_path(AVFORMAT_INCLUDE_DIR "libavformat/avformat.h" /usr/include/ffmpeg) + if(AVFORMAT_INCLUDE_DIR) + include_directories("${AVFORMAT_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${AVFORMAT_INCLUDE_DIR}") + endif(AVFORMAT_INCLUDE_DIR) + mark_as_advanced(FORCE AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIR) + check_include_file("libavformat/avformat.h" HAVE_LIBAVFORMAT_AVFORMAT_H) + set(optlibsfound "${optlibsfound} AVFormat") +else(AVFORMAT_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} AVFormat") +endif(AVFORMAT_LIBRARIES) - # avcodec (using find_library and find_path) - find_library(AVCODEC_LIBRARIES avcodec) - if(AVCODEC_LIBRARIES) - set(HAVE_LIBAVCODEC 1) - list(APPEND ZM_BIN_LIBS "${AVCODEC_LIBRARIES}") - find_path(AVCODEC_INCLUDE_DIR "libavcodec/avcodec.h" /usr/include/ffmpeg) - if(AVCODEC_INCLUDE_DIR) - include_directories("${AVCODEC_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${AVCODEC_INCLUDE_DIR}") - endif(AVCODEC_INCLUDE_DIR) - mark_as_advanced(FORCE AVCODEC_LIBRARIES AVCODEC_INCLUDE_DIR) - check_include_file("libavcodec/avcodec.h" HAVE_LIBAVCODEC_AVCODEC_H) - set(optlibsfound "${optlibsfound} AVCodec") - else(AVCODEC_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} AVCodec") - endif(AVCODEC_LIBRARIES) +# avcodec (using find_library and find_path) +find_library(AVCODEC_LIBRARIES avcodec) +if(AVCODEC_LIBRARIES) + set(HAVE_LIBAVCODEC 1) + list(APPEND ZM_BIN_LIBS "${AVCODEC_LIBRARIES}") + find_path(AVCODEC_INCLUDE_DIR "libavcodec/avcodec.h" /usr/include/ffmpeg) + if(AVCODEC_INCLUDE_DIR) + include_directories("${AVCODEC_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${AVCODEC_INCLUDE_DIR}") + endif(AVCODEC_INCLUDE_DIR) + mark_as_advanced(FORCE AVCODEC_LIBRARIES AVCODEC_INCLUDE_DIR) + check_include_file("libavcodec/avcodec.h" HAVE_LIBAVCODEC_AVCODEC_H) + set(optlibsfound "${optlibsfound} AVCodec") +else(AVCODEC_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} AVCodec") +endif(AVCODEC_LIBRARIES) - # avdevice (using find_library and find_path) - find_library(AVDEVICE_LIBRARIES avdevice) - if(AVDEVICE_LIBRARIES) - set(HAVE_LIBAVDEVICE 1) - list(APPEND ZM_BIN_LIBS "${AVDEVICE_LIBRARIES}") - find_path(AVDEVICE_INCLUDE_DIR "libavdevice/avdevice.h" /usr/include/ffmpeg) - if(AVDEVICE_INCLUDE_DIR) - include_directories("${AVDEVICE_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${AVDEVICE_INCLUDE_DIR}") - endif(AVDEVICE_INCLUDE_DIR) - mark_as_advanced(FORCE AVDEVICE_LIBRARIES AVDEVICE_INCLUDE_DIR) - check_include_file("libavdevice/avdevice.h" HAVE_LIBAVDEVICE_AVDEVICE_H) - set(optlibsfound "${optlibsfound} AVDevice") - else(AVDEVICE_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} AVDevice") - endif(AVDEVICE_LIBRARIES) +# avdevice (using find_library and find_path) +find_library(AVDEVICE_LIBRARIES avdevice) +if(AVDEVICE_LIBRARIES) + set(HAVE_LIBAVDEVICE 1) + list(APPEND ZM_BIN_LIBS "${AVDEVICE_LIBRARIES}") + find_path(AVDEVICE_INCLUDE_DIR "libavdevice/avdevice.h" /usr/include/ffmpeg) + if(AVDEVICE_INCLUDE_DIR) + include_directories("${AVDEVICE_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${AVDEVICE_INCLUDE_DIR}") + endif(AVDEVICE_INCLUDE_DIR) + mark_as_advanced(FORCE AVDEVICE_LIBRARIES AVDEVICE_INCLUDE_DIR) + check_include_file("libavdevice/avdevice.h" HAVE_LIBAVDEVICE_AVDEVICE_H) + set(optlibsfound "${optlibsfound} AVDevice") +else(AVDEVICE_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} AVDevice") +endif(AVDEVICE_LIBRARIES) - # avutil (using find_library and find_path) - find_library(AVUTIL_LIBRARIES avutil) - if(AVUTIL_LIBRARIES) - set(HAVE_LIBAVUTIL 1) - list(APPEND ZM_BIN_LIBS "${AVUTIL_LIBRARIES}") - find_path(AVUTIL_INCLUDE_DIR "libavutil/avutil.h" /usr/include/ffmpeg) - if(AVUTIL_INCLUDE_DIR) - include_directories("${AVUTIL_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${AVUTIL_INCLUDE_DIR}") - endif(AVUTIL_INCLUDE_DIR) - mark_as_advanced(FORCE AVUTIL_LIBRARIES AVUTIL_INCLUDE_DIR) - check_include_file("libavutil/avutil.h" HAVE_LIBAVUTIL_AVUTIL_H) - check_include_file("libavutil/mathematics.h" HAVE_LIBAVUTIL_MATHEMATICS_H) - check_include_file("libavutil/hwcontext.h" HAVE_LIBAVUTIL_HWCONTEXT_H) - set(optlibsfound "${optlibsfound} AVUtil") - else(AVUTIL_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} AVUtil") - endif(AVUTIL_LIBRARIES) +# avutil (using find_library and find_path) +find_library(AVUTIL_LIBRARIES avutil) +if(AVUTIL_LIBRARIES) + set(HAVE_LIBAVUTIL 1) + list(APPEND ZM_BIN_LIBS "${AVUTIL_LIBRARIES}") + find_path(AVUTIL_INCLUDE_DIR "libavutil/avutil.h" /usr/include/ffmpeg) + if(AVUTIL_INCLUDE_DIR) + include_directories("${AVUTIL_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${AVUTIL_INCLUDE_DIR}") + endif(AVUTIL_INCLUDE_DIR) + mark_as_advanced(FORCE AVUTIL_LIBRARIES AVUTIL_INCLUDE_DIR) + check_include_file("libavutil/avutil.h" HAVE_LIBAVUTIL_AVUTIL_H) + check_include_file("libavutil/mathematics.h" HAVE_LIBAVUTIL_MATHEMATICS_H) + check_include_file("libavutil/hwcontext.h" HAVE_LIBAVUTIL_HWCONTEXT_H) + set(optlibsfound "${optlibsfound} AVUtil") +else(AVUTIL_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} AVUtil") +endif(AVUTIL_LIBRARIES) - # swscale (using find_library and find_path) - find_library(SWSCALE_LIBRARIES swscale) - if(SWSCALE_LIBRARIES) - set(HAVE_LIBSWSCALE 1) - list(APPEND ZM_BIN_LIBS "${SWSCALE_LIBRARIES}") - find_path(SWSCALE_INCLUDE_DIR "libswscale/swscale.h" /usr/include/ffmpeg) - if(SWSCALE_INCLUDE_DIR) - include_directories("${SWSCALE_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${SWSCALE_INCLUDE_DIR}") - endif(SWSCALE_INCLUDE_DIR) - mark_as_advanced(FORCE SWSCALE_LIBRARIES SWSCALE_INCLUDE_DIR) - check_include_file("libswscale/swscale.h" HAVE_LIBSWSCALE_SWSCALE_H) - set(optlibsfound "${optlibsfound} SWScale") - else(SWSCALE_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} SWScale") - endif(SWSCALE_LIBRARIES) +# swscale (using find_library and find_path) +find_library(SWSCALE_LIBRARIES swscale) +if(SWSCALE_LIBRARIES) + set(HAVE_LIBSWSCALE 1) + list(APPEND ZM_BIN_LIBS "${SWSCALE_LIBRARIES}") + find_path(SWSCALE_INCLUDE_DIR "libswscale/swscale.h" /usr/include/ffmpeg) + if(SWSCALE_INCLUDE_DIR) + include_directories("${SWSCALE_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${SWSCALE_INCLUDE_DIR}") + endif(SWSCALE_INCLUDE_DIR) + mark_as_advanced(FORCE SWSCALE_LIBRARIES SWSCALE_INCLUDE_DIR) + check_include_file("libswscale/swscale.h" HAVE_LIBSWSCALE_SWSCALE_H) + set(optlibsfound "${optlibsfound} SWScale") +else(SWSCALE_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} SWScale") +endif(SWSCALE_LIBRARIES) - # SWresample (using find_library and find_path) - find_library(SWRESAMPLE_LIBRARIES swresample) - if(SWRESAMPLE_LIBRARIES) - set(HAVE_LIBSWRESAMPLE 1) - list(APPEND ZM_BIN_LIBS "${SWRESAMPLE_LIBRARIES}") - find_path(SWRESAMPLE_INCLUDE_DIR "libswresample/swresample.h" /usr/include/ffmpeg) - if(SWRESAMPLE_INCLUDE_DIR) - include_directories("${SWRESAMPLE_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${SWRESAMPLE_INCLUDE_DIR}") - endif(SWRESAMPLE_INCLUDE_DIR) - mark_as_advanced(FORCE SWRESAMPLE_LIBRARIES SWRESAMPLE_INCLUDE_DIR) - check_include_file("libswresample/swresample.h" HAVE_LIBSWRESAMPLE_SWRESAMPLE_H) - set(optlibsfound "${optlibsfound} SWResample") - else(SWRESAMPLE_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} SWResample") +# SWresample (using find_library and find_path) +find_library(SWRESAMPLE_LIBRARIES swresample) +if(SWRESAMPLE_LIBRARIES) + set(HAVE_LIBSWRESAMPLE 1) + list(APPEND ZM_BIN_LIBS "${SWRESAMPLE_LIBRARIES}") + find_path(SWRESAMPLE_INCLUDE_DIR "libswresample/swresample.h" /usr/include/ffmpeg) + if(SWRESAMPLE_INCLUDE_DIR) + include_directories("${SWRESAMPLE_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${SWRESAMPLE_INCLUDE_DIR}") + endif(SWRESAMPLE_INCLUDE_DIR) + mark_as_advanced(FORCE SWRESAMPLE_LIBRARIES SWRESAMPLE_INCLUDE_DIR) + check_include_file("libswresample/swresample.h" HAVE_LIBSWRESAMPLE_SWRESAMPLE_H) + set(optlibsfound "${optlibsfound} SWResample") +else(SWRESAMPLE_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} SWResample") - # AVresample (using find_library and find_path) - find_library(AVRESAMPLE_LIBRARIES avresample) - if(AVRESAMPLE_LIBRARIES) - set(HAVE_LIBAVRESAMPLE 1) - list(APPEND ZM_BIN_LIBS "${AVRESAMPLE_LIBRARIES}") - find_path(AVRESAMPLE_INCLUDE_DIR "libavresample/avresample.h" /usr/include/ffmpeg) - if(AVRESAMPLE_INCLUDE_DIR) - include_directories("${AVRESAMPLE_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${AVRESAMPLE_INCLUDE_DIR}") - endif(AVRESAMPLE_INCLUDE_DIR) - mark_as_advanced(FORCE AVRESAMPLE_LIBRARIES AVRESAMPLE_INCLUDE_DIR) - check_include_file("libavresample/avresample.h" HAVE_LIBAVRESAMPLE_AVRESAMPLE_H) - set(optlibsfound "${optlibsfound} AVResample") - else(AVRESAMPLE_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} AVResample") - endif(AVRESAMPLE_LIBRARIES) + # AVresample (using find_library and find_path) + find_library(AVRESAMPLE_LIBRARIES avresample) + if(AVRESAMPLE_LIBRARIES) + set(HAVE_LIBAVRESAMPLE 1) + list(APPEND ZM_BIN_LIBS "${AVRESAMPLE_LIBRARIES}") + find_path(AVRESAMPLE_INCLUDE_DIR "libavresample/avresample.h" /usr/include/ffmpeg) + if(AVRESAMPLE_INCLUDE_DIR) + include_directories("${AVRESAMPLE_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${AVRESAMPLE_INCLUDE_DIR}") + endif(AVRESAMPLE_INCLUDE_DIR) + mark_as_advanced(FORCE AVRESAMPLE_LIBRARIES AVRESAMPLE_INCLUDE_DIR) + check_include_file("libavresample/avresample.h" HAVE_LIBAVRESAMPLE_AVRESAMPLE_H) + set(optlibsfound "${optlibsfound} AVResample") + else(AVRESAMPLE_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} AVResample") + endif(AVRESAMPLE_LIBRARIES) - endif(SWRESAMPLE_LIBRARIES) +endif(SWRESAMPLE_LIBRARIES) - # Find the path to the ffmpeg executable - find_program(FFMPEG_EXECUTABLE - NAMES ffmpeg avconv - PATH_SUFFIXES ffmpeg) - if(FFMPEG_EXECUTABLE) - set(PATH_FFMPEG "${FFMPEG_EXECUTABLE}") - set(OPT_FFMPEG "yes") - mark_as_advanced(FFMPEG_EXECUTABLE) - endif(FFMPEG_EXECUTABLE) - -endif(NOT ZM_NO_FFMPEG) +# Find the path to the ffmpeg executable +find_program(FFMPEG_EXECUTABLE + NAMES ffmpeg avconv + PATH_SUFFIXES ffmpeg) +if(FFMPEG_EXECUTABLE) + set(PATH_FFMPEG "${FFMPEG_EXECUTABLE}") + set(OPT_FFMPEG "yes") + mark_as_advanced(FFMPEG_EXECUTABLE) +endif(FFMPEG_EXECUTABLE) # Do not check for libvlc if ZM_NO_LIBVLC is on if(NOT ZM_NO_LIBVLC) diff --git a/INSTALL b/INSTALL index 666105c40..a837a516a 100644 --- a/INSTALL +++ b/INSTALL @@ -62,7 +62,6 @@ Advanced: ZM_EXTRA_LIBS A list of optional libraries, separated by semicolons, e.g. ssl;theora ZM_MYSQL_ENGINE MySQL engine to use with database, default: InnoDB ZM_NO_MMAP Set to ON to not use mmap shared memory. Shouldn't be enabled unless you experience problems with the shared memory. default: OFF - ZM_NO_FFMPEG Set to ON to skip ffmpeg checks and force building ZM without ffmpeg. default: OFF ZM_NO_X10 Set to ON to build ZoneMinder without X10 support. default: OFF ZM_PERL_MM_PARMS By default, ZoneMinder's Perl modules are installed into the Vendor folders, as defined by your installation of Perl. You can change that here. Consult Perl's MakeMaker documentation for a definition of acceptable parameters. If you set this to something that causes the modules to be installed outside Perl's normal serach path, then you will also need to set ZM_PERL_SEARCH_PATH accordingly. default: "INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1" ZM_PERL_SEARCH_PATH Use to add a folder to your Perl's search path. This will need to be set in cases where ZM_PERL_MM_PARMS has been modified such that ZoneMinder's Perl modules are installed outside Perl's default search path. default: "" From b8335b3e2af6b3819ecad16096ca2a47a352629d Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 28 Dec 2018 09:49:05 -0600 Subject: [PATCH 11/47] Update definezone.rst --- docs/userguide/definezone.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/userguide/definezone.rst b/docs/userguide/definezone.rst index cf33f44c9..98c869e6c 100644 --- a/docs/userguide/definezone.rst +++ b/docs/userguide/definezone.rst @@ -104,6 +104,9 @@ 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. +Extend Alarm Frame Count + This field applies to Preclusive Zones only. Placing a value in this field holds the Preclusive zone active for the specified number of frames after the initial triggering event. This is useful in cases where a sudden change in light level triggers the Preclusive zone, but the zone needs to be held active for a few frames as the camera itself adjusts to that change in light level. + Other information ----------------- Refer to `this `__ user contributed Zone guide for additional information will illustrations if you are new to zones and need more help. From 77f51e6d6a8b5116c9feb511dd3a05a9f8f322c6 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 28 Dec 2018 12:34:09 -0600 Subject: [PATCH 12/47] attempt to trigger readthedocs --- temp | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 temp diff --git a/temp b/temp new file mode 100644 index 000000000..e69de29bb From 0d1539802ca489af306398c1cecbc16137a44f26 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 28 Dec 2018 12:34:37 -0600 Subject: [PATCH 13/47] attempt to trigger readthedocs --- temp | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 temp diff --git a/temp b/temp deleted file mode 100644 index e69de29bb..000000000 From 35f89962e277b53b738c637bacddfa8f091740e3 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 28 Dec 2018 12:40:17 -0600 Subject: [PATCH 14/47] mention exclude alarm frame feature in preclusive --- docs/userguide/definezone.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/userguide/definezone.rst b/docs/userguide/definezone.rst index 98c869e6c..97f42f864 100644 --- a/docs/userguide/definezone.rst +++ b/docs/userguide/definezone.rst @@ -29,7 +29,7 @@ Type Triggers an alarm when motion is detected within it, as long as no alarms have already been triggered in an Active zone. This is the most specialized of the zone types. For instance in the camera covering my garden I keep watch for a hedgehog that visits most nights and scoffs the food out of my cats bowls. By creating a sensitive Exclusive zone in that area I can ensure that a hedgehog alarm will only trigger if there is activity in that small area. If something much bigger occurs, like someone walking by it will trigger a regular alarm and not one from the Exclusive zone. Thus I can ensure I get alarms for big events and also special small events but not the noise in between. * Preclusive - This zone type is relatively recent. It is called a Preclusive zone because if it is triggered it actually precludes an alarm being generated for that image frame. So motion or other changes that occur in a Preclusive zone will have the effect of ensuring that no alarm occurs at all. The application for this zone type is primarily as a shortcut for detecting general large-scale lighting or other changes. Generally this may be achieved by limiting the maximum number of alarm pixels or other measure in an Active zone. However in some cases that zone may cover an area where the area of variable illumination occurs in different places as the sun and/or shadows move and it thus may be difficult to come up with general values. Additionally, if the sun comes out rapidly then although the initial change may be ignored in this way as the reference image catches up an alarm may ultimately be triggered as the image becomes less different. Using one or more Preclusive zones offers a different approach. Preclusive zones are designed to be fairly small, even just a few pixels across, with quite low alarm thresholds. They should be situated in areas of the image that are less likely to have motion occur such as high on a wall or in a corner. Should a general illumination change occur they would be triggered at least as early as any Active zones and prevent any other zones from generating an alarm. Obviously careful placement is required to ensure that they do not cancel any genuine alarms or that they are not so close together that any motion just hops from one Preclusive zone to another. Preclusive zones may also be used to reduce processing time by situating one over an Active zone. The Preclusive zone is processed first; if it is small, and is triggered, the rest of the zone/image will not be processed. + This zone type is relatively recent. It is called a Preclusive zone because if it is triggered it actually precludes an alarm being generated for that image frame. So motion or other changes that occur in a Preclusive zone will have the effect of ensuring that no alarm occurs at all. The application for this zone type is primarily as a shortcut for detecting general large-scale lighting or other changes. Generally this may be achieved by limiting the maximum number of alarm pixels or other measure in an Active zone. However in some cases that zone may cover an area where the area of variable illumination occurs in different places as the sun and/or shadows move and it thus may be difficult to come up with general values. Additionally, if the sun comes out rapidly then although the initial change may be ignored in this way as the reference image catches up an alarm may ultimately be triggered as the image becomes less different. Using one or more Preclusive zones offers a different approach. Preclusive zones are designed to be fairly small, even just a few pixels across, with quite low alarm thresholds. They should be situated in areas of the image that are less likely to have motion occur such as high on a wall or in a corner. Should a general illumination change occur they would be triggered at least as early as any Active zones and prevent any other zones from generating an alarm. Obviously careful placement is required to ensure that they do not cancel any genuine alarms or that they are not so close together that any motion just hops from one Preclusive zone to another. Preclusive zones may also be used to reduce processing time by situating one over an Active zone. The Preclusive zone is processed first; if it is small, and is triggered, the rest of the zone/image will not be processed. See Extend Alarm Frame Count below for a way to hold the preclusive zone active for an extended period. * Inactive Suppresses the detection of motion within it. This can be layered on top of any other zone type, preventing motion within the Inactive zone from being effective for any other zone type. Use inactive zones to cover areas in which nothing notable will ever happen or where you get false alarms that don't relate to what you are trying to monitor. Inactive zones may be overlaid on other zones to blank out areas, and are processed first (with the exception of Privacy zones, see below). As a general practice, you should try and make zones abut each other instead of overlapping to avoid repeated duplicate processing of the same area. From bcbe9075f9e3a427d00e06c45ca0ef58ed229bd3 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Fri, 28 Dec 2018 21:11:52 -0500 Subject: [PATCH 15/47] fixed preset delete and set --- .../lib/ZoneMinder/Control/FOSCAMR2C.pm | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm index 563eb174f..55bd89f91 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm @@ -64,8 +64,8 @@ our $VERSION = $ZoneMinder::Base::VERSION; use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); -use ZoneMinder::Database qw(zmDbConnect); - +use DBI; +#use XML::LibXML; use Time::HiRes qw( usleep ); sub new @@ -268,7 +268,7 @@ sub presetHome { my $self = shift; Debug( "Home Preset" ); - my $cmd = "decoder_control.cgi?command=25"; + my $cmd = "CGIProxy.fcgi?cmd=ptzReset"; $self->sendCmd( $cmd ); } @@ -278,16 +278,30 @@ sub presetSet my $self = shift; my $params = shift; my $preset = $self->getParam( $params, 'preset' ); - my $dbh = zmDbConnect(1); + my $cmd1 = "CGIProxy.fcgi?cmd=getPTZPresetPointList"; + my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); $sth->execute(); my $ref = ($sth->fetchrow_hashref()); my $label = $ref->{'Label'}; - $sth->finish(); - Debug( "Set Preset $preset with cmd $label" ); - my $cmd = "CGIProxy.fcgi?cmd=ptzAddPresetPoint&name=$label"; + $sth = $dbh->prepare("SELECT `Label2` FROM `ControlPresetNames` WHERE `Preset` = $preset"); + $sth->execute(); + $ref = ($sth->fetchrow_hashref()); + my $label2 = $ref->{'Label2'}; + Debug( "Delete Preset $preset with name $label2 from camera" ); + my $cmd = "CGIProxy.fcgi?cmd=ptzDeletePresetPoint&name=$label2"; $self->sendCmd( $cmd ); - + Debug( "Set Preset $preset with cmd $label in camera" ); + $cmd = "CGIProxy.fcgi?cmd=ptzAddPresetPoint&name=$label"; + $self->sendCmd( $cmd ); + Debug( "Delete row Preset $preset with Label2 $label2 from db" ); + $sth = $dbh->prepare("DELETE FROM `ControlPresetNames` WHERE `Preset` = $preset"); + $sth->execute(); + Debug( "Insert Preset $preset with cmd $label in db" ); + $sth = $dbh->prepare("INSERT INTO `ControlPresetNames`(`MoniterId`, `Preset`, `Label2`) VALUES ('$self->{Monitor}','$preset','$label')"); + $sth->execute(); + $sth->finish(); + } @@ -297,7 +311,7 @@ sub presetGoto my $self = shift; my $params = shift; my $preset = $self->getParam( $params, 'preset' ); - my $dbh = zmDbConnect(1); + my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); $sth->execute(); my $ref = ($sth->fetchrow_hashref()); From 3258d8e590673752a2dbc773d0847834ca8640b4 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 29 Dec 2018 08:52:58 -0600 Subject: [PATCH 16/47] remove ZM_DIR_IMAGES (#2374) --- CMakeLists.txt | 4 --- INSTALL | 5 ++- conf.d/01-system-paths.conf.in | 5 --- distros/debian/rules | 1 - distros/redhat/CMakeLists.txt | 4 +-- .../redhat/httpd/zoneminder.httpd.tmpfiles.in | 1 - .../redhat/nginx/zoneminder.nginx.tmpfiles.in | 1 - distros/redhat/zoneminder.spec | 2 -- distros/ubuntu1204/rules | 1 - distros/ubuntu1504_cmake_split_packages/rules | 1 - distros/ubuntu1604/rules | 1 - docs/installationguide/dedicateddrive.rst | 1 - docs/userguide/options/options_paths.rst | 2 -- scripts/zmaudit.pl.in | 4 +-- src/zm_config.cpp | 2 -- src/zm_config.h.in | 1 - web/ajax/zone.php | 31 ------------------- .../Controller/Component/ImageComponent.php | 6 ++-- web/api/app/Controller/EventsController.php | 1 - web/api/app/Controller/ZonesController.php | 29 ----------------- web/index.php | 4 +-- web/lang/ro_ro.php | 4 --- 22 files changed, 10 insertions(+), 101 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 602549ab9..9646ffc3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,9 +162,6 @@ set(ZM_WEB_GROUP "" CACHE STRING Leave empty to be the same as the web user") set(ZM_DIR_EVENTS "${ZM_CONTENTDIR}/events" CACHE PATH "Location where events are recorded to, default: ZM_CONTENTDIR/events") -set(ZM_DIR_IMAGES "${ZM_CONTENTDIR}/images" CACHE PATH - "Location where images, not directly associated with events, - are recorded to, default: ZM_CONTENTDIR/images") set(ZM_DIR_SOUNDS "sounds" CACHE PATH "Location to look for optional sound files, default: sounds") set(ZM_PATH_ZMS "/cgi-bin/nph-zms" CACHE PATH @@ -225,7 +222,6 @@ if((ZM_TARGET_DISTRO MATCHES "^el") OR (ZM_TARGET_DISTRO MATCHES "^fc")) set(ZM_WEBDIR "/usr/share/zoneminder/www") set(ZM_CGIDIR "/usr/libexec/zoneminder/cgi-bin") set(ZM_DIR_EVENTS "/var/lib/zoneminder/events") - set(ZM_DIR_IMAGES "/var/lib/zoneminder/images") set(ZM_PATH_ZMS "/cgi-bin-zm/nph-zms") elseif(ZM_TARGET_DISTRO STREQUAL "OS13") set(ZM_RUNDIR "/var/run/zoneminder") diff --git a/INSTALL b/INSTALL index a837a516a..ecf7b909a 100644 --- a/INSTALL +++ b/INSTALL @@ -51,7 +51,6 @@ Possible configuration options: ZM_WEB_USER The user apache or the local web server runs on. Leave empty for automatic detection. If that fails, you can use this variable to force ZM_WEB_GROUP The group apache or the local web server runs on, Leave empty to be the same as the web user ZM_DIR_EVENTS Location where events are recorded to, default: ZM_CONTENTDIR/events - ZM_DIR_IMAGES Location where images, not directly associated with events, are recorded to, default: ZM_CONTENTDIR/images ZM_DIR_SOUNDS Location to look for optional sound files, default: sounds ZM_PATH_ZMS Web url to zms streaming server, default: /cgi-bin/nph-zms Advanced: @@ -129,8 +128,8 @@ cmake -C zm_conf.cmake [extra options] . 2) Run "make" to compile ZoneMinder 3) Run "make install" (as root, or use sudo) to install ZoneMinder to your system. -4) Depending on your configuration: If the DIR_EVENTS and DIR_IMAGES options are set to default (pointing to web directory/events and web directory/images), You will need to update the symlinks in the web directory to the correct folders. e.g. web directory/events should point to the real events directory, and likewise for the images directory. -You can use the zmlinkcontent.sh script for this. For example, if /var/lib/zoneminder is the folder that contains the "images" and "events" directories, you can use: +4) Depending on your configuration: If DIR_EVENTS is set to default, You will need to update the symlinks in the web directory to the correct folders. e.g. web directory/events should point to the real events directory. +You can use the zmlinkcontent.sh script for this. For example, if /var/lib/zoneminder is the folder that contains the "events" directory, you can use: ./zmlinkcontent.sh /var/lib/zoneminder By default, the content directory for new installations is /var/lib/zoneminder. This can be overridden in cmake with the ZM_CONTENTDIR option. e.g. cmake -DZM_CONTENTDIR="/some/big/storage/zm" . diff --git a/conf.d/01-system-paths.conf.in b/conf.d/01-system-paths.conf.in index e97433ba2..e1aaf0bef 100644 --- a/conf.d/01-system-paths.conf.in +++ b/conf.d/01-system-paths.conf.in @@ -16,11 +16,6 @@ # The web account user must have full read/write permission to this folder. ZM_DIR_EVENTS=@ZM_DIR_EVENTS@ -# Full path to the folder images, not directly associated with events, -# are recorded to. -# The web account user must have full read/write permission to this folder. -ZM_DIR_IMAGES=@ZM_DIR_IMAGES@ - # Foldername under the webroot where ZoneMinder looks for optional sound files # to play when an alarm is detected. ZM_DIR_SOUNDS=@ZM_DIR_SOUNDS@ diff --git a/distros/debian/rules b/distros/debian/rules index fe725c2d0..6185838e0 100755 --- a/distros/debian/rules +++ b/distros/debian/rules @@ -24,7 +24,6 @@ override_dh_auto_configure: -DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \ -DZM_CONFIG_DIR="/etc/zm" \ -DZM_DIR_EVENTS="/var/cache/zoneminder/events" \ - -DZM_DIR_IMAGES="/var/cache/zoneminder/images" \ -DZM_PATH_ZMS="/zm/cgi-bin/nph-zms" override_dh_auto_install: diff --git a/distros/redhat/CMakeLists.txt b/distros/redhat/CMakeLists.txt index 06b0e8cbf..f1a1bc75b 100644 --- a/distros/redhat/CMakeLists.txt +++ b/distros/redhat/CMakeLists.txt @@ -21,7 +21,7 @@ endif(ZM_TARGET_DISTRO MATCHES "^el") # Configure the common zoneminder files configure_file(common/zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY) configure_file(common/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) -file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events images temp) +file(MAKE_DIRECTORY sock swap zoneminder zoneminder-upload events temp) # Configure the Apache zoneminder files configure_file(httpd/zm-httpd.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zm-httpd.conf @ONLY) @@ -52,7 +52,7 @@ install(DIRECTORY zoneminder DESTINATION /var/log DIRECTORY_PERMISSIONS OWNER_WR install(DIRECTORY zoneminder DESTINATION /var/run DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(DIRECTORY zoneminder DESTINATION /var/cache DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(DIRECTORY zoneminder-upload DESTINATION /var/spool DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -install(DIRECTORY events images temp DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +install(DIRECTORY events temp DESTINATION /var/lib/zoneminder DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # Install the Apache zoneminder files install(FILES zm-httpd.conf DESTINATION /usr/lib/systemd/system/zoneminder.service.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ) diff --git a/distros/redhat/httpd/zoneminder.httpd.tmpfiles.in b/distros/redhat/httpd/zoneminder.httpd.tmpfiles.in index f24babdc6..b403fb24d 100644 --- a/distros/redhat/httpd/zoneminder.httpd.tmpfiles.in +++ b/distros/redhat/httpd/zoneminder.httpd.tmpfiles.in @@ -2,5 +2,4 @@ D @ZM_TMPDIR@ 0755 @WEB_USER@ @WEB_GROUP@ D @ZM_SOCKDIR@ 0755 @WEB_USER@ @WEB_GROUP@ D @ZM_CACHEDIR@ 0755 @WEB_USER@ @WEB_GROUP@ d @ZM_DIR_EVENTS@ 0755 @WEB_USER@ @WEB_GROUP@ -D @ZM_DIR_IMAGES@ 0755 @WEB_USER@ @WEB_GROUP@ diff --git a/distros/redhat/nginx/zoneminder.nginx.tmpfiles.in b/distros/redhat/nginx/zoneminder.nginx.tmpfiles.in index 1c581fcb9..502b817d8 100644 --- a/distros/redhat/nginx/zoneminder.nginx.tmpfiles.in +++ b/distros/redhat/nginx/zoneminder.nginx.tmpfiles.in @@ -2,5 +2,4 @@ D @ZM_TMPDIR@ 0755 nginx nginx D @ZM_SOCKDIR@ 0755 nginx nginx D @ZM_CACHEDIR@ 0755 nginx nginx d @ZM_DIR_EVENTS@ 0755 nginx nginx -D @ZM_DIR_IMAGES@ 0755 nginx nginx diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index cbda079ca..8f30d6fee 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -377,7 +377,6 @@ EOF %{_tmpfilesdir}/zoneminder.httpd.tmpfiles.conf %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/events -%dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/images %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/sock %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/swap %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_sharedstatedir}/zoneminder/temp @@ -402,7 +401,6 @@ EOF %{_tmpfilesdir}/zoneminder.nginx.tmpfiles.conf %dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder %dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/events -%dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/images %dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/sock %dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/swap %dir %attr(755,nginx,nginx) %{_sharedstatedir}/zoneminder/temp diff --git a/distros/ubuntu1204/rules b/distros/ubuntu1204/rules index f971e9cc3..20dd303f8 100755 --- a/distros/ubuntu1204/rules +++ b/distros/ubuntu1204/rules @@ -27,7 +27,6 @@ override_dh_auto_configure: -DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \ -DZM_CACHEDIR="/var/cache/zoneminder/cache" \ -DZM_DIR_EVENTS="/var/cache/zoneminder/events" \ - -DZM_DIR_IMAGES="/var/cache/zoneminder/images" \ -DZM_PATH_ZMS="/zm/cgi-bin/nph-zms" override_dh_clean: diff --git a/distros/ubuntu1504_cmake_split_packages/rules b/distros/ubuntu1504_cmake_split_packages/rules index 0eca4b511..f6169c495 100755 --- a/distros/ubuntu1504_cmake_split_packages/rules +++ b/distros/ubuntu1504_cmake_split_packages/rules @@ -64,7 +64,6 @@ override_dh_auto_configure: -DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \ -DZM_CONFIG_DIR="/etc/zm" \ -DZM_DIR_EVENTS="/var/cache/zoneminder/events" \ - -DZM_DIR_IMAGES="/var/cache/zoneminder/images" \ -DZM_PATH_ZMS="/zm/cgi-bin/nph-zms" override_dh_auto_test: diff --git a/distros/ubuntu1604/rules b/distros/ubuntu1604/rules index f0808a8e1..98b9ac0a2 100755 --- a/distros/ubuntu1604/rules +++ b/distros/ubuntu1604/rules @@ -27,7 +27,6 @@ override_dh_auto_configure: -DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \ -DZM_CACHEDIR="/var/cache/zoneminder/cache" \ -DZM_DIR_EVENTS="/var/cache/zoneminder/events" \ - -DZM_DIR_IMAGES="/var/cache/zoneminder/images" \ -DZM_PATH_ZMS="/zm/cgi-bin/nph-zms" override_dh_clean: diff --git a/docs/installationguide/dedicateddrive.rst b/docs/installationguide/dedicateddrive.rst index f0dfadc28..6a7367b8b 100644 --- a/docs/installationguide/dedicateddrive.rst +++ b/docs/installationguide/dedicateddrive.rst @@ -31,7 +31,6 @@ Add the following content to the file and save your changes: :: ZM_DIR_EVENTS=/full/path/to/the/events/folder - ZM_DIR_IMAGES=/full/path/to/the/images/folder **Step 5:** Start ZoneMinder and inspect the ZoneMinder log files for errors. :: diff --git a/docs/userguide/options/options_paths.rst b/docs/userguide/options/options_paths.rst index 024998194..1d4911f70 100644 --- a/docs/userguide/options/options_paths.rst +++ b/docs/userguide/options/options_paths.rst @@ -7,8 +7,6 @@ ZM_DIR_EVENTS - This is the path to the events directory where all the event ima USE_DEEP_STORAGE - Traditionally ZoneMinder stores all events for a monitor in one directory for that monitor. This is simple and efficient except when you have very large amounts of events. Some filesystems are unable to store more than 32k files in one directory and even without this limitation, large numbers of files in a directory can slow creation and deletion of files. This option allows you to select an alternate method of storing events by year/month/day/hour/min/second which has the effect of separating events out into more directories, resulting in less per directory, and also making it easier to manually navigate to any events that may have happened at a particular time or date. -DIR_IMAGES - ZoneMinder generates a myriad of images, mostly of which are associated with events. For those that aren't this is where they go. CAUTION: The directory you specify here cannot be outside the web root. This is a common mistake. Most users should never change this value. If you intend to save images to a second disk or network share, then you should mount the drive or share directly to the ZoneMinder images folder or follow the instructions in the ZoneMinder Wiki titled Using a dedicated Hard Drive. - DIR_SOUNDS - ZoneMinder can optionally play a sound file when an alarm is detected. This indicates where to look for this file. CAUTION: The directory you specify here cannot be outside the web root. Most users should never change this value. PATH_ZMS - The ZoneMinder streaming server is required to send streamed images to your browser. It will be installed into the cgi-bin path given at configuration time. This option determines what the web path to the server is rather than the local path on your machine. Ordinarily the streaming server runs in parser-header mode however if you experience problems with streaming you can change this to non-parsed-header (nph) mode by changing 'zms' to 'nph-zms'. diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index fdb9d68ff..10917a729 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -48,7 +48,6 @@ use Time::HiRes qw/gettimeofday/; use Getopt::Long; use autouse 'Pod::Usage'=>qw(pod2usage); -use constant IMAGE_PATH => $Config{ZM_PATH_WEB}.'/'.$Config{ZM_DIR_IMAGES}; use constant EVENT_PATH => ($Config{ZM_DIR_EVENTS}=~m|/|) ? $Config{ZM_DIR_EVENTS} : ($Config{ZM_PATH_WEB}.'/'.$Config{ZM_DIR_EVENTS}) @@ -144,7 +143,8 @@ require ZoneMinder::Event; my $max_image_age = 6/24; # 6 hours my $max_swap_age = 24/24; # 24 hours -my $image_path = IMAGE_PATH; +# images now live under the event path +my $image_path = EVENT_PATH; my $loop = 1; my $cleaned = 0; diff --git a/src/zm_config.cpp b/src/zm_config.cpp index 6d63be98b..f9e11e59b 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -176,8 +176,6 @@ void process_configfile( char* configFile) { staticConfig.SERVER_ID = atoi(val_ptr); else if ( strcasecmp( name_ptr, "ZM_DIR_EVENTS" ) == 0 ) staticConfig.DIR_EVENTS = std::string(val_ptr); - else if ( strcasecmp( name_ptr, "ZM_DIR_IMAGES" ) == 0 ) - staticConfig.DIR_IMAGES = std::string(val_ptr); else if ( strcasecmp( name_ptr, "ZM_DIR_SOUNDS" ) == 0 ) staticConfig.DIR_SOUNDS = std::string(val_ptr); else if ( strcasecmp( name_ptr, "ZM_DIR_EXPORTS" ) == 0 ) diff --git a/src/zm_config.h.in b/src/zm_config.h.in index 87a0f2db4..9831677f0 100644 --- a/src/zm_config.h.in +++ b/src/zm_config.h.in @@ -76,7 +76,6 @@ struct StaticConfig { std::string SERVER_NAME; unsigned int SERVER_ID; std::string DIR_EVENTS; - std::string DIR_IMAGES; std::string DIR_SOUNDS; std::string DIR_EXPORTS; std::string PATH_ZMS; diff --git a/web/ajax/zone.php b/web/ajax/zone.php index bfa77a922..12a68f681 100644 --- a/web/ajax/zone.php +++ b/web/ajax/zone.php @@ -9,37 +9,6 @@ elseif ( !isset($_REQUEST['zid']) ) ajaxError( 'No zone id(s) supplied' ); } -if ( canView( 'Monitors' ) ) -{ - switch ( $_REQUEST['action'] ) - { - case "zoneImage" : - { - $wd = getcwd(); - chdir( ZM_DIR_IMAGES ); - $hiColor = '0x00ff00'; - - $command = getZmuCommand( " -m ".$_REQUEST['mid']." -z" ); - if ( !isset($_REQUEST['zid']) ) - $_REQUEST['zid'] = 0; - $command .= "'".$_REQUEST['zid'].' '.$hiColor.' '.$_REQUEST['coords']."'"; - $status = exec( escapeshellcmd($command) ); - chdir( $wd ); - - $monitor = dbFetchOne( 'SELECT * FROM Monitors WHERE Id = ?', NULL, array($_REQUEST['mid']) ); - $points = coordsToPoints( $_REQUEST['coords'] ); - - ajaxResponse( array( - 'zoneImage' => ZM_DIR_IMAGES.'/Zones'.$monitor['Id'].'.jpg?'.time(), - 'selfIntersecting' => isSelfIntersecting( $points ), - 'area' => getPolyArea( $points ) - ) ); - - break; - } - } -} - ajaxError( 'Unrecognised action or insufficient permissions' ); ?> diff --git a/web/api/app/Controller/Component/ImageComponent.php b/web/api/app/Controller/Component/ImageComponent.php index fc967a2de..2033e0d8c 100644 --- a/web/api/app/Controller/Component/ImageComponent.php +++ b/web/api/app/Controller/Component/ImageComponent.php @@ -7,12 +7,10 @@ class ImageComponent extends Component { $captImage = sprintf( "%0".$config['ZM_EVENT_IMAGE_DIGITS']."d-capture.jpg", $frame['Frame']['FrameId'] ); $captPath = $eventPath.'/'.$captImage; - $thumbCaptPath = $config['ZM_DIR_IMAGES'].'/'.$event['Event']['Id'].'-'.$captImage; $analImage = sprintf( "%0".$config['ZM_EVENT_IMAGE_DIGITS']."d-analyse.jpg", $frame['Frame']['FrameId'] ); $analPath = $eventPath.'/'.$analImage; $analFile = $config['ZM_DIR_EVENTS']."/".$analPath; - $thumbAnalPath = $config['ZM_DIR_IMAGES'].'/'.$event['Event']['Id'].'-'.$analImage; $alarmFrame = $frame['Frame']['Type']=='Alarm'; @@ -31,8 +29,8 @@ class ImageComponent extends Component { $fraction = sprintf( "%.3f", $scale/100 ); $scale = (int)round( $scale ); - $thumbCaptPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $thumbCaptPath ); - $thumbAnalPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $thumbAnalPath ); + $thumbCaptPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $captPath ); + $thumbAnalPath = preg_replace( "/\.jpg$/", "-$scale.jpg", $analPath ); if ( $isAnalImage ) { diff --git a/web/api/app/Controller/EventsController.php b/web/api/app/Controller/EventsController.php index 1d9456cc4..cf8ca8f37 100644 --- a/web/api/app/Controller/EventsController.php +++ b/web/api/app/Controller/EventsController.php @@ -318,7 +318,6 @@ class EventsController extends AppController { 'ZM_WEB_LIST_THUMB_WIDTH', 'ZM_WEB_LIST_THUMB_HEIGHT', 'ZM_EVENT_IMAGE_DIGITS', - 'ZM_DIR_IMAGES', $thumbs, 'ZM_DIR_EVENTS' ) diff --git a/web/api/app/Controller/ZonesController.php b/web/api/app/Controller/ZonesController.php index 74a87f353..4d6564443 100644 --- a/web/api/app/Controller/ZonesController.php +++ b/web/api/app/Controller/ZonesController.php @@ -137,33 +137,4 @@ class ZonesController extends AppController { return $this->flash(__('The zone could not be deleted. Please, try again.'), array('action' => 'index')); } } - - public function createZoneImage($id = null) { - $this->loadModel('Monitor'); - $this->Monitor->id = $id; - if ( !$this->Monitor->exists() ) { - throw new NotFoundException(__('Invalid zone')); - } - - $this->loadModel('Config'); - $zm_dir_images = $this->Config->find('list', array( - 'conditions' => array('Name' => 'ZM_DIR_IMAGES'), - 'fields' => array('Name', 'Value') - )); - - $zm_dir_images = $zm_dir_images['ZM_DIR_IMAGES']; - $zm_path_web = Configure::read('ZM_PATH_WEB'); - $zm_path_bin = Configure::read('ZM_PATH_BIN'); - $images_path = "$zm_path_web/$zm_dir_images"; - - chdir($images_path); - - $command = escapeshellcmd("$zm_path_bin/zmu -z -m $id"); - system($command, $status); - - $this->set(array( - 'status' => $status, - '_serialize' => array('status') - )); - } } // end class diff --git a/web/index.php b/web/index.php index bd80f1d89..2331809bc 100644 --- a/web/index.php +++ b/web/index.php @@ -164,8 +164,8 @@ $running = null; CORSHeaders(); // Check for valid content dirs -if ( !is_writable(ZM_DIR_EVENTS) || !is_writable(ZM_DIR_IMAGES) ) { - Warning("Cannot write to content dirs('".ZM_DIR_EVENTS."','".ZM_DIR_IMAGES."'). Check that these exist and are owned by the web account user"); +if ( !is_writable(ZM_DIR_EVENTS) ) { + Warning("Cannot write to event folder ".ZM_DIR_EVENTS.". Check that it exists and is owned by the web account user."); } # Globals diff --git a/web/lang/ro_ro.php b/web/lang/ro_ro.php index 1f2d17e2e..5526be753 100644 --- a/web/lang/ro_ro.php +++ b/web/lang/ro_ro.php @@ -882,10 +882,6 @@ $OLANG = array( 'Prompt' => "Directorul în care sunt stocate evenimentele", 'Help' => "Acesta este subdirectorul în care sunt salvate imaginile generate de evenimente şi alte fişiere. Implicit este un subdirector al directorului rădăcina zoneminder; dacă spaţiul nu vă permite puteţi să stocaţi imaginile pe altă partiţie, caz în care ar trebui să faceţi un link la subdirectorul implicit." ), - 'DIR_IMAGES' => array( - 'Prompt' => "Directorul în care sunt stocate imaginile", - 'Help' => "ZoneMinder generează multe imagini, majoritate asociate cu evenimente. În acest director vor fi stocate imaginile neasociate evenimentelor." - ), 'DIR_SOUNDS' => array( 'Prompt' => "Directorul cu sunetele care pot fi folosite de ZoneMinder", 'Help' => "ZoneMinder poate rula un sunet atunci când este detectată o alarmă. Acesta este directorul în care este stocat sunetul care va fi rulat." From d14e9ecf74d6d76036651a5688fbdf680bae2ec0 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 29 Dec 2018 08:53:31 -0600 Subject: [PATCH 17/47] force overloadframes and ExtendAlarmFrames to int (#2373) --- web/includes/actions.php | 8 +++++++- web/includes/functions.php | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/web/includes/actions.php b/web/includes/actions.php index 2ae7fdc2a..746454bec 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -288,7 +288,13 @@ if ( !empty($_REQUEST['mid']) && canEdit('Monitors', $_REQUEST['mid']) ) { } unset( $_REQUEST['newZone']['Points'] ); - $types = array(); + + # convert these fields to integer e.g. NULL -> 0 + $types = array( + 'OverloadFrames' => 'integer', + 'ExtendAlarmFrames' => 'integer', + ); + $changes = getFormChanges($zone, $_REQUEST['newZone'], $types); if ( count($changes) ) { diff --git a/web/includes/functions.php b/web/includes/functions.php index f4a9b3395..6f2877530 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -608,6 +608,11 @@ function getFormChanges( $values, $newValues, $types=false, $columns=false ) { } } break; + case 'integer' : + if ( (!isset($values[$key])) or $values[$key] != $value ) { + $changes[$key] = $key . ' = '.intval($value); + } + break; default : { if ( !isset($values[$key]) || ($values[$key] != $value) ) { From 751c312609a6c667b710e4bc4cbc0d14c9396a44 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 29 Dec 2018 09:56:33 -0500 Subject: [PATCH 18/47] fix non-ascii char --- src/zm_monitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 30feecfe8..3e4aff2a4 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2646,7 +2646,7 @@ unsigned int Monitor::DetectMotion( const Image &comp_image, Event::StringSet &z } else { // check if end of alarm if (old_zone_alarmed) { - Debug(3, "Preclusive Zone %s alarm Ends. Prevíous score: %d", zone->Label(), old_zone_score); + Debug(3, "Preclusive Zone %s alarm Ends. Previous score: %d", zone->Label(), old_zone_score); if (old_zone_score > 0) { zone->SetExtendAlarmCount(zone->GetExtendAlarmFrames()); } From 2cac25d35311a90ea0110775e26298dad188e265 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Sat, 29 Dec 2018 19:35:16 -0500 Subject: [PATCH 19/47] removed unused preset code --- scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm index 55bd89f91..4ff02a228 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm @@ -278,7 +278,6 @@ sub presetSet my $self = shift; my $params = shift; my $preset = $self->getParam( $params, 'preset' ); - my $cmd1 = "CGIProxy.fcgi?cmd=getPTZPresetPointList"; my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); $sth->execute(); From f25e176b88ff0b4c3e0c4c535611aec77137ad2a Mon Sep 17 00:00:00 2001 From: techrockedge Date: Sat, 29 Dec 2018 20:57:46 -0500 Subject: [PATCH 20/47] added create table if not exist --- scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm index 4ff02a228..2f379a48a 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm @@ -283,6 +283,8 @@ sub presetSet $sth->execute(); my $ref = ($sth->fetchrow_hashref()); my $label = $ref->{'Label'}; + $sth = $dbh->prepare("CREATE TABLE IF NOT EXISTS `ControlPresetNames` (`Preset` int(10) unsigned NOT NULL,`Label2` varchar(64) NOT NULL, UNIQUE KEY (`Label2`))"); + $sth->execute(); $sth = $dbh->prepare("SELECT `Label2` FROM `ControlPresetNames` WHERE `Preset` = $preset"); $sth->execute(); $ref = ($sth->fetchrow_hashref()); @@ -297,7 +299,7 @@ sub presetSet $sth = $dbh->prepare("DELETE FROM `ControlPresetNames` WHERE `Preset` = $preset"); $sth->execute(); Debug( "Insert Preset $preset with cmd $label in db" ); - $sth = $dbh->prepare("INSERT INTO `ControlPresetNames`(`MoniterId`, `Preset`, `Label2`) VALUES ('$self->{Monitor}','$preset','$label')"); + $sth = $dbh->prepare("INSERT INTO `ControlPresetNames`(`Preset`, `Label2`) VALUES ('$preset','$label')"); $sth->execute(); $sth->finish(); From bd2b761bcda89b027369671d69fda55dee6df5ae Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 31 Dec 2018 09:54:48 -0600 Subject: [PATCH 21/47] change configdata.pm.in defaults --- scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 846a62f82..fa7b86079 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -2450,7 +2450,7 @@ our @options = ( }, { name => 'ZM_RUN_AUDIT', - default => 'yes', + default => 'no', description => 'Run zmaudit to check data consistency', help => q` The zmaudit daemon exists to check that the saved information @@ -2679,7 +2679,7 @@ our @options = ( }, { name => 'ZM_OPT_CONTROL', - default => 'no', + default => 'yes', description => 'Support controllable (e.g. PTZ) cameras', help => q` ZoneMinder includes limited support for controllable cameras. A @@ -2892,7 +2892,7 @@ our @options = ( }, { name => 'ZM_WEB_LIST_THUMBS', - default => 'no', + default => 'yes', description => 'Display mini-thumbnails of event images in event lists', help => q` Ordinarily the event lists just display text details of the From 79113a6869244268b7dcab366748b8233dd69502 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 2 Jan 2019 10:56:40 -0500 Subject: [PATCH 22/47] Add a default Server object to handle non-multi-server case --- web/skins/classic/views/js/montagereview.js.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/skins/classic/views/js/montagereview.js.php b/web/skins/classic/views/js/montagereview.js.php index 2afab05d3..1aa003e2f 100644 --- a/web/skins/classic/views/js/montagereview.js.php +++ b/web/skins/classic/views/js/montagereview.js.php @@ -18,7 +18,7 @@ var speedIndex=; // for history, and fps for live, and dynamically determined (in ms) var currentDisplayInterval=; -var playSecsperInterval=1; // How many seconds of recorded image we play per refresh determined by speed (replay rate) and display interval; (default=1 if coming from live) +var playSecsperInterval=1; // How many seconds of recorded image we play per refresh determined by speed (replay rate) and display interval; (default=1 if coming from live) var timerInterval; // milliseconds between interrupts var timerObj; // object to hold timer interval; var freeTimeLastIntervals=[]; // Percentage of current interval used in loading most recent image @@ -35,7 +35,7 @@ var timeLabelsFractOfRow = 0.9; $index = 0; $anyAlarms = false; -$maxScore=0; +$maxScore = 0; if ( !$liveMode ) { $result = dbQuery($eventsSql); @@ -126,6 +126,11 @@ echo "\nvar Servers = [];\n"; foreach ( Server::find() as $Server ) { echo 'Servers[' . $Server->Id() . '] = new Server(' . json_encode($Server). ");\n"; } + +// Fall back to get Server paths, etc when no using multi-server mode +$Server = new Server(); +echo 'Servers[' . $Server->Id() . '] = new Server(' . json_encode($Server). ");\n"; + echo ' var monitorName = []; var monitorLoading = []; From 8a1707a615c20bdeb787de38dd4709696eabca6c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 2 Jan 2019 11:27:46 -0500 Subject: [PATCH 23/47] Add monitorServerId array to provide server info for each monitor so that we can load images from the recording server. --- web/skins/classic/views/js/montagereview.js.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/views/js/montagereview.js.php b/web/skins/classic/views/js/montagereview.js.php index 1aa003e2f..1e91a8b23 100644 --- a/web/skins/classic/views/js/montagereview.js.php +++ b/web/skins/classic/views/js/montagereview.js.php @@ -123,17 +123,18 @@ foreach ( Storage::find() as $Storage ) { echo 'Storage[' . $Storage->Id() . '] = ' . json_encode($Storage). ";\n"; } echo "\nvar Servers = [];\n"; +// Fall back to get Server paths, etc when no using multi-server mode +$Server = new Server(); +echo 'Servers[0] = new Server(' . json_encode($Server). ");\n"; foreach ( Server::find() as $Server ) { echo 'Servers[' . $Server->Id() . '] = new Server(' . json_encode($Server). ");\n"; } -// Fall back to get Server paths, etc when no using multi-server mode -$Server = new Server(); -echo 'Servers[' . $Server->Id() . '] = new Server(' . json_encode($Server). ");\n"; echo ' var monitorName = []; var monitorLoading = []; +var monitorServerId = []; var monitorImageObject = []; var monitorImageURL = []; var monitorLoadingStageURL = []; @@ -169,6 +170,7 @@ foreach ( $monitors as $m ) { echo " monitorWidth[" . $m->Id() . "]=" . $m->Width() . ";\n"; echo " monitorHeight[" . $m->Id() . "]=" . $m->Height() . ";\n"; echo " monitorIndex[" . $m->Id() . "]=" . $numMonitors . ";\n"; + echo " monitorServerId[" . $m->Id() . "]='" .($m->ServerId() ? $m->ServerId() : '0'). "';\n"; echo " monitorName[" . $m->Id() . "]=\"" . $m->Name() . "\";\n"; echo " monitorLoadStartTimems[" . $m->Id() . "]=0;\n"; echo " monitorLoadEndTimems[" . $m->Id() . "]=0;\n"; From 99471836b775d58fcae0688f6b1b239162522247 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 2 Jan 2019 11:28:12 -0500 Subject: [PATCH 24/47] Use monitor's serverId when loading server object so that images load from recording server. --- web/skins/classic/views/js/montagereview.js | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/web/skins/classic/views/js/montagereview.js b/web/skins/classic/views/js/montagereview.js index aad114325..9c4789e4e 100644 --- a/web/skins/classic/views/js/montagereview.js +++ b/web/skins/classic/views/js/montagereview.js @@ -117,21 +117,12 @@ function getImageSource( monId, time ) { Event = events[Frame.EventId]; var storage = Storage[Event.StorageId]; - var server = storage.ServerId ? Servers[storage.ServerId] : Servers[serverId]; - if ( server ) { - return server.url() + - //location.protocol + '//' + server.Hostname + - //'/cgi-bin/zms?mode=jpeg&replay=single&event=' + event_id + - //'&frame='+Frame.FrameId + - '/index.php?view=image&eid=' + Frame.EventId + '&fid='+Frame.FrameId + - "&width=" + monitorCanvasObj[monId].width + - "&height=" + monitorCanvasObj[monId].height; - } - console.log("No server found for " + ( storage.ServerId ? storage.ServerId : serverId )); - //console.log("No storage found for " + eStorageId[i] ); - return '/zm/index.php?view=image&eid=' + Frame.EventId + '&fid='+frame_id + "&width=" + monitorCanvasObj[monId].width + "&height=" + monitorCanvasObj[monId].height; - //return "/cgi-bin/zms?mode=single&replay=single&event=" + Frame.EventId + '&time='+time+ "&width=" + monitorCanvasObj[monId].width + "&height=" + monitorCanvasObj[monId].height; - //return "/cgi-bin/zms?mode=jpeg&replay=single&event=" + Frame.EventId + '&frame='+frame_id + "&width=" + monitorCanvasObj[monId].width + "&height=" + monitorCanvasObj[monId].height; + // monitorServerId may be 0, which gives us the default Server entry + var server = storage.ServerId ? Servers[storage.ServerId] : Servers[monitorServerId[monId]]; + return server.PathToIndex() + + '?view=image&eid=' + Frame.EventId + '&fid='+Frame.FrameId + + "&width=" + monitorCanvasObj[monId].width + + "&height=" + monitorCanvasObj[monId].height; } // end found Frame return ''; //return "no data"; From 51d3e6b2cdd7b17afb639569cffc2d2353c56a70 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Wed, 2 Jan 2019 14:09:35 -0500 Subject: [PATCH 25/47] changed to ZM db functions --- .../ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm index 2f379a48a..7766d9bf8 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm @@ -64,9 +64,8 @@ our $VERSION = $ZoneMinder::Base::VERSION; use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); -use DBI; -#use XML::LibXML; -use Time::HiRes qw( usleep ); +use ZoneMinder::Database qw(zmDbConnect); + sub new { @@ -278,14 +277,14 @@ sub presetSet my $self = shift; my $params = shift; my $preset = $self->getParam( $params, 'preset' ); - my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); + my $dbh = zmDbConnect(1); my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); $sth->execute(); my $ref = ($sth->fetchrow_hashref()); my $label = $ref->{'Label'}; $sth = $dbh->prepare("CREATE TABLE IF NOT EXISTS `ControlPresetNames` (`Preset` int(10) unsigned NOT NULL,`Label2` varchar(64) NOT NULL, UNIQUE KEY (`Label2`))"); - $sth->execute(); - $sth = $dbh->prepare("SELECT `Label2` FROM `ControlPresetNames` WHERE `Preset` = $preset"); + $sth->execute(); + $sth = $dbh->prepare("SELECT `Label2` FROM `ControlPresetNames` WHERE `Preset` = $preset"); $sth->execute(); $ref = ($sth->fetchrow_hashref()); my $label2 = $ref->{'Label2'}; @@ -312,7 +311,7 @@ sub presetGoto my $self = shift; my $params = shift; my $preset = $self->getParam( $params, 'preset' ); - my $dbh = DBI->connect("DBI:mysql:database=zm;host=localhost", "zmuser", "zmpass", {'RaiseError' => 1}); + my $dbh = zmDbConnect(1); my $sth = $dbh->prepare("SELECT `Label` FROM `ControlPresets` WHERE `Preset` = $preset"); $sth->execute(); my $ref = ($sth->fetchrow_hashref()); From e21b8dc1f98590e9a2972ee95ca5619033d73905 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Wed, 2 Jan 2019 16:01:33 -0500 Subject: [PATCH 26/47] changed to ZM db functions --- .../lib/ZoneMinder/Control/FOSCAMR2C.pm | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm index 7766d9bf8..1b96ae52b 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/FOSCAMR2C.pm @@ -1,10 +1,10 @@ -# Modified on Jun 19 2016 by PP -# Changes made -# - modified command to work properly and pick up credentials from Control Device -# - the old script did not stop moving- added autostop -# (note that mjpeg cameras have onestep but that is too granular) -# - You need to set "user=xxx&pwd=yyy" in the ControlDevice field (NOT usr like in Foscam HD) - +# Modified Jan 2019 for use with Foscam R2C IP Camera by Erik Schoepplenberg +# The presets work with names so adds table to ZM db to track preset names and deletes and adds presets +# in the camera and modifies the ZM db entries.The camera has 16 presets with 1-4 +# occupied with TopMost, Bottomost, LeftMost, RightMost so configure for 12. +# the camera stores presets in available spot until full. the script first deletes +# a preset then sets one using the now avialable spot. +# # ========================================================================== # # ZoneMinder Foscam FI8918W IP Control Protocol Module, $Date: 2009-11-25 09:20:00 +0000 (Wed, 04 Nov 2009) $, $Revision: 0001 $ @@ -16,7 +16,7 @@ # use Control Device field to pass username and password # Modified May 2014 by Arun Horne (http://arunhorne.co.uk) to: # use HTTP basic auth as required by firmware 11.37.x.x upward -# Modified for use with Foscam R2C IP Camera by Erik Schoepplenberg +# Modified Jan 2019 for use with Foscam R2C IP Camera by Erik Schoepplenberg # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -65,7 +65,7 @@ our $VERSION = $ZoneMinder::Base::VERSION; use ZoneMinder::Logger qw(:all); use ZoneMinder::Config qw(:all); use ZoneMinder::Database qw(zmDbConnect); - +use Time::HiRes qw( usleep ); sub new { @@ -130,7 +130,7 @@ sub sendCmd # PP Old cameras also support onstep=1 but it is too granular. Instead using moveCon and stop after interval # PP - cleaned up URL to take it properly from Control device - # Control device needs to be of format user=xxx&pwd=yyy + # Control device needs to be of format usr=xxx&pwd=yyy my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd"."&".$self->{Monitor}->{ControlDevice}); print ("Sending $req\n"); my $res = $self->{ua}->request($req); @@ -353,12 +353,8 @@ Control script for Foscam R2C cameras. =head1 DESCRIPTION -You need to set "user=xxx&pwd=yyy" in the ControlDevice field +You need to set "usr=xxx&pwd=yyy" in the ControlDevice field of the control tab for that monitor. -Auto TimeOut should be 1. Don't set it to less - processes -start crashing :) -NOTE: unlike HD foscam cameras, this one uses "user" not "usr" -in the control device =head2 EXPORT From 561a8811144dee611f706b8a8a9f18eb93041eb4 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Thu, 3 Jan 2019 14:35:01 -0500 Subject: [PATCH 27/47] added Control line to zm_create.sql --- db/zm_create.sql | 2881 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2881 insertions(+) create mode 100644 db/zm_create.sql diff --git a/db/zm_create.sql b/db/zm_create.sql new file mode 100644 index 000000000..169f3de7c --- /dev/null +++ b/db/zm_create.sql @@ -0,0 +1,2881 @@ +-- MySQL dump 10.13 Distrib 5.6.13, for Linux (i686) +-- +-- Host: localhost Database: zm +-- ------------------------------------------------------ +-- Server version 5.6.13 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `zm` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `zm`; + +USE `zm`; + +-- +-- Table structure for table `Config` +-- + +DROP TABLE IF EXISTS `Config`; +CREATE TABLE `Config` ( + `Id` smallint(5) unsigned NOT NULL default '0', + `Name` varchar(32) NOT NULL default '', + `Value` text NOT NULL, + `Type` tinytext NOT NULL, + `DefaultValue` text, + `Hint` tinytext, + `Pattern` tinytext, + `Format` tinytext, + `Prompt` tinytext, + `Help` text, + `Category` varchar(32) NOT NULL default '', + `Readonly` tinyint(3) unsigned NOT NULL default '0', + `Requires` text, + PRIMARY KEY (`Name`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `ControlPresets` +-- + +DROP TABLE IF EXISTS `ControlPresets`; +CREATE TABLE `ControlPresets` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Preset` int(10) unsigned NOT NULL default '0', + `Label` varchar(64) NOT NULL default '', + PRIMARY KEY (`MonitorId`,`Preset`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Controls` +-- + +DROP TABLE IF EXISTS `Controls`; +CREATE TABLE `Controls` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','Ffmpeg','Libvlc','cURL','WebSite') NOT NULL default 'Local', + `Protocol` varchar(64) default NULL, + `CanWake` tinyint(3) unsigned NOT NULL default '0', + `CanSleep` tinyint(3) unsigned NOT NULL default '0', + `CanReset` tinyint(3) unsigned NOT NULL default '0', + `CanZoom` tinyint(3) unsigned NOT NULL default '0', + `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0', + `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0', + `CanZoomRel` tinyint(3) unsigned NOT NULL default '0', + `CanZoomCon` tinyint(3) unsigned NOT NULL default '0', + `MinZoomRange` int(10) unsigned default NULL, + `MaxZoomRange` int(10) unsigned default NULL, + `MinZoomStep` int(10) unsigned default NULL, + `MaxZoomStep` int(10) unsigned default NULL, + `HasZoomSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinZoomSpeed` int(10) unsigned default NULL, + `MaxZoomSpeed` int(10) unsigned default NULL, + `CanFocus` tinyint(3) unsigned NOT NULL default '0', + `CanAutoFocus` tinyint(3) unsigned NOT NULL default '0', + `CanFocusAbs` tinyint(3) unsigned NOT NULL default '0', + `CanFocusRel` tinyint(3) unsigned NOT NULL default '0', + `CanFocusCon` tinyint(3) unsigned NOT NULL default '0', + `MinFocusRange` int(10) unsigned default NULL, + `MaxFocusRange` int(10) unsigned default NULL, + `MinFocusStep` int(10) unsigned default NULL, + `MaxFocusStep` int(10) unsigned default NULL, + `HasFocusSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinFocusSpeed` int(10) unsigned default NULL, + `MaxFocusSpeed` int(10) unsigned default NULL, + `CanIris` tinyint(3) unsigned NOT NULL default '0', + `CanAutoIris` tinyint(3) unsigned NOT NULL default '0', + `CanIrisAbs` tinyint(3) unsigned NOT NULL default '0', + `CanIrisRel` tinyint(3) unsigned NOT NULL default '0', + `CanIrisCon` tinyint(3) unsigned NOT NULL default '0', + `MinIrisRange` int(10) unsigned default NULL, + `MaxIrisRange` int(10) unsigned default NULL, + `MinIrisStep` int(10) unsigned default NULL, + `MaxIrisStep` int(10) unsigned default NULL, + `HasIrisSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinIrisSpeed` int(10) unsigned default NULL, + `MaxIrisSpeed` int(10) unsigned default NULL, + `CanGain` tinyint(3) unsigned NOT NULL default '0', + `CanAutoGain` tinyint(3) unsigned NOT NULL default '0', + `CanGainAbs` tinyint(3) unsigned NOT NULL default '0', + `CanGainRel` tinyint(3) unsigned NOT NULL default '0', + `CanGainCon` tinyint(3) unsigned NOT NULL default '0', + `MinGainRange` int(10) unsigned default NULL, + `MaxGainRange` int(10) unsigned default NULL, + `MinGainStep` int(10) unsigned default NULL, + `MaxGainStep` int(10) unsigned default NULL, + `HasGainSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinGainSpeed` int(10) unsigned default NULL, + `MaxGainSpeed` int(10) unsigned default NULL, + `CanWhite` tinyint(3) unsigned NOT NULL default '0', + `CanAutoWhite` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteAbs` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteRel` tinyint(3) unsigned NOT NULL default '0', + `CanWhiteCon` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteRange` int(10) unsigned default NULL, + `MaxWhiteRange` int(10) unsigned default NULL, + `MinWhiteStep` int(10) unsigned default NULL, + `MaxWhiteStep` int(10) unsigned default NULL, + `HasWhiteSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinWhiteSpeed` int(10) unsigned default NULL, + `MaxWhiteSpeed` int(10) unsigned default NULL, + `HasPresets` tinyint(3) unsigned NOT NULL default '0', + `NumPresets` tinyint(3) unsigned NOT NULL default '0', + `HasHomePreset` tinyint(3) unsigned NOT NULL default '0', + `CanSetPresets` tinyint(3) unsigned NOT NULL default '0', + `CanMove` tinyint(3) unsigned NOT NULL default '0', + `CanMoveDiag` tinyint(3) unsigned NOT NULL default '0', + `CanMoveMap` tinyint(3) unsigned NOT NULL default '0', + `CanMoveAbs` tinyint(3) unsigned NOT NULL default '0', + `CanMoveRel` tinyint(3) unsigned NOT NULL default '0', + `CanMoveCon` tinyint(3) unsigned NOT NULL default '0', + `CanPan` tinyint(3) unsigned NOT NULL default '0', + `MinPanRange` int(10) default NULL, + `MaxPanRange` int(10) default NULL, + `MinPanStep` int(10) default NULL, + `MaxPanStep` int(10) default NULL, + `HasPanSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinPanSpeed` int(10) default NULL, + `MaxPanSpeed` int(10) default NULL, + `HasTurboPan` tinyint(3) unsigned NOT NULL default '0', + `TurboPanSpeed` int(10) default NULL, + `CanTilt` tinyint(3) unsigned NOT NULL default '0', + `MinTiltRange` int(10) default NULL, + `MaxTiltRange` int(10) default NULL, + `MinTiltStep` int(10) default NULL, + `MaxTiltStep` int(10) default NULL, + `HasTiltSpeed` tinyint(3) unsigned NOT NULL default '0', + `MinTiltSpeed` int(10) default NULL, + `MaxTiltSpeed` int(10) default NULL, + `HasTurboTilt` tinyint(3) unsigned NOT NULL default '0', + `TurboTiltSpeed` int(10) default NULL, + `CanAutoScan` tinyint(3) unsigned NOT NULL default '0', + `NumScanPaths` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Devices` +-- + +DROP TABLE IF EXISTS `Devices`; +CREATE TABLE `Devices` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` tinytext NOT NULL, + `Type` enum('X10') NOT NULL default 'X10', + `KeyString` varchar(32) NOT NULL default '', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Events` +-- + +DROP TABLE IF EXISTS `Events`; +CREATE TABLE `Events` ( + `Id` bigint unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `StorageId` smallint(5) unsigned default 0, + `Name` varchar(64) NOT NULL default '', + `Cause` varchar(32) NOT NULL default '', + `StartTime` datetime default NULL, + `EndTime` datetime default NULL, + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Length` decimal(10,2) NOT NULL default '0.00', + `Frames` int(10) unsigned default NULL, + `AlarmFrames` int(10) unsigned default NULL, + `DefaultVideo` VARCHAR( 64 ) DEFAULT '' NOT NULL, + `SaveJPEGs` TINYINT, + `TotScore` int(10) unsigned NOT NULL default '0', + `AvgScore` smallint(5) unsigned default '0', + `MaxScore` smallint(5) unsigned default '0', + `Archived` tinyint(3) unsigned NOT NULL default '0', + `Videoed` tinyint(3) unsigned NOT NULL default '0', + `Uploaded` tinyint(3) unsigned NOT NULL default '0', + `Emailed` tinyint(3) unsigned NOT NULL default '0', + `Messaged` tinyint(3) unsigned NOT NULL default '0', + `Executed` tinyint(3) unsigned NOT NULL default '0', + `Notes` text, + `StateId` int(10) unsigned NOT NULL, + `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', + `DiskSpace` bigint unsigned default NULL, + `Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium', + `Locked` BOOLEAN NOT NULL DEFAULT False, + PRIMARY KEY (`Id`), + KEY `Events_MonitorId_idx` (`MonitorId`), + KEY `Events_StorageId_idx` (`StorageId`), + KEY `Events_StartTime_idx` (`StartTime`), + KEY `Events_EndTime_DiskSpace` (`EndTime`,`DiskSpace`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS `Events_Hour`; +CREATE TABLE `Events_Hour` ( + `EventId` BIGINT unsigned NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `StartTime` datetime default NULL, + `DiskSpace` bigint unsigned default NULL, + PRIMARY KEY (`EventId`), + KEY `Events_Hour_MonitorId_idx` (`MonitorId`), + KEY `Events_Hour_StartTime_idx` (`StartTime`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS `Events_Day`; +CREATE TABLE `Events_Day` ( + `EventId` BIGINT unsigned NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `StartTime` datetime default NULL, + `DiskSpace` bigint unsigned default NULL, + PRIMARY KEY (`EventId`), + KEY `Events_Day_MonitorId_idx` (`MonitorId`), + KEY `Events_Day_StartTime_idx` (`StartTime`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS `Events_Week`; +CREATE TABLE `Events_Week` ( + `EventId` BIGINT unsigned NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `StartTime` datetime default NULL, + `DiskSpace` bigint unsigned default NULL, + PRIMARY KEY (`EventId`), + KEY `Events_Week_MonitorId_idx` (`MonitorId`), + KEY `Events_Week_StartTime_idx` (`StartTime`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS `Events_Month`; +CREATE TABLE `Events_Month` ( + `EventId` BIGINT unsigned NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `StartTime` datetime default NULL, + `DiskSpace` bigint unsigned default NULL, + PRIMARY KEY (`EventId`), + KEY `Events_Month_MonitorId_idx` (`MonitorId`), + KEY `Events_Month_StartTime_idx` (`StartTime`) +) ENGINE=InnoDB; + + +DROP TABLE IF EXISTS `Events_Archived`; +CREATE TABLE `Events_Archived` ( + `EventId` BIGINT unsigned NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + `DiskSpace` bigint unsigned default NULL, + PRIMARY KEY (`EventId`), + KEY `Events_Archived_MonitorId_idx` (`MonitorId`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Filters` +-- + +DROP TABLE IF EXISTS `Filters`; +CREATE TABLE `Filters` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Query` text NOT NULL, + `AutoArchive` tinyint(3) unsigned NOT NULL default '0', + `AutoVideo` tinyint(3) unsigned NOT NULL default '0', + `AutoUpload` tinyint(3) unsigned NOT NULL default '0', + `AutoEmail` tinyint(3) unsigned NOT NULL default '0', + `AutoMessage` tinyint(3) unsigned NOT NULL default '0', + `AutoExecute` tinyint(3) unsigned NOT NULL default '0', + `AutoExecuteCmd` tinytext, + `AutoDelete` tinyint(3) unsigned NOT NULL default '0', + `AutoMove` tinyint(3) unsigned NOT NULL default '0', + `AutoMoveTo` smallint(5) unsigned NOT NULL default 0, + `UpdateDiskSpace` tinyint(3) unsigned NOT NULL default '0', + `Background` tinyint(1) unsigned NOT NULL default '0', + `Concurrent` tinyint(1) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`), + KEY `Name` (`Name`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Frames` +-- + +DROP TABLE IF EXISTS `Frames`; +CREATE TABLE `Frames` ( + `Id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `EventId` BIGINT UNSIGNED NOT NULL default '0', + `FrameId` int(10) unsigned NOT NULL default '0', + `Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal', + `TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `Delta` decimal(8,2) NOT NULL default '0.00', + `Score` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`), + INDEX `EventId_idx` (`EventId`), + KEY `Type` (`Type`), + KEY `TimeStamp` (`TimeStamp`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Groups` +-- + +DROP TABLE IF EXISTS `Groups`; +CREATE TABLE `Groups` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `ParentId` int(10) unsigned, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Groups_Monitors` +-- + +DROP TABLE IF EXISTS `Groups_Monitors`; +CREATE TABLE `Groups_Monitors` ( + `Id` INT(10) unsigned NOT NULL auto_increment, + `GroupId` int(10) unsigned NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +CREATE INDEX `Groups_Monitors_GroupId_idx` ON `Groups_Monitors` (`GroupId`); +CREATE INDEX `Groups_Monitors_MonitorId_idx` ON `Groups_Monitors` (`MonitorId`); + +-- +-- Table structure for table `Logs` +-- + +DROP TABLE IF EXISTS `Logs`; +CREATE TABLE `Logs` ( + `TimeKey` decimal(16,6) NOT NULL, + `Component` varchar(32) NOT NULL, + `ServerId` int(10) unsigned, + `Pid` int(10) DEFAULT NULL, + `Level` tinyint(3) NOT NULL, + `Code` char(3) NOT NULL, + `Message` text NOT NULL, + `File` varchar(255) DEFAULT NULL, + `Line` smallint(5) unsigned DEFAULT NULL, + KEY `TimeKey` (`TimeKey`) +) ENGINE=InnoDB; + +CREATE INDEX `Logs_TimeKey_idx` ON `Logs` (`TimeKey`); +CREATE INDEX `Logs_Level_idx` ON `Logs` (`Level`); +-- +-- Table structure for table `Manufacturers` +-- + +DROP TABLE IF EXISTS `Manufacturers`; +CREATE TABLE `Manufacturers` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL, + PRIMARY KEY (`Id`), + UNIQUE KEY (`Name`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Models` +-- + +DROP TABLE IF EXISTS `Models`; +CREATE TABLE `Models` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL, + `ManufacturerId` int(10), + PRIMARY KEY (`Id`), + UNIQUE KEY (`ManufacturerId`,`Name`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `MonitorPresets` +-- + +DROP TABLE IF EXISTS `MonitorPresets`; +CREATE TABLE `MonitorPresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','NVSocket') NOT NULL default 'Local', + `Device` tinytext, + `Channel` tinyint(3) unsigned default NULL, + `Format` int(10) unsigned default NULL, + `Protocol` varchar(16) default NULL, + `Method` varchar(16) default NULL, + `Host` varchar(64) default NULL, + `Port` varchar(8) default NULL, + `Path` varchar(255) default NULL, + `SubPath` varchar(64) default NULL, + `Width` smallint(5) unsigned default NULL, + `Height` smallint(5) unsigned default NULL, + `Palette` int(10) unsigned default NULL, + `MaxFPS` decimal(5,2) default NULL, + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` varchar(16) default NULL, + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Monitors` +-- + +DROP TABLE IF EXISTS `Monitors`; +CREATE TABLE `Monitors` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `ServerId` int(10) unsigned, + `StorageId` smallint(5) unsigned default 0, + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL') NOT NULL default 'Local', + `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `LinkedMonitors` varchar(255), + `Triggers` set('X10') NOT NULL default '', + `Device` tinytext NOT NULL default '', + `Channel` tinyint(3) unsigned NOT NULL default '0', + `Format` int(10) unsigned NOT NULL default '0', + `V4LMultiBuffer` tinyint(1) unsigned, + `V4LCapturesPerFrame` tinyint(3) unsigned, + `Protocol` varchar(16), + `Method` varchar(16) default '', + `Host` varchar(64), + `Port` varchar(8) NOT NULL default '', + `SubPath` varchar(64) NOT NULL default '', + `Path` varchar(255), + `Options` varchar(255), + `User` varchar(64), + `Pass` varchar(64), + `Width` smallint(5) unsigned NOT NULL default '0', + `Height` smallint(5) unsigned NOT NULL default '0', + `Colours` tinyint(3) unsigned NOT NULL default '1', + `Palette` int(10) unsigned NOT NULL default '0', + `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', + `Deinterlacing` int(10) unsigned NOT NULL default '0', + `SaveJPEGs` TINYINT NOT NULL DEFAULT '3' , + `VideoWriter` TINYINT NOT NULL DEFAULT '0', + `OutputCodec` enum('h264','mjpeg','mpeg1','mpeg2'), + `OutputContainer` enum('auto','mp4','mkv'), + `EncoderParameters` TEXT, + `RecordAudio` TINYINT NOT NULL DEFAULT '0', + `RTSPDescribe` tinyint(1) unsigned, + `Brightness` mediumint(7) NOT NULL default '-1', + `Contrast` mediumint(7) NOT NULL default '-1', + `Hue` mediumint(7) NOT NULL default '-1', + `Colour` mediumint(7) NOT NULL default '-1', + `EventPrefix` varchar(32) NOT NULL default 'Event-', + `LabelFormat` varchar(64) default '%N - %y/%m/%d %H:%M:%S', + `LabelX` smallint(5) unsigned NOT NULL default '0', + `LabelY` smallint(5) unsigned NOT NULL default '0', + `LabelSize` smallint(5) unsigned NOT NULL DEFAULT '1', + `ImageBufferCount` smallint(5) unsigned NOT NULL default '100', + `WarmupCount` smallint(5) unsigned NOT NULL default '25', + `PreEventCount` smallint(5) unsigned NOT NULL default '10', + `PostEventCount` smallint(5) unsigned NOT NULL default '10', + `StreamReplayBuffer` int(10) unsigned NOT NULL default '1000', + `AlarmFrameCount` smallint(5) unsigned NOT NULL default '1', + `SectionLength` int(10) unsigned NOT NULL default '600', + `FrameSkip` smallint(5) unsigned NOT NULL default '0', + `MotionFrameSkip` smallint(5) unsigned NOT NULL default '0', + `AnalysisFPSLimit` decimal(5,2) default NULL, + `AnalysisUpdateDelay` smallint(5) unsigned NOT NULL default '0', + `MaxFPS` decimal(5,2) default NULL, + `AlarmMaxFPS` decimal(5,2) default NULL, + `FPSReportInterval` smallint(5) unsigned NOT NULL default '250', + `RefBlendPerc` tinyint(3) unsigned NOT NULL default '6', + `AlarmRefBlendPerc` tinyint(3) unsigned NOT NULL default '6', + `Controllable` tinyint(3) unsigned NOT NULL default '0', + `ControlId` int(10) unsigned, + `ControlDevice` varchar(255) default NULL, + `ControlAddress` varchar(255) default NULL, + `AutoStopTimeout` decimal(5,2) default NULL, + `TrackMotion` tinyint(3) unsigned NOT NULL default '0', + `TrackDelay` smallint(5) unsigned, + `ReturnLocation` tinyint(3) NOT NULL default '-1', + `ReturnDelay` smallint(5) unsigned, + `DefaultRate` smallint(5) unsigned NOT NULL default '100', + `DefaultScale` smallint(5) unsigned NOT NULL default '100', + `SignalCheckPoints` INT UNSIGNED NOT NULL default '0', + `SignalCheckColour` varchar(32) NOT NULL default '#0000BE', + `WebColour` varchar(32) NOT NULL default 'red', + `Exif` tinyint(1) unsigned NOT NULL default '0', + `Sequence` smallint(5) unsigned default NULL, + `TotalEvents` int(10) default NULL, + `TotalEventDiskSpace` bigint default NULL, + `HourEvents` int(10) default NULL, + `HourEventDiskSpace` bigint default NULL, + `DayEvents` int(10) default NULL, + `DayEventDiskSpace` bigint default NULL, + `WeekEvents` int(10) default NULL, + `WeekEventDiskSpace` bigint default NULL, + `MonthEvents` int(10) default NULL, + `MonthEventDiskSpace` bigint default NULL, + `ArchivedEvents` int(10) default NULL, + `ArchivedEventDiskSpace` bigint default NULL, + `ZoneCount` TINYINT NOT NULL DEFAULT 0, + `Refresh` int(10) unsigned default NULL, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +CREATE INDEX `Monitors_ServerId_idx` ON `Monitors` (`ServerId`); + +DROP TABLE IF EXISTS `Monitor_Status`; +CREATE TABLE `Monitor_Status` ( + `MonitorId` int(10) unsigned NOT NULL, + `Status` enum('Unknown','NotRunning','Running','Connected','Signal') NOT NULL default 'Unknown', + `CaptureFPS` DECIMAL(10,2) NOT NULL default 0, + `AnalysisFPS` DECIMAL(5,2) NOT NULL default 0, + `CaptureBandwidth` INT NOT NULL default 0, + PRIMARY KEY (`MonitorId`) +) ENGINE=MEMORY; +-- +-- Table structure for table `States` +-- PP - Added IsActive to track custom run states +-- Also made sure Name is unique + +DROP TABLE IF EXISTS `States`; +CREATE TABLE `States` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Definition` text NOT NULL, + `IsActive` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`Id`), + UNIQUE KEY (`Name`) +) ENGINE=InnoDB; +INSERT INTO States (Name,Definition,IsActive) VALUES ('default','','1'); + + +-- +-- Table structure for table `Servers` +-- + +DROP TABLE IF EXISTS `Servers`; +CREATE TABLE `Servers` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Protocol` TEXT, + `Hostname` TEXT, + `Port` INTEGER UNSIGNED, + `PathToIndex` TEXT, + `PathToZMS` TEXT, + `PathToApi` TEXT, + `Name` varchar(64) NOT NULL default '', + `State_Id` int(10) unsigned, + `Status` enum('Unknown','NotRunning','Running') NOT NULL default 'Unknown', + `CpuLoad` DECIMAL(5,1) default NULL, + `TotalMem` bigint unsigned default null, + `FreeMem` bigint unsigned default null, + `TotalSwap` bigint unsigned default null, + `FreeSwap` bigint unsigned default null, + `zmstats` BOOLEAN NOT NULL DEFAULT FALSE, + `zmaudit` BOOLEAN NOT NULL DEFAULT FALSE, + `zmtrigger` BOOLEAN NOT NULL DEFAULT FALSE, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +CREATE INDEX `Servers_Name_idx` ON `Servers` (`Name`); + +-- +-- Table structure for table `Stats` +-- + +DROP TABLE IF EXISTS `Stats`; +CREATE TABLE `Stats` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `ZoneId` int(10) unsigned NOT NULL default '0', + `EventId` BIGINT UNSIGNED NOT NULL, + `FrameId` int(10) unsigned NOT NULL default '0', + `PixelDiff` tinyint(3) unsigned NOT NULL default '0', + `AlarmPixels` int(10) unsigned NOT NULL default '0', + `FilterPixels` int(10) unsigned NOT NULL default '0', + `BlobPixels` int(10) unsigned NOT NULL default '0', + `Blobs` smallint(5) unsigned NOT NULL default '0', + `MinBlobSize` int(10) unsigned NOT NULL default '0', + `MaxBlobSize` int(10) unsigned NOT NULL default '0', + `MinX` smallint(5) unsigned NOT NULL default '0', + `MaxX` smallint(5) unsigned NOT NULL default '0', + `MinY` smallint(5) unsigned NOT NULL default '0', + `MaxY` smallint(5) unsigned NOT NULL default '0', + `Score` smallint(5) unsigned NOT NULL default '0', + KEY `EventId` (`EventId`), + KEY `MonitorId` (`MonitorId`), + KEY `ZoneId` (`ZoneId`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `TriggersX10` +-- + +DROP TABLE IF EXISTS `TriggersX10`; +CREATE TABLE `TriggersX10` ( + `MonitorId` int(10) unsigned NOT NULL default '0', + `Activation` varchar(32) default NULL, + `AlarmInput` varchar(32) default NULL, + `AlarmOutput` varchar(32) default NULL, + PRIMARY KEY (`MonitorId`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Users` +-- + +DROP TABLE IF EXISTS `Users`; +CREATE TABLE `Users` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Username` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', + `Password` varchar(64) NOT NULL default '', + `Language` varchar(8), + `Enabled` tinyint(3) unsigned NOT NULL default '1', + `Stream` enum('None','View') NOT NULL default 'None', + `Events` enum('None','View','Edit') NOT NULL default 'None', + `Control` enum('None','View','Edit') NOT NULL default 'None', + `Monitors` enum('None','View','Edit') NOT NULL default 'None', + `Groups` enum('None','View','Edit') NOT NULL default 'None', + `Devices` enum('None','View','Edit') NOT NULL default 'None', + `System` enum('None','View','Edit') NOT NULL default 'None', + `MaxBandwidth` varchar(16), + `MonitorIds` tinytext, + PRIMARY KEY (`Id`), + UNIQUE KEY `UC_Username` (`Username`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `ZonePresets` +-- + +DROP TABLE IF EXISTS `ZonePresets`; +CREATE TABLE `ZonePresets` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive','Privacy') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + `ExtendAlarmFrames` smallint(5) unsigned not null default 0, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +-- +-- Table structure for table `Zones` +-- + +DROP TABLE IF EXISTS `Zones`; +CREATE TABLE `Zones` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `MonitorId` int(10) unsigned NOT NULL default '0', + `Name` varchar(64) NOT NULL default '', + `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive','Privacy') NOT NULL default 'Active', + `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', + `NumCoords` tinyint(3) unsigned NOT NULL default '0', + `Coords` tinytext NOT NULL, + `Area` int(10) unsigned NOT NULL default '0', + `AlarmRGB` int(10) unsigned default '0', + `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', + `MinPixelThreshold` smallint(5) unsigned default NULL, + `MaxPixelThreshold` smallint(5) unsigned default NULL, + `MinAlarmPixels` int(10) unsigned default NULL, + `MaxAlarmPixels` int(10) unsigned default NULL, + `FilterX` tinyint(3) unsigned default NULL, + `FilterY` tinyint(3) unsigned default NULL, + `MinFilterPixels` int(10) unsigned default NULL, + `MaxFilterPixels` int(10) unsigned default NULL, + `MinBlobPixels` int(10) unsigned default NULL, + `MaxBlobPixels` int(10) unsigned default NULL, + `MinBlobs` smallint(5) unsigned default NULL, + `MaxBlobs` smallint(5) unsigned default NULL, + `OverloadFrames` smallint(5) unsigned NOT NULL default '0', + `ExtendAlarmFrames` smallint(5) unsigned not null default 0, + PRIMARY KEY (`Id`), + KEY `MonitorId` (`MonitorId`) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS `Storage`; +CREATE TABLE `Storage` ( + `Id` smallint(5) unsigned NOT NULL auto_increment, + `Path` varchar(64) NOT NULL default '', + `Name` varchar(64) NOT NULL default '', + `Type` enum('local','s3fs') NOT NULL default 'local', + `Url` varchar(255) default NULL, + `DiskSpace` bigint default NULL, + `Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium', + `ServerId` int(10) unsigned, + `DoDelete` BOOLEAN NOT NULL DEFAULT true, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB; + +-- +-- Create a default storage location +-- +insert into Storage VALUES (NULL, '/var/lib/zoneminder/events', 'Default', 'local', NULL, NULL, 'Medium', 0, true ); + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- +-- Initial data to be loaded into ZoneMinder database +-- + +-- +-- Create a default admin user. +-- +insert into Users VALUES (NULL,'admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','Edit','',''); + +-- +-- Add a sample filter to purge the oldest 100 events when the disk is 95% full +-- + +insert into Filters values (NULL,'PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":100,"sort_asc":1}',0/*AutoArchive*/,0/*AutoVideo*/,0/*AutoUpload*/,0/*AutoEmail*/,0/*AutoMessage*/,0/*AutoExecute*/,'',1/*AutoDelete*/,0/*AutoMove*/,0/*MoveTo*/,0/*UpdateDiskSpace*/,1/*Background*/,0/*Concurrent*/); +insert into Filters values (NULL,'Update DiskSpace','{"terms":[{"attr":"DiskSpace","op":"IS","val":"NULL"}]}',0,0,0,0,0,0,'',0,0,0,1,1,0); + +-- +-- Add in some sample control protocol definitions +-- +INSERT INTO Controls VALUES (NULL,'Pelco-D','Local','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +INSERT INTO Controls VALUES (NULL,'Pelco-P','Local','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +INSERT INTO Controls VALUES (NULL,'Sony VISCA','Local','Visca',1,1,0,1,0,0,0,1,0,16384,10,4000,1,1,6,1,1,1,0,1,0,1536,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,3,1,1,1,1,0,1,1,0,1,-15578,15578,100,10000,1,1,50,1,254,1,-7789,7789,100,5000,1,1,50,1,254,0,0); +INSERT INTO Controls VALUES (NULL,'Axis API v2','Remote','AxisV2',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0); +INSERT INTO Controls VALUES (NULL,'Panasonic IP','Remote','PanasonicIP',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); +INSERT INTO Controls VALUES (NULL,'Neu-Fusion NCS370','Remote','Ncs370',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,24,1,0,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); +INSERT INTO Controls VALUES (NULL,'AirLink SkyIPCam 7xx','Remote','SkyIPCam7xx',0,0,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,1,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); +INSERT INTO Controls VALUES (NULL,'Pelco-D','Ffmpeg','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +INSERT INTO Controls VALUES (NULL,'Pelco-P','Ffmpeg','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); +INSERT INTO Controls VALUES (NULL,'Foscam FI8620','Ffmpeg','FI8620_Y2k',0,0,0,1,0,0,0,1,1,10,1,10,1,1,63,1,1,0,0,1,1,63,1,63,1,1,63,1,1,0,0,1,0,0,0,0,1,0,255,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,255,1,8,0,1,1,1,0,0,0,1,1,1,360,1,360,1,1,63,0,0,1,1,90,1,90,1,1,63,0,0,0,0); +INSERT INTO Controls VALUES (NULL,'Foscam FI8608W','Ffmpeg','FI8608W_Y2k',1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,255,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,255,1,8,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,128,0,0,1,0,0,0,0,1,1,128,0,0,0,0); +INSERT INTO Controls VALUES (NULL,'Foscam FI8908W','Remote','FI8908W',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO Controls VALUES (NULL,'Foscam FI9821W','Ffmpeg','FI9821W_Y2k',1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,100,1,1,0,0,1,0,100,0,100,1,0,100,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,100,0,100,1,0,100,1,16,0,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,1,0,4,0,0,0,0); +INSERT INTO Controls VALUES (NULL,'Loftek Sentinel','Remote','LoftekSentinel',0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,255,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,6,1,1,0,0,0,1,10,0,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO Controls VALUES (NULL,'Toshiba IK-WB11A','Remote','Toshiba_IK_WB11A',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,10,0,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO Controls VALUES (NULL,'WanscamPT','Remote','Wanscam',1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,16,0,0,0,0,0,1,16,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO Controls VALUES (NULL,'3S Domo N5071', 'Remote', '3S', 0, 0, 1, 1, 0, 1, 1, 0, 0, 9999, 0, 9999, 0, 0, 0, 1, 1, 1, 1, 0, 0, 9999, 20, 9999, 0, 0, 0, 1, 1, 1, 1, 0, 0, 9999, 1, 9999, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 1, 0, 1, 1, 0, 0, 0, 0, 1, -180, 180, 40, 100, 1, 40, 100, 0, 0, 1, -180, 180, 40, 100, 1, 40, 100, 0, 0, 0, 0); +INSERT INTO Controls VALUES (NULL,'ONVIF Camera','Ffmpeg','onvif',0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,255,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,6,1,1,0,0,0,1,10,0,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Foscam 9831W','Ffmpeg','FI9831W',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,1,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Foscam FI8918W','Ffmpeg','FI8918W',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,1,0,4,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'SunEyes SP-P1802SWPTZ','Libvlc','SPP1802SWPTZ',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,64,0,0,1,0,0,0,0,1,0,64,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Wanscam HW0025','Libvlc','WanscamHW0025', 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 350, 0, 0, 1, 0, 10, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0); +INSERT INTO `Controls` VALUES (NULL,'IPCC 7210W','Remote','IPCC7210W', 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +INSERT INTO `Controls` VALUES (NULL,'Vivotek ePTZ','Remote','Vivotek_ePTZ',0,0,1,1,0,0,0,1,0,0,0,0,1,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,5,0,0,1,0,0,0,0,1,0,5,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Netcat ONVIF','Ffmpeg','Netcat',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,100,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,100,5,5,0,0,0,1,255,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Keekoon','Remote','Keekoon', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +INSERT INTO `Controls` VALUES (NULL,'HikVision','Local','',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,100,0,0,1,0,0,0,0,1,1,100,1,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Maginon Supra IPC','cURL','MaginonIPC',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Floureon 1080P','Ffmpeg','Floureon',0,0,0,1,0,0,0,1,1,18,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-423','Ffmpeg','Reolink',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,64,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-411','Ffmpeg','Reolink',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-420','Ffmpeg','Reolink',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'D-LINK DCS-3415','Remote','DCS3415',0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'IOS Camera','Ffmpeg','IPCAMIOS',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Dericam P2','Ffmpeg','DericamP2',0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,10,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,45,0,0,1,0,0,0,0,1,1,45,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Trendnet','Remote','Trendnet',1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'PSIA','Remote','PSIA',0,0,0,1,0,0,1,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,-100,100,0,0,1,0,0,0,0,1,-100,100,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'Dahua','Remote','Dahua',0,0,0,1,0,0,1,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'FOSCAMR2C','Libvlc','FOSCAMR2C',1,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,0,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,0,0); + +-- +-- Add some monitor preset values +-- +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, mpjpeg, B&W','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&color=0',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, mpjpeg, B&W','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&color=0',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,1,4,NULL,':',100,100); +INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, unicast','Remote','rtsp',0,255,'rtsp','rtpUni','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, multicast','Remote','rtsp',0,255,'rtsp','rtpMulti','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, RTP/RTSP','Remote','rtsp',0,255,'rtsp','rtpRtsp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, RTP/RTSP/HTTP','Remote',NULL,NULL,NULL,'rtsp','rtpRtspHttp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'D-link DCS-930L, 640x480, mjpeg','Remote','http',0,0,'http','simple','',80,'/mjpeg.cgi',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,1,5,NULL,':',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, jpeg','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, mpjpeg','Remote','http',0,0,'http','simple','',80,'/GetData.cgi',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, mpjpeg','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'IP Webcam by Pavel Khlebovich 1920x1080','Remote','/dev/video','0',255,'http','simple','','8080','/video','',1920,1080,0,NULL,0,'0','','',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'VEO Observer, jpeg','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Blue Net Video Server, jpeg','Remote','http',0,0,'http','simple','',80,'/cgi-bin/image.cgi?control=0&id=admin&passwd=admin',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT into MonitorPresets VALUES (NULL,'ACTi IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',7070,'','/track',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp?videocodec=h264',NULL,NULL,NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Vivotek FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://:554/live.sdp',NULL,NULL,NULL,352,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Axis FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp',NULL,NULL,NULL,640,480,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'ACTi TCM FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://admin:123456@:7070',NULL,NULL,NULL,320,240,NULL,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 320x240','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 320x240, max 5 FPS','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 640x480','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 640x480, max 5 FPS','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 320x240','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 320x240, max 5 FPS','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 640x480','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 640x480, max 5 FPS','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 320x240','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 320x240, max 5 FPS','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 640x480','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 640x480, max 5 FPS','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 320x240','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 320x240, max 5 FPS','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 640x480','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 640x480, max 5 FPS','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Foscam FI8620 FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://:@:554/11',NULL,704,576,0,NULL,1,'10','','',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Foscam FI8608W FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://:@:554/11',NULL,640,480,0,NULL,1,'11','','',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Foscam FI9821W FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://:@:88/videoMain',NULL,1280,720,0,NULL,1,'12','','',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Loftek Sentinel PTZ, 640x480, mjpeg','Remote','http',0,0,NULL,NULL,'','80','/videostream.cgi?user=&pwd=&resolution=32&rate=11',NULL,640,480,4,NULL,1,'13','',':@',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Airlink 777W PTZ, 640x480, mjpeg','Remote','http',0,0,NULL,NULL,':@','80','/cgi/mjpg/mjpg.cgi',NULL,640,480,4,NULL,1,'7','',':@',100,100); +INSERT INTO MonitorPresets VALUES (NULL,'SunEyes SP-P1802SWPTZ','Libvlc','/dev/video','0',255,'','rtpMulti','','80','rtsp://:554/11','',1920,1080,0,0.00,1,'16','-speed=64',':',100,33); +INSERT INTO MonitorPresets VALUES (NULL,'Qihan IP, 1280x720, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp',NULL,554,'rtsp:///tcp_live/ch0_0',NULL,1280,720,3,NULL,0,NULL,NULL,NULL,100,100); +INSERT INTO MonitorPresets VALUES (NULL,'Qihan IP, 1920x1080, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp',NULL,554,'rtsp:///tcp_live/ch0_0',NULL,1920,1080,3,NULL,0,NULL,NULL,NULL,100,100); + +-- +-- Add some zone preset values +-- +INSERT INTO ZonePresets VALUES (1,'Default','Active','Percent','Blobs',25,NULL,3,75,3,3,3,75,2,NULL,1,NULL,0,0); +INSERT INTO ZonePresets VALUES (2,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0); +INSERT INTO ZonePresets VALUES (3,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0); +INSERT INTO ZonePresets VALUES (4,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0); +INSERT INTO ZonePresets VALUES (5,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL,0,0); +INSERT INTO ZonePresets VALUES (6,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL,0,0); +INSERT INTO ZonePresets VALUES (7,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL,0,0); + +DROP TABLE IF EXISTS Maps; + +CREATE TABLE Maps ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` VARCHAR(64) NOT NULL, + `Filename` VARCHAR(64) NOT NULL default '', + `NumCoords` tinyint(3) unsigned NOT NULL default '0', + `Coords` tinytext NOT NULL, + `ParentId` int(1) unsigned, + PRIMARY KEY (`Id`) +); + +DROP TABLE IF EXISTS MontageLayouts; + +CREATE TABLE MontageLayouts ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` TEXT NOT NULL, + `Positions` LONGTEXT, + /*`Positions` JSON,*/ + PRIMARY KEY (`Id`) +); + +INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('Freeform', '{ "default":{"float":"left","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); +INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('2 Wide', '{ "default":{"float":"left", "width":"49%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); +INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('3 Wide', '{ "default":{"float":"left", "width":"33%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); +INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('4 Wide', '{ "default":{"float":"left", "width":"24.5%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); +INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('5 Wide', '{ "default":{"float":"left", "width":"19%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); + +-- We generally don't alter triggers, we drop and re-create them, so let's keep them in a separate file that we can just source in update scripts. +source /usr/local/share/zoneminder/db/triggers.sql +-- +-- Apply the initial configuration +-- +-- This section is autogenerated by zmconfgen.pl +-- Do not edit this file as any changes will be overwritten +-- + +delete from Config; + +insert into Config set Id = 0, Name = 'ZM_SKIN_DEFAULT', Value = 'classic', Type = 'string', DefaultValue = 'classic', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default skin used by web interface', Help = ' + ZoneMinder allows the use of many different web interfaces. + This option allows you to set the default skin used by the + website. Users can change their skin later, this merely sets + the default. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 1, Name = 'ZM_CSS_DEFAULT', Value = 'classic', Type = 'string', DefaultValue = 'classic', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default set of css files used by web interface', Help = ' + ZoneMinder allows the use of many different web interfaces, and + some skins allow the use of different set of CSS files to + control the appearance. This option allows you to set the + default set of css files used by the website. Users can change + their css later, this merely sets the default. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 2, Name = 'ZM_BANDWIDTH_DEFAULT', Value = 'high', Type = 'string', DefaultValue = 'high', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default setting for bandwidth profile used by web interface', Help = 'The classic skin for ZoneMinder has different + profiles to use for low medium or high bandwidth connections. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 3, Name = 'ZM_LANG_DEFAULT', Value = 'en_gb', Type = 'string', DefaultValue = 'en_gb', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default language used by web interface', Help = ' + ZoneMinder allows the web interface to use languages other than + English if the appropriate language file has been created and + is present. This option allows you to change the default + language that is used from the shipped language, British + English, to another language + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 4, Name = 'ZM_OPT_USE_AUTH', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Authenticate user logins to ZoneMinder', Help = ' + ZoneMinder can run in two modes. The simplest is an entirely + unauthenticated mode where anyone can access ZoneMinder and + perform all tasks. This is most suitable for installations + where the web server access is limited in other ways. The other + mode enables user accounts with varying sets of permissions. + Users must login or authenticate to access ZoneMinder and are + limited by their defined permissions. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 5, Name = 'ZM_AUTH_TYPE', Value = 'builtin', Type = 'string', DefaultValue = 'builtin', Hint = 'builtin|remote', Pattern = '(?^i:^([br]))', Format = ' $1 =~ /^b/ ? \'builtin\' : \'remote\' ', Prompt = 'What is used to authenticate ZoneMinder users', Help = ' + ZoneMinder can use two methods to authenticate users when + running in authenticated mode. The first is a builtin method + where ZoneMinder provides facilities for users to log in and + maintains track of their identity. The second method allows + interworking with other methods such as http basic + authentication which passes an independently authentication + \'remote\' user via http. In this case ZoneMinder would use the + supplied user without additional authentication provided such a + user is configured ion ZoneMinder. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; +insert into Config set Id = 6, Name = 'ZM_AUTH_RELAY', Value = 'hashed', Type = 'string', DefaultValue = 'hashed', Hint = 'hashed|plain|none', Pattern = '(?^i:^([hpn]))', Format = ' ($1 =~ /^h/) ? \'hashed\' : ($1 =~ /^p/ ? \'plain\' : \'none\' ) ', Prompt = 'Method used to relay authentication information', Help = ' + When ZoneMinder is running in authenticated mode it can pass + user details between the web pages and the back end processes. + There are two methods for doing this. This first is to use a + time limited hashed string which contains no direct username or + password details, the second method is to pass the username and + passwords around in plaintext. This method is not recommend + except where you do not have the md5 libraries available on + your system or you have a completely isolated system with no + external access. You can also switch off authentication + relaying if your system is isolated in other ways. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; +insert into Config set Id = 7, Name = 'ZM_AUTH_HASH_SECRET', Value = '...Change me to something unique...', Type = 'string', DefaultValue = '...Change me to something unique...', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Secret for encoding hashed authentication information', Help = ' + When ZoneMinder is running in hashed authenticated mode it is + necessary to generate hashed strings containing encrypted + sensitive information such as usernames and password. Although + these string are reasonably secure the addition of a random + secret increases security substantially. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; +insert into Config set Id = 8, Name = 'ZM_AUTH_HASH_IPS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Include IP addresses in the authentication hash', Help = ' + When ZoneMinder is running in hashed authenticated mode it can + optionally include the requesting IP address in the resultant + hash. This adds an extra level of security as only requests + from that address may use that authentication key. However in + some circumstances, such as access over mobile networks, the + requesting address can change for each request which will cause + most requests to fail. This option allows you to control + whether IP addresses are included in the authentication hash on + your system. If you experience intermitent problems with + authentication, switching this option off may help. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; +insert into Config set Id = 9, Name = 'ZM_AUTH_HASH_TTL', Value = '2', Type = 'integer', DefaultValue = '2', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The number of hours that an authentication hash is valid for.', Help = ' + The default has traditionally been 2 hours. A new hash will + automatically be regenerated at half this value. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; +insert into Config set Id = 10, Name = 'ZM_AUTH_HASH_LOGINS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Allow login by authentication hash', Help = ' + The normal process for logging into ZoneMinder is via the login + screen with username and password. In some circumstances it may + be desirable to allow access directly to one or more pages, for + instance from a third party application. If this option is + enabled then adding an \'auth\' parameter to any request will + include a shortcut login bypassing the login screen, if not + already logged in. As authentication hashes are time and, + optionally, IP limited this can allow short-term access to + ZoneMinder screens from other web pages etc. In order to use + this the calling application will have to generate the + authentication hash itself and ensure it is valid. If you use + this option you should ensure that you have modified the + ZM_AUTH_HASH_SECRET to something unique to your system. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; +insert into Config set Id = 11, Name = 'ZM_ENABLE_CSRF_MAGIC', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Enable csrf-magic library', Help = ' + CSRF stands for Cross-Site Request Forgery which, under specific + circumstances, can allow an attacker to perform any task your + ZoneMinder user account has permission to perform. To accomplish + this, the attacker must write a very specific web page and get + you to navigate to it, while you are logged into the ZoneMinder + web console at the same time. Enabling ZM_ENABLE_CSRF_MAGIC will + help mitigate these kinds of attackes. Be warned this feature + is experimental and may cause problems, particularly with the API. + If you find a false positive and can document how to reproduce it, + then please report it. This feature defaults to OFF currently due to + its experimental nature. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 12, Name = 'ZM_OPT_USE_API', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Enable ZoneMinder APIs', Help = ' + ZoneMinder now features a new API using which 3rd party + applications can interact with ZoneMinder data. It is + STRONGLY recommended that you enable authentication along + with APIs. Note that the APIs return sensitive data like + Monitor access details which are configured as JSON objects. + Which is why we recommend you enabling authentication, especially + if you are exposing your ZM instance on the Internet. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 13, Name = 'ZM_OPT_USE_EVENTNOTIFICATION', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Enable 3rd party Event Notification Server', Help = ' + zmeventnotification is a 3rd party event notification server + that is used to get notifications for alarms detected by ZoneMinder + in real time. zmNinja requires this server for push notifications to + mobile phones. This option only enables the server if its already installed. + Please visit the [zmeventserver project site](https://github.com/pliablepixels/zmeventserver) + for installation instructions. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 14, Name = 'ZM_OPT_USE_GOOG_RECAPTCHA', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Add Google reCaptcha to login page', Help = ' + This option allows you to include a google + reCaptcha validation at login. This means in addition to providing + a valid usernane and password, you will also have to + pass the reCaptcha test. Please note that enabling this + option results in the zoneminder login page reach out + to google servers for captcha validation. Also please note + that enabling this option will break 3rd party clients + like zmNinja and zmView as they also need to login to ZoneMinder + and they will fail the reCaptcha test. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; +insert into Config set Id = 15, Name = 'ZM_OPT_GOOG_RECAPTCHA_SITEKEY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Your recaptcha site-key', Help = 'You need to generate your keys from + the Google reCaptcha website. + Please refer to the [recaptcha project site](https://www.google.com/recaptcha/) + for more details. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_GOOG_RECAPTCHA=1'; +insert into Config set Id = 16, Name = 'ZM_OPT_GOOG_RECAPTCHA_SECRETKEY', Value = '...Insert your recaptcha secret-key here...', Type = 'string', DefaultValue = '...Insert your recaptcha secret-key here...', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Your recaptcha secret-key', Help = 'You need to generate your keys from + the Google reCaptcha website. + Please refer to the [recaptcha project site](https://www.google.com/recaptcha/) + for more details. + ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_GOOG_RECAPTCHA=1'; +insert into Config set Id = 17, Name = 'ZM_USE_DEEP_STORAGE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a deep filesystem hierarchy for events', Help = ' + This option is now the default for new ZoneMinder systems and + should not be changed. Previous versions of ZoneMinder stored + all events for a monitor under one folder. Enabling + USE_DEEP_STORAGE causes ZoneMinder to store events under a + folder structure that follows year/month/day/hour/min/second. + Storing events this way avoids the limitation of storing more + than 32k files in a single folder inherent in some filesystems. + It is important to note that you cannot simply change this + option. You must stop zoneminder, enable USE_DEEP_STORAGE, and + then run \"sudo zmupdate.pl --migrate-events\". FAILURE TO DO + SO WILL RESULT IN LOSS OF YOUR DATA! Consult the ZoneMinder + WiKi for further details. + ', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 18, Name = 'ZM_COLOUR_JPEG_FILES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Colourise greyscale JPEG files', Help = ' + Cameras that capture in greyscale can write their captured + images to jpeg files with a corresponding greyscale colour + space. This saves a small amount of disk space over colour + ones. However some tools such as ffmpeg either fail to work + with this colour space or have to convert it beforehand. + Setting this option to yes uses up a little more space but + makes creation of MPEG files much faster. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 19, Name = 'ZM_ADD_JPEG_COMMENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Add jpeg timestamp annotations as file header comments', Help = ' + JPEG files may have a number of extra fields added to the file + header. The comment field may have any kind of text added. This + options allows you to have the same text that is used to + annotate the image additionally included as a file header + comment. If you archive event images to other locations this + may help you locate images for particular events or times if + you use software that can read comment headers. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 20, Name = 'ZM_JPEG_FILE_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the saved event files (1-100)', Help = ' + When ZoneMinder detects an event it will save the images + associated with that event to files. These files are in the + JPEG format and can be viewed or streamed later. This option + specifies what image quality should be used to save these + files. A higher number means better quality but less + compression so will take up more disk space and take longer to + view over a slow connection. By contrast a low number means + smaller, quicker to view, files but at the price of lower + quality images. This setting applies to all images written + except if the capture image has caused an alarm and the alarm + file quality option is set at a higher value when that is used + instead. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 21, Name = 'ZM_JPEG_ALARM_FILE_QUALITY', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the saved event files during an alarm (1-100)', Help = ' + This value is equivalent to the regular jpeg file quality + setting above except that it only applies to images saved while + in an alarm state and then only if this value is set to a + higher quality setting than the ordinary file setting. If set + to a lower value then it is ignored. Thus leaving it at the + default of 0 effectively means to use the regular file quality + setting for all saved images. This is to prevent acccidentally + saving important images at a worse quality setting. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 22, Name = 'ZM_JPEG_IMAGE_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the streamed \'live\' images (1-100)', Help = ' + When viewing a \'live\' stream for a monitor ZoneMinder will grab + an image from the buffer and encode it into JPEG format before + sending it. This option specifies what image quality should be + used to encode these images. A higher number means better + quality but less compression so will take longer to view over a + slow connection. By contrast a low number means quicker to view + images but at the price of lower quality images. This option + does not apply when viewing events or still images as these are + usually just read from disk and so will be encoded at the + quality specified by the previous options. + ', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 23, Name = 'ZM_JPEG_STREAM_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the streamed \'live\' images (1-100)', Help = ' + When viewing a \'live\' stream for a monitor ZoneMinder will grab + an image from the buffer and encode it into JPEG format before + sending it. This option specifies what image quality should be + used to encode these images. A higher number means better + quality but less compression so will take longer to view over a + slow connection. By contrast a low number means quicker to view + images but at the price of lower quality images. This option + does not apply when viewing events or still images as these are + usually just read from disk and so will be encoded at the + quality specified by the previous options. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 24, Name = 'ZM_MPEG_TIMED_FRAMES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Tag video frames with a timestamp for more realistic streaming', Help = ' + When using streamed MPEG based video, either for live monitor + streams or events, ZoneMinder can send the streams in two ways. + If this option is selected then the timestamp for each frame, + taken from it\'s capture time, is included in the stream. This + means that where the frame rate varies, for instance around an + alarm, the stream will still maintain it\'s \'real\' timing. If + this option is not selected then an approximate frame rate is + calculated and that is used to schedule frames instead. This + option should be selected unless you encounter problems with + your preferred streaming method. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 25, Name = 'ZM_MPEG_LIVE_FORMAT', Value = 'swf', Type = 'string', DefaultValue = 'swf', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What format \'live\' video streams are played in', Help = ' + When using MPEG mode ZoneMinder can output live video. However + what formats are handled by the browser varies greatly between + machines. This option allows you to specify a video format + using a file extension format, so you would just enter the + extension of the file type you would like and the rest is + determined from that. The default of \'asf\' works well under + Windows with Windows Media Player but I\'m currently not sure + what, if anything, works on a Linux platform. If you find out + please let me know! If this option is left blank then live + streams will revert to being in motion jpeg format + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 26, Name = 'ZM_MPEG_REPLAY_FORMAT', Value = 'swf', Type = 'string', DefaultValue = 'swf', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What format \'replay\' video streams are played in', Help = ' + When using MPEG mode ZoneMinder can replay events in encoded + video format. However what formats are handled by the browser + varies greatly between machines. This option allows you to + specify a video format using a file extension format, so you + would just enter the extension of the file type you would like + and the rest is determined from that. The default of \'asf\' + works well under Windows with Windows Media Player and \'mpg\', + or \'avi\' etc should work under Linux. If you know any more then + please let me know! If this option is left blank then live + streams will revert to being in motion jpeg format + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 27, Name = 'ZM_RAND_STREAM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Add a random string to prevent caching of streams', Help = ' + Some browsers can cache the streams used by ZoneMinder. In + order to prevent this a harmless random string can be appended + to the url to make each invocation of the stream appear unique. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 28, Name = 'ZM_OPT_CAMBOZOLA', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Is the (optional) cambozola java streaming client installed', Help = ' + Cambozola is a handy low fat cheese flavoured Java applet that + ZoneMinder uses to view image streams on browsers such as + Internet Explorer that don\'t natively support this format. If + you use this browser it is highly recommended to install this + from the [cambozola project site](http://www.charliemouse.com/code/cambozola/). + However, if it is not installed still images at a lower refresh rate can + still be viewed. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 29, Name = 'ZM_PATH_CAMBOZOLA', Value = 'cambozola.jar', Type = 'string', DefaultValue = 'cambozola.jar', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'Web path to (optional) cambozola java streaming client', Help = ' + Cambozola is a handy low fat cheese flavoured Java applet that + ZoneMinder uses to view image streams on browsers such as + Internet Explorer that don\'t natively support this format. If + you use this browser it is highly recommended to install this + from the [cambozola project site](http://www.charliemouse.com/code/cambozola/). + However if it is not installed still images at a lower refresh rate can + still be viewed. Leave this as \'cambozola.jar\' if cambozola is + installed in the same directory as the ZoneMinder web client + files. + ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_CAMBOZOLA=1'; +insert into Config set Id = 30, Name = 'ZM_RELOAD_CAMBOZOLA', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'After how many seconds should Cambozola be reloaded in live view', Help = ' + Cambozola allows for the viewing of streaming MJPEG however it + caches the entire stream into cache space on the computer, + setting this to a number > 0 will cause it to automatically + reload after that many seconds to avoid filling up a hard + drive. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 31, Name = 'ZM_TIMESTAMP_ON_CAPTURE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Timestamp images as soon as they are captured', Help = ' + ZoneMinder can add a timestamp to images in two ways. The + default method, when this option is set, is that each image is + timestamped immediately when captured and so the image held in + memory is marked right away. The second method does not + timestamp the images until they are either saved as part of an + event or accessed over the web. The timestamp used in both + methods will contain the same time as this is preserved along + with the image. The first method ensures that an image is + timestamped regardless of any other circumstances but will + result in all images being timestamped even those never saved + or viewed. The second method necessitates that saved images are + copied before being saved otherwise two timestamps perhaps at + different scales may be applied. This has the (perhaps) + desirable side effect that the timestamp is always applied at + the same resolution so an image that has scaling applied will + still have a legible and correctly scaled timestamp. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 32, Name = 'ZM_TIMESTAMP_CODE_CHAR', Value = '%', Type = 'string', DefaultValue = '%', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Character to used to identify timestamp codes', Help = ' + There are a few codes one can use to tell ZoneMinder to insert + data into the timestamp of each image. Traditionally, the + percent (%) character has been used to identify these codes since + the current character codes do not conflict with the strftime + codes, which can also be used in the timestamp. While this works + well for Linux, this does not work well for BSD operating systems. + Changing the default character to something else, such as an + exclamation point (!), resolves the issue. Note this only affects + the timestamp codes built into ZoneMinder. It has no effect on + the family of strftime codes one can use. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 33, Name = 'ZM_CPU_EXTENSIONS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use advanced CPU extensions to increase performance', Help = ' + When advanced processor extensions such as SSE2 or SSSE3 are + available, ZoneMinder can use them, which should increase + performance and reduce system load. Enabling this option on + processors that do not support the advanced processors + extensions used by ZoneMinder is harmless and will have no + effect. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 34, Name = 'ZM_FAST_IMAGE_BLENDS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a fast algorithm to blend the reference image', Help = ' + To detect alarms ZoneMinder needs to blend the captured image + with the stored reference image to update it for comparison + with the next image. The reference blend percentage specified + for the monitor controls how much the new image affects the + reference image. There are two methods that are available for + this. If this option is set then fast calculation which does + not use any multiplication or division is used. This + calculation is extremely fast, however it limits the possible + blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%. + Any other blend percentage will be rounded to the nearest + possible one. The alternative is to switch this option off + and use standard blending instead, which is slower. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 35, Name = 'ZM_OPT_ADAPTIVE_SKIP', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should frame analysis try and be efficient in skipping frames', Help = ' + In previous versions of ZoneMinder the analysis daemon would + attempt to keep up with the capture daemon by processing the + last captured frame on each pass. This would sometimes have the + undesirable side-effect of missing a chunk of the initial + activity that caused the alarm because the pre-alarm frames + would all have to be written to disk and the database before + processing the next frame, leading to some delay between the + first and second event frames. Setting this option enables a + newer adaptive algorithm where the analysis daemon attempts to + process as many captured frames as possible, only skipping + frames when in danger of the capture daemon overwriting yet to + be processed frames. This skip is variable depending on the + size of the ring buffer and the amount of space left in it. + Enabling this option will give you much better coverage of the + beginning of alarms whilst biasing out any skipped frames + towards the middle or end of the event. However you should be + aware that this will have the effect of making the analysis + daemon run somewhat behind the capture daemon during events and + for particularly fast rates of capture it is possible for the + adaptive algorithm to be overwhelmed and not have time to react + to a rapid build up of pending frames and thus for a buffer + overrun condition to occur. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 36, Name = 'ZM_MAX_SUSPEND_TIME', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum time that a monitor may have motion detection suspended', Help = ' + ZoneMinder allows monitors to have motion detection to be + suspended, for instance while panning a camera. Ordinarily this + relies on the operator resuming motion detection afterwards as + failure to do so can leave a monitor in a permanently suspended + state. This setting allows you to set a maximum time which a + camera may be suspended for before it automatically resumes + motion detection. This time can be extended by subsequent + suspend indications after the first so continuous camera + movement will also occur while the monitor is suspended. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 37, Name = 'ZM_OPT_REMOTE_CAMERAS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Are you going to use remote/networked cameras', Help = ' + ZoneMinder can work with both local cameras, ie. those attached + physically to your computer and remote or network cameras. If + you will be using networked cameras select this option. + ', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 38, Name = 'ZM_NETCAM_REGEXPS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use regular expression matching with network cameras', Help = ' + Traditionally ZoneMinder has used complex regular regular + expressions to handle the multitude of formats that network + cameras produce. In versions from 1.21.1 the default is to use + a simpler and faster built in pattern matching methodology. + This works well with most networks cameras but if you have + problems you can try the older, but more flexible, regular + expression based method by selecting this option. Note, to use + this method you must have libpcre installed on your system. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_REMOTE_CAMERAS=1'; +insert into Config set Id = 39, Name = 'ZM_HTTP_VERSION', Value = '1.0', Type = 'string', DefaultValue = '1.0', Hint = '1.1|1.0', Pattern = '(?^:^(1\.[01])$)', Format = ' $1?$1:\'\' ', Prompt = 'The version of HTTP that ZoneMinder will use to connect', Help = ' + ZoneMinder can communicate with network cameras using either of + the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall + back to the version it supports with no problem so this should + usually by left at the default. However it can be changed to + HTTP/1.0 if necessary to resolve particular issues. + ', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 40, Name = 'ZM_HTTP_UA', Value = 'ZoneMinder', Type = 'string', DefaultValue = 'ZoneMinder', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The user agent that ZoneMinder uses to identify itself', Help = ' + When ZoneMinder communicates with remote cameras it will + identify itself using this string and it\'s version number. This + is normally sufficient, however if a particular cameras expects + only to communicate with certain browsers then this can be + changed to a different string identifying ZoneMinder as + Internet Explorer or Netscape etc. + ', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 41, Name = 'ZM_HTTP_TIMEOUT', Value = '2500', Type = 'integer', DefaultValue = '2500', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long ZoneMinder waits before giving up on images (milliseconds)', Help = ' + When retrieving remote images ZoneMinder will wait for this + length of time before deciding that an image is not going to + arrive and taking steps to retry. This timeout is in + milliseconds (1000 per second) and will apply to each part of + an image if it is not sent in one whole chunk. + ', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 42, Name = 'ZM_MIN_STREAMING_PORT', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Alternate port range to contact for streaming video.', Help = ' + Due to browsers only wanting to open 6 connections, if you have more + than 6 monitors, you can have trouble viewing more than 6. This setting + specified the beginning of a port range that will be used to contact ZM + on. Each monitor will use this value plus the Monitor Id to stream + content. So a value of 2000 here will cause a stream for Monitor 1 to + hit port 2001. Please ensure that you configure apache appropriately + to respond on these ports.', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 43, Name = 'ZM_MIN_RTP_PORT', Value = '40200', Type = 'integer', DefaultValue = '40200', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Minimum port that ZoneMinder will listen for RTP traffic on', Help = ' + When ZoneMinder communicates with MPEG4 capable cameras using + RTP with the unicast method it must open ports for the camera + to connect back to for control and streaming purposes. This + setting specifies the minimum port number that ZoneMinder will + use. Ordinarily two adjacent ports are used for each camera, + one for control packets and one for data packets. This port + should be set to an even number, you may also need to open up a + hole in your firewall to allow cameras to connect back if you + wish to use unicasting. + ', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 44, Name = 'ZM_MAX_RTP_PORT', Value = '40499', Type = 'integer', DefaultValue = '40499', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum port that ZoneMinder will listen for RTP traffic on', Help = ' + When ZoneMinder communicates with MPEG4 capable cameras using + RTP with the unicast method it must open ports for the camera + to connect back to for control and streaming purposes. This + setting specifies the maximum port number that ZoneMinder will + use. Ordinarily two adjacent ports are used for each camera, + one for control packets and one for data packets. This port + should be set to an even number, you may also need to open up a + hole in your firewall to allow cameras to connect back if you + wish to use unicasting. You should also ensure that you have + opened up at least two ports for each monitor that will be + connecting to unicasting network cameras. + ', Category = 'network', Readonly = '0', Requires = ''; +insert into Config set Id = 45, Name = 'ZM_OPT_FFMPEG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Is the ffmpeg video encoder/decoder installed', Help = ' + ZoneMinder can optionally encode a series of video images into + an MPEG encoded movie file for viewing, downloading or storage. + This option allows you to specify whether you have the ffmpeg + tools installed. Note that creating MPEG files can be fairly + CPU and disk intensive and is not a required option as events + can still be reviewed as video streams without it. + ', Category = 'images', Readonly = '0', Requires = ''; +insert into Config set Id = 46, Name = 'ZM_PATH_FFMPEG', Value = '/usr/bin/ffmpeg', Type = 'string', DefaultValue = '/usr/bin/ffmpeg', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to (optional) ffmpeg mpeg encoder', Help = 'This path should point to where ffmpeg has been installed.', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 47, Name = 'ZM_FFMPEG_INPUT_OPTIONS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Additional input options to ffmpeg', Help = ' + Ffmpeg can take many options on the command line to control the + quality of video produced. This option allows you to specify + your own set that apply to the input to ffmpeg (options that + are given before the -i option). Check the ffmpeg documentation + for a full list of options which may be used here. + ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 48, Name = 'ZM_FFMPEG_OUTPUT_OPTIONS', Value = '-r 25', Type = 'string', DefaultValue = '-r 25', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Additional output options to ffmpeg', Help = ' + Ffmpeg can take many options on the command line to control the + quality of video produced. This option allows you to specify + your own set that apply to the output from ffmpeg (options that + are given after the -i option). Check the ffmpeg documentation + for a full list of options which may be used here. The most + common one will often be to force an output frame rate + supported by the video encoder. + ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 49, Name = 'ZM_FFMPEG_FORMATS', Value = 'mpg mpeg wmv asf avi* mov swf 3gp**', Type = 'string', DefaultValue = 'mpg mpeg wmv asf avi* mov swf 3gp**', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Formats to allow for ffmpeg video generation', Help = ' + Ffmpeg can generate video in many different formats. This + option allows you to list the ones you want to be able to + select. As new formats are supported by ffmpeg you can add them + here and be able to use them immediately. Adding a \'*\' after a + format indicates that this will be the default format used for + web video, adding \'**\' defines the default format for phone + video. + ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 50, Name = 'ZM_FFMPEG_OPEN_TIMEOUT', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Timeout in seconds when opening a stream.', Help = ' + When Ffmpeg is opening a stream, it can take a long time before + failing; certain circumstances even seem to be able to lock + indefinitely. This option allows you to set a maximum time in + seconds to pass before closing the stream and trying to reopen + it again. + ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; +insert into Config set Id = 51, Name = 'ZM_LOG_LEVEL_SYSLOG', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the system log', Help = ' + ZoneMinder logging is now more more integrated between + components and allows you to specify the destination for + logging output and the individual levels for each. This option + lets you control the level of logging output that goes to the + system log. ZoneMinder binaries have always logged to the + system log but now scripts and web logging is also included. To + preserve the previous behaviour you should ensure this value is + set to Info or Warning. This option controls the maximum level + of logging that will be written, so Info includes Warnings and + Errors etc. To disable entirely, set this option to None. You + should use caution when setting this option to Debug as it can + affect severely affect system performance. If you want debug + you will also need to set a level and component below + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 52, Name = 'ZM_LOG_LEVEL_FILE', Value = '-5', Type = 'integer', DefaultValue = '-5', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to component files', Help = ' + ZoneMinder logging is now more more integrated between + components and allows you to specify the destination for + logging output and the individual levels for each. This option + lets you control the level of logging output that goes to + individual log files written by specific components. This is + how logging worked previously and although useful for tracking + down issues in specific components it also resulted in many + disparate log files. To preserve this behaviour you should + ensure this value is set to Info or Warning. This option + controls the maximum level of logging that will be written, so + Info includes Warnings and Errors etc. To disable entirely, set + this option to None. You should use caution when setting this + option to Debug as it can affect severely affect system + performance though file output has less impact than the other + options. If you want debug you will also need to set a level + and component below + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 53, Name = 'ZM_LOG_LEVEL_WEBLOG', Value = '-5', Type = 'integer', DefaultValue = '-5', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the weblog', Help = ' + ZoneMinder logging is now more more integrated between + components and allows you to specify the destination for + logging output and the individual levels for each. This option + lets you control the level of logging output from the web + interface that goes to the httpd error log. Note that only web + logging from PHP and JavaScript files is included and so this + option is really only useful for investigating specific issues + with those components. This option controls the maximum level + of logging that will be written, so Info includes Warnings and + Errors etc. To disable entirely, set this option to None. You + should use caution when setting this option to Debug as it can + affect severely affect system performance. If you want debug + you will also need to set a level and component below + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 54, Name = 'ZM_LOG_LEVEL_DATABASE', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the database', Help = ' + ZoneMinder logging is now more more integrated between + components and allows you to specify the destination for + logging output and the individual levels for each. This option + lets you control the level of logging output that is written to + the database. This is a new option which can make viewing + logging output easier and more intuitive and also makes it + easier to get an overall impression of how the system is + performing. If you have a large or very busy system then it is + possible that use of this option may slow your system down if + the table becomes very large. Ensure you use the + LOG_DATABASE_LIMIT option to keep the table to a manageable + size. This option controls the maximum level of logging that + will be written, so Info includes Warnings and Errors etc. To + disable entirely, set this option to None. You should use + caution when setting this option to Debug as it can affect + severely affect system performance. If you want debug you will + also need to set a level and component below + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 55, Name = 'ZM_LOG_DATABASE_LIMIT', Value = '7 day', Type = 'string', DefaultValue = '7 day', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Maximum number of log entries to retain', Help = ' + If you are using database logging then it is possible to + quickly build up a large number of entries in the Logs table. + This option allows you to specify how many of these entries are + kept. If you set this option to a number greater than zero then + that number is used to determine the maximum number of rows, + less than or equal to zero indicates no limit and is not + recommended. You can also set this value to time values such as + \' day\' which will limit the log entries to those newer than + that time. You can specify \'hour\', \'day\', \'week\', \'month\' and + \'year\', note that the values should be singular (no \'s\' at the + end). The Logs table is pruned periodically so it is possible + for more than the expected number of rows to be present briefly + in the meantime. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 56, Name = 'ZM_LOG_FFMPEG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Log FFMPEG messages', Help = ' + When enabled (default is on), this option will log FFMPEG messages. + FFMPEG messages can be useful when debugging streaming issues. However, + depending on your distro and FFMPEG version, this may also result in + more logs than you\'d typically like to see. If all your streams are working + well, you may choose to turn this off. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 57, Name = 'ZM_LOG_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Switch debugging on', Help = ' + ZoneMinder components usually support debug logging available + to help with diagnosing problems. Binary components have + several levels of debug whereas more other components have only + one. Normally this is disabled to minimise performance + penalties and avoid filling logs too quickly. This option lets + you switch on other options that allow you to configure + additional debug information to be output. Components will pick + up this instruction when they are restarted. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 58, Name = 'ZM_LOG_DEBUG_TARGET', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What components should have extra debug enabled', Help = ' + There are three scopes of debug available. Leaving this option + blank means that all components will use extra debug (not + recommended). Setting this option to \'_\', e.g. _zmc, + will limit extra debug to that component only. Setting this + option to \'__\', e.g. \'_zmc_m1\' will limit + extra debug to that instance of the component only. This is + ordinarily what you probably want to do. To debug scripts use + their names without the .pl extension, e.g. \'_zmvideo\' and to + debug issues with the web interface use \'_web\'. You can specify + multiple targets by separating them with \'|\' characters. + ', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; +insert into Config set Id = 59, Name = 'ZM_LOG_DEBUG_LEVEL', Value = '1', Type = 'integer', DefaultValue = '1', Hint = '1|2|3|4|5|6|7|8|9', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What level of extra debug should be enabled', Help = ' + There are 9 levels of debug available, with higher numbers + being more debug and level 0 being no debug. However not all + levels are used by all components. Also if there is debug at a + high level it is usually likely to be output at such a volume + that it may obstruct normal operation. For this reason you + should set the level carefully and cautiously until the degree + of debug you wish to see is present. Scripts and the web + interface only have one level so this is an on/off type option + for them. + ', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; +insert into Config set Id = 60, Name = 'ZM_LOG_DEBUG_FILE', Value = '/var/log/zm/zm_debug.log+', Type = 'string', DefaultValue = '/var/log/zm/zm_debug.log+', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Where extra debug is output to', Help = ' + This option allows you to specify a different target for debug + output. All components have a default log file which will + norally be in /tmp or /var/log and this is where debug will be + written to if this value is empty. Adding a path here will + temporarily redirect debug, and other logging output, to this + file. This option is a simple filename and you are debugging + several components then they will all try and write to the same + file with undesirable consequences. Appending a \'+\' to the + filename will cause the file to be created with a \'.\' + suffix containing your process id. In this way debug from each + run of a component is kept separate. This is the recommended + setting as it will also prevent subsequent runs from + overwriting the same log. You should ensure that permissions + are set up to allow writing to the file and directory specified + here. + ', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; +insert into Config set Id = 61, Name = 'ZM_LOG_CHECK_PERIOD', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Time period used when calculating overall system health', Help = ' + When ZoneMinder is logging events to the database it can + retrospectively examine the number of warnings and errors that + have occurred to calculate an overall state of system health. + This option allows you to indicate what period of historical + events are used in this calculation. This value is expressed in + seconds and is ignored if LOG_LEVEL_DATABASE is set to None. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 62, Name = 'ZM_LOG_ALERT_WAR_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of warnings indicating system alert state', Help = ' + When ZoneMinder is logging events to the database it can + retrospectively examine the number of warnings and errors that + have occurred to calculate an overall state of system health. + This option allows you to specify how many warnings must have + occurred within the defined time period to generate an overall + system alert state. A value of zero means warnings are not + considered. This value is ignored if LOG_LEVEL_DATABASE is set + to None. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 63, Name = 'ZM_LOG_ALERT_ERR_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of errors indicating system alert state', Help = ' + When ZoneMinder is logging events to the database it can + retrospectively examine the number of warnings and errors that + have occurred to calculate an overall state of system health. + This option allows you to specify how many errors must have + occurred within the defined time period to generate an overall + system alert state. A value of zero means errors are not + considered. This value is ignored if LOG_LEVEL_DATABASE is set + to None. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 64, Name = 'ZM_LOG_ALERT_FAT_COUNT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of fatal error indicating system alert state', Help = ' + When ZoneMinder is logging events to the database it can + retrospectively examine the number of warnings and errors that + have occurred to calculate an overall state of system health. + This option allows you to specify how many fatal errors + (including panics) must have occurred within the defined time + period to generate an overall system alert state. A value of + zero means fatal errors are not considered. This value is + ignored if LOG_LEVEL_DATABASE is set to None. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 65, Name = 'ZM_LOG_ALARM_WAR_COUNT', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of warnings indicating system alarm state', Help = ' + When ZoneMinder is logging events to the database it can + retrospectively examine the number of warnings and errors that + have occurred to calculate an overall state of system health. + This option allows you to specify how many warnings must have + occurred within the defined time period to generate an overall + system alarm state. A value of zero means warnings are not + considered. This value is ignored if LOG_LEVEL_DATABASE is set + to None. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 66, Name = 'ZM_LOG_ALARM_ERR_COUNT', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of errors indicating system alarm state', Help = ' + When ZoneMinder is logging events to the database it can + retrospectively examine the number of warnings and errors that + have occurred to calculate an overall state of system health. + This option allows you to specify how many errors must have + occurred within the defined time period to generate an overall + system alarm state. A value of zero means errors are not + considered. This value is ignored if LOG_LEVEL_DATABASE is set + to None. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 67, Name = 'ZM_LOG_ALARM_FAT_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of fatal error indicating system alarm state', Help = ' + When ZoneMinder is logging events to the database it can + retrospectively examine the number of warnings and errors that + have occurred to calculate an overall state of system health. + This option allows you to specify how many fatal errors + (including panics) must have occurred within the defined time + period to generate an overall system alarm state. A value of + zero means fatal errors are not considered. This value is + ignored if LOG_LEVEL_DATABASE is set to None. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 68, Name = 'ZM_RECORD_EVENT_STATS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Record event statistical information, switch off if too slow', Help = ' + This version of ZoneMinder records detailed information about + events in the Stats table. This can help in profiling what the + optimum settings are for Zones though this is tricky at + present. However in future releases this will be done more + easily and intuitively, especially with a large sample of + events. The default option of \'yes\' allows this information to + be collected now in readiness for this but if you are concerned + about performance you can switch this off in which case no + Stats information will be saved. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 69, Name = 'ZM_RECORD_DIAG_IMAGES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Record intermediate alarm diagnostic images, can be very slow', Help = ' + In addition to recording event statistics you can also record + the intermediate diagnostic images that display the results of + the various checks and processing that occur when trying to + determine if an alarm event has taken place. There are several + of these images generated for each frame and zone for each + alarm or alert frame so this can have a massive impact on + performance. Only switch this setting on for debug or analysis + purposes and remember to switch it off again once no longer + required. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 70, Name = 'ZM_DUMP_CORES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Create core files on unexpected process failure.', Help = ' + When an unrecoverable error occurs in a ZoneMinder binary + process is has traditionally been trapped and the details + written to logs to aid in remote analysis. However in some + cases it is easier to diagnose the error if a core file, which + is a memory dump of the process at the time of the error, is + created. This can be interactively analysed in the debugger and + may reveal more or better information than that available from + the logs. This option is recommended for advanced users only + otherwise leave at the default. Note using this option to + trigger core files will mean that there will be no indication + in the binary logs that a process has died, they will just + stop, however the zmdc log will still contain an entry. Also + note that you may have to explicitly enable core file creation + on your system via the \'ulimit -c\' command or other means + otherwise no file will be created regardless of the value of + this option. + ', Category = 'logging', Readonly = '0', Requires = ''; +insert into Config set Id = 71, Name = 'ZM_WEB_TITLE', Value = 'ZoneMinder', Type = 'string', DefaultValue = 'ZoneMinder', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The title displayed wherever the site references itself.', Help = ' + If you want the site to identify as something other than ZoneMinder, change this here. + It can be used to more accurately identify this installation from others. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 72, Name = 'ZM_WEB_TITLE_PREFIX', Value = 'ZM', Type = 'string', DefaultValue = 'ZM', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The title prefix displayed on each window', Help = ' + If you have more than one installation of ZoneMinder it can be + helpful to display different titles for each one. Changing this + option allows you to customise the window titles to include + further information to aid identification. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 73, Name = 'ZM_HOME_URL', Value = 'http://zoneminder.com', Type = 'string', DefaultValue = 'http://zoneminder.com', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The url used in the home/logo area of the navigation bar.', Help = ' + By default this takes you to the zoneminder.com website, + but perhaps you would prefer it to take you somewhere else. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 74, Name = 'ZM_HOME_CONTENT', Value = 'ZoneMinder', Type = 'string', DefaultValue = 'ZoneMinder', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The content of the home button.', Help = ' + You may wish to set this to empty if you are using css to put a background image on it. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 75, Name = 'ZM_WEB_CONSOLE_BANNER', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Arbitrary text message near the top of the console', Help = ' + Allows the administrator to place an arbitrary text message + near the top of the web console. This is useful for the developers + to display a message which indicates the running instance of + ZoneMinder is a development snapshot, but it can also be used for + any other purpose as well. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 76, Name = 'ZM_WEB_EVENT_DISK_SPACE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Whether to show disk space used by each event.', Help = 'Adds another column to the listing of events + showing the disk space used by the event. This will impart a small + overhead as it will call du on the event directory. In practice + this overhead is fairly small but may be noticeable on IO-constrained + systems. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 77, Name = 'ZM_WEB_RESIZE_CONSOLE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the console window resize itself to fit', Help = ' + Traditionally the main ZoneMinder web console window has + resized itself to shrink to a size small enough to list only + the monitors that are actually present. This is intended to + make the window more unobtrusize but may not be to everyones + tastes, especially if opened in a tab in browsers which support + this kind if layout. Switch this option off to have the console + window size left to the users preference + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 78, Name = 'ZM_WEB_ID_ON_CONSOLE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the console list the monitor id', Help = ' + Some find it useful to have the id always visible + on the console. This option will add a column listing it. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 79, Name = 'ZM_WEB_POPUP_ON_ALARM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the monitor window jump to the top if an alarm occurs', Help = ' + When viewing a live monitor stream you can specify whether you + want the window to pop to the front if an alarm occurs when the + window is minimised or behind another window. This is most + useful if your monitors are over doors for example when they + can pop up if someone comes to the doorway. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 80, Name = 'ZM_OPT_X10', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Support interfacing with X10 devices', Help = ' + If you have an X10 Home Automation setup in your home you can + use ZoneMinder to initiate or react to X10 signals if your + computer has the appropriate interface controller. This option + indicates whether X10 options will be available in the browser + client. + ', Category = 'x10', Readonly = '0', Requires = ''; +insert into Config set Id = 81, Name = 'ZM_X10_DEVICE', Value = '/dev/ttyS0', Type = 'string', DefaultValue = '/dev/ttyS0', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'What device is your X10 controller connected on', Help = ' + If you have an X10 controller device (e.g. XM10U) connected to + your computer this option details which port it is connected on, + the default of /dev/ttyS0 maps to serial or com port 1. + ', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; +insert into Config set Id = 82, Name = 'ZM_X10_HOUSE_CODE', Value = 'A', Type = 'string', DefaultValue = 'A', Hint = 'A-P', Pattern = '(?^i:^([A-P]))', Format = ' uc($1) ', Prompt = 'What X10 house code should be used', Help = ' + X10 devices are grouped together by identifying them as all + belonging to one House Code. This option details what that is. + It should be a single letter between A and P. + ', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; +insert into Config set Id = 83, Name = 'ZM_X10_DB_RELOAD_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the X10 daemon reloads the monitors from the database', Help = ' + The zmx10 daemon periodically checks the database to find out + what X10 events trigger, or result from, alarms. This option + determines how frequently this check occurs, unless you change + this area frequently this can be a fairly large value. + ', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; +insert into Config set Id = 84, Name = 'ZM_WEB_SOUND_ON_ALARM', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the monitor window play a sound if an alarm occurs', Help = ' + When viewing a live monitor stream you can specify whether you + want the window to play a sound to alert you if an alarm + occurs. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 85, Name = 'ZM_WEB_ALARM_SOUND', Value = '', Type = 'string', DefaultValue = '', Hint = 'filename', Pattern = '(?^:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'The sound to play on alarm, put this in the sounds directory', Help = ' + You can specify a sound file to play if an alarm occurs whilst + you are watching a live monitor stream. So long as your browser + understands the format it does not need to be any particular + type. This file should be placed in the sounds directory + defined earlier. + ', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_SOUND_ON_ALARM=1'; +insert into Config set Id = 86, Name = 'ZM_WEB_COMPACT_MONTAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Compact the montage view by removing extra detail', Help = ' + The montage view shows the output of all of your active + monitors in one window. This include a small menu and status + information for each one. This can increase the web traffic and + make the window larger than may be desired. Setting this option + on removes all this extraneous information and just displays + the images. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 87, Name = 'ZM_OPT_FAST_DELETE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Delete only event database records for speed', Help = ' + 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. Note that this feature is less relevant + with modern hardware. Recommend this feature be left off. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 88, Name = 'ZM_STRICT_VIDEO_CONFIG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Allow errors in setting video config to be fatal', Help = ' + With some video devices errors can be reported in setting the + various video attributes when in fact the operation was + successful. Switching this option off will still allow these + errors to be reported but will not cause them to kill the video + capture daemon. Note however that doing this will cause all + errors to be ignored including those which are genuine and + which may cause the video capture to not function correctly. + Use this option with caution. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 89, Name = 'ZM_LD_PRELOAD', Value = '', Type = 'string', DefaultValue = '', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to library to preload before launching daemons', Help = ' + Some older cameras require the use of the v4l1 compat + library. This setting allows the setting of the path + to the library, so that it can be loaded by zmdc.pl + before launching zmc. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 90, Name = 'ZM_V4L_MULTI_BUFFER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use more than one buffer for Video 4 Linux devices', Help = ' + Performance when using Video 4 Linux devices is usually best if + multiple buffers are used allowing the next image to be + captured while the previous one is being processed. If you have + multiple devices on a card sharing one input that requires + switching then this approach can sometimes cause frames from + one source to be mixed up with frames from another. Switching + this option off prevents multi buffering resulting in slower + but more stable image capture. This option is ignored for + non-local cameras or if only one input is present on a capture + chip. This option addresses a similar problem to the + ZM_CAPTURES_PER_FRAME option and you should normally change the + value of only one of the options at a time. If you have + different capture cards that need different values you can + override them in each individual monitor on the source page. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 91, Name = 'ZM_CAPTURES_PER_FRAME', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many images are captured per returned frame, for shared local cameras', Help = ' + If you are using cameras attached to a video capture card which + forces multiple inputs to share one capture chip, it can + sometimes produce images with interlaced frames reversed + resulting in poor image quality and a distinctive comb edge + appearance. Increasing this setting allows you to force + additional image captures before one is selected as the + captured frame. This allows the capture hardware to \'settle + down\' and produce better quality images at the price of lesser + capture rates. This option has no effect on (a) network + cameras, or (b) where multiple inputs do not share a capture + chip. This option addresses a similar problem to the + ZM_V4L_MULTI_BUFFER option and you should normally change the + value of only one of the options at a time. If you have + different capture cards that need different values you can + override them in each individual monitor on the source page. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 92, Name = 'ZM_FILTER_RELOAD_DELAY', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) filters are reloaded in zmfilter', Help = ' + ZoneMinder allows you to save filters to the database which + allow events that match certain criteria to be emailed, deleted + or uploaded to a remote machine etc. The zmfilter daemon loads + these and does the actual operation. This option determines how + often the filters are reloaded from the database to get the + latest versions or new filters. If you don\'t change filters + very often this value can be set to a large value. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 93, Name = 'ZM_FILTER_EXECUTE_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) to run automatic saved filters', Help = ' + ZoneMinder allows you to save filters to the database which + allow events that match certain criteria to be emailed, deleted + or uploaded to a remote machine etc. The zmfilter daemon loads + these and does the actual operation. This option determines how + often the filters are executed on the saved event in the + database. If you want a rapid response to new events this + should be a smaller value, however this may increase the + overall load on the system and affect performance of other + elements. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 94, Name = 'ZM_OPT_UPLOAD', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should ZoneMinder support uploading events from filters', Help = ' + In ZoneMinder you can create event filters that specify whether + events that match certain criteria should be uploaded to a + remote server for archiving. This option specifies whether this + functionality should be available + ', Category = 'upload', Readonly = '0', Requires = ''; +insert into Config set Id = 95, Name = 'ZM_UPLOAD_ARCH_FORMAT', Value = 'tar', Type = 'string', DefaultValue = 'tar', Hint = 'tar|zip', Pattern = '(?^i:^([tz]))', Format = ' $1 =~ /^t/ ? \'tar\' : \'zip\' ', Prompt = 'What format the uploaded events should be created in.', Help = ' + Uploaded events may be stored in either .tar or .zip format, + this option specifies which. Note that to use this you will + need to have the Archive::Tar and/or Archive::Zip perl modules + installed. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 96, Name = 'ZM_UPLOAD_ARCH_COMPRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should archive files be compressed', Help = ' + When the archive files are created they can be compressed. + However in general since the images are compressed already this + saves only a minimal amount of space versus utilising more CPU + in their creation. Only enable if you have CPU to waste and are + limited in disk space on your remote server or bandwidth. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 97, Name = 'ZM_UPLOAD_ARCH_ANALYSE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Include the analysis files in the archive', Help = ' + When the archive files are created they can contain either just + the captured frames or both the captured frames and, for frames + that caused an alarm, the analysed image with the changed area + highlighted. This option controls files are included. Only + include analysed frames if you have a high bandwidth connection + to the remote server or if you need help in figuring out what + caused an alarm in the first place as archives with these files + in can be considerably larger. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 98, Name = 'ZM_UPLOAD_PROTOCOL', Value = 'ftp', Type = 'string', DefaultValue = 'ftp', Hint = 'ftp|sftp', Pattern = '(?^i:^([tz]))', Format = ' $1 =~ /^f/ ? \'ftp\' : \'sftp\' ', Prompt = 'What protocol to use to upload events', Help = ' + ZoneMinder can upload events to a remote server using either + FTP or SFTP. Regular FTP is widely supported but not + necessarily very secure whereas SFTP (Secure FTP) runs over an + ssh connection and so is encrypted and uses regular ssh ports. + Note that to use this you will need to have the appropriate + perl module, either Net::FTP or Net::SFTP installed depending + on your choice. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 99, Name = 'ZM_UPLOAD_FTP_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload to', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote ftp server. This option indicates the name, or ip + address, of the server to use. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 100, Name = 'ZM_UPLOAD_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload events to', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. This option indicates the name, or ip address, + of the server to use. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 101, Name = 'ZM_UPLOAD_PORT', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The port on the remote upload server, if not the default (SFTP only)', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. If you are using the SFTP protocol then this + option allows you to specify a particular port to use for + connection. If this option is left blank then the default, port + 22, is used. This option is ignored for FTP uploads. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 102, Name = 'ZM_UPLOAD_FTP_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?^:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Your ftp username', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote ftp server. This option indicates the username that + ZoneMinder should use to log in for ftp transfer. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 103, Name = 'ZM_UPLOAD_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?^:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Remote server username', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. This option indicates the username that + ZoneMinder should use to log in for transfer. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 104, Name = 'ZM_UPLOAD_FTP_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Your ftp password', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote ftp server. This option indicates the password that + ZoneMinder should use to log in for ftp transfer. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 105, Name = 'ZM_UPLOAD_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Remote server password', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. This option indicates the password that + ZoneMinder should use to log in for transfer. If you are using + certificate based logins for SFTP servers you can leave this + option blank. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 106, Name = 'ZM_UPLOAD_FTP_LOC_DIR', Value = '/var/tmp/zm', Type = 'string', DefaultValue = '/var/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote ftp server. This option indicates the local directory + that ZoneMinder should use for temporary upload files. These + are files that are created from events, uploaded and then + deleted. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 107, Name = 'ZM_UPLOAD_LOC_DIR', Value = '/var/tmp/zm', Type = 'string', DefaultValue = '/var/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. This option indicates the local directory that + ZoneMinder should use for temporary upload files. These are + files that are created from events, uploaded and then deleted. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 108, Name = 'ZM_UPLOAD_FTP_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote ftp server. This option indicates the remote directory + that ZoneMinder should use to upload event files to. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 109, Name = 'ZM_UPLOAD_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. This option indicates the remote directory + that ZoneMinder should use to upload event files to. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 110, Name = 'ZM_UPLOAD_FTP_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to allow the transfer to take for each file', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote ftp server. This option indicates the maximum ftp + inactivity timeout (in seconds) that should be tolerated before + ZoneMinder determines that the transfer has failed and closes + down the connection. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 111, Name = 'ZM_UPLOAD_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to allow the transfer to take for each file', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. This option indicates the maximum inactivity + timeout (in seconds) that should be tolerated before ZoneMinder + determines that the transfer has failed and closes down the + connection. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 112, Name = 'ZM_UPLOAD_STRICT', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Require strict host key checking for SFTP uploads', Help = ' + You can require SFTP uploads to verify the host key of the remote server + for protection against man-in-the-middle attacks. You will need to add the + server\'s key to the known_hosts file. On most systems, this will be + ~/.ssh/known_hosts, where ~ is the home directory of the web server running + ZoneMinder. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 113, Name = 'ZM_UPLOAD_FTP_PASSIVE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use passive ftp when uploading', Help = ' + If your computer is behind a firewall or proxy you may need to + set FTP to passive mode. In fact for simple transfers it makes + little sense to do otherwise anyway but you can set this to + \'No\' if you wish. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 114, Name = 'ZM_UPLOAD_FTP_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Switch ftp debugging on', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote ftp server. If you are having (or expecting) troubles + with uploading events then setting this to \'yes\' permits + additional information to be included in the zmfilter log file. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 115, Name = 'ZM_UPLOAD_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Switch upload debugging on', Help = ' + You can use filters to instruct ZoneMinder to upload events to + a remote server. If you are having (or expecting) troubles with + uploading events then setting this to \'yes\' permits additional + information to be generated by the underlying transfer modules + and included in the logs. + ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; +insert into Config set Id = 116, Name = 'ZM_OPT_EMAIL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should ZoneMinder email you details of events that match corresponding filters', Help = ' + In ZoneMinder you can create event filters that specify whether + events that match certain criteria should have their details + emailed to you at a designated email address. This will allow + you to be notified of events as soon as they occur and also to + quickly view the events directly. This option specifies whether + this functionality should be available. The email created with + this option can be any size and is intended to be sent to a + regular email reader rather than a mobile device. + ', Category = 'mail', Readonly = '0', Requires = ''; +insert into Config set Id = 117, Name = 'ZM_EMAIL_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = ' + This option is used to define the email address that any events + that match the appropriate filters will be sent to. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 118, Name = 'ZM_EMAIL_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\" + body = \" + Hello, + + An alarm has been detected on your installation of the ZoneMinder. + + The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + + This alarm was matched by the %FN% filter and can be viewed at %EPS% + + ZoneMinder\"', Type = 'text', DefaultValue = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\" + body = \" + Hello, + + An alarm has been detected on your installation of the ZoneMinder. + + The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + + This alarm was matched by the %FN% filter and can be viewed at %EPS% + + ZoneMinder\"', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the email used to send matching event details', Help = ' + This option is used to define the content of the email that is + sent for any events that match the appropriate filters. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 119, Name = 'ZM_EMAIL_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the email used to send matching event details', Help = ' + This option is used to define the subject of the email that is + sent for any events that match the appropriate filters. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 120, Name = 'ZM_EMAIL_BODY', Value = ' + Hello, + + An alarm has been detected on your installation of the ZoneMinder. + + The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + + This alarm was matched by the %FN% filter and can be viewed at %EPS% + + ZoneMinder', Type = 'text', DefaultValue = ' + Hello, + + An alarm has been detected on your installation of the ZoneMinder. + + The details are as follows :- + + Monitor : %MN% + Event Id : %EI% + Length : %EL% + Frames : %EF% (%EFA%) + Scores : t%EST% m%ESM% a%ESA% + + This alarm was matched by the %FN% filter and can be viewed at %EPS% + + ZoneMinder', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the email used to send matching event details', Help = ' + This option is used to define the content of the email that is + sent for any events that match the appropriate filters. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; +insert into Config set Id = 121, Name = 'ZM_OPT_MESSAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should ZoneMinder message you with details of events that match corresponding filters', Help = ' + In ZoneMinder you can create event filters that specify whether + events that match certain criteria should have their details + sent to you at a designated short message email address. This + will allow you to be notified of events as soon as they occur. + This option specifies whether this functionality should be + available. The email created by this option will be brief and + is intended to be sent to an SMS gateway or a minimal mail + reader such as a mobile device or phone rather than a regular + email reader. + ', Category = 'mail', Readonly = '0', Requires = ''; +insert into Config set Id = 122, Name = 'ZM_MESSAGE_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = ' + This option is used to define the short message email address + that any events that match the appropriate filters will be sent + to. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 123, Name = 'ZM_MESSAGE_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\" + body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Type = 'text', DefaultValue = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\" + body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the message used to send matching event details', Help = ' + This option is used to define the content of the message that + is sent for any events that match the appropriate filters. + ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 124, Name = 'ZM_MESSAGE_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI%', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI%', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the message used to send matching event details', Help = ' + This option is used to define the subject of the message that + is sent for any events that match the appropriate filters. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 125, Name = 'ZM_MESSAGE_BODY', Value = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Type = 'text', DefaultValue = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the message used to send matching event details', Help = ' + This option is used to define the content of the message that + is sent for any events that match the appropriate filters. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; +insert into Config set Id = 126, Name = 'ZM_NEW_MAIL_MODULES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a newer perl method to send emails', Help = ' + Traditionally ZoneMinder has used the MIME::Entity perl module + to construct and send notification emails and messages. Some + people have reported problems with this module not being + present at all or flexible enough for their needs. If you are + one of those people this option allows you to select a new + mailing method using MIME::Lite and Net::SMTP instead. This + method was contributed by Ross Melin and should work for + everyone but has not been extensively tested so currently is + not selected by default. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 127, Name = 'ZM_EMAIL_HOST', Value = 'localhost', Type = 'string', DefaultValue = 'localhost', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The host address of your SMTP mail server', Help = ' + If you have chosen SMTP as the method by which to send + notification emails or messages then this option allows you to + choose which SMTP server to use to send them. The default of + localhost may work if you have the sendmail, exim or a similar + daemon running however you may wish to enter your ISP\'s SMTP + mail server here. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 128, Name = 'ZM_FROM_EMAIL', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address you wish your event notifications to originate from', Help = ' + The emails or messages that will be sent to you informing you + of events can appear to come from a designated email address to + help you with mail filtering etc. An address of something like + ZoneMinder\@your.domain is recommended. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 129, Name = 'ZM_URL', Value = '', Type = 'string', DefaultValue = '', Hint = 'http://host.your.domain/', Pattern = '(?^:^(?:http://)?(.+)$)', Format = ' \'http://\'.$1 ', Prompt = 'The URL of your ZoneMinder installation', Help = ' + The emails or messages that will be sent to you informing you + of events can include a link to the events themselves for easy + viewing. If you intend to use this feature then set this option + to the url of your installation as it would appear from where + you read your email, e.g. http://host.your.domain/zm.php. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; +insert into Config set Id = 130, Name = 'ZM_MAX_RESTART_DELAY', Value = '600', Type = 'integer', DefaultValue = '600', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum delay (in seconds) for daemon restart attempts.', Help = ' + The zmdc (zm daemon control) process controls when processeses + are started or stopped and will attempt to restart any that + fail. If a daemon fails frequently then a delay is introduced + between each restart attempt. If the daemon stills fails then + this delay is increased to prevent extra load being placed on + the system by continual restarts. This option controls what + this maximum delay is. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 131, Name = 'ZM_STATS_UPDATE_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to update the database statistics', Help = ' + The zmstats daemon performs various db queries that may take + a long time in the background. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 132, Name = 'ZM_WATCH_CHECK_INTERVAL', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check the capture daemons have not locked up', Help = ' + The zmwatch daemon checks the image capture performance of the + capture daemons to ensure that they have not locked up (rarely + a sync error may occur which blocks indefinitely). This option + determines how often the daemons are checked. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 133, Name = 'ZM_WATCH_MAX_DELAY', Value = '5', Type = 'decimal', DefaultValue = '5', Hint = 'decimal', Pattern = '(?^:^(\d+(?:\.\d+)?)$)', Format = ' $1 ', Prompt = 'The maximum delay allowed since the last captured image', Help = ' + The zmwatch daemon checks the image capture performance of the + capture daemons to ensure that they have not locked up (rarely + a sync error may occur which blocks indefinitely). This option + determines the maximum delay to allow since the last captured + frame. The daemon will be restarted if it has not captured any + images after this period though the actual restart may take + slightly longer in conjunction with the check interval value + above. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 134, Name = 'ZM_RUN_AUDIT', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Run zmaudit to check data consistency', Help = ' + The zmaudit daemon exists to check that the saved information + in the database and on the filesystem match and are consistent + with each other. If an error occurs or if you 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 synchronise 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 + filesystem 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. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 135, Name = 'ZM_AUDIT_CHECK_INTERVAL', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check database and filesystem consistency', Help = ' + The zmaudit daemon exists to check that the saved information + in the database and on the filesystem match and are consistent + with each other. If an error occurs or if you 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 synchronise 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 filesystem 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. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 136, Name = 'ZM_AUDIT_MIN_AGE', Value = '86400', Type = 'integer', DefaultValue = '86400', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The minimum age in seconds event data must be in order to be deleted.', Help = ' + The zmaudit daemon exists to check that the saved information + in the database and on the filesystem match and are consistent + with each other. Event files or db records that are younger than + this setting will not be deleted and a warning will be given. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 137, Name = 'ZM_FORCED_ALARM_SCORE', Value = '255', Type = 'integer', DefaultValue = '255', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Score to give forced alarms', Help = ' + The \'zmu\' utility can be used to force an alarm on a monitor + rather than rely on the motion detection algorithms. This + option determines what score to give these alarms to + distinguish them from regular ones. It must be 255 or less. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 138, Name = 'ZM_BULK_FRAME_INTERVAL', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often a bulk frame should be written to the database', Help = ' + Traditionally ZoneMinder writes an entry into the Frames + database table for each frame that is captured and saved. This + works well in motion detection scenarios but when in a DVR + situation (\'Record\' or \'Mocord\' mode) this results in a huge + number of frame writes and a lot of database and disk bandwidth + for very little additional information. Setting this to a + non-zero value will enabled ZoneMinder to group these non-alarm + frames into one \'bulk\' frame entry which saves a lot of + bandwidth and space. The only disadvantage of this is that + timing information for individual frames is lost but in + constant frame rate situations this is usually not significant. + This setting is ignored in Modect mode and individual frames + are still written if an alarm occurs in Mocord mode also. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 139, Name = 'ZM_EVENT_CLOSE_MODE', Value = 'idle', Type = 'string', DefaultValue = 'idle', Hint = 'time|idle|alarm', Pattern = '(?^i:^([tia]))', Format = ' ($1 =~ /^t/) + ? \'time\' + : ($1 =~ /^i/ ? \'idle\' : \'time\' ) + ', Prompt = 'When continuous events are closed.', Help = ' + When a monitor is running in a continuous recording mode + (Record or Mocord) events are usually closed after a fixed + period of time (the section length). However in Mocord mode it + is possible that motion detection may occur near the end of a + section. This option controls what happens when an alarm occurs + in Mocord mode. The \'time\' setting means that the event will be + closed at the end of the section regardless of alarm activity. + The \'idle\' setting means that the event will be closed at the + end of the section if there is no alarm activity occurring at + the time otherwise it will be closed once the alarm is over + meaning the event may end up being longer than the normal + section length. The \'alarm\' setting means that if an alarm + occurs during the event, the event will be closed once the + alarm is over regardless of when this occurs. This has the + effect of limiting the number of alarms to one per event and + the events will be shorter than the section length if an alarm + has occurred. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 140, Name = 'ZM_FORCE_CLOSE_EVENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Close events at section ends.', Help = ' + When a monitor is running in a continuous recording mode + (Record or Mocord) events are usually closed after a fixed + period of time (the section length). However in Mocord mode it + is possible that motion detection may occur near the end of a + section and ordinarily this will prevent the event being closed + until the motion has ceased. Switching this option on will + force the event closed at the specified time regardless of any + motion activity. + ', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 141, Name = 'ZM_CREATE_ANALYSIS_IMAGES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Create analysed alarm images with motion outlined', Help = ' + By default during an alarm ZoneMinder records both the raw + captured image and one that has been analysed and had areas + where motion was detected outlined. This can be very useful + during zone configuration or in analysing why events occurred. + However it also incurs some overhead and in a stable system may + no longer be necessary. This parameter allows you to switch the + generation of these images off. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 142, Name = 'ZM_WEIGHTED_ALARM_CENTRES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a weighted algorithm to calculate the centre of an alarm', Help = ' + ZoneMinder will always calculate the centre point of an alarm + in a zone to give some indication of where on the screen it is. + This can be used by the experimental motion tracking feature or + your own custom extensions. In the alarmed or filtered pixels + mode this is a simple midpoint between the extents of the + detected pixels. However in the blob method this can instead be + calculated using weighted pixel locations to give more accurate + positioning for irregularly shaped blobs. This method, while + more precise is also slower and so is turned off by default. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 143, Name = 'ZM_EVENT_IMAGE_DIGITS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many significant digits are used in event image numbering', Help = ' + As event images are captured they are stored to the filesystem + with a numerical index. By default this index has three digits + so the numbers start 001, 002 etc. This works works for most + scenarios as events with more than 999 frames are rarely + captured. However if you have extremely long events and use + external applications then you may wish to increase this to + ensure correct sorting of images in listings etc. Warning, + increasing this value on a live system may render existing + events unviewable as the event will have been saved with the + previous scheme. Decreasing this value should have no ill + effects. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 144, Name = 'ZM_DEFAULT_ASPECT_RATIO', Value = '4:3', Type = 'string', DefaultValue = '4:3', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The default width:height aspect ratio used in monitors', Help = ' + When specifying the dimensions of monitors you can click a + checkbox to ensure that the width stays in the correct ratio to + the height, or vice versa. This setting allows you to indicate + what the ratio of these settings should be. This should be + specified in the format : and the + default of 4:3 normally be acceptable but 11:9 is another + common setting. If the checkbox is not clicked when specifying + monitor dimensions this setting has no effect. + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 145, Name = 'ZM_USER_SELF_EDIT', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Allow unprivileged users to change their details', Help = ' + Ordinarily only users with system edit privilege are able to + change users details. Switching this option on allows ordinary + users to change their passwords and their language settings + ', Category = 'config', Readonly = '0', Requires = ''; +insert into Config set Id = 146, Name = 'ZM_OPT_CONTROL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Support controllable (e.g. PTZ) cameras', Help = ' + ZoneMinder includes limited support for controllable cameras. A + number of sample protocols are included and others can easily + be added. If you wish to control your cameras via ZoneMinder + then select this option otherwise if you only have static + cameras or use other control methods then leave this option + off. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 147, Name = 'ZM_OPT_TRIGGERS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Interface external event triggers via socket or device files', Help = ' + ZoneMinder can interact with external systems which prompt or + cancel alarms. This is done via the zmtrigger.pl script. This + option indicates whether you want to use these external + triggers. Most people will say no here. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 148, Name = 'ZM_CHECK_FOR_UPDATES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Check with zoneminder.com for updated versions', Help = ' + From ZoneMinder version 1.17.0 onwards new versions are + expected to be more frequent. To save checking manually for + each new version ZoneMinder can check with the zoneminder.com + website to determine the most recent release. These checks are + infrequent, about once per week, and no personal or system + information is transmitted other than your current version + number. If you do not wish these checks to take place or your + ZoneMinder system has no internet access you can switch these + check off with this configuration variable + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 149, Name = 'ZM_TELEMETRY_DATA', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Send usage information to ZoneMinder', Help = ' + Enable collection of usage information of the local system and send + it to the ZoneMinder development team. This data will be used to + determine things like who and where our customers are, how big their + systems are, the underlying hardware and operating system, etc. + This is being done for the sole purpoase of creating a better + product for our target audience. This script is intended to be + completely transparent to the end user, and can be disabled from + the web console under Options. For more details on what information + we collect, please refer to our [privacy](?view=privacy) statement. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 150, Name = 'ZM_TELEMETRY_UUID', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Unique identifier for ZoneMinder telemetry', Help = ' + This variable is auto-generated once by the system and is used to + uniquely identify it among all other ZoneMinder systems in + existence. + ', Category = 'dynamic', Readonly = '0', Requires = ''; +insert into Config set Id = 151, Name = 'ZM_TELEMETRY_LAST_UPLOAD', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the last ZoneMinder telemetry upload ocurred', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 152, Name = 'ZM_TELEMETRY_INTERVAL', Value = '14*24*60*60', Type = 'string', DefaultValue = '14*24*60*60', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Interval in seconds between telemetry updates.', Help = 'This value can be expressed as a mathematical expression for ease.', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 153, Name = 'ZM_TELEMETRY_SERVER_ENDPOINT', Value = 'https://zmanon:2b2d0b4skps@telemetry.zoneminder.com/zmtelemetry/testing5', Type = 'string', DefaultValue = 'https://zmanon:2b2d0b4skps@telemetry.zoneminder.com/zmtelemetry/testing5', Hint = 'http://host.your.domain/', Pattern = '(?^:^(?:http://)?(.+)$)', Format = ' \'http://\'.$1 ', Prompt = 'URL that ZoneMinder will send usage data to', Help = '', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 154, Name = 'ZM_UPDATE_CHECK_PROXY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Proxy url if required to access zoneminder.com', Help = ' + If you use a proxy to access the internet then ZoneMinder needs + to know so it can access zoneminder.com to check for updates. + If you do use a proxy enter the full proxy url here in the form + of http://:/ + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 155, Name = 'ZM_SHM_KEY', Value = '0x7a6d0000', Type = 'hexadecimal', DefaultValue = '0x7a6d0000', Hint = 'hexadecimal', Pattern = '(?^:^(?:0x)?([0-9a-f]{1,8})$)', Format = ' \'0x\'.$1 ', Prompt = 'Shared memory root key to use', Help = ' + ZoneMinder uses shared memory to speed up communication between + modules. To identify the right area to use shared memory keys + are used. This option controls what the base key is, each + monitor will have it\'s Id or\'ed with this to get the actual key + used. You will not normally need to change this value unless it + clashes with another instance of ZoneMinder on the same + machine. Only the first four hex digits are used, the lower + four will be masked out and ignored. + ', Category = 'system', Readonly = '0', Requires = ''; +insert into Config set Id = 156, Name = 'ZM_WEB_REFRESH_METHOD', Value = 'javascript', Type = 'string', DefaultValue = 'javascript', Hint = 'javascript|http', Pattern = '(?^i:^([jh]))', Format = ' $1 =~ /^j/ + ? \'javascript\' + : \'http\' + ', Prompt = 'What method windows should use to refresh themselves', Help = ' + Many windows in Javascript need to refresh themselves to keep + their information current. This option determines what method + they should use to do this. Choosing \'javascript\' means that + each window will have a short JavaScript statement in with a + timer to prompt the refresh. This is the most compatible + method. Choosing \'http\' means the refresh instruction is put in + the HTTP header. This is a cleaner method but refreshes are + interrupted or cancelled when a link in the window is clicked + meaning that the window will no longer refresh and this would + have to be done manually. + ', Category = 'hidden', Readonly = '0', Requires = ''; +insert into Config set Id = 157, Name = 'ZM_WEB_EVENT_SORT_FIELD', Value = 'DateTime', Type = 'string', DefaultValue = 'DateTime', Hint = 'Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore', Pattern = '(?^:.)', Format = ' $1 ', Prompt = 'Default field the event lists are sorted by', Help = ' + Events in lists can be initially ordered in any way you want. + This option controls what field is used to sort them. You can + modify this ordering from filters or by clicking on headings in + the lists themselves. Bear in mind however that the \'Prev\' and + \'Next\' links, when scrolling through events, relate to the + ordering in the lists and so not always to time based ordering. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 158, Name = 'ZM_WEB_EVENT_SORT_ORDER', Value = 'asc', Type = 'string', DefaultValue = 'asc', Hint = 'asc|desc', Pattern = '(?^i:^([ad]))', Format = ' $1 =~ /^a/i ? \'asc\' : \'desc\' ', Prompt = 'Default order the event lists are sorted by', Help = ' + Events in lists can be initially ordered in any way you want. + This option controls what order (ascending or descending) is + used to sort them. You can modify this ordering from filters or + by clicking on headings in the lists themselves. Bear in mind + however that the \'Prev\' and \'Next\' links, when scrolling + through events, relate to the ordering in the lists and so not + always to time based ordering. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 159, Name = 'ZM_WEB_EVENTS_PER_PAGE', Value = '25', Type = 'integer', DefaultValue = '25', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many events to list per page in paged mode', Help = ' + In the event list view you can either list all events or just a + page at a time. This option controls how many events are listed + per page in paged mode and how often to repeat the column + headers in non-paged mode. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 160, Name = 'ZM_WEB_LIST_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Display mini-thumbnails of event images in event lists', Help = ' + Ordinarily the event lists just display text details of the + events to save space and time. By switching this option on you + can also display small thumbnails to help you identify events + of interest. The size of these thumbnails is controlled by the + following two options. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 161, Name = 'ZM_WEB_LIST_THUMB_WIDTH', Value = '48', Type = 'integer', DefaultValue = '48', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The width of the thumbnails that appear in the event lists', Help = ' + This options controls the width of the thumbnail images that + appear in the event lists. It should be fairly small to fit in + with the rest of the table. If you prefer you can specify a + height instead in the next option but you should only use one + of the width or height and the other option should be set to + zero. If both width and height are specified then width will be + used and height ignored. + ', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1'; +insert into Config set Id = 162, Name = 'ZM_WEB_LIST_THUMB_HEIGHT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The height of the thumbnails that appear in the event lists', Help = ' + This options controls the height of the thumbnail images that + appear in the event lists. It should be fairly small to fit in + with the rest of the table. If you prefer you can specify a + width instead in the previous option but you should only use + one of the width or height and the other option should be set + to zero. If both width and height are specified then width will + be used and height ignored. + ', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1'; +insert into Config set Id = 163, Name = 'ZM_WEB_USE_OBJECT_TAGS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Wrap embed in object tags for media content', Help = ' + There are two methods of including media content in web pages. + The most common way is use the EMBED tag which is able to give + some indication of the type of content. However this is not a + standard part of HTML. The official method is to use OBJECT + tags which are able to give more information allowing the + correct media viewers etc to be loaded. However these are less + widely supported and content may be specifically tailored to a + particular platform or player. This option controls whether + media content is enclosed in EMBED tags only or whether, where + appropriate, it is additionally wrapped in OBJECT tags. + Currently OBJECT tags are only used in a limited number of + circumstances but they may become more widespread in the + future. It is suggested that you leave this option on unless + you encounter problems playing some content. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 164, Name = 'ZM_WEB_XFRAME_WARN', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Warn when website X-Frame-Options is set to sameorigin', Help = ' + When creating a Web Site monitor, if the target web site has + X-Frame-Options set to sameorigin in the header, the site will + not display in ZoneMinder. This is a design feature in most modern + browsers. When this condition occurs, ZoneMinder will write a + warning to the log file. To get around this, one can install a browser + plugin or extension to ignore X-Frame headers, and then the page will + display properly. Once the plugin or extenstion has ben installed, + the end user may choose to turn this warning off. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 165, Name = 'ZM_WEB_FILTER_SOURCE', Value = 'Hostname', Type = 'string', DefaultValue = 'Hostname', Hint = 'None|Hostname|NoCredentials', Pattern = '(?^i:^([NH]))', Format = ' ($1 =~ /^Non/) + ? \'None\' + : ($1 =~ /^H/ ? \'Hostname\' : \'NoCredentials\' ) + ', Prompt = 'How to filter information in the source column.', Help = ' + This option only affects monitors with a source type of Ffmpeg, + Libvlc, or WebSite. This setting controls what information is + displayed in the Source column on the console. Selecting \'None\' + will not filter anything. The entire source string will be + displayed, which may contain sensitive information. Selecting + \'NoCredentials\' will strip out usernames and passwords from the + string. If there are any port numbers in the string and they are + common (80, 554, etc) then those will be removed as well. + Selecting \'Hostname\' will filter out all information except for + the hostname or ip address. When in doubt, stay with the default + \'Hostname\'. This feature uses the php function \'url_parts\' to + identify the various pieces of the url. If the url in question + is unusual or not standard in some way, then filtering may not + produce the desired results. + ', Category = 'web', Readonly = '0', Requires = ''; +insert into Config set Id = 166, Name = 'ZM_WEB_H_REFRESH_MAIN', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = ' + The main console window lists a general status and the event + totals for all monitors. This is not a trivial task and should + not be repeated too frequently or it may affect the performance + of the rest of the system. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 167, Name = 'ZM_WEB_H_REFRESH_NAVBAR', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the navigation header should refresh itself', Help = ' + The navigation header contains the general status information about server load and storage space. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 168, Name = 'ZM_WEB_H_REFRESH_CYCLE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = ' + The cycle watch window is a method of continuously cycling + between images from all of your monitors. This option + determines how often to refresh with a new image. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 169, Name = 'ZM_WEB_H_REFRESH_IMAGE', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = ' + The live images from a monitor can be viewed in either streamed + or stills mode. This option determines how often a stills image + is refreshed, it has no effect if streaming is selected. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 170, Name = 'ZM_WEB_H_REFRESH_STATUS', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = ' + The monitor window is actually made from several frames. The + one in the middle merely contains a monitor status which needs + to refresh fairly frequently to give a true indication. This + option determines that frequency. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 171, Name = 'ZM_WEB_H_REFRESH_EVENTS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = ' + The monitor window is actually made from several frames. The + lower framme contains a listing of the last few events for easy + access. This option determines how often this is refreshed. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 172, Name = 'ZM_WEB_H_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : ($1 =~ /^n/ ? \'no\' : \'auto\' ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = ' + If you know that your browser can handle image streams of the + type \'multipart/x-mixed-replace\' but ZoneMinder does not detect + this correctly you can set this option to ensure that the + stream is delivered with or without the use of the Cambozola + plugin. Selecting \'yes\' will tell ZoneMinder that your browser + can handle the streams natively, \'no\' means that it can\'t and + so the plugin will be used while \'auto\' lets ZoneMinder decide. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 173, Name = 'ZM_WEB_H_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \'mpeg\' : \'jpeg\' ', Prompt = 'Which method should be used to send video streams to your browser.', Help = ' + ZoneMinder can be configured to use either mpeg encoded video + or a series or still jpeg images when sending video streams. + This option defines which is used. If you choose mpeg you + should ensure that you have the appropriate plugins available + on your browser whereas choosing jpeg will work natively on + Mozilla and related browsers and with a Java applet on Internet + Explorer + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 174, Name = 'ZM_WEB_H_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = ' + Normally ZoneMinder will display \'live\' or \'event\' streams in + their native size. However if you have monitors with large + dimensions or a slow link you may prefer to reduce this size, + alternatively for small monitors you can enlarge it. This + options lets you specify what the default scaling factor will + be. It is expressed as a percentage so 100 is normal size, 200 + is double size etc. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 175, Name = 'ZM_WEB_H_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = ' + Normally ZoneMinder will display \'event\' streams at their + native rate, i.e. as close to real-time as possible. However if + you have long events it is often convenient to replay them at a + faster rate for review. This option lets you specify what the + default replay rate will be. It is expressed as a percentage so + 100 is normal rate, 200 is double speed etc. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 176, Name = 'ZM_WEB_H_VIDEO_BITRATE', Value = '150000', Type = 'integer', DefaultValue = '150000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = ' + When encoding real video via the ffmpeg library a bit rate can + be specified which roughly corresponds to the available + bandwidth used for the stream. This setting effectively + corresponds to a \'quality\' setting for the video. A low value + will result in a blocky image whereas a high value will produce + a clearer view. Note that this setting does not control the + frame rate of the video however the quality of the video + produced is affected both by this setting and the frame rate + that the video is produced at. A higher frame rate at a + particular bit rate result in individual frames being at a + lower quality. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 177, Name = 'ZM_WEB_H_VIDEO_MAXFPS', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = ' + When using streamed video the main control is the bitrate which + determines how much data can be transmitted. However a lower + bitrate at high frame rates results in a lower quality image. + This option allows you to limit the maximum frame rate to + ensure that video quality is maintained. An additional + advantage is that encoding video at high frame rates is a + processor intensive task when for the most part a very high + frame rate offers little perceptible improvement over one that + has a more manageable resource requirement. Note, this option + is implemented as a cap beyond which binary reduction takes + place. So if you have a device capturing at 15fps and set this + option to 10fps then the video is not produced at 10fps, but + rather at 7.5fps (15 divided by 2) as the final frame rate must + be the original divided by a power of 2. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 178, Name = 'ZM_WEB_H_SCALE_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = ' + If unset, this option sends the whole image to the browser + which resizes it in the window. If set the image is scaled down + on the server before sending a reduced size image to the + browser to conserve bandwidth at the cost of cpu on the server. + Note that ZM can only perform the resizing if the appropriate + PHP graphics functionality is installed. This is usually + available in the php-gd package. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 179, Name = 'ZM_WEB_H_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \'events\' : \'timeline\' ', Prompt = 'What the default view of multiple events should be.', Help = ' + Stored events can be viewed in either an events list format or + in a timeline based one. This option sets the default view that + will be used. Choosing one view here does not prevent the other + view being used as it will always be selectable from whichever + view is currently being used. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 180, Name = 'ZM_WEB_H_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Show the progress of replay in event view.', Help = ' + When viewing events an event navigation panel and progress bar + is shown below the event itself. This allows you to jump to + specific points in the event, but can can also dynamically + update to display the current progress of the event replay + itself. This progress is calculated from the actual event + duration and is not directly linked to the replay itself, so on + limited bandwidth connections may be out of step with the + replay. This option allows you to turn off the progress + display, whilst still keeping the navigation aspect, where + bandwidth prevents it functioning effectively. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 181, Name = 'ZM_WEB_H_AJAX_TIMEOUT', Value = '3000', Type = 'integer', DefaultValue = '3000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = ' + The newer versions of the live feed and event views use Ajax to + request information from the server and populate the views + dynamically. This option allows you to specify a timeout if + required after which requests are abandoned. A timeout may be + necessary if requests would overwise hang such as on a slow + connection. This would tend to consume a lot of browser memory + and make the interface unresponsive. Ordinarily no requests + should timeout so this setting should be set to a value greater + than the slowest expected response. This value is in + milliseconds but if set to zero then no timeout will be used. + ', Category = 'highband', Readonly = '0', Requires = ''; +insert into Config set Id = 182, Name = 'ZM_WEB_M_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = ' + The main console window lists a general status and the event + totals for all monitors. This is not a trivial task and should + not be repeated too frequently or it may affect the performance + of the rest of the system. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 183, Name = 'ZM_WEB_M_REFRESH_NAVBAR', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the navigation header should refresh itself', Help = ' + The navigation header contains the general status information about server load and storage space. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 184, Name = 'ZM_WEB_M_REFRESH_CYCLE', Value = '20', Type = 'integer', DefaultValue = '20', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = ' + The cycle watch window is a method of continuously cycling + between images from all of your monitors. This option + determines how often to refresh with a new image. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 185, Name = 'ZM_WEB_M_REFRESH_IMAGE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = ' + The live images from a monitor can be viewed in either streamed + or stills mode. This option determines how often a stills image + is refreshed, it has no effect if streaming is selected. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 186, Name = 'ZM_WEB_M_REFRESH_STATUS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = ' + The monitor window is actually made from several frames. The + one in the middle merely contains a monitor status which needs + to refresh fairly frequently to give a true indication. This + option determines that frequency. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 187, Name = 'ZM_WEB_M_REFRESH_EVENTS', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = ' + The monitor window is actually made from several frames. The + lower framme contains a listing of the last few events for easy + access. This option determines how often this is refreshed. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 188, Name = 'ZM_WEB_M_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : ($1 =~ /^n/ ? \'no\' : \'auto\' ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = ' + If you know that your browser can handle image streams of the + type \'multipart/x-mixed-replace\' but ZoneMinder does not detect + this correctly you can set this option to ensure that the + stream is delivered with or without the use of the Cambozola + plugin. Selecting \'yes\' will tell ZoneMinder that your browser + can handle the streams natively, \'no\' means that it can\'t and + so the plugin will be used while \'auto\' lets ZoneMinder decide. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 189, Name = 'ZM_WEB_M_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \'mpeg\' : \'jpeg\' ', Prompt = 'Which method should be used to send video streams to your browser.', Help = ' + ZoneMinder can be configured to use either mpeg encoded video + or a series or still jpeg images when sending video streams. + This option defines which is used. If you choose mpeg you + should ensure that you have the appropriate plugins available + on your browser whereas choosing jpeg will work natively on + Mozilla and related browsers and with a Java applet on Internet + Explorer + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 190, Name = 'ZM_WEB_M_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = ' + Normally ZoneMinder will display \'live\' or \'event\' streams in + their native size. However if you have monitors with large + dimensions or a slow link you may prefer to reduce this size, + alternatively for small monitors you can enlarge it. This + options lets you specify what the default scaling factor will + be. It is expressed as a percentage so 100 is normal size, 200 + is double size etc. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 191, Name = 'ZM_WEB_M_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = ' + Normally ZoneMinder will display \'event\' streams at their + native rate, i.e. as close to real-time as possible. However if + you have long events it is often convenient to replay them at a + faster rate for review. This option lets you specify what the + default replay rate will be. It is expressed as a percentage so + 100 is normal rate, 200 is double speed etc. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 192, Name = 'ZM_WEB_M_VIDEO_BITRATE', Value = '75000', Type = 'integer', DefaultValue = '75000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = ' + When encoding real video via the ffmpeg library a bit rate can + be specified which roughly corresponds to the available + bandwidth used for the stream. This setting effectively + corresponds to a \'quality\' setting for the video. A low value + will result in a blocky image whereas a high value will produce + a clearer view. Note that this setting does not control the + frame rate of the video however the quality of the video + produced is affected both by this setting and the frame rate + that the video is produced at. A higher frame rate at a + particular bit rate result in individual frames being at a + lower quality. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 193, Name = 'ZM_WEB_M_VIDEO_MAXFPS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = ' + When using streamed video the main control is the bitrate which + determines how much data can be transmitted. However a lower + bitrate at high frame rates results in a lower quality image. + This option allows you to limit the maximum frame rate to + ensure that video quality is maintained. An additional + advantage is that encoding video at high frame rates is a + processor intensive task when for the most part a very high + frame rate offers little perceptible improvement over one that + has a more manageable resource requirement. Note, this option + is implemented as a cap beyond which binary reduction takes + place. So if you have a device capturing at 15fps and set this + option to 10fps then the video is not produced at 10fps, but + rather at 7.5fps (15 divided by 2) as the final frame rate must + be the original divided by a power of 2. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 194, Name = 'ZM_WEB_M_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = ' + If unset, this option sends the whole image to the browser + which resizes it in the window. If set the image is scaled down + on the server before sending a reduced size image to the + browser to conserve bandwidth at the cost of cpu on the server. + Note that ZM can only perform the resizing if the appropriate + PHP graphics functionality is installed. This is usually + available in the php-gd package. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 195, Name = 'ZM_WEB_M_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \'events\' : \'timeline\' ', Prompt = 'What the default view of multiple events should be.', Help = ' + Stored events can be viewed in either an events list format or + in a timeline based one. This option sets the default view that + will be used. Choosing one view here does not prevent the other + view being used as it will always be selectable from whichever + view is currently being used. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 196, Name = 'ZM_WEB_M_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Show the progress of replay in event view.', Help = ' + When viewing events an event navigation panel and progress bar + is shown below the event itself. This allows you to jump to + specific points in the event, but can can also dynamically + update to display the current progress of the event replay + itself. This progress is calculated from the actual event + duration and is not directly linked to the replay itself, so on + limited bandwidth connections may be out of step with the + replay. This option allows you to turn off the progress + display, whilst still keeping the navigation aspect, where + bandwidth prevents it functioning effectively. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 197, Name = 'ZM_WEB_M_AJAX_TIMEOUT', Value = '5000', Type = 'integer', DefaultValue = '5000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = ' + The newer versions of the live feed and event views use Ajax to + request information from the server and populate the views + dynamically. This option allows you to specify a timeout if + required after which requests are abandoned. A timeout may be + necessary if requests would overwise hang such as on a slow + connection. This would tend to consume a lot of browser memory + and make the interface unresponsive. Ordinarily no requests + should timeout so this setting should be set to a value greater + than the slowest expected response. This value is in + milliseconds but if set to zero then no timeout will be used. + ', Category = 'medband', Readonly = '0', Requires = ''; +insert into Config set Id = 198, Name = 'ZM_WEB_L_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = ' + The main console window lists a general status and the event + totals for all monitors. This is not a trivial task and should + not be repeated too frequently or it may affect the performance + of the rest of the system. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 199, Name = 'ZM_WEB_L_REFRESH_NAVBAR', Value = '35', Type = 'integer', DefaultValue = '35', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the navigation header should refresh itself', Help = ' + The navigation header contains the general status information about server load and storage space. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 200, Name = 'ZM_WEB_L_REFRESH_CYCLE', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = ' + The cycle watch window is a method of continuously cycling + between images from all of your monitors. This option + determines how often to refresh with a new image. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 201, Name = 'ZM_WEB_L_REFRESH_IMAGE', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = ' + The live images from a monitor can be viewed in either streamed + or stills mode. This option determines how often a stills image + is refreshed, it has no effect if streaming is selected. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 202, Name = 'ZM_WEB_L_REFRESH_STATUS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = ' + The monitor window is actually made from several frames. The + one in the middle merely contains a monitor status which needs + to refresh fairly frequently to give a true indication. This + option determines that frequency. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 203, Name = 'ZM_WEB_L_REFRESH_EVENTS', Value = '180', Type = 'integer', DefaultValue = '180', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = ' + The monitor window is actually made from several frames. The + lower framme contains a listing of the last few events for easy + access. This option determines how often this is refreshed. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 204, Name = 'ZM_WEB_L_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : ($1 =~ /^n/ ? \'no\' : \'auto\' ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = ' + If you know that your browser can handle image streams of the + type \'multipart/x-mixed-replace\' but ZoneMinder does not detect + this correctly you can set this option to ensure that the + stream is delivered with or without the use of the Cambozola + plugin. Selecting \'yes\' will tell ZoneMinder that your browser + can handle the streams natively, \'no\' means that it can\'t and + so the plugin will be used while \'auto\' lets ZoneMinder decide. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 205, Name = 'ZM_WEB_L_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \'mpeg\' : \'jpeg\' ', Prompt = 'Which method should be used to send video streams to your browser.', Help = ' + ZoneMinder can be configured to use either mpeg encoded video + or a series or still jpeg images when sending video streams. + This option defines which is used. If you choose mpeg you + should ensure that you have the appropriate plugins available + on your browser whereas choosing jpeg will work natively on + Mozilla and related browsers and with a Java applet on Internet + Explorer + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 206, Name = 'ZM_WEB_L_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = ' + Normally ZoneMinder will display \'live\' or \'event\' streams in + their native size. However if you have monitors with large + dimensions or a slow link you may prefer to reduce this size, + alternatively for small monitors you can enlarge it. This + options lets you specify what the default scaling factor will + be. It is expressed as a percentage so 100 is normal size, 200 + is double size etc. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 207, Name = 'ZM_WEB_L_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = ' + Normally ZoneMinder will display \'event\' streams at their + native rate, i.e. as close to real-time as possible. However if + you have long events it is often convenient to replay them at a + faster rate for review. This option lets you specify what the + default replay rate will be. It is expressed as a percentage so + 100 is normal rate, 200 is double speed etc. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 208, Name = 'ZM_WEB_L_VIDEO_BITRATE', Value = '25000', Type = 'integer', DefaultValue = '25000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = ' + When encoding real video via the ffmpeg library a bit rate can + be specified which roughly corresponds to the available + bandwidth used for the stream. This setting effectively + corresponds to a \'quality\' setting for the video. A low value + will result in a blocky image whereas a high value will produce + a clearer view. Note that this setting does not control the + frame rate of the video however the quality of the video + produced is affected both by this setting and the frame rate + that the video is produced at. A higher frame rate at a + particular bit rate result in individual frames being at a + lower quality. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 209, Name = 'ZM_WEB_L_VIDEO_MAXFPS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = ' + When using streamed video the main control is the bitrate which + determines how much data can be transmitted. However a lower + bitrate at high frame rates results in a lower quality image. + This option allows you to limit the maximum frame rate to + ensure that video quality is maintained. An additional + advantage is that encoding video at high frame rates is a + processor intensive task when for the most part a very high + frame rate offers little perceptible improvement over one that + has a more manageable resource requirement. Note, this option + is implemented as a cap beyond which binary reduction takes + place. So if you have a device capturing at 15fps and set this + option to 10fps then the video is not produced at 10fps, but + rather at 7.5fps (15 divided by 2) as the final frame rate must + be the original divided by a power of 2. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 210, Name = 'ZM_WEB_L_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = ' + If unset, this option sends the whole image to the browser + which resizes it in the window. If set the image is scaled down + on the server before sending a reduced size image to the + browser to conserve bandwidth at the cost of cpu on the server. + Note that ZM can only perform the resizing if the appropriate + PHP graphics functionality is installed. This is usually + available in the php-gd package. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 211, Name = 'ZM_WEB_L_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \'events\' : \'timeline\' ', Prompt = 'What the default view of multiple events should be.', Help = ' + Stored events can be viewed in either an events list format or + in a timeline based one. This option sets the default view that + will be used. Choosing one view here does not prevent the other + view being used as it will always be selectable from whichever + view is currently being used. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 212, Name = 'ZM_WEB_L_SHOW_PROGRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Show the progress of replay in event view.', Help = ' + When viewing events an event navigation panel and progress bar + is shown below the event itself. This allows you to jump to + specific points in the event, but can can also dynamically + update to display the current progress of the event replay + itself. This progress is calculated from the actual event + duration and is not directly linked to the replay itself, so on + limited bandwidth connections may be out of step with the + replay. This option allows you to turn off the progress + display, whilst still keeping the navigation aspect, where + bandwidth prevents it functioning effectively. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 213, Name = 'ZM_WEB_L_AJAX_TIMEOUT', Value = '10000', Type = 'integer', DefaultValue = '10000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = ' + The newer versions of the live feed and event views use Ajax to + request information from the server and populate the views + dynamically. This option allows you to specify a timeout if + required after which requests are abandoned. A timeout may be + necessary if requests would overwise hang such as on a slow + connection. This would tend to consume a lot of browser memory + and make the interface unresponsive. Ordinarily no requests + should timeout so this setting should be set to a value greater + than the slowest expected response. This value is in + milliseconds but if set to zero then no timeout will be used. + ', Category = 'lowband', Readonly = '0', Requires = ''; +insert into Config set Id = 214, Name = 'ZM_DYN_LAST_VERSION', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What the last version of ZoneMinder recorded from zoneminder.com is', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 215, Name = 'ZM_DYN_CURR_VERSION', Value = '1.33.0', Type = 'string', DefaultValue = '1.33.0', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = ' + What the effective current version of ZoneMinder is, might be + different from actual if versions ignored + ', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 216, Name = 'ZM_DYN_DB_VERSION', Value = '1.33.0', Type = 'string', DefaultValue = '1.33.0', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What the version of the database is, from zmupdate', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 217, Name = 'ZM_DYN_LAST_CHECK', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the last check for version from zoneminder.com was', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 218, Name = 'ZM_DYN_NEXT_REMINDER', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about versions will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 219, Name = 'ZM_DYN_DONATE_REMINDER_TIME', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about donations will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 220, Name = 'ZM_DYN_SHOW_DONATE_REMINDER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Remind about donations or not', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 221, Name = 'ZM_SHOW_PRIVACY', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Present the privacy statment', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; +insert into Config set Id = 222, Name = 'ZM_SSMTP_MAIL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = ' + Use a SSMTP mail server if available. + NEW_MAIL_MODULES must be enabled + ', Help = ' + SSMTP is a lightweight and efficient method to send email. + The SSMTP application is not installed by default. + NEW_MAIL_MODULES must also be enabled. + Please visit the ZoneMinder [SSMTP Wiki page](http://www.zoneminder.com/wiki/index.php/How_to_get_ssmtp_working_with_Zoneminder) + for setup and configuration help. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1;ZM_NEW_MAIL_MODULES=1'; +insert into Config set Id = 223, Name = 'ZM_SSMTP_PATH', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'SSMTP executable path', Help = ' + Recommend setting the path to the SSMTP application. + If path is not defined. Zoneminder will try to determine + the path via shell command. Example path: /usr/sbin/ssmtp. + ', Category = 'mail', Readonly = '0', Requires = 'ZM_SSMTP_MAIL=1'; + From 07d745cf555ac96a7f10e5225652a87511adaaf8 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Thu, 3 Jan 2019 14:46:23 -0500 Subject: [PATCH 28/47] added Control line to zm_create.sql.in --- db/zm_create.sql.in | 1 + 1 file changed, 1 insertion(+) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 26d31dd2f..e719daedc 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -787,6 +787,7 @@ INSERT INTO `Controls` VALUES (NULL,'Dericam P2','Ffmpeg','DericamP2',0,1,1,0,0, INSERT INTO `Controls` VALUES (NULL,'Trendnet','Remote','Trendnet',1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `Controls` VALUES (NULL,'PSIA','Remote','PSIA',0,0,0,1,0,0,1,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,-100,100,0,0,1,0,0,0,0,1,-100,100,0,0,0,0); INSERT INTO `Controls` VALUES (NULL,'Dahua','Remote','Dahua',0,0,0,1,0,0,1,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); +INSERT INTO `Controls` VALUES (NULL,'FOSCAMR2C','Libvlc','FOSCAMR2C',1,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,0,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,0,0); -- -- Add some monitor preset values From af7d4b1af63c07c4ff48355bf79af9245a845dd0 Mon Sep 17 00:00:00 2001 From: techrockedge Date: Thu, 3 Jan 2019 14:58:17 -0500 Subject: [PATCH 29/47] added Control line to zm_create.sql.in --- db/zm_create.sql.in | 1 + 1 file changed, 1 insertion(+) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index e719daedc..401a03cdc 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -789,6 +789,7 @@ INSERT INTO `Controls` VALUES (NULL,'PSIA','Remote','PSIA',0,0,0,1,0,0,1,0,0,0,0 INSERT INTO `Controls` VALUES (NULL,'Dahua','Remote','Dahua',0,0,0,1,0,0,1,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); INSERT INTO `Controls` VALUES (NULL,'FOSCAMR2C','Libvlc','FOSCAMR2C',1,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,0,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,0,0); + -- -- Add some monitor preset values -- From c0e54a9874214fec5173cad59802872296f485ff Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Thu, 3 Jan 2019 15:59:28 -0600 Subject: [PATCH 30/47] Delete zm_create.sql --- db/zm_create.sql | 2881 ---------------------------------------------- 1 file changed, 2881 deletions(-) delete mode 100644 db/zm_create.sql diff --git a/db/zm_create.sql b/db/zm_create.sql deleted file mode 100644 index 169f3de7c..000000000 --- a/db/zm_create.sql +++ /dev/null @@ -1,2881 +0,0 @@ --- MySQL dump 10.13 Distrib 5.6.13, for Linux (i686) --- --- Host: localhost Database: zm --- ------------------------------------------------------ --- Server version 5.6.13 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Current Database: `zm` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `zm`; - -USE `zm`; - --- --- Table structure for table `Config` --- - -DROP TABLE IF EXISTS `Config`; -CREATE TABLE `Config` ( - `Id` smallint(5) unsigned NOT NULL default '0', - `Name` varchar(32) NOT NULL default '', - `Value` text NOT NULL, - `Type` tinytext NOT NULL, - `DefaultValue` text, - `Hint` tinytext, - `Pattern` tinytext, - `Format` tinytext, - `Prompt` tinytext, - `Help` text, - `Category` varchar(32) NOT NULL default '', - `Readonly` tinyint(3) unsigned NOT NULL default '0', - `Requires` text, - PRIMARY KEY (`Name`) -) ENGINE=InnoDB; - --- --- Table structure for table `ControlPresets` --- - -DROP TABLE IF EXISTS `ControlPresets`; -CREATE TABLE `ControlPresets` ( - `MonitorId` int(10) unsigned NOT NULL default '0', - `Preset` int(10) unsigned NOT NULL default '0', - `Label` varchar(64) NOT NULL default '', - PRIMARY KEY (`MonitorId`,`Preset`) -) ENGINE=InnoDB; - --- --- Table structure for table `Controls` --- - -DROP TABLE IF EXISTS `Controls`; -CREATE TABLE `Controls` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','Ffmpeg','Libvlc','cURL','WebSite') NOT NULL default 'Local', - `Protocol` varchar(64) default NULL, - `CanWake` tinyint(3) unsigned NOT NULL default '0', - `CanSleep` tinyint(3) unsigned NOT NULL default '0', - `CanReset` tinyint(3) unsigned NOT NULL default '0', - `CanZoom` tinyint(3) unsigned NOT NULL default '0', - `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0', - `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0', - `CanZoomRel` tinyint(3) unsigned NOT NULL default '0', - `CanZoomCon` tinyint(3) unsigned NOT NULL default '0', - `MinZoomRange` int(10) unsigned default NULL, - `MaxZoomRange` int(10) unsigned default NULL, - `MinZoomStep` int(10) unsigned default NULL, - `MaxZoomStep` int(10) unsigned default NULL, - `HasZoomSpeed` tinyint(3) unsigned NOT NULL default '0', - `MinZoomSpeed` int(10) unsigned default NULL, - `MaxZoomSpeed` int(10) unsigned default NULL, - `CanFocus` tinyint(3) unsigned NOT NULL default '0', - `CanAutoFocus` tinyint(3) unsigned NOT NULL default '0', - `CanFocusAbs` tinyint(3) unsigned NOT NULL default '0', - `CanFocusRel` tinyint(3) unsigned NOT NULL default '0', - `CanFocusCon` tinyint(3) unsigned NOT NULL default '0', - `MinFocusRange` int(10) unsigned default NULL, - `MaxFocusRange` int(10) unsigned default NULL, - `MinFocusStep` int(10) unsigned default NULL, - `MaxFocusStep` int(10) unsigned default NULL, - `HasFocusSpeed` tinyint(3) unsigned NOT NULL default '0', - `MinFocusSpeed` int(10) unsigned default NULL, - `MaxFocusSpeed` int(10) unsigned default NULL, - `CanIris` tinyint(3) unsigned NOT NULL default '0', - `CanAutoIris` tinyint(3) unsigned NOT NULL default '0', - `CanIrisAbs` tinyint(3) unsigned NOT NULL default '0', - `CanIrisRel` tinyint(3) unsigned NOT NULL default '0', - `CanIrisCon` tinyint(3) unsigned NOT NULL default '0', - `MinIrisRange` int(10) unsigned default NULL, - `MaxIrisRange` int(10) unsigned default NULL, - `MinIrisStep` int(10) unsigned default NULL, - `MaxIrisStep` int(10) unsigned default NULL, - `HasIrisSpeed` tinyint(3) unsigned NOT NULL default '0', - `MinIrisSpeed` int(10) unsigned default NULL, - `MaxIrisSpeed` int(10) unsigned default NULL, - `CanGain` tinyint(3) unsigned NOT NULL default '0', - `CanAutoGain` tinyint(3) unsigned NOT NULL default '0', - `CanGainAbs` tinyint(3) unsigned NOT NULL default '0', - `CanGainRel` tinyint(3) unsigned NOT NULL default '0', - `CanGainCon` tinyint(3) unsigned NOT NULL default '0', - `MinGainRange` int(10) unsigned default NULL, - `MaxGainRange` int(10) unsigned default NULL, - `MinGainStep` int(10) unsigned default NULL, - `MaxGainStep` int(10) unsigned default NULL, - `HasGainSpeed` tinyint(3) unsigned NOT NULL default '0', - `MinGainSpeed` int(10) unsigned default NULL, - `MaxGainSpeed` int(10) unsigned default NULL, - `CanWhite` tinyint(3) unsigned NOT NULL default '0', - `CanAutoWhite` tinyint(3) unsigned NOT NULL default '0', - `CanWhiteAbs` tinyint(3) unsigned NOT NULL default '0', - `CanWhiteRel` tinyint(3) unsigned NOT NULL default '0', - `CanWhiteCon` tinyint(3) unsigned NOT NULL default '0', - `MinWhiteRange` int(10) unsigned default NULL, - `MaxWhiteRange` int(10) unsigned default NULL, - `MinWhiteStep` int(10) unsigned default NULL, - `MaxWhiteStep` int(10) unsigned default NULL, - `HasWhiteSpeed` tinyint(3) unsigned NOT NULL default '0', - `MinWhiteSpeed` int(10) unsigned default NULL, - `MaxWhiteSpeed` int(10) unsigned default NULL, - `HasPresets` tinyint(3) unsigned NOT NULL default '0', - `NumPresets` tinyint(3) unsigned NOT NULL default '0', - `HasHomePreset` tinyint(3) unsigned NOT NULL default '0', - `CanSetPresets` tinyint(3) unsigned NOT NULL default '0', - `CanMove` tinyint(3) unsigned NOT NULL default '0', - `CanMoveDiag` tinyint(3) unsigned NOT NULL default '0', - `CanMoveMap` tinyint(3) unsigned NOT NULL default '0', - `CanMoveAbs` tinyint(3) unsigned NOT NULL default '0', - `CanMoveRel` tinyint(3) unsigned NOT NULL default '0', - `CanMoveCon` tinyint(3) unsigned NOT NULL default '0', - `CanPan` tinyint(3) unsigned NOT NULL default '0', - `MinPanRange` int(10) default NULL, - `MaxPanRange` int(10) default NULL, - `MinPanStep` int(10) default NULL, - `MaxPanStep` int(10) default NULL, - `HasPanSpeed` tinyint(3) unsigned NOT NULL default '0', - `MinPanSpeed` int(10) default NULL, - `MaxPanSpeed` int(10) default NULL, - `HasTurboPan` tinyint(3) unsigned NOT NULL default '0', - `TurboPanSpeed` int(10) default NULL, - `CanTilt` tinyint(3) unsigned NOT NULL default '0', - `MinTiltRange` int(10) default NULL, - `MaxTiltRange` int(10) default NULL, - `MinTiltStep` int(10) default NULL, - `MaxTiltStep` int(10) default NULL, - `HasTiltSpeed` tinyint(3) unsigned NOT NULL default '0', - `MinTiltSpeed` int(10) default NULL, - `MaxTiltSpeed` int(10) default NULL, - `HasTurboTilt` tinyint(3) unsigned NOT NULL default '0', - `TurboTiltSpeed` int(10) default NULL, - `CanAutoScan` tinyint(3) unsigned NOT NULL default '0', - `NumScanPaths` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - --- --- Table structure for table `Devices` --- - -DROP TABLE IF EXISTS `Devices`; -CREATE TABLE `Devices` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` tinytext NOT NULL, - `Type` enum('X10') NOT NULL default 'X10', - `KeyString` varchar(32) NOT NULL default '', - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - --- --- Table structure for table `Events` --- - -DROP TABLE IF EXISTS `Events`; -CREATE TABLE `Events` ( - `Id` bigint unsigned NOT NULL auto_increment, - `MonitorId` int(10) unsigned NOT NULL default '0', - `StorageId` smallint(5) unsigned default 0, - `Name` varchar(64) NOT NULL default '', - `Cause` varchar(32) NOT NULL default '', - `StartTime` datetime default NULL, - `EndTime` datetime default NULL, - `Width` smallint(5) unsigned NOT NULL default '0', - `Height` smallint(5) unsigned NOT NULL default '0', - `Length` decimal(10,2) NOT NULL default '0.00', - `Frames` int(10) unsigned default NULL, - `AlarmFrames` int(10) unsigned default NULL, - `DefaultVideo` VARCHAR( 64 ) DEFAULT '' NOT NULL, - `SaveJPEGs` TINYINT, - `TotScore` int(10) unsigned NOT NULL default '0', - `AvgScore` smallint(5) unsigned default '0', - `MaxScore` smallint(5) unsigned default '0', - `Archived` tinyint(3) unsigned NOT NULL default '0', - `Videoed` tinyint(3) unsigned NOT NULL default '0', - `Uploaded` tinyint(3) unsigned NOT NULL default '0', - `Emailed` tinyint(3) unsigned NOT NULL default '0', - `Messaged` tinyint(3) unsigned NOT NULL default '0', - `Executed` tinyint(3) unsigned NOT NULL default '0', - `Notes` text, - `StateId` int(10) unsigned NOT NULL, - `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', - `DiskSpace` bigint unsigned default NULL, - `Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium', - `Locked` BOOLEAN NOT NULL DEFAULT False, - PRIMARY KEY (`Id`), - KEY `Events_MonitorId_idx` (`MonitorId`), - KEY `Events_StorageId_idx` (`StorageId`), - KEY `Events_StartTime_idx` (`StartTime`), - KEY `Events_EndTime_DiskSpace` (`EndTime`,`DiskSpace`) -) ENGINE=InnoDB; - -DROP TABLE IF EXISTS `Events_Hour`; -CREATE TABLE `Events_Hour` ( - `EventId` BIGINT unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `StartTime` datetime default NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Hour_MonitorId_idx` (`MonitorId`), - KEY `Events_Hour_StartTime_idx` (`StartTime`) -) ENGINE=InnoDB; - -DROP TABLE IF EXISTS `Events_Day`; -CREATE TABLE `Events_Day` ( - `EventId` BIGINT unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `StartTime` datetime default NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Day_MonitorId_idx` (`MonitorId`), - KEY `Events_Day_StartTime_idx` (`StartTime`) -) ENGINE=InnoDB; - -DROP TABLE IF EXISTS `Events_Week`; -CREATE TABLE `Events_Week` ( - `EventId` BIGINT unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `StartTime` datetime default NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Week_MonitorId_idx` (`MonitorId`), - KEY `Events_Week_StartTime_idx` (`StartTime`) -) ENGINE=InnoDB; - -DROP TABLE IF EXISTS `Events_Month`; -CREATE TABLE `Events_Month` ( - `EventId` BIGINT unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `StartTime` datetime default NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Month_MonitorId_idx` (`MonitorId`), - KEY `Events_Month_StartTime_idx` (`StartTime`) -) ENGINE=InnoDB; - - -DROP TABLE IF EXISTS `Events_Archived`; -CREATE TABLE `Events_Archived` ( - `EventId` BIGINT unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`EventId`), - KEY `Events_Archived_MonitorId_idx` (`MonitorId`) -) ENGINE=InnoDB; - --- --- Table structure for table `Filters` --- - -DROP TABLE IF EXISTS `Filters`; -CREATE TABLE `Filters` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `Query` text NOT NULL, - `AutoArchive` tinyint(3) unsigned NOT NULL default '0', - `AutoVideo` tinyint(3) unsigned NOT NULL default '0', - `AutoUpload` tinyint(3) unsigned NOT NULL default '0', - `AutoEmail` tinyint(3) unsigned NOT NULL default '0', - `AutoMessage` tinyint(3) unsigned NOT NULL default '0', - `AutoExecute` tinyint(3) unsigned NOT NULL default '0', - `AutoExecuteCmd` tinytext, - `AutoDelete` tinyint(3) unsigned NOT NULL default '0', - `AutoMove` tinyint(3) unsigned NOT NULL default '0', - `AutoMoveTo` smallint(5) unsigned NOT NULL default 0, - `UpdateDiskSpace` tinyint(3) unsigned NOT NULL default '0', - `Background` tinyint(1) unsigned NOT NULL default '0', - `Concurrent` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`Id`), - KEY `Name` (`Name`) -) ENGINE=InnoDB; - --- --- Table structure for table `Frames` --- - -DROP TABLE IF EXISTS `Frames`; -CREATE TABLE `Frames` ( - `Id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, - `EventId` BIGINT UNSIGNED NOT NULL default '0', - `FrameId` int(10) unsigned NOT NULL default '0', - `Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal', - `TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `Delta` decimal(8,2) NOT NULL default '0.00', - `Score` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`Id`), - INDEX `EventId_idx` (`EventId`), - KEY `Type` (`Type`), - KEY `TimeStamp` (`TimeStamp`) -) ENGINE=InnoDB; - --- --- Table structure for table `Groups` --- - -DROP TABLE IF EXISTS `Groups`; -CREATE TABLE `Groups` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `ParentId` int(10) unsigned, - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - --- --- Table structure for table `Groups_Monitors` --- - -DROP TABLE IF EXISTS `Groups_Monitors`; -CREATE TABLE `Groups_Monitors` ( - `Id` INT(10) unsigned NOT NULL auto_increment, - `GroupId` int(10) unsigned NOT NULL, - `MonitorId` int(10) unsigned NOT NULL, - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - -CREATE INDEX `Groups_Monitors_GroupId_idx` ON `Groups_Monitors` (`GroupId`); -CREATE INDEX `Groups_Monitors_MonitorId_idx` ON `Groups_Monitors` (`MonitorId`); - --- --- Table structure for table `Logs` --- - -DROP TABLE IF EXISTS `Logs`; -CREATE TABLE `Logs` ( - `TimeKey` decimal(16,6) NOT NULL, - `Component` varchar(32) NOT NULL, - `ServerId` int(10) unsigned, - `Pid` int(10) DEFAULT NULL, - `Level` tinyint(3) NOT NULL, - `Code` char(3) NOT NULL, - `Message` text NOT NULL, - `File` varchar(255) DEFAULT NULL, - `Line` smallint(5) unsigned DEFAULT NULL, - KEY `TimeKey` (`TimeKey`) -) ENGINE=InnoDB; - -CREATE INDEX `Logs_TimeKey_idx` ON `Logs` (`TimeKey`); -CREATE INDEX `Logs_Level_idx` ON `Logs` (`Level`); --- --- Table structure for table `Manufacturers` --- - -DROP TABLE IF EXISTS `Manufacturers`; -CREATE TABLE `Manufacturers` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL, - PRIMARY KEY (`Id`), - UNIQUE KEY (`Name`) -) ENGINE=InnoDB; - --- --- Table structure for table `Models` --- - -DROP TABLE IF EXISTS `Models`; -CREATE TABLE `Models` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL, - `ManufacturerId` int(10), - PRIMARY KEY (`Id`), - UNIQUE KEY (`ManufacturerId`,`Name`) -) ENGINE=InnoDB; - --- --- Table structure for table `MonitorPresets` --- - -DROP TABLE IF EXISTS `MonitorPresets`; -CREATE TABLE `MonitorPresets` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','NVSocket') NOT NULL default 'Local', - `Device` tinytext, - `Channel` tinyint(3) unsigned default NULL, - `Format` int(10) unsigned default NULL, - `Protocol` varchar(16) default NULL, - `Method` varchar(16) default NULL, - `Host` varchar(64) default NULL, - `Port` varchar(8) default NULL, - `Path` varchar(255) default NULL, - `SubPath` varchar(64) default NULL, - `Width` smallint(5) unsigned default NULL, - `Height` smallint(5) unsigned default NULL, - `Palette` int(10) unsigned default NULL, - `MaxFPS` decimal(5,2) default NULL, - `Controllable` tinyint(3) unsigned NOT NULL default '0', - `ControlId` varchar(16) default NULL, - `ControlDevice` varchar(255) default NULL, - `ControlAddress` varchar(255) default NULL, - `DefaultRate` smallint(5) unsigned NOT NULL default '100', - `DefaultScale` smallint(5) unsigned NOT NULL default '100', - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - --- --- Table structure for table `Monitors` --- - -DROP TABLE IF EXISTS `Monitors`; -CREATE TABLE `Monitors` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `ServerId` int(10) unsigned, - `StorageId` smallint(5) unsigned default 0, - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL') NOT NULL default 'Local', - `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', - `Enabled` tinyint(3) unsigned NOT NULL default '1', - `LinkedMonitors` varchar(255), - `Triggers` set('X10') NOT NULL default '', - `Device` tinytext NOT NULL default '', - `Channel` tinyint(3) unsigned NOT NULL default '0', - `Format` int(10) unsigned NOT NULL default '0', - `V4LMultiBuffer` tinyint(1) unsigned, - `V4LCapturesPerFrame` tinyint(3) unsigned, - `Protocol` varchar(16), - `Method` varchar(16) default '', - `Host` varchar(64), - `Port` varchar(8) NOT NULL default '', - `SubPath` varchar(64) NOT NULL default '', - `Path` varchar(255), - `Options` varchar(255), - `User` varchar(64), - `Pass` varchar(64), - `Width` smallint(5) unsigned NOT NULL default '0', - `Height` smallint(5) unsigned NOT NULL default '0', - `Colours` tinyint(3) unsigned NOT NULL default '1', - `Palette` int(10) unsigned NOT NULL default '0', - `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', - `Deinterlacing` int(10) unsigned NOT NULL default '0', - `SaveJPEGs` TINYINT NOT NULL DEFAULT '3' , - `VideoWriter` TINYINT NOT NULL DEFAULT '0', - `OutputCodec` enum('h264','mjpeg','mpeg1','mpeg2'), - `OutputContainer` enum('auto','mp4','mkv'), - `EncoderParameters` TEXT, - `RecordAudio` TINYINT NOT NULL DEFAULT '0', - `RTSPDescribe` tinyint(1) unsigned, - `Brightness` mediumint(7) NOT NULL default '-1', - `Contrast` mediumint(7) NOT NULL default '-1', - `Hue` mediumint(7) NOT NULL default '-1', - `Colour` mediumint(7) NOT NULL default '-1', - `EventPrefix` varchar(32) NOT NULL default 'Event-', - `LabelFormat` varchar(64) default '%N - %y/%m/%d %H:%M:%S', - `LabelX` smallint(5) unsigned NOT NULL default '0', - `LabelY` smallint(5) unsigned NOT NULL default '0', - `LabelSize` smallint(5) unsigned NOT NULL DEFAULT '1', - `ImageBufferCount` smallint(5) unsigned NOT NULL default '100', - `WarmupCount` smallint(5) unsigned NOT NULL default '25', - `PreEventCount` smallint(5) unsigned NOT NULL default '10', - `PostEventCount` smallint(5) unsigned NOT NULL default '10', - `StreamReplayBuffer` int(10) unsigned NOT NULL default '1000', - `AlarmFrameCount` smallint(5) unsigned NOT NULL default '1', - `SectionLength` int(10) unsigned NOT NULL default '600', - `FrameSkip` smallint(5) unsigned NOT NULL default '0', - `MotionFrameSkip` smallint(5) unsigned NOT NULL default '0', - `AnalysisFPSLimit` decimal(5,2) default NULL, - `AnalysisUpdateDelay` smallint(5) unsigned NOT NULL default '0', - `MaxFPS` decimal(5,2) default NULL, - `AlarmMaxFPS` decimal(5,2) default NULL, - `FPSReportInterval` smallint(5) unsigned NOT NULL default '250', - `RefBlendPerc` tinyint(3) unsigned NOT NULL default '6', - `AlarmRefBlendPerc` tinyint(3) unsigned NOT NULL default '6', - `Controllable` tinyint(3) unsigned NOT NULL default '0', - `ControlId` int(10) unsigned, - `ControlDevice` varchar(255) default NULL, - `ControlAddress` varchar(255) default NULL, - `AutoStopTimeout` decimal(5,2) default NULL, - `TrackMotion` tinyint(3) unsigned NOT NULL default '0', - `TrackDelay` smallint(5) unsigned, - `ReturnLocation` tinyint(3) NOT NULL default '-1', - `ReturnDelay` smallint(5) unsigned, - `DefaultRate` smallint(5) unsigned NOT NULL default '100', - `DefaultScale` smallint(5) unsigned NOT NULL default '100', - `SignalCheckPoints` INT UNSIGNED NOT NULL default '0', - `SignalCheckColour` varchar(32) NOT NULL default '#0000BE', - `WebColour` varchar(32) NOT NULL default 'red', - `Exif` tinyint(1) unsigned NOT NULL default '0', - `Sequence` smallint(5) unsigned default NULL, - `TotalEvents` int(10) default NULL, - `TotalEventDiskSpace` bigint default NULL, - `HourEvents` int(10) default NULL, - `HourEventDiskSpace` bigint default NULL, - `DayEvents` int(10) default NULL, - `DayEventDiskSpace` bigint default NULL, - `WeekEvents` int(10) default NULL, - `WeekEventDiskSpace` bigint default NULL, - `MonthEvents` int(10) default NULL, - `MonthEventDiskSpace` bigint default NULL, - `ArchivedEvents` int(10) default NULL, - `ArchivedEventDiskSpace` bigint default NULL, - `ZoneCount` TINYINT NOT NULL DEFAULT 0, - `Refresh` int(10) unsigned default NULL, - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - -CREATE INDEX `Monitors_ServerId_idx` ON `Monitors` (`ServerId`); - -DROP TABLE IF EXISTS `Monitor_Status`; -CREATE TABLE `Monitor_Status` ( - `MonitorId` int(10) unsigned NOT NULL, - `Status` enum('Unknown','NotRunning','Running','Connected','Signal') NOT NULL default 'Unknown', - `CaptureFPS` DECIMAL(10,2) NOT NULL default 0, - `AnalysisFPS` DECIMAL(5,2) NOT NULL default 0, - `CaptureBandwidth` INT NOT NULL default 0, - PRIMARY KEY (`MonitorId`) -) ENGINE=MEMORY; --- --- Table structure for table `States` --- PP - Added IsActive to track custom run states --- Also made sure Name is unique - -DROP TABLE IF EXISTS `States`; -CREATE TABLE `States` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `Definition` text NOT NULL, - `IsActive` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`Id`), - UNIQUE KEY (`Name`) -) ENGINE=InnoDB; -INSERT INTO States (Name,Definition,IsActive) VALUES ('default','','1'); - - --- --- Table structure for table `Servers` --- - -DROP TABLE IF EXISTS `Servers`; -CREATE TABLE `Servers` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Protocol` TEXT, - `Hostname` TEXT, - `Port` INTEGER UNSIGNED, - `PathToIndex` TEXT, - `PathToZMS` TEXT, - `PathToApi` TEXT, - `Name` varchar(64) NOT NULL default '', - `State_Id` int(10) unsigned, - `Status` enum('Unknown','NotRunning','Running') NOT NULL default 'Unknown', - `CpuLoad` DECIMAL(5,1) default NULL, - `TotalMem` bigint unsigned default null, - `FreeMem` bigint unsigned default null, - `TotalSwap` bigint unsigned default null, - `FreeSwap` bigint unsigned default null, - `zmstats` BOOLEAN NOT NULL DEFAULT FALSE, - `zmaudit` BOOLEAN NOT NULL DEFAULT FALSE, - `zmtrigger` BOOLEAN NOT NULL DEFAULT FALSE, - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - -CREATE INDEX `Servers_Name_idx` ON `Servers` (`Name`); - --- --- Table structure for table `Stats` --- - -DROP TABLE IF EXISTS `Stats`; -CREATE TABLE `Stats` ( - `MonitorId` int(10) unsigned NOT NULL default '0', - `ZoneId` int(10) unsigned NOT NULL default '0', - `EventId` BIGINT UNSIGNED NOT NULL, - `FrameId` int(10) unsigned NOT NULL default '0', - `PixelDiff` tinyint(3) unsigned NOT NULL default '0', - `AlarmPixels` int(10) unsigned NOT NULL default '0', - `FilterPixels` int(10) unsigned NOT NULL default '0', - `BlobPixels` int(10) unsigned NOT NULL default '0', - `Blobs` smallint(5) unsigned NOT NULL default '0', - `MinBlobSize` int(10) unsigned NOT NULL default '0', - `MaxBlobSize` int(10) unsigned NOT NULL default '0', - `MinX` smallint(5) unsigned NOT NULL default '0', - `MaxX` smallint(5) unsigned NOT NULL default '0', - `MinY` smallint(5) unsigned NOT NULL default '0', - `MaxY` smallint(5) unsigned NOT NULL default '0', - `Score` smallint(5) unsigned NOT NULL default '0', - KEY `EventId` (`EventId`), - KEY `MonitorId` (`MonitorId`), - KEY `ZoneId` (`ZoneId`) -) ENGINE=InnoDB; - --- --- Table structure for table `TriggersX10` --- - -DROP TABLE IF EXISTS `TriggersX10`; -CREATE TABLE `TriggersX10` ( - `MonitorId` int(10) unsigned NOT NULL default '0', - `Activation` varchar(32) default NULL, - `AlarmInput` varchar(32) default NULL, - `AlarmOutput` varchar(32) default NULL, - PRIMARY KEY (`MonitorId`) -) ENGINE=InnoDB; - --- --- Table structure for table `Users` --- - -DROP TABLE IF EXISTS `Users`; -CREATE TABLE `Users` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Username` varchar(32) character set latin1 collate latin1_bin NOT NULL default '', - `Password` varchar(64) NOT NULL default '', - `Language` varchar(8), - `Enabled` tinyint(3) unsigned NOT NULL default '1', - `Stream` enum('None','View') NOT NULL default 'None', - `Events` enum('None','View','Edit') NOT NULL default 'None', - `Control` enum('None','View','Edit') NOT NULL default 'None', - `Monitors` enum('None','View','Edit') NOT NULL default 'None', - `Groups` enum('None','View','Edit') NOT NULL default 'None', - `Devices` enum('None','View','Edit') NOT NULL default 'None', - `System` enum('None','View','Edit') NOT NULL default 'None', - `MaxBandwidth` varchar(16), - `MonitorIds` tinytext, - PRIMARY KEY (`Id`), - UNIQUE KEY `UC_Username` (`Username`) -) ENGINE=InnoDB; - --- --- Table structure for table `ZonePresets` --- - -DROP TABLE IF EXISTS `ZonePresets`; -CREATE TABLE `ZonePresets` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` varchar(64) NOT NULL default '', - `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive','Privacy') NOT NULL default 'Active', - `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', - `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', - `MinPixelThreshold` smallint(5) unsigned default NULL, - `MaxPixelThreshold` smallint(5) unsigned default NULL, - `MinAlarmPixels` int(10) unsigned default NULL, - `MaxAlarmPixels` int(10) unsigned default NULL, - `FilterX` tinyint(3) unsigned default NULL, - `FilterY` tinyint(3) unsigned default NULL, - `MinFilterPixels` int(10) unsigned default NULL, - `MaxFilterPixels` int(10) unsigned default NULL, - `MinBlobPixels` int(10) unsigned default NULL, - `MaxBlobPixels` int(10) unsigned default NULL, - `MinBlobs` smallint(5) unsigned default NULL, - `MaxBlobs` smallint(5) unsigned default NULL, - `OverloadFrames` smallint(5) unsigned NOT NULL default '0', - `ExtendAlarmFrames` smallint(5) unsigned not null default 0, - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - --- --- Table structure for table `Zones` --- - -DROP TABLE IF EXISTS `Zones`; -CREATE TABLE `Zones` ( - `Id` int(10) unsigned NOT NULL auto_increment, - `MonitorId` int(10) unsigned NOT NULL default '0', - `Name` varchar(64) NOT NULL default '', - `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive','Privacy') NOT NULL default 'Active', - `Units` enum('Pixels','Percent') NOT NULL default 'Pixels', - `NumCoords` tinyint(3) unsigned NOT NULL default '0', - `Coords` tinytext NOT NULL, - `Area` int(10) unsigned NOT NULL default '0', - `AlarmRGB` int(10) unsigned default '0', - `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', - `MinPixelThreshold` smallint(5) unsigned default NULL, - `MaxPixelThreshold` smallint(5) unsigned default NULL, - `MinAlarmPixels` int(10) unsigned default NULL, - `MaxAlarmPixels` int(10) unsigned default NULL, - `FilterX` tinyint(3) unsigned default NULL, - `FilterY` tinyint(3) unsigned default NULL, - `MinFilterPixels` int(10) unsigned default NULL, - `MaxFilterPixels` int(10) unsigned default NULL, - `MinBlobPixels` int(10) unsigned default NULL, - `MaxBlobPixels` int(10) unsigned default NULL, - `MinBlobs` smallint(5) unsigned default NULL, - `MaxBlobs` smallint(5) unsigned default NULL, - `OverloadFrames` smallint(5) unsigned NOT NULL default '0', - `ExtendAlarmFrames` smallint(5) unsigned not null default 0, - PRIMARY KEY (`Id`), - KEY `MonitorId` (`MonitorId`) -) ENGINE=InnoDB; - -DROP TABLE IF EXISTS `Storage`; -CREATE TABLE `Storage` ( - `Id` smallint(5) unsigned NOT NULL auto_increment, - `Path` varchar(64) NOT NULL default '', - `Name` varchar(64) NOT NULL default '', - `Type` enum('local','s3fs') NOT NULL default 'local', - `Url` varchar(255) default NULL, - `DiskSpace` bigint default NULL, - `Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium', - `ServerId` int(10) unsigned, - `DoDelete` BOOLEAN NOT NULL DEFAULT true, - PRIMARY KEY (`Id`) -) ENGINE=InnoDB; - --- --- Create a default storage location --- -insert into Storage VALUES (NULL, '/var/lib/zoneminder/events', 'Default', 'local', NULL, NULL, 'Medium', 0, true ); - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- --- Initial data to be loaded into ZoneMinder database --- - --- --- Create a default admin user. --- -insert into Users VALUES (NULL,'admin',password('admin'),'',1,'View','Edit','Edit','Edit','Edit','Edit','Edit','',''); - --- --- Add a sample filter to purge the oldest 100 events when the disk is 95% full --- - -insert into Filters values (NULL,'PurgeWhenFull','{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":100,"sort_asc":1}',0/*AutoArchive*/,0/*AutoVideo*/,0/*AutoUpload*/,0/*AutoEmail*/,0/*AutoMessage*/,0/*AutoExecute*/,'',1/*AutoDelete*/,0/*AutoMove*/,0/*MoveTo*/,0/*UpdateDiskSpace*/,1/*Background*/,0/*Concurrent*/); -insert into Filters values (NULL,'Update DiskSpace','{"terms":[{"attr":"DiskSpace","op":"IS","val":"NULL"}]}',0,0,0,0,0,0,'',0,0,0,1,1,0); - --- --- Add in some sample control protocol definitions --- -INSERT INTO Controls VALUES (NULL,'Pelco-D','Local','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); -INSERT INTO Controls VALUES (NULL,'Pelco-P','Local','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); -INSERT INTO Controls VALUES (NULL,'Sony VISCA','Local','Visca',1,1,0,1,0,0,0,1,0,16384,10,4000,1,1,6,1,1,1,0,1,0,1536,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,3,1,1,1,1,0,1,1,0,1,-15578,15578,100,10000,1,1,50,1,254,1,-7789,7789,100,5000,1,1,50,1,254,0,0); -INSERT INTO Controls VALUES (NULL,'Axis API v2','Remote','AxisV2',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0); -INSERT INTO Controls VALUES (NULL,'Panasonic IP','Remote','PanasonicIP',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); -INSERT INTO Controls VALUES (NULL,'Neu-Fusion NCS370','Remote','Ncs370',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,24,1,0,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); -INSERT INTO Controls VALUES (NULL,'AirLink SkyIPCam 7xx','Remote','SkyIPCam7xx',0,0,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,1,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); -INSERT INTO Controls VALUES (NULL,'Pelco-D','Ffmpeg','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); -INSERT INTO Controls VALUES (NULL,'Pelco-P','Ffmpeg','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0); -INSERT INTO Controls VALUES (NULL,'Foscam FI8620','Ffmpeg','FI8620_Y2k',0,0,0,1,0,0,0,1,1,10,1,10,1,1,63,1,1,0,0,1,1,63,1,63,1,1,63,1,1,0,0,1,0,0,0,0,1,0,255,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,255,1,8,0,1,1,1,0,0,0,1,1,1,360,1,360,1,1,63,0,0,1,1,90,1,90,1,1,63,0,0,0,0); -INSERT INTO Controls VALUES (NULL,'Foscam FI8608W','Ffmpeg','FI8608W_Y2k',1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,255,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,255,1,8,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,128,0,0,1,0,0,0,0,1,1,128,0,0,0,0); -INSERT INTO Controls VALUES (NULL,'Foscam FI8908W','Remote','FI8908W',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO Controls VALUES (NULL,'Foscam FI9821W','Ffmpeg','FI9821W_Y2k',1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,100,1,1,0,0,1,0,100,0,100,1,0,100,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,100,0,100,1,0,100,1,16,0,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,1,0,4,0,0,0,0); -INSERT INTO Controls VALUES (NULL,'Loftek Sentinel','Remote','LoftekSentinel',0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,255,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,6,1,1,0,0,0,1,10,0,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO Controls VALUES (NULL,'Toshiba IK-WB11A','Remote','Toshiba_IK_WB11A',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,10,0,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO Controls VALUES (NULL,'WanscamPT','Remote','Wanscam',1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,16,0,0,0,0,0,1,16,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO Controls VALUES (NULL,'3S Domo N5071', 'Remote', '3S', 0, 0, 1, 1, 0, 1, 1, 0, 0, 9999, 0, 9999, 0, 0, 0, 1, 1, 1, 1, 0, 0, 9999, 20, 9999, 0, 0, 0, 1, 1, 1, 1, 0, 0, 9999, 1, 9999, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 1, 0, 1, 1, 0, 0, 0, 0, 1, -180, 180, 40, 100, 1, 40, 100, 0, 0, 1, -180, 180, 40, 100, 1, 40, 100, 0, 0, 0, 0); -INSERT INTO Controls VALUES (NULL,'ONVIF Camera','Ffmpeg','onvif',0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,255,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,6,1,1,0,0,0,1,10,0,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Foscam 9831W','Ffmpeg','FI9831W',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,1,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Foscam FI8918W','Ffmpeg','FI8918W',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,1,0,4,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'SunEyes SP-P1802SWPTZ','Libvlc','SPP1802SWPTZ',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,64,0,0,1,0,0,0,0,1,0,64,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Wanscam HW0025','Libvlc','WanscamHW0025', 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 350, 0, 0, 1, 0, 10, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0); -INSERT INTO `Controls` VALUES (NULL,'IPCC 7210W','Remote','IPCC7210W', 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -INSERT INTO `Controls` VALUES (NULL,'Vivotek ePTZ','Remote','Vivotek_ePTZ',0,0,1,1,0,0,0,1,0,0,0,0,1,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,5,0,0,1,0,0,0,0,1,0,5,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Netcat ONVIF','Ffmpeg','Netcat',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,100,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,100,5,5,0,0,0,1,255,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Keekoon','Remote','Keekoon', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -INSERT INTO `Controls` VALUES (NULL,'HikVision','Local','',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,100,0,0,1,0,0,0,0,1,1,100,1,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Maginon Supra IPC','cURL','MaginonIPC',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Floureon 1080P','Ffmpeg','Floureon',0,0,0,1,0,0,0,1,1,18,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-423','Ffmpeg','Reolink',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,64,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-411','Ffmpeg','Reolink',0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Reolink RLC-420','Ffmpeg','Reolink',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'D-LINK DCS-3415','Remote','DCS3415',0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'IOS Camera','Ffmpeg','IPCAMIOS',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Dericam P2','Ffmpeg','DericamP2',0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,10,0,1,1,1,0,0,0,1,1,0,0,0,0,1,1,45,0,0,1,0,0,0,0,1,1,45,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Trendnet','Remote','Trendnet',1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'PSIA','Remote','PSIA',0,0,0,1,0,0,1,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,-100,100,0,0,1,0,0,0,0,1,-100,100,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'Dahua','Remote','Dahua',0,0,0,1,0,0,1,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); -INSERT INTO `Controls` VALUES (NULL,'FOSCAMR2C','Libvlc','FOSCAMR2C',1,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,0,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,0,0); - --- --- Add some monitor preset values --- -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 320x240, mpjpeg, B&W','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&color=0',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP, 640x480, mpjpeg, B&W','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&color=0',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,1,4,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,1,4,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,1,4,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,1,4,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,1,4,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,1,4,NULL,':',100,100); -INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, unicast','Remote','rtsp',0,255,'rtsp','rtpUni','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, multicast','Remote','rtsp',0,255,'rtsp','rtpMulti','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, RTP/RTSP','Remote','rtsp',0,255,'rtsp','rtpRtsp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT into MonitorPresets VALUES (NULL,'Axis IP, mpeg4, RTP/RTSP/HTTP','Remote',NULL,NULL,NULL,'rtsp','rtpRtspHttp','',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'D-link DCS-930L, 640x480, mjpeg','Remote','http',0,0,'http','simple','',80,'/mjpeg.cgi',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 320x240, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 320x240, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,5,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,1,5,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 640x480, mpjpeg','Remote','http',0,0,'http','simple','',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 640x480, jpeg','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,5,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Panasonic IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,1,5,NULL,':',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, jpeg','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, mpjpeg','Remote','http',0,0,'http','simple','',80,'/GetData.cgi',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Gadspot IP, mpjpeg','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'IP Webcam by Pavel Khlebovich 1920x1080','Remote','/dev/video','0',255,'http','simple','','8080','/video','',1920,1080,0,NULL,0,'0','','',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'VEO Observer, jpeg','Remote','http',0,0,'http','simple','',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Blue Net Video Server, jpeg','Remote','http',0,0,'http','simple','',80,'/cgi-bin/image.cgi?control=0&id=admin&passwd=admin',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT into MonitorPresets VALUES (NULL,'ACTi IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','',7070,'','/track',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp?videocodec=h264',NULL,NULL,NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Vivotek FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://:554/live.sdp',NULL,NULL,NULL,352,240,NULL,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Axis FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp:///axis-media/media.amp',NULL,NULL,NULL,640,480,NULL,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'ACTi TCM FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,'rtsp://admin:123456@:7070',NULL,NULL,NULL,320,240,NULL,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 320x240','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 320x240, max 5 FPS','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 640x480','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), PAL, 640x480, max 5 FPS','Local','/dev/video',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 320x240','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 320x240, max 5 FPS','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 640x480','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L2), NTSC, 640x480, max 5 FPS','Local','/dev/video',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 320x240','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 320x240, max 5 FPS','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 640x480','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), PAL, 640x480, max 5 FPS','Local','/dev/video',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 320x240','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 320x240, max 5 FPS','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 640x480','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'BTTV Video (V4L1), NTSC, 640x480, max 5 FPS','Local','/dev/video',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Foscam FI8620 FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://:@:554/11',NULL,704,576,0,NULL,1,'10','','',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Foscam FI8608W FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://:@:554/11',NULL,640,480,0,NULL,1,'11','','',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Foscam FI9821W FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://:@:88/videoMain',NULL,1280,720,0,NULL,1,'12','','',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Loftek Sentinel PTZ, 640x480, mjpeg','Remote','http',0,0,NULL,NULL,'','80','/videostream.cgi?user=&pwd=&resolution=32&rate=11',NULL,640,480,4,NULL,1,'13','',':@',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Airlink 777W PTZ, 640x480, mjpeg','Remote','http',0,0,NULL,NULL,':@','80','/cgi/mjpg/mjpg.cgi',NULL,640,480,4,NULL,1,'7','',':@',100,100); -INSERT INTO MonitorPresets VALUES (NULL,'SunEyes SP-P1802SWPTZ','Libvlc','/dev/video','0',255,'','rtpMulti','','80','rtsp://:554/11','',1920,1080,0,0.00,1,'16','-speed=64',':',100,33); -INSERT INTO MonitorPresets VALUES (NULL,'Qihan IP, 1280x720, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp',NULL,554,'rtsp:///tcp_live/ch0_0',NULL,1280,720,3,NULL,0,NULL,NULL,NULL,100,100); -INSERT INTO MonitorPresets VALUES (NULL,'Qihan IP, 1920x1080, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp',NULL,554,'rtsp:///tcp_live/ch0_0',NULL,1920,1080,3,NULL,0,NULL,NULL,NULL,100,100); - --- --- Add some zone preset values --- -INSERT INTO ZonePresets VALUES (1,'Default','Active','Percent','Blobs',25,NULL,3,75,3,3,3,75,2,NULL,1,NULL,0,0); -INSERT INTO ZonePresets VALUES (2,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0); -INSERT INTO ZonePresets VALUES (3,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0); -INSERT INTO ZonePresets VALUES (4,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0); -INSERT INTO ZonePresets VALUES (5,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL,0,0); -INSERT INTO ZonePresets VALUES (6,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL,0,0); -INSERT INTO ZonePresets VALUES (7,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL,0,0); - -DROP TABLE IF EXISTS Maps; - -CREATE TABLE Maps ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` VARCHAR(64) NOT NULL, - `Filename` VARCHAR(64) NOT NULL default '', - `NumCoords` tinyint(3) unsigned NOT NULL default '0', - `Coords` tinytext NOT NULL, - `ParentId` int(1) unsigned, - PRIMARY KEY (`Id`) -); - -DROP TABLE IF EXISTS MontageLayouts; - -CREATE TABLE MontageLayouts ( - `Id` int(10) unsigned NOT NULL auto_increment, - `Name` TEXT NOT NULL, - `Positions` LONGTEXT, - /*`Positions` JSON,*/ - PRIMARY KEY (`Id`) -); - -INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('Freeform', '{ "default":{"float":"left","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); -INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('2 Wide', '{ "default":{"float":"left", "width":"49%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); -INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('3 Wide', '{ "default":{"float":"left", "width":"33%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); -INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('4 Wide', '{ "default":{"float":"left", "width":"24.5%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); -INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('5 Wide', '{ "default":{"float":"left", "width":"19%","left":"0px","right":"0px","top":"0px","bottom":"0px"} }' ); - --- We generally don't alter triggers, we drop and re-create them, so let's keep them in a separate file that we can just source in update scripts. -source /usr/local/share/zoneminder/db/triggers.sql --- --- Apply the initial configuration --- --- This section is autogenerated by zmconfgen.pl --- Do not edit this file as any changes will be overwritten --- - -delete from Config; - -insert into Config set Id = 0, Name = 'ZM_SKIN_DEFAULT', Value = 'classic', Type = 'string', DefaultValue = 'classic', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default skin used by web interface', Help = ' - ZoneMinder allows the use of many different web interfaces. - This option allows you to set the default skin used by the - website. Users can change their skin later, this merely sets - the default. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 1, Name = 'ZM_CSS_DEFAULT', Value = 'classic', Type = 'string', DefaultValue = 'classic', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default set of css files used by web interface', Help = ' - ZoneMinder allows the use of many different web interfaces, and - some skins allow the use of different set of CSS files to - control the appearance. This option allows you to set the - default set of css files used by the website. Users can change - their css later, this merely sets the default. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 2, Name = 'ZM_BANDWIDTH_DEFAULT', Value = 'high', Type = 'string', DefaultValue = 'high', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default setting for bandwidth profile used by web interface', Help = 'The classic skin for ZoneMinder has different - profiles to use for low medium or high bandwidth connections. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 3, Name = 'ZM_LANG_DEFAULT', Value = 'en_gb', Type = 'string', DefaultValue = 'en_gb', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Default language used by web interface', Help = ' - ZoneMinder allows the web interface to use languages other than - English if the appropriate language file has been created and - is present. This option allows you to change the default - language that is used from the shipped language, British - English, to another language - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 4, Name = 'ZM_OPT_USE_AUTH', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Authenticate user logins to ZoneMinder', Help = ' - ZoneMinder can run in two modes. The simplest is an entirely - unauthenticated mode where anyone can access ZoneMinder and - perform all tasks. This is most suitable for installations - where the web server access is limited in other ways. The other - mode enables user accounts with varying sets of permissions. - Users must login or authenticate to access ZoneMinder and are - limited by their defined permissions. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 5, Name = 'ZM_AUTH_TYPE', Value = 'builtin', Type = 'string', DefaultValue = 'builtin', Hint = 'builtin|remote', Pattern = '(?^i:^([br]))', Format = ' $1 =~ /^b/ ? \'builtin\' : \'remote\' ', Prompt = 'What is used to authenticate ZoneMinder users', Help = ' - ZoneMinder can use two methods to authenticate users when - running in authenticated mode. The first is a builtin method - where ZoneMinder provides facilities for users to log in and - maintains track of their identity. The second method allows - interworking with other methods such as http basic - authentication which passes an independently authentication - \'remote\' user via http. In this case ZoneMinder would use the - supplied user without additional authentication provided such a - user is configured ion ZoneMinder. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; -insert into Config set Id = 6, Name = 'ZM_AUTH_RELAY', Value = 'hashed', Type = 'string', DefaultValue = 'hashed', Hint = 'hashed|plain|none', Pattern = '(?^i:^([hpn]))', Format = ' ($1 =~ /^h/) ? \'hashed\' : ($1 =~ /^p/ ? \'plain\' : \'none\' ) ', Prompt = 'Method used to relay authentication information', Help = ' - When ZoneMinder is running in authenticated mode it can pass - user details between the web pages and the back end processes. - There are two methods for doing this. This first is to use a - time limited hashed string which contains no direct username or - password details, the second method is to pass the username and - passwords around in plaintext. This method is not recommend - except where you do not have the md5 libraries available on - your system or you have a completely isolated system with no - external access. You can also switch off authentication - relaying if your system is isolated in other ways. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; -insert into Config set Id = 7, Name = 'ZM_AUTH_HASH_SECRET', Value = '...Change me to something unique...', Type = 'string', DefaultValue = '...Change me to something unique...', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Secret for encoding hashed authentication information', Help = ' - When ZoneMinder is running in hashed authenticated mode it is - necessary to generate hashed strings containing encrypted - sensitive information such as usernames and password. Although - these string are reasonably secure the addition of a random - secret increases security substantially. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; -insert into Config set Id = 8, Name = 'ZM_AUTH_HASH_IPS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Include IP addresses in the authentication hash', Help = ' - When ZoneMinder is running in hashed authenticated mode it can - optionally include the requesting IP address in the resultant - hash. This adds an extra level of security as only requests - from that address may use that authentication key. However in - some circumstances, such as access over mobile networks, the - requesting address can change for each request which will cause - most requests to fail. This option allows you to control - whether IP addresses are included in the authentication hash on - your system. If you experience intermitent problems with - authentication, switching this option off may help. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; -insert into Config set Id = 9, Name = 'ZM_AUTH_HASH_TTL', Value = '2', Type = 'integer', DefaultValue = '2', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The number of hours that an authentication hash is valid for.', Help = ' - The default has traditionally been 2 hours. A new hash will - automatically be regenerated at half this value. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; -insert into Config set Id = 10, Name = 'ZM_AUTH_HASH_LOGINS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Allow login by authentication hash', Help = ' - The normal process for logging into ZoneMinder is via the login - screen with username and password. In some circumstances it may - be desirable to allow access directly to one or more pages, for - instance from a third party application. If this option is - enabled then adding an \'auth\' parameter to any request will - include a shortcut login bypassing the login screen, if not - already logged in. As authentication hashes are time and, - optionally, IP limited this can allow short-term access to - ZoneMinder screens from other web pages etc. In order to use - this the calling application will have to generate the - authentication hash itself and ensure it is valid. If you use - this option you should ensure that you have modified the - ZM_AUTH_HASH_SECRET to something unique to your system. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1;ZM_AUTH_RELAY=hashed'; -insert into Config set Id = 11, Name = 'ZM_ENABLE_CSRF_MAGIC', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Enable csrf-magic library', Help = ' - CSRF stands for Cross-Site Request Forgery which, under specific - circumstances, can allow an attacker to perform any task your - ZoneMinder user account has permission to perform. To accomplish - this, the attacker must write a very specific web page and get - you to navigate to it, while you are logged into the ZoneMinder - web console at the same time. Enabling ZM_ENABLE_CSRF_MAGIC will - help mitigate these kinds of attackes. Be warned this feature - is experimental and may cause problems, particularly with the API. - If you find a false positive and can document how to reproduce it, - then please report it. This feature defaults to OFF currently due to - its experimental nature. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 12, Name = 'ZM_OPT_USE_API', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Enable ZoneMinder APIs', Help = ' - ZoneMinder now features a new API using which 3rd party - applications can interact with ZoneMinder data. It is - STRONGLY recommended that you enable authentication along - with APIs. Note that the APIs return sensitive data like - Monitor access details which are configured as JSON objects. - Which is why we recommend you enabling authentication, especially - if you are exposing your ZM instance on the Internet. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 13, Name = 'ZM_OPT_USE_EVENTNOTIFICATION', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Enable 3rd party Event Notification Server', Help = ' - zmeventnotification is a 3rd party event notification server - that is used to get notifications for alarms detected by ZoneMinder - in real time. zmNinja requires this server for push notifications to - mobile phones. This option only enables the server if its already installed. - Please visit the [zmeventserver project site](https://github.com/pliablepixels/zmeventserver) - for installation instructions. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 14, Name = 'ZM_OPT_USE_GOOG_RECAPTCHA', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Add Google reCaptcha to login page', Help = ' - This option allows you to include a google - reCaptcha validation at login. This means in addition to providing - a valid usernane and password, you will also have to - pass the reCaptcha test. Please note that enabling this - option results in the zoneminder login page reach out - to google servers for captcha validation. Also please note - that enabling this option will break 3rd party clients - like zmNinja and zmView as they also need to login to ZoneMinder - and they will fail the reCaptcha test. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_AUTH=1'; -insert into Config set Id = 15, Name = 'ZM_OPT_GOOG_RECAPTCHA_SITEKEY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Your recaptcha site-key', Help = 'You need to generate your keys from - the Google reCaptcha website. - Please refer to the [recaptcha project site](https://www.google.com/recaptcha/) - for more details. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_GOOG_RECAPTCHA=1'; -insert into Config set Id = 16, Name = 'ZM_OPT_GOOG_RECAPTCHA_SECRETKEY', Value = '...Insert your recaptcha secret-key here...', Type = 'string', DefaultValue = '...Insert your recaptcha secret-key here...', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Your recaptcha secret-key', Help = 'You need to generate your keys from - the Google reCaptcha website. - Please refer to the [recaptcha project site](https://www.google.com/recaptcha/) - for more details. - ', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_USE_GOOG_RECAPTCHA=1'; -insert into Config set Id = 17, Name = 'ZM_USE_DEEP_STORAGE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a deep filesystem hierarchy for events', Help = ' - This option is now the default for new ZoneMinder systems and - should not be changed. Previous versions of ZoneMinder stored - all events for a monitor under one folder. Enabling - USE_DEEP_STORAGE causes ZoneMinder to store events under a - folder structure that follows year/month/day/hour/min/second. - Storing events this way avoids the limitation of storing more - than 32k files in a single folder inherent in some filesystems. - It is important to note that you cannot simply change this - option. You must stop zoneminder, enable USE_DEEP_STORAGE, and - then run \"sudo zmupdate.pl --migrate-events\". FAILURE TO DO - SO WILL RESULT IN LOSS OF YOUR DATA! Consult the ZoneMinder - WiKi for further details. - ', Category = 'hidden', Readonly = '0', Requires = ''; -insert into Config set Id = 18, Name = 'ZM_COLOUR_JPEG_FILES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Colourise greyscale JPEG files', Help = ' - Cameras that capture in greyscale can write their captured - images to jpeg files with a corresponding greyscale colour - space. This saves a small amount of disk space over colour - ones. However some tools such as ffmpeg either fail to work - with this colour space or have to convert it beforehand. - Setting this option to yes uses up a little more space but - makes creation of MPEG files much faster. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 19, Name = 'ZM_ADD_JPEG_COMMENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Add jpeg timestamp annotations as file header comments', Help = ' - JPEG files may have a number of extra fields added to the file - header. The comment field may have any kind of text added. This - options allows you to have the same text that is used to - annotate the image additionally included as a file header - comment. If you archive event images to other locations this - may help you locate images for particular events or times if - you use software that can read comment headers. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 20, Name = 'ZM_JPEG_FILE_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the saved event files (1-100)', Help = ' - When ZoneMinder detects an event it will save the images - associated with that event to files. These files are in the - JPEG format and can be viewed or streamed later. This option - specifies what image quality should be used to save these - files. A higher number means better quality but less - compression so will take up more disk space and take longer to - view over a slow connection. By contrast a low number means - smaller, quicker to view, files but at the price of lower - quality images. This setting applies to all images written - except if the capture image has caused an alarm and the alarm - file quality option is set at a higher value when that is used - instead. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 21, Name = 'ZM_JPEG_ALARM_FILE_QUALITY', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the saved event files during an alarm (1-100)', Help = ' - This value is equivalent to the regular jpeg file quality - setting above except that it only applies to images saved while - in an alarm state and then only if this value is set to a - higher quality setting than the ordinary file setting. If set - to a lower value then it is ignored. Thus leaving it at the - default of 0 effectively means to use the regular file quality - setting for all saved images. This is to prevent acccidentally - saving important images at a worse quality setting. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 22, Name = 'ZM_JPEG_IMAGE_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the streamed \'live\' images (1-100)', Help = ' - When viewing a \'live\' stream for a monitor ZoneMinder will grab - an image from the buffer and encode it into JPEG format before - sending it. This option specifies what image quality should be - used to encode these images. A higher number means better - quality but less compression so will take longer to view over a - slow connection. By contrast a low number means quicker to view - images but at the price of lower quality images. This option - does not apply when viewing events or still images as these are - usually just read from disk and so will be encoded at the - quality specified by the previous options. - ', Category = 'hidden', Readonly = '0', Requires = ''; -insert into Config set Id = 23, Name = 'ZM_JPEG_STREAM_QUALITY', Value = '70', Type = 'integer', DefaultValue = '70', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Set the JPEG quality setting for the streamed \'live\' images (1-100)', Help = ' - When viewing a \'live\' stream for a monitor ZoneMinder will grab - an image from the buffer and encode it into JPEG format before - sending it. This option specifies what image quality should be - used to encode these images. A higher number means better - quality but less compression so will take longer to view over a - slow connection. By contrast a low number means quicker to view - images but at the price of lower quality images. This option - does not apply when viewing events or still images as these are - usually just read from disk and so will be encoded at the - quality specified by the previous options. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 24, Name = 'ZM_MPEG_TIMED_FRAMES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Tag video frames with a timestamp for more realistic streaming', Help = ' - When using streamed MPEG based video, either for live monitor - streams or events, ZoneMinder can send the streams in two ways. - If this option is selected then the timestamp for each frame, - taken from it\'s capture time, is included in the stream. This - means that where the frame rate varies, for instance around an - alarm, the stream will still maintain it\'s \'real\' timing. If - this option is not selected then an approximate frame rate is - calculated and that is used to schedule frames instead. This - option should be selected unless you encounter problems with - your preferred streaming method. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 25, Name = 'ZM_MPEG_LIVE_FORMAT', Value = 'swf', Type = 'string', DefaultValue = 'swf', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What format \'live\' video streams are played in', Help = ' - When using MPEG mode ZoneMinder can output live video. However - what formats are handled by the browser varies greatly between - machines. This option allows you to specify a video format - using a file extension format, so you would just enter the - extension of the file type you would like and the rest is - determined from that. The default of \'asf\' works well under - Windows with Windows Media Player but I\'m currently not sure - what, if anything, works on a Linux platform. If you find out - please let me know! If this option is left blank then live - streams will revert to being in motion jpeg format - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 26, Name = 'ZM_MPEG_REPLAY_FORMAT', Value = 'swf', Type = 'string', DefaultValue = 'swf', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What format \'replay\' video streams are played in', Help = ' - When using MPEG mode ZoneMinder can replay events in encoded - video format. However what formats are handled by the browser - varies greatly between machines. This option allows you to - specify a video format using a file extension format, so you - would just enter the extension of the file type you would like - and the rest is determined from that. The default of \'asf\' - works well under Windows with Windows Media Player and \'mpg\', - or \'avi\' etc should work under Linux. If you know any more then - please let me know! If this option is left blank then live - streams will revert to being in motion jpeg format - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 27, Name = 'ZM_RAND_STREAM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Add a random string to prevent caching of streams', Help = ' - Some browsers can cache the streams used by ZoneMinder. In - order to prevent this a harmless random string can be appended - to the url to make each invocation of the stream appear unique. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 28, Name = 'ZM_OPT_CAMBOZOLA', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Is the (optional) cambozola java streaming client installed', Help = ' - Cambozola is a handy low fat cheese flavoured Java applet that - ZoneMinder uses to view image streams on browsers such as - Internet Explorer that don\'t natively support this format. If - you use this browser it is highly recommended to install this - from the [cambozola project site](http://www.charliemouse.com/code/cambozola/). - However, if it is not installed still images at a lower refresh rate can - still be viewed. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 29, Name = 'ZM_PATH_CAMBOZOLA', Value = 'cambozola.jar', Type = 'string', DefaultValue = 'cambozola.jar', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'Web path to (optional) cambozola java streaming client', Help = ' - Cambozola is a handy low fat cheese flavoured Java applet that - ZoneMinder uses to view image streams on browsers such as - Internet Explorer that don\'t natively support this format. If - you use this browser it is highly recommended to install this - from the [cambozola project site](http://www.charliemouse.com/code/cambozola/). - However if it is not installed still images at a lower refresh rate can - still be viewed. Leave this as \'cambozola.jar\' if cambozola is - installed in the same directory as the ZoneMinder web client - files. - ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_CAMBOZOLA=1'; -insert into Config set Id = 30, Name = 'ZM_RELOAD_CAMBOZOLA', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'After how many seconds should Cambozola be reloaded in live view', Help = ' - Cambozola allows for the viewing of streaming MJPEG however it - caches the entire stream into cache space on the computer, - setting this to a number > 0 will cause it to automatically - reload after that many seconds to avoid filling up a hard - drive. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 31, Name = 'ZM_TIMESTAMP_ON_CAPTURE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Timestamp images as soon as they are captured', Help = ' - ZoneMinder can add a timestamp to images in two ways. The - default method, when this option is set, is that each image is - timestamped immediately when captured and so the image held in - memory is marked right away. The second method does not - timestamp the images until they are either saved as part of an - event or accessed over the web. The timestamp used in both - methods will contain the same time as this is preserved along - with the image. The first method ensures that an image is - timestamped regardless of any other circumstances but will - result in all images being timestamped even those never saved - or viewed. The second method necessitates that saved images are - copied before being saved otherwise two timestamps perhaps at - different scales may be applied. This has the (perhaps) - desirable side effect that the timestamp is always applied at - the same resolution so an image that has scaling applied will - still have a legible and correctly scaled timestamp. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 32, Name = 'ZM_TIMESTAMP_CODE_CHAR', Value = '%', Type = 'string', DefaultValue = '%', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Character to used to identify timestamp codes', Help = ' - There are a few codes one can use to tell ZoneMinder to insert - data into the timestamp of each image. Traditionally, the - percent (%) character has been used to identify these codes since - the current character codes do not conflict with the strftime - codes, which can also be used in the timestamp. While this works - well for Linux, this does not work well for BSD operating systems. - Changing the default character to something else, such as an - exclamation point (!), resolves the issue. Note this only affects - the timestamp codes built into ZoneMinder. It has no effect on - the family of strftime codes one can use. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 33, Name = 'ZM_CPU_EXTENSIONS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use advanced CPU extensions to increase performance', Help = ' - When advanced processor extensions such as SSE2 or SSSE3 are - available, ZoneMinder can use them, which should increase - performance and reduce system load. Enabling this option on - processors that do not support the advanced processors - extensions used by ZoneMinder is harmless and will have no - effect. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 34, Name = 'ZM_FAST_IMAGE_BLENDS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a fast algorithm to blend the reference image', Help = ' - To detect alarms ZoneMinder needs to blend the captured image - with the stored reference image to update it for comparison - with the next image. The reference blend percentage specified - for the monitor controls how much the new image affects the - reference image. There are two methods that are available for - this. If this option is set then fast calculation which does - not use any multiplication or division is used. This - calculation is extremely fast, however it limits the possible - blend percentages to 50%, 25%, 12.5%, 6.25%, 3.25% and 1.5%. - Any other blend percentage will be rounded to the nearest - possible one. The alternative is to switch this option off - and use standard blending instead, which is slower. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 35, Name = 'ZM_OPT_ADAPTIVE_SKIP', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should frame analysis try and be efficient in skipping frames', Help = ' - In previous versions of ZoneMinder the analysis daemon would - attempt to keep up with the capture daemon by processing the - last captured frame on each pass. This would sometimes have the - undesirable side-effect of missing a chunk of the initial - activity that caused the alarm because the pre-alarm frames - would all have to be written to disk and the database before - processing the next frame, leading to some delay between the - first and second event frames. Setting this option enables a - newer adaptive algorithm where the analysis daemon attempts to - process as many captured frames as possible, only skipping - frames when in danger of the capture daemon overwriting yet to - be processed frames. This skip is variable depending on the - size of the ring buffer and the amount of space left in it. - Enabling this option will give you much better coverage of the - beginning of alarms whilst biasing out any skipped frames - towards the middle or end of the event. However you should be - aware that this will have the effect of making the analysis - daemon run somewhat behind the capture daemon during events and - for particularly fast rates of capture it is possible for the - adaptive algorithm to be overwhelmed and not have time to react - to a rapid build up of pending frames and thus for a buffer - overrun condition to occur. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 36, Name = 'ZM_MAX_SUSPEND_TIME', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum time that a monitor may have motion detection suspended', Help = ' - ZoneMinder allows monitors to have motion detection to be - suspended, for instance while panning a camera. Ordinarily this - relies on the operator resuming motion detection afterwards as - failure to do so can leave a monitor in a permanently suspended - state. This setting allows you to set a maximum time which a - camera may be suspended for before it automatically resumes - motion detection. This time can be extended by subsequent - suspend indications after the first so continuous camera - movement will also occur while the monitor is suspended. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 37, Name = 'ZM_OPT_REMOTE_CAMERAS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Are you going to use remote/networked cameras', Help = ' - ZoneMinder can work with both local cameras, ie. those attached - physically to your computer and remote or network cameras. If - you will be using networked cameras select this option. - ', Category = 'hidden', Readonly = '0', Requires = ''; -insert into Config set Id = 38, Name = 'ZM_NETCAM_REGEXPS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use regular expression matching with network cameras', Help = ' - Traditionally ZoneMinder has used complex regular regular - expressions to handle the multitude of formats that network - cameras produce. In versions from 1.21.1 the default is to use - a simpler and faster built in pattern matching methodology. - This works well with most networks cameras but if you have - problems you can try the older, but more flexible, regular - expression based method by selecting this option. Note, to use - this method you must have libpcre installed on your system. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_REMOTE_CAMERAS=1'; -insert into Config set Id = 39, Name = 'ZM_HTTP_VERSION', Value = '1.0', Type = 'string', DefaultValue = '1.0', Hint = '1.1|1.0', Pattern = '(?^:^(1\.[01])$)', Format = ' $1?$1:\'\' ', Prompt = 'The version of HTTP that ZoneMinder will use to connect', Help = ' - ZoneMinder can communicate with network cameras using either of - the HTTP/1.1 or HTTP/1.0 standard. A server will normally fall - back to the version it supports with no problem so this should - usually by left at the default. However it can be changed to - HTTP/1.0 if necessary to resolve particular issues. - ', Category = 'network', Readonly = '0', Requires = ''; -insert into Config set Id = 40, Name = 'ZM_HTTP_UA', Value = 'ZoneMinder', Type = 'string', DefaultValue = 'ZoneMinder', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The user agent that ZoneMinder uses to identify itself', Help = ' - When ZoneMinder communicates with remote cameras it will - identify itself using this string and it\'s version number. This - is normally sufficient, however if a particular cameras expects - only to communicate with certain browsers then this can be - changed to a different string identifying ZoneMinder as - Internet Explorer or Netscape etc. - ', Category = 'network', Readonly = '0', Requires = ''; -insert into Config set Id = 41, Name = 'ZM_HTTP_TIMEOUT', Value = '2500', Type = 'integer', DefaultValue = '2500', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long ZoneMinder waits before giving up on images (milliseconds)', Help = ' - When retrieving remote images ZoneMinder will wait for this - length of time before deciding that an image is not going to - arrive and taking steps to retry. This timeout is in - milliseconds (1000 per second) and will apply to each part of - an image if it is not sent in one whole chunk. - ', Category = 'network', Readonly = '0', Requires = ''; -insert into Config set Id = 42, Name = 'ZM_MIN_STREAMING_PORT', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Alternate port range to contact for streaming video.', Help = ' - Due to browsers only wanting to open 6 connections, if you have more - than 6 monitors, you can have trouble viewing more than 6. This setting - specified the beginning of a port range that will be used to contact ZM - on. Each monitor will use this value plus the Monitor Id to stream - content. So a value of 2000 here will cause a stream for Monitor 1 to - hit port 2001. Please ensure that you configure apache appropriately - to respond on these ports.', Category = 'network', Readonly = '0', Requires = ''; -insert into Config set Id = 43, Name = 'ZM_MIN_RTP_PORT', Value = '40200', Type = 'integer', DefaultValue = '40200', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Minimum port that ZoneMinder will listen for RTP traffic on', Help = ' - When ZoneMinder communicates with MPEG4 capable cameras using - RTP with the unicast method it must open ports for the camera - to connect back to for control and streaming purposes. This - setting specifies the minimum port number that ZoneMinder will - use. Ordinarily two adjacent ports are used for each camera, - one for control packets and one for data packets. This port - should be set to an even number, you may also need to open up a - hole in your firewall to allow cameras to connect back if you - wish to use unicasting. - ', Category = 'network', Readonly = '0', Requires = ''; -insert into Config set Id = 44, Name = 'ZM_MAX_RTP_PORT', Value = '40499', Type = 'integer', DefaultValue = '40499', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum port that ZoneMinder will listen for RTP traffic on', Help = ' - When ZoneMinder communicates with MPEG4 capable cameras using - RTP with the unicast method it must open ports for the camera - to connect back to for control and streaming purposes. This - setting specifies the maximum port number that ZoneMinder will - use. Ordinarily two adjacent ports are used for each camera, - one for control packets and one for data packets. This port - should be set to an even number, you may also need to open up a - hole in your firewall to allow cameras to connect back if you - wish to use unicasting. You should also ensure that you have - opened up at least two ports for each monitor that will be - connecting to unicasting network cameras. - ', Category = 'network', Readonly = '0', Requires = ''; -insert into Config set Id = 45, Name = 'ZM_OPT_FFMPEG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Is the ffmpeg video encoder/decoder installed', Help = ' - ZoneMinder can optionally encode a series of video images into - an MPEG encoded movie file for viewing, downloading or storage. - This option allows you to specify whether you have the ffmpeg - tools installed. Note that creating MPEG files can be fairly - CPU and disk intensive and is not a required option as events - can still be reviewed as video streams without it. - ', Category = 'images', Readonly = '0', Requires = ''; -insert into Config set Id = 46, Name = 'ZM_PATH_FFMPEG', Value = '/usr/bin/ffmpeg', Type = 'string', DefaultValue = '/usr/bin/ffmpeg', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to (optional) ffmpeg mpeg encoder', Help = 'This path should point to where ffmpeg has been installed.', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; -insert into Config set Id = 47, Name = 'ZM_FFMPEG_INPUT_OPTIONS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Additional input options to ffmpeg', Help = ' - Ffmpeg can take many options on the command line to control the - quality of video produced. This option allows you to specify - your own set that apply to the input to ffmpeg (options that - are given before the -i option). Check the ffmpeg documentation - for a full list of options which may be used here. - ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; -insert into Config set Id = 48, Name = 'ZM_FFMPEG_OUTPUT_OPTIONS', Value = '-r 25', Type = 'string', DefaultValue = '-r 25', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Additional output options to ffmpeg', Help = ' - Ffmpeg can take many options on the command line to control the - quality of video produced. This option allows you to specify - your own set that apply to the output from ffmpeg (options that - are given after the -i option). Check the ffmpeg documentation - for a full list of options which may be used here. The most - common one will often be to force an output frame rate - supported by the video encoder. - ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; -insert into Config set Id = 49, Name = 'ZM_FFMPEG_FORMATS', Value = 'mpg mpeg wmv asf avi* mov swf 3gp**', Type = 'string', DefaultValue = 'mpg mpeg wmv asf avi* mov swf 3gp**', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Formats to allow for ffmpeg video generation', Help = ' - Ffmpeg can generate video in many different formats. This - option allows you to list the ones you want to be able to - select. As new formats are supported by ffmpeg you can add them - here and be able to use them immediately. Adding a \'*\' after a - format indicates that this will be the default format used for - web video, adding \'**\' defines the default format for phone - video. - ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; -insert into Config set Id = 50, Name = 'ZM_FFMPEG_OPEN_TIMEOUT', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Timeout in seconds when opening a stream.', Help = ' - When Ffmpeg is opening a stream, it can take a long time before - failing; certain circumstances even seem to be able to lock - indefinitely. This option allows you to set a maximum time in - seconds to pass before closing the stream and trying to reopen - it again. - ', Category = 'images', Readonly = '0', Requires = 'ZM_OPT_FFMPEG=1'; -insert into Config set Id = 51, Name = 'ZM_LOG_LEVEL_SYSLOG', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the system log', Help = ' - ZoneMinder logging is now more more integrated between - components and allows you to specify the destination for - logging output and the individual levels for each. This option - lets you control the level of logging output that goes to the - system log. ZoneMinder binaries have always logged to the - system log but now scripts and web logging is also included. To - preserve the previous behaviour you should ensure this value is - set to Info or Warning. This option controls the maximum level - of logging that will be written, so Info includes Warnings and - Errors etc. To disable entirely, set this option to None. You - should use caution when setting this option to Debug as it can - affect severely affect system performance. If you want debug - you will also need to set a level and component below - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 52, Name = 'ZM_LOG_LEVEL_FILE', Value = '-5', Type = 'integer', DefaultValue = '-5', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to component files', Help = ' - ZoneMinder logging is now more more integrated between - components and allows you to specify the destination for - logging output and the individual levels for each. This option - lets you control the level of logging output that goes to - individual log files written by specific components. This is - how logging worked previously and although useful for tracking - down issues in specific components it also resulted in many - disparate log files. To preserve this behaviour you should - ensure this value is set to Info or Warning. This option - controls the maximum level of logging that will be written, so - Info includes Warnings and Errors etc. To disable entirely, set - this option to None. You should use caution when setting this - option to Debug as it can affect severely affect system - performance though file output has less impact than the other - options. If you want debug you will also need to set a level - and component below - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 53, Name = 'ZM_LOG_LEVEL_WEBLOG', Value = '-5', Type = 'integer', DefaultValue = '-5', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the weblog', Help = ' - ZoneMinder logging is now more more integrated between - components and allows you to specify the destination for - logging output and the individual levels for each. This option - lets you control the level of logging output from the web - interface that goes to the httpd error log. Note that only web - logging from PHP and JavaScript files is included and so this - option is really only useful for investigating specific issues - with those components. This option controls the maximum level - of logging that will be written, so Info includes Warnings and - Errors etc. To disable entirely, set this option to None. You - should use caution when setting this option to Debug as it can - affect severely affect system performance. If you want debug - you will also need to set a level and component below - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 54, Name = 'ZM_LOG_LEVEL_DATABASE', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'None=-5|Panic=-4|Fatal=-3|Error=-2|Warning=-1|Info=0|Debug=1', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Save logging output to the database', Help = ' - ZoneMinder logging is now more more integrated between - components and allows you to specify the destination for - logging output and the individual levels for each. This option - lets you control the level of logging output that is written to - the database. This is a new option which can make viewing - logging output easier and more intuitive and also makes it - easier to get an overall impression of how the system is - performing. If you have a large or very busy system then it is - possible that use of this option may slow your system down if - the table becomes very large. Ensure you use the - LOG_DATABASE_LIMIT option to keep the table to a manageable - size. This option controls the maximum level of logging that - will be written, so Info includes Warnings and Errors etc. To - disable entirely, set this option to None. You should use - caution when setting this option to Debug as it can affect - severely affect system performance. If you want debug you will - also need to set a level and component below - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 55, Name = 'ZM_LOG_DATABASE_LIMIT', Value = '7 day', Type = 'string', DefaultValue = '7 day', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Maximum number of log entries to retain', Help = ' - If you are using database logging then it is possible to - quickly build up a large number of entries in the Logs table. - This option allows you to specify how many of these entries are - kept. If you set this option to a number greater than zero then - that number is used to determine the maximum number of rows, - less than or equal to zero indicates no limit and is not - recommended. You can also set this value to time values such as - \' day\' which will limit the log entries to those newer than - that time. You can specify \'hour\', \'day\', \'week\', \'month\' and - \'year\', note that the values should be singular (no \'s\' at the - end). The Logs table is pruned periodically so it is possible - for more than the expected number of rows to be present briefly - in the meantime. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 56, Name = 'ZM_LOG_FFMPEG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Log FFMPEG messages', Help = ' - When enabled (default is on), this option will log FFMPEG messages. - FFMPEG messages can be useful when debugging streaming issues. However, - depending on your distro and FFMPEG version, this may also result in - more logs than you\'d typically like to see. If all your streams are working - well, you may choose to turn this off. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 57, Name = 'ZM_LOG_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Switch debugging on', Help = ' - ZoneMinder components usually support debug logging available - to help with diagnosing problems. Binary components have - several levels of debug whereas more other components have only - one. Normally this is disabled to minimise performance - penalties and avoid filling logs too quickly. This option lets - you switch on other options that allow you to configure - additional debug information to be output. Components will pick - up this instruction when they are restarted. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 58, Name = 'ZM_LOG_DEBUG_TARGET', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What components should have extra debug enabled', Help = ' - There are three scopes of debug available. Leaving this option - blank means that all components will use extra debug (not - recommended). Setting this option to \'_\', e.g. _zmc, - will limit extra debug to that component only. Setting this - option to \'__\', e.g. \'_zmc_m1\' will limit - extra debug to that instance of the component only. This is - ordinarily what you probably want to do. To debug scripts use - their names without the .pl extension, e.g. \'_zmvideo\' and to - debug issues with the web interface use \'_web\'. You can specify - multiple targets by separating them with \'|\' characters. - ', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; -insert into Config set Id = 59, Name = 'ZM_LOG_DEBUG_LEVEL', Value = '1', Type = 'integer', DefaultValue = '1', Hint = '1|2|3|4|5|6|7|8|9', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What level of extra debug should be enabled', Help = ' - There are 9 levels of debug available, with higher numbers - being more debug and level 0 being no debug. However not all - levels are used by all components. Also if there is debug at a - high level it is usually likely to be output at such a volume - that it may obstruct normal operation. For this reason you - should set the level carefully and cautiously until the degree - of debug you wish to see is present. Scripts and the web - interface only have one level so this is an on/off type option - for them. - ', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; -insert into Config set Id = 60, Name = 'ZM_LOG_DEBUG_FILE', Value = '/var/log/zm/zm_debug.log+', Type = 'string', DefaultValue = '/var/log/zm/zm_debug.log+', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Where extra debug is output to', Help = ' - This option allows you to specify a different target for debug - output. All components have a default log file which will - norally be in /tmp or /var/log and this is where debug will be - written to if this value is empty. Adding a path here will - temporarily redirect debug, and other logging output, to this - file. This option is a simple filename and you are debugging - several components then they will all try and write to the same - file with undesirable consequences. Appending a \'+\' to the - filename will cause the file to be created with a \'.\' - suffix containing your process id. In this way debug from each - run of a component is kept separate. This is the recommended - setting as it will also prevent subsequent runs from - overwriting the same log. You should ensure that permissions - are set up to allow writing to the file and directory specified - here. - ', Category = 'logging', Readonly = '0', Requires = 'ZM_LOG_DEBUG=1'; -insert into Config set Id = 61, Name = 'ZM_LOG_CHECK_PERIOD', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Time period used when calculating overall system health', Help = ' - When ZoneMinder is logging events to the database it can - retrospectively examine the number of warnings and errors that - have occurred to calculate an overall state of system health. - This option allows you to indicate what period of historical - events are used in this calculation. This value is expressed in - seconds and is ignored if LOG_LEVEL_DATABASE is set to None. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 62, Name = 'ZM_LOG_ALERT_WAR_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of warnings indicating system alert state', Help = ' - When ZoneMinder is logging events to the database it can - retrospectively examine the number of warnings and errors that - have occurred to calculate an overall state of system health. - This option allows you to specify how many warnings must have - occurred within the defined time period to generate an overall - system alert state. A value of zero means warnings are not - considered. This value is ignored if LOG_LEVEL_DATABASE is set - to None. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 63, Name = 'ZM_LOG_ALERT_ERR_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of errors indicating system alert state', Help = ' - When ZoneMinder is logging events to the database it can - retrospectively examine the number of warnings and errors that - have occurred to calculate an overall state of system health. - This option allows you to specify how many errors must have - occurred within the defined time period to generate an overall - system alert state. A value of zero means errors are not - considered. This value is ignored if LOG_LEVEL_DATABASE is set - to None. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 64, Name = 'ZM_LOG_ALERT_FAT_COUNT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of fatal error indicating system alert state', Help = ' - When ZoneMinder is logging events to the database it can - retrospectively examine the number of warnings and errors that - have occurred to calculate an overall state of system health. - This option allows you to specify how many fatal errors - (including panics) must have occurred within the defined time - period to generate an overall system alert state. A value of - zero means fatal errors are not considered. This value is - ignored if LOG_LEVEL_DATABASE is set to None. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 65, Name = 'ZM_LOG_ALARM_WAR_COUNT', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of warnings indicating system alarm state', Help = ' - When ZoneMinder is logging events to the database it can - retrospectively examine the number of warnings and errors that - have occurred to calculate an overall state of system health. - This option allows you to specify how many warnings must have - occurred within the defined time period to generate an overall - system alarm state. A value of zero means warnings are not - considered. This value is ignored if LOG_LEVEL_DATABASE is set - to None. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 66, Name = 'ZM_LOG_ALARM_ERR_COUNT', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of errors indicating system alarm state', Help = ' - When ZoneMinder is logging events to the database it can - retrospectively examine the number of warnings and errors that - have occurred to calculate an overall state of system health. - This option allows you to specify how many errors must have - occurred within the defined time period to generate an overall - system alarm state. A value of zero means errors are not - considered. This value is ignored if LOG_LEVEL_DATABASE is set - to None. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 67, Name = 'ZM_LOG_ALARM_FAT_COUNT', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Number of fatal error indicating system alarm state', Help = ' - When ZoneMinder is logging events to the database it can - retrospectively examine the number of warnings and errors that - have occurred to calculate an overall state of system health. - This option allows you to specify how many fatal errors - (including panics) must have occurred within the defined time - period to generate an overall system alarm state. A value of - zero means fatal errors are not considered. This value is - ignored if LOG_LEVEL_DATABASE is set to None. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 68, Name = 'ZM_RECORD_EVENT_STATS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Record event statistical information, switch off if too slow', Help = ' - This version of ZoneMinder records detailed information about - events in the Stats table. This can help in profiling what the - optimum settings are for Zones though this is tricky at - present. However in future releases this will be done more - easily and intuitively, especially with a large sample of - events. The default option of \'yes\' allows this information to - be collected now in readiness for this but if you are concerned - about performance you can switch this off in which case no - Stats information will be saved. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 69, Name = 'ZM_RECORD_DIAG_IMAGES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Record intermediate alarm diagnostic images, can be very slow', Help = ' - In addition to recording event statistics you can also record - the intermediate diagnostic images that display the results of - the various checks and processing that occur when trying to - determine if an alarm event has taken place. There are several - of these images generated for each frame and zone for each - alarm or alert frame so this can have a massive impact on - performance. Only switch this setting on for debug or analysis - purposes and remember to switch it off again once no longer - required. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 70, Name = 'ZM_DUMP_CORES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Create core files on unexpected process failure.', Help = ' - When an unrecoverable error occurs in a ZoneMinder binary - process is has traditionally been trapped and the details - written to logs to aid in remote analysis. However in some - cases it is easier to diagnose the error if a core file, which - is a memory dump of the process at the time of the error, is - created. This can be interactively analysed in the debugger and - may reveal more or better information than that available from - the logs. This option is recommended for advanced users only - otherwise leave at the default. Note using this option to - trigger core files will mean that there will be no indication - in the binary logs that a process has died, they will just - stop, however the zmdc log will still contain an entry. Also - note that you may have to explicitly enable core file creation - on your system via the \'ulimit -c\' command or other means - otherwise no file will be created regardless of the value of - this option. - ', Category = 'logging', Readonly = '0', Requires = ''; -insert into Config set Id = 71, Name = 'ZM_WEB_TITLE', Value = 'ZoneMinder', Type = 'string', DefaultValue = 'ZoneMinder', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The title displayed wherever the site references itself.', Help = ' - If you want the site to identify as something other than ZoneMinder, change this here. - It can be used to more accurately identify this installation from others. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 72, Name = 'ZM_WEB_TITLE_PREFIX', Value = 'ZM', Type = 'string', DefaultValue = 'ZM', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The title prefix displayed on each window', Help = ' - If you have more than one installation of ZoneMinder it can be - helpful to display different titles for each one. Changing this - option allows you to customise the window titles to include - further information to aid identification. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 73, Name = 'ZM_HOME_URL', Value = 'http://zoneminder.com', Type = 'string', DefaultValue = 'http://zoneminder.com', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The url used in the home/logo area of the navigation bar.', Help = ' - By default this takes you to the zoneminder.com website, - but perhaps you would prefer it to take you somewhere else. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 74, Name = 'ZM_HOME_CONTENT', Value = 'ZoneMinder', Type = 'string', DefaultValue = 'ZoneMinder', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The content of the home button.', Help = ' - You may wish to set this to empty if you are using css to put a background image on it. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 75, Name = 'ZM_WEB_CONSOLE_BANNER', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Arbitrary text message near the top of the console', Help = ' - Allows the administrator to place an arbitrary text message - near the top of the web console. This is useful for the developers - to display a message which indicates the running instance of - ZoneMinder is a development snapshot, but it can also be used for - any other purpose as well. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 76, Name = 'ZM_WEB_EVENT_DISK_SPACE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Whether to show disk space used by each event.', Help = 'Adds another column to the listing of events - showing the disk space used by the event. This will impart a small - overhead as it will call du on the event directory. In practice - this overhead is fairly small but may be noticeable on IO-constrained - systems. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 77, Name = 'ZM_WEB_RESIZE_CONSOLE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the console window resize itself to fit', Help = ' - Traditionally the main ZoneMinder web console window has - resized itself to shrink to a size small enough to list only - the monitors that are actually present. This is intended to - make the window more unobtrusize but may not be to everyones - tastes, especially if opened in a tab in browsers which support - this kind if layout. Switch this option off to have the console - window size left to the users preference - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 78, Name = 'ZM_WEB_ID_ON_CONSOLE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the console list the monitor id', Help = ' - Some find it useful to have the id always visible - on the console. This option will add a column listing it. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 79, Name = 'ZM_WEB_POPUP_ON_ALARM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the monitor window jump to the top if an alarm occurs', Help = ' - When viewing a live monitor stream you can specify whether you - want the window to pop to the front if an alarm occurs when the - window is minimised or behind another window. This is most - useful if your monitors are over doors for example when they - can pop up if someone comes to the doorway. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 80, Name = 'ZM_OPT_X10', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Support interfacing with X10 devices', Help = ' - If you have an X10 Home Automation setup in your home you can - use ZoneMinder to initiate or react to X10 signals if your - computer has the appropriate interface controller. This option - indicates whether X10 options will be available in the browser - client. - ', Category = 'x10', Readonly = '0', Requires = ''; -insert into Config set Id = 81, Name = 'ZM_X10_DEVICE', Value = '/dev/ttyS0', Type = 'string', DefaultValue = '/dev/ttyS0', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'What device is your X10 controller connected on', Help = ' - If you have an X10 controller device (e.g. XM10U) connected to - your computer this option details which port it is connected on, - the default of /dev/ttyS0 maps to serial or com port 1. - ', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; -insert into Config set Id = 82, Name = 'ZM_X10_HOUSE_CODE', Value = 'A', Type = 'string', DefaultValue = 'A', Hint = 'A-P', Pattern = '(?^i:^([A-P]))', Format = ' uc($1) ', Prompt = 'What X10 house code should be used', Help = ' - X10 devices are grouped together by identifying them as all - belonging to one House Code. This option details what that is. - It should be a single letter between A and P. - ', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; -insert into Config set Id = 83, Name = 'ZM_X10_DB_RELOAD_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the X10 daemon reloads the monitors from the database', Help = ' - The zmx10 daemon periodically checks the database to find out - what X10 events trigger, or result from, alarms. This option - determines how frequently this check occurs, unless you change - this area frequently this can be a fairly large value. - ', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1'; -insert into Config set Id = 84, Name = 'ZM_WEB_SOUND_ON_ALARM', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should the monitor window play a sound if an alarm occurs', Help = ' - When viewing a live monitor stream you can specify whether you - want the window to play a sound to alert you if an alarm - occurs. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 85, Name = 'ZM_WEB_ALARM_SOUND', Value = '', Type = 'string', DefaultValue = '', Hint = 'filename', Pattern = '(?^:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'The sound to play on alarm, put this in the sounds directory', Help = ' - You can specify a sound file to play if an alarm occurs whilst - you are watching a live monitor stream. So long as your browser - understands the format it does not need to be any particular - type. This file should be placed in the sounds directory - defined earlier. - ', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_SOUND_ON_ALARM=1'; -insert into Config set Id = 86, Name = 'ZM_WEB_COMPACT_MONTAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Compact the montage view by removing extra detail', Help = ' - The montage view shows the output of all of your active - monitors in one window. This include a small menu and status - information for each one. This can increase the web traffic and - make the window larger than may be desired. Setting this option - on removes all this extraneous information and just displays - the images. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 87, Name = 'ZM_OPT_FAST_DELETE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Delete only event database records for speed', Help = ' - 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. Note that this feature is less relevant - with modern hardware. Recommend this feature be left off. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 88, Name = 'ZM_STRICT_VIDEO_CONFIG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Allow errors in setting video config to be fatal', Help = ' - With some video devices errors can be reported in setting the - various video attributes when in fact the operation was - successful. Switching this option off will still allow these - errors to be reported but will not cause them to kill the video - capture daemon. Note however that doing this will cause all - errors to be ignored including those which are genuine and - which may cause the video capture to not function correctly. - Use this option with caution. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 89, Name = 'ZM_LD_PRELOAD', Value = '', Type = 'string', DefaultValue = '', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to library to preload before launching daemons', Help = ' - Some older cameras require the use of the v4l1 compat - library. This setting allows the setting of the path - to the library, so that it can be loaded by zmdc.pl - before launching zmc. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 90, Name = 'ZM_V4L_MULTI_BUFFER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use more than one buffer for Video 4 Linux devices', Help = ' - Performance when using Video 4 Linux devices is usually best if - multiple buffers are used allowing the next image to be - captured while the previous one is being processed. If you have - multiple devices on a card sharing one input that requires - switching then this approach can sometimes cause frames from - one source to be mixed up with frames from another. Switching - this option off prevents multi buffering resulting in slower - but more stable image capture. This option is ignored for - non-local cameras or if only one input is present on a capture - chip. This option addresses a similar problem to the - ZM_CAPTURES_PER_FRAME option and you should normally change the - value of only one of the options at a time. If you have - different capture cards that need different values you can - override them in each individual monitor on the source page. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 91, Name = 'ZM_CAPTURES_PER_FRAME', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many images are captured per returned frame, for shared local cameras', Help = ' - If you are using cameras attached to a video capture card which - forces multiple inputs to share one capture chip, it can - sometimes produce images with interlaced frames reversed - resulting in poor image quality and a distinctive comb edge - appearance. Increasing this setting allows you to force - additional image captures before one is selected as the - captured frame. This allows the capture hardware to \'settle - down\' and produce better quality images at the price of lesser - capture rates. This option has no effect on (a) network - cameras, or (b) where multiple inputs do not share a capture - chip. This option addresses a similar problem to the - ZM_V4L_MULTI_BUFFER option and you should normally change the - value of only one of the options at a time. If you have - different capture cards that need different values you can - override them in each individual monitor on the source page. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 92, Name = 'ZM_FILTER_RELOAD_DELAY', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) filters are reloaded in zmfilter', Help = ' - ZoneMinder allows you to save filters to the database which - allow events that match certain criteria to be emailed, deleted - or uploaded to a remote machine etc. The zmfilter daemon loads - these and does the actual operation. This option determines how - often the filters are reloaded from the database to get the - latest versions or new filters. If you don\'t change filters - very often this value can be set to a large value. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 93, Name = 'ZM_FILTER_EXECUTE_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) to run automatic saved filters', Help = ' - ZoneMinder allows you to save filters to the database which - allow events that match certain criteria to be emailed, deleted - or uploaded to a remote machine etc. The zmfilter daemon loads - these and does the actual operation. This option determines how - often the filters are executed on the saved event in the - database. If you want a rapid response to new events this - should be a smaller value, however this may increase the - overall load on the system and affect performance of other - elements. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 94, Name = 'ZM_OPT_UPLOAD', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should ZoneMinder support uploading events from filters', Help = ' - In ZoneMinder you can create event filters that specify whether - events that match certain criteria should be uploaded to a - remote server for archiving. This option specifies whether this - functionality should be available - ', Category = 'upload', Readonly = '0', Requires = ''; -insert into Config set Id = 95, Name = 'ZM_UPLOAD_ARCH_FORMAT', Value = 'tar', Type = 'string', DefaultValue = 'tar', Hint = 'tar|zip', Pattern = '(?^i:^([tz]))', Format = ' $1 =~ /^t/ ? \'tar\' : \'zip\' ', Prompt = 'What format the uploaded events should be created in.', Help = ' - Uploaded events may be stored in either .tar or .zip format, - this option specifies which. Note that to use this you will - need to have the Archive::Tar and/or Archive::Zip perl modules - installed. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 96, Name = 'ZM_UPLOAD_ARCH_COMPRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should archive files be compressed', Help = ' - When the archive files are created they can be compressed. - However in general since the images are compressed already this - saves only a minimal amount of space versus utilising more CPU - in their creation. Only enable if you have CPU to waste and are - limited in disk space on your remote server or bandwidth. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 97, Name = 'ZM_UPLOAD_ARCH_ANALYSE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Include the analysis files in the archive', Help = ' - When the archive files are created they can contain either just - the captured frames or both the captured frames and, for frames - that caused an alarm, the analysed image with the changed area - highlighted. This option controls files are included. Only - include analysed frames if you have a high bandwidth connection - to the remote server or if you need help in figuring out what - caused an alarm in the first place as archives with these files - in can be considerably larger. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 98, Name = 'ZM_UPLOAD_PROTOCOL', Value = 'ftp', Type = 'string', DefaultValue = 'ftp', Hint = 'ftp|sftp', Pattern = '(?^i:^([tz]))', Format = ' $1 =~ /^f/ ? \'ftp\' : \'sftp\' ', Prompt = 'What protocol to use to upload events', Help = ' - ZoneMinder can upload events to a remote server using either - FTP or SFTP. Regular FTP is widely supported but not - necessarily very secure whereas SFTP (Secure FTP) runs over an - ssh connection and so is encrypted and uses regular ssh ports. - Note that to use this you will need to have the appropriate - perl module, either Net::FTP or Net::SFTP installed depending - on your choice. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 99, Name = 'ZM_UPLOAD_FTP_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload to', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote ftp server. This option indicates the name, or ip - address, of the server to use. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 100, Name = 'ZM_UPLOAD_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload events to', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. This option indicates the name, or ip address, - of the server to use. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 101, Name = 'ZM_UPLOAD_PORT', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The port on the remote upload server, if not the default (SFTP only)', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. If you are using the SFTP protocol then this - option allows you to specify a particular port to use for - connection. If this option is left blank then the default, port - 22, is used. This option is ignored for FTP uploads. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 102, Name = 'ZM_UPLOAD_FTP_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?^:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Your ftp username', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote ftp server. This option indicates the username that - ZoneMinder should use to log in for ftp transfer. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 103, Name = 'ZM_UPLOAD_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?^:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Remote server username', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. This option indicates the username that - ZoneMinder should use to log in for transfer. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 104, Name = 'ZM_UPLOAD_FTP_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Your ftp password', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote ftp server. This option indicates the password that - ZoneMinder should use to log in for ftp transfer. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 105, Name = 'ZM_UPLOAD_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Remote server password', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. This option indicates the password that - ZoneMinder should use to log in for transfer. If you are using - certificate based logins for SFTP servers you can leave this - option blank. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 106, Name = 'ZM_UPLOAD_FTP_LOC_DIR', Value = '/var/tmp/zm', Type = 'string', DefaultValue = '/var/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote ftp server. This option indicates the local directory - that ZoneMinder should use for temporary upload files. These - are files that are created from events, uploaded and then - deleted. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 107, Name = 'ZM_UPLOAD_LOC_DIR', Value = '/var/tmp/zm', Type = 'string', DefaultValue = '/var/tmp/zm', Hint = '/absolute/path/to/somewhere', Pattern = '(?^:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. This option indicates the local directory that - ZoneMinder should use for temporary upload files. These are - files that are created from events, uploaded and then deleted. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 108, Name = 'ZM_UPLOAD_FTP_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote ftp server. This option indicates the remote directory - that ZoneMinder should use to upload event files to. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 109, Name = 'ZM_UPLOAD_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?^:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. This option indicates the remote directory - that ZoneMinder should use to upload event files to. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 110, Name = 'ZM_UPLOAD_FTP_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to allow the transfer to take for each file', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote ftp server. This option indicates the maximum ftp - inactivity timeout (in seconds) that should be tolerated before - ZoneMinder determines that the transfer has failed and closes - down the connection. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 111, Name = 'ZM_UPLOAD_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to allow the transfer to take for each file', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. This option indicates the maximum inactivity - timeout (in seconds) that should be tolerated before ZoneMinder - determines that the transfer has failed and closes down the - connection. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 112, Name = 'ZM_UPLOAD_STRICT', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Require strict host key checking for SFTP uploads', Help = ' - You can require SFTP uploads to verify the host key of the remote server - for protection against man-in-the-middle attacks. You will need to add the - server\'s key to the known_hosts file. On most systems, this will be - ~/.ssh/known_hosts, where ~ is the home directory of the web server running - ZoneMinder. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 113, Name = 'ZM_UPLOAD_FTP_PASSIVE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use passive ftp when uploading', Help = ' - If your computer is behind a firewall or proxy you may need to - set FTP to passive mode. In fact for simple transfers it makes - little sense to do otherwise anyway but you can set this to - \'No\' if you wish. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 114, Name = 'ZM_UPLOAD_FTP_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Switch ftp debugging on', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote ftp server. If you are having (or expecting) troubles - with uploading events then setting this to \'yes\' permits - additional information to be included in the zmfilter log file. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 115, Name = 'ZM_UPLOAD_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Switch upload debugging on', Help = ' - You can use filters to instruct ZoneMinder to upload events to - a remote server. If you are having (or expecting) troubles with - uploading events then setting this to \'yes\' permits additional - information to be generated by the underlying transfer modules - and included in the logs. - ', Category = 'upload', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1'; -insert into Config set Id = 116, Name = 'ZM_OPT_EMAIL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should ZoneMinder email you details of events that match corresponding filters', Help = ' - In ZoneMinder you can create event filters that specify whether - events that match certain criteria should have their details - emailed to you at a designated email address. This will allow - you to be notified of events as soon as they occur and also to - quickly view the events directly. This option specifies whether - this functionality should be available. The email created with - this option can be any size and is intended to be sent to a - regular email reader rather than a mobile device. - ', Category = 'mail', Readonly = '0', Requires = ''; -insert into Config set Id = 117, Name = 'ZM_EMAIL_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = ' - This option is used to define the email address that any events - that match the appropriate filters will be sent to. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; -insert into Config set Id = 118, Name = 'ZM_EMAIL_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\" - body = \" - Hello, - - An alarm has been detected on your installation of the ZoneMinder. - - The details are as follows :- - - Monitor : %MN% - Event Id : %EI% - Length : %EL% - Frames : %EF% (%EFA%) - Scores : t%EST% m%ESM% a%ESA% - - This alarm was matched by the %FN% filter and can be viewed at %EPS% - - ZoneMinder\"', Type = 'text', DefaultValue = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\" - body = \" - Hello, - - An alarm has been detected on your installation of the ZoneMinder. - - The details are as follows :- - - Monitor : %MN% - Event Id : %EI% - Length : %EL% - Frames : %EF% (%EFA%) - Scores : t%EST% m%ESM% a%ESA% - - This alarm was matched by the %FN% filter and can be viewed at %EPS% - - ZoneMinder\"', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the email used to send matching event details', Help = ' - This option is used to define the content of the email that is - sent for any events that match the appropriate filters. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; -insert into Config set Id = 119, Name = 'ZM_EMAIL_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the email used to send matching event details', Help = ' - This option is used to define the subject of the email that is - sent for any events that match the appropriate filters. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; -insert into Config set Id = 120, Name = 'ZM_EMAIL_BODY', Value = ' - Hello, - - An alarm has been detected on your installation of the ZoneMinder. - - The details are as follows :- - - Monitor : %MN% - Event Id : %EI% - Length : %EL% - Frames : %EF% (%EFA%) - Scores : t%EST% m%ESM% a%ESA% - - This alarm was matched by the %FN% filter and can be viewed at %EPS% - - ZoneMinder', Type = 'text', DefaultValue = ' - Hello, - - An alarm has been detected on your installation of the ZoneMinder. - - The details are as follows :- - - Monitor : %MN% - Event Id : %EI% - Length : %EL% - Frames : %EF% (%EFA%) - Scores : t%EST% m%ESM% a%ESA% - - This alarm was matched by the %FN% filter and can be viewed at %EPS% - - ZoneMinder', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the email used to send matching event details', Help = ' - This option is used to define the content of the email that is - sent for any events that match the appropriate filters. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1'; -insert into Config set Id = 121, Name = 'ZM_OPT_MESSAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Should ZoneMinder message you with details of events that match corresponding filters', Help = ' - In ZoneMinder you can create event filters that specify whether - events that match certain criteria should have their details - sent to you at a designated short message email address. This - will allow you to be notified of events as soon as they occur. - This option specifies whether this functionality should be - available. The email created by this option will be brief and - is intended to be sent to an SMS gateway or a minimal mail - reader such as a mobile device or phone rather than a regular - email reader. - ', Category = 'mail', Readonly = '0', Requires = ''; -insert into Config set Id = 122, Name = 'ZM_MESSAGE_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = ' - This option is used to define the short message email address - that any events that match the appropriate filters will be sent - to. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; -insert into Config set Id = 123, Name = 'ZM_MESSAGE_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\" - body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Type = 'text', DefaultValue = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\" - body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the message used to send matching event details', Help = ' - This option is used to define the content of the message that - is sent for any events that match the appropriate filters. - ', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; -insert into Config set Id = 124, Name = 'ZM_MESSAGE_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI%', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI%', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the message used to send matching event details', Help = ' - This option is used to define the subject of the message that - is sent for any events that match the appropriate filters. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; -insert into Config set Id = 125, Name = 'ZM_MESSAGE_BODY', Value = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Type = 'text', DefaultValue = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Hint = 'free text', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the message used to send matching event details', Help = ' - This option is used to define the content of the message that - is sent for any events that match the appropriate filters. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1'; -insert into Config set Id = 126, Name = 'ZM_NEW_MAIL_MODULES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a newer perl method to send emails', Help = ' - Traditionally ZoneMinder has used the MIME::Entity perl module - to construct and send notification emails and messages. Some - people have reported problems with this module not being - present at all or flexible enough for their needs. If you are - one of those people this option allows you to select a new - mailing method using MIME::Lite and Net::SMTP instead. This - method was contributed by Ross Melin and should work for - everyone but has not been extensively tested so currently is - not selected by default. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; -insert into Config set Id = 127, Name = 'ZM_EMAIL_HOST', Value = 'localhost', Type = 'string', DefaultValue = 'localhost', Hint = 'host.your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The host address of your SMTP mail server', Help = ' - If you have chosen SMTP as the method by which to send - notification emails or messages then this option allows you to - choose which SMTP server to use to send them. The default of - localhost may work if you have the sendmail, exim or a similar - daemon running however you may wish to enter your ISP\'s SMTP - mail server here. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; -insert into Config set Id = 128, Name = 'ZM_FROM_EMAIL', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?^:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address you wish your event notifications to originate from', Help = ' - The emails or messages that will be sent to you informing you - of events can appear to come from a designated email address to - help you with mail filtering etc. An address of something like - ZoneMinder\@your.domain is recommended. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; -insert into Config set Id = 129, Name = 'ZM_URL', Value = '', Type = 'string', DefaultValue = '', Hint = 'http://host.your.domain/', Pattern = '(?^:^(?:http://)?(.+)$)', Format = ' \'http://\'.$1 ', Prompt = 'The URL of your ZoneMinder installation', Help = ' - The emails or messages that will be sent to you informing you - of events can include a link to the events themselves for easy - viewing. If you intend to use this feature then set this option - to the url of your installation as it would appear from where - you read your email, e.g. http://host.your.domain/zm.php. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1'; -insert into Config set Id = 130, Name = 'ZM_MAX_RESTART_DELAY', Value = '600', Type = 'integer', DefaultValue = '600', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum delay (in seconds) for daemon restart attempts.', Help = ' - The zmdc (zm daemon control) process controls when processeses - are started or stopped and will attempt to restart any that - fail. If a daemon fails frequently then a delay is introduced - between each restart attempt. If the daemon stills fails then - this delay is increased to prevent extra load being placed on - the system by continual restarts. This option controls what - this maximum delay is. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 131, Name = 'ZM_STATS_UPDATE_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to update the database statistics', Help = ' - The zmstats daemon performs various db queries that may take - a long time in the background. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 132, Name = 'ZM_WATCH_CHECK_INTERVAL', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check the capture daemons have not locked up', Help = ' - The zmwatch daemon checks the image capture performance of the - capture daemons to ensure that they have not locked up (rarely - a sync error may occur which blocks indefinitely). This option - determines how often the daemons are checked. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 133, Name = 'ZM_WATCH_MAX_DELAY', Value = '5', Type = 'decimal', DefaultValue = '5', Hint = 'decimal', Pattern = '(?^:^(\d+(?:\.\d+)?)$)', Format = ' $1 ', Prompt = 'The maximum delay allowed since the last captured image', Help = ' - The zmwatch daemon checks the image capture performance of the - capture daemons to ensure that they have not locked up (rarely - a sync error may occur which blocks indefinitely). This option - determines the maximum delay to allow since the last captured - frame. The daemon will be restarted if it has not captured any - images after this period though the actual restart may take - slightly longer in conjunction with the check interval value - above. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 134, Name = 'ZM_RUN_AUDIT', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Run zmaudit to check data consistency', Help = ' - The zmaudit daemon exists to check that the saved information - in the database and on the filesystem match and are consistent - with each other. If an error occurs or if you 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 synchronise 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 - filesystem 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. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 135, Name = 'ZM_AUDIT_CHECK_INTERVAL', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check database and filesystem consistency', Help = ' - The zmaudit daemon exists to check that the saved information - in the database and on the filesystem match and are consistent - with each other. If an error occurs or if you 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 synchronise 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 filesystem 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. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 136, Name = 'ZM_AUDIT_MIN_AGE', Value = '86400', Type = 'integer', DefaultValue = '86400', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The minimum age in seconds event data must be in order to be deleted.', Help = ' - The zmaudit daemon exists to check that the saved information - in the database and on the filesystem match and are consistent - with each other. Event files or db records that are younger than - this setting will not be deleted and a warning will be given. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 137, Name = 'ZM_FORCED_ALARM_SCORE', Value = '255', Type = 'integer', DefaultValue = '255', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'Score to give forced alarms', Help = ' - The \'zmu\' utility can be used to force an alarm on a monitor - rather than rely on the motion detection algorithms. This - option determines what score to give these alarms to - distinguish them from regular ones. It must be 255 or less. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 138, Name = 'ZM_BULK_FRAME_INTERVAL', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often a bulk frame should be written to the database', Help = ' - Traditionally ZoneMinder writes an entry into the Frames - database table for each frame that is captured and saved. This - works well in motion detection scenarios but when in a DVR - situation (\'Record\' or \'Mocord\' mode) this results in a huge - number of frame writes and a lot of database and disk bandwidth - for very little additional information. Setting this to a - non-zero value will enabled ZoneMinder to group these non-alarm - frames into one \'bulk\' frame entry which saves a lot of - bandwidth and space. The only disadvantage of this is that - timing information for individual frames is lost but in - constant frame rate situations this is usually not significant. - This setting is ignored in Modect mode and individual frames - are still written if an alarm occurs in Mocord mode also. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 139, Name = 'ZM_EVENT_CLOSE_MODE', Value = 'idle', Type = 'string', DefaultValue = 'idle', Hint = 'time|idle|alarm', Pattern = '(?^i:^([tia]))', Format = ' ($1 =~ /^t/) - ? \'time\' - : ($1 =~ /^i/ ? \'idle\' : \'time\' ) - ', Prompt = 'When continuous events are closed.', Help = ' - When a monitor is running in a continuous recording mode - (Record or Mocord) events are usually closed after a fixed - period of time (the section length). However in Mocord mode it - is possible that motion detection may occur near the end of a - section. This option controls what happens when an alarm occurs - in Mocord mode. The \'time\' setting means that the event will be - closed at the end of the section regardless of alarm activity. - The \'idle\' setting means that the event will be closed at the - end of the section if there is no alarm activity occurring at - the time otherwise it will be closed once the alarm is over - meaning the event may end up being longer than the normal - section length. The \'alarm\' setting means that if an alarm - occurs during the event, the event will be closed once the - alarm is over regardless of when this occurs. This has the - effect of limiting the number of alarms to one per event and - the events will be shorter than the section length if an alarm - has occurred. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 140, Name = 'ZM_FORCE_CLOSE_EVENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Close events at section ends.', Help = ' - When a monitor is running in a continuous recording mode - (Record or Mocord) events are usually closed after a fixed - period of time (the section length). However in Mocord mode it - is possible that motion detection may occur near the end of a - section and ordinarily this will prevent the event being closed - until the motion has ceased. Switching this option on will - force the event closed at the specified time regardless of any - motion activity. - ', Category = 'hidden', Readonly = '0', Requires = ''; -insert into Config set Id = 141, Name = 'ZM_CREATE_ANALYSIS_IMAGES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Create analysed alarm images with motion outlined', Help = ' - By default during an alarm ZoneMinder records both the raw - captured image and one that has been analysed and had areas - where motion was detected outlined. This can be very useful - during zone configuration or in analysing why events occurred. - However it also incurs some overhead and in a stable system may - no longer be necessary. This parameter allows you to switch the - generation of these images off. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 142, Name = 'ZM_WEIGHTED_ALARM_CENTRES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Use a weighted algorithm to calculate the centre of an alarm', Help = ' - ZoneMinder will always calculate the centre point of an alarm - in a zone to give some indication of where on the screen it is. - This can be used by the experimental motion tracking feature or - your own custom extensions. In the alarmed or filtered pixels - mode this is a simple midpoint between the extents of the - detected pixels. However in the blob method this can instead be - calculated using weighted pixel locations to give more accurate - positioning for irregularly shaped blobs. This method, while - more precise is also slower and so is turned off by default. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 143, Name = 'ZM_EVENT_IMAGE_DIGITS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many significant digits are used in event image numbering', Help = ' - As event images are captured they are stored to the filesystem - with a numerical index. By default this index has three digits - so the numbers start 001, 002 etc. This works works for most - scenarios as events with more than 999 frames are rarely - captured. However if you have extremely long events and use - external applications then you may wish to increase this to - ensure correct sorting of images in listings etc. Warning, - increasing this value on a live system may render existing - events unviewable as the event will have been saved with the - previous scheme. Decreasing this value should have no ill - effects. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 144, Name = 'ZM_DEFAULT_ASPECT_RATIO', Value = '4:3', Type = 'string', DefaultValue = '4:3', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'The default width:height aspect ratio used in monitors', Help = ' - When specifying the dimensions of monitors you can click a - checkbox to ensure that the width stays in the correct ratio to - the height, or vice versa. This setting allows you to indicate - what the ratio of these settings should be. This should be - specified in the format : and the - default of 4:3 normally be acceptable but 11:9 is another - common setting. If the checkbox is not clicked when specifying - monitor dimensions this setting has no effect. - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 145, Name = 'ZM_USER_SELF_EDIT', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Allow unprivileged users to change their details', Help = ' - Ordinarily only users with system edit privilege are able to - change users details. Switching this option on allows ordinary - users to change their passwords and their language settings - ', Category = 'config', Readonly = '0', Requires = ''; -insert into Config set Id = 146, Name = 'ZM_OPT_CONTROL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Support controllable (e.g. PTZ) cameras', Help = ' - ZoneMinder includes limited support for controllable cameras. A - number of sample protocols are included and others can easily - be added. If you wish to control your cameras via ZoneMinder - then select this option otherwise if you only have static - cameras or use other control methods then leave this option - off. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 147, Name = 'ZM_OPT_TRIGGERS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Interface external event triggers via socket or device files', Help = ' - ZoneMinder can interact with external systems which prompt or - cancel alarms. This is done via the zmtrigger.pl script. This - option indicates whether you want to use these external - triggers. Most people will say no here. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 148, Name = 'ZM_CHECK_FOR_UPDATES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Check with zoneminder.com for updated versions', Help = ' - From ZoneMinder version 1.17.0 onwards new versions are - expected to be more frequent. To save checking manually for - each new version ZoneMinder can check with the zoneminder.com - website to determine the most recent release. These checks are - infrequent, about once per week, and no personal or system - information is transmitted other than your current version - number. If you do not wish these checks to take place or your - ZoneMinder system has no internet access you can switch these - check off with this configuration variable - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 149, Name = 'ZM_TELEMETRY_DATA', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Send usage information to ZoneMinder', Help = ' - Enable collection of usage information of the local system and send - it to the ZoneMinder development team. This data will be used to - determine things like who and where our customers are, how big their - systems are, the underlying hardware and operating system, etc. - This is being done for the sole purpoase of creating a better - product for our target audience. This script is intended to be - completely transparent to the end user, and can be disabled from - the web console under Options. For more details on what information - we collect, please refer to our [privacy](?view=privacy) statement. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 150, Name = 'ZM_TELEMETRY_UUID', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Unique identifier for ZoneMinder telemetry', Help = ' - This variable is auto-generated once by the system and is used to - uniquely identify it among all other ZoneMinder systems in - existence. - ', Category = 'dynamic', Readonly = '0', Requires = ''; -insert into Config set Id = 151, Name = 'ZM_TELEMETRY_LAST_UPLOAD', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the last ZoneMinder telemetry upload ocurred', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 152, Name = 'ZM_TELEMETRY_INTERVAL', Value = '14*24*60*60', Type = 'string', DefaultValue = '14*24*60*60', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Interval in seconds between telemetry updates.', Help = 'This value can be expressed as a mathematical expression for ease.', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 153, Name = 'ZM_TELEMETRY_SERVER_ENDPOINT', Value = 'https://zmanon:2b2d0b4skps@telemetry.zoneminder.com/zmtelemetry/testing5', Type = 'string', DefaultValue = 'https://zmanon:2b2d0b4skps@telemetry.zoneminder.com/zmtelemetry/testing5', Hint = 'http://host.your.domain/', Pattern = '(?^:^(?:http://)?(.+)$)', Format = ' \'http://\'.$1 ', Prompt = 'URL that ZoneMinder will send usage data to', Help = '', Category = 'hidden', Readonly = '0', Requires = ''; -insert into Config set Id = 154, Name = 'ZM_UPDATE_CHECK_PROXY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'Proxy url if required to access zoneminder.com', Help = ' - If you use a proxy to access the internet then ZoneMinder needs - to know so it can access zoneminder.com to check for updates. - If you do use a proxy enter the full proxy url here in the form - of http://:/ - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 155, Name = 'ZM_SHM_KEY', Value = '0x7a6d0000', Type = 'hexadecimal', DefaultValue = '0x7a6d0000', Hint = 'hexadecimal', Pattern = '(?^:^(?:0x)?([0-9a-f]{1,8})$)', Format = ' \'0x\'.$1 ', Prompt = 'Shared memory root key to use', Help = ' - ZoneMinder uses shared memory to speed up communication between - modules. To identify the right area to use shared memory keys - are used. This option controls what the base key is, each - monitor will have it\'s Id or\'ed with this to get the actual key - used. You will not normally need to change this value unless it - clashes with another instance of ZoneMinder on the same - machine. Only the first four hex digits are used, the lower - four will be masked out and ignored. - ', Category = 'system', Readonly = '0', Requires = ''; -insert into Config set Id = 156, Name = 'ZM_WEB_REFRESH_METHOD', Value = 'javascript', Type = 'string', DefaultValue = 'javascript', Hint = 'javascript|http', Pattern = '(?^i:^([jh]))', Format = ' $1 =~ /^j/ - ? \'javascript\' - : \'http\' - ', Prompt = 'What method windows should use to refresh themselves', Help = ' - Many windows in Javascript need to refresh themselves to keep - their information current. This option determines what method - they should use to do this. Choosing \'javascript\' means that - each window will have a short JavaScript statement in with a - timer to prompt the refresh. This is the most compatible - method. Choosing \'http\' means the refresh instruction is put in - the HTTP header. This is a cleaner method but refreshes are - interrupted or cancelled when a link in the window is clicked - meaning that the window will no longer refresh and this would - have to be done manually. - ', Category = 'hidden', Readonly = '0', Requires = ''; -insert into Config set Id = 157, Name = 'ZM_WEB_EVENT_SORT_FIELD', Value = 'DateTime', Type = 'string', DefaultValue = 'DateTime', Hint = 'Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore', Pattern = '(?^:.)', Format = ' $1 ', Prompt = 'Default field the event lists are sorted by', Help = ' - Events in lists can be initially ordered in any way you want. - This option controls what field is used to sort them. You can - modify this ordering from filters or by clicking on headings in - the lists themselves. Bear in mind however that the \'Prev\' and - \'Next\' links, when scrolling through events, relate to the - ordering in the lists and so not always to time based ordering. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 158, Name = 'ZM_WEB_EVENT_SORT_ORDER', Value = 'asc', Type = 'string', DefaultValue = 'asc', Hint = 'asc|desc', Pattern = '(?^i:^([ad]))', Format = ' $1 =~ /^a/i ? \'asc\' : \'desc\' ', Prompt = 'Default order the event lists are sorted by', Help = ' - Events in lists can be initially ordered in any way you want. - This option controls what order (ascending or descending) is - used to sort them. You can modify this ordering from filters or - by clicking on headings in the lists themselves. Bear in mind - however that the \'Prev\' and \'Next\' links, when scrolling - through events, relate to the ordering in the lists and so not - always to time based ordering. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 159, Name = 'ZM_WEB_EVENTS_PER_PAGE', Value = '25', Type = 'integer', DefaultValue = '25', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How many events to list per page in paged mode', Help = ' - In the event list view you can either list all events or just a - page at a time. This option controls how many events are listed - per page in paged mode and how often to repeat the column - headers in non-paged mode. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 160, Name = 'ZM_WEB_LIST_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Display mini-thumbnails of event images in event lists', Help = ' - Ordinarily the event lists just display text details of the - events to save space and time. By switching this option on you - can also display small thumbnails to help you identify events - of interest. The size of these thumbnails is controlled by the - following two options. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 161, Name = 'ZM_WEB_LIST_THUMB_WIDTH', Value = '48', Type = 'integer', DefaultValue = '48', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The width of the thumbnails that appear in the event lists', Help = ' - This options controls the width of the thumbnail images that - appear in the event lists. It should be fairly small to fit in - with the rest of the table. If you prefer you can specify a - height instead in the next option but you should only use one - of the width or height and the other option should be set to - zero. If both width and height are specified then width will be - used and height ignored. - ', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1'; -insert into Config set Id = 162, Name = 'ZM_WEB_LIST_THUMB_HEIGHT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'The height of the thumbnails that appear in the event lists', Help = ' - This options controls the height of the thumbnail images that - appear in the event lists. It should be fairly small to fit in - with the rest of the table. If you prefer you can specify a - width instead in the previous option but you should only use - one of the width or height and the other option should be set - to zero. If both width and height are specified then width will - be used and height ignored. - ', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1'; -insert into Config set Id = 163, Name = 'ZM_WEB_USE_OBJECT_TAGS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Wrap embed in object tags for media content', Help = ' - There are two methods of including media content in web pages. - The most common way is use the EMBED tag which is able to give - some indication of the type of content. However this is not a - standard part of HTML. The official method is to use OBJECT - tags which are able to give more information allowing the - correct media viewers etc to be loaded. However these are less - widely supported and content may be specifically tailored to a - particular platform or player. This option controls whether - media content is enclosed in EMBED tags only or whether, where - appropriate, it is additionally wrapped in OBJECT tags. - Currently OBJECT tags are only used in a limited number of - circumstances but they may become more widespread in the - future. It is suggested that you leave this option on unless - you encounter problems playing some content. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 164, Name = 'ZM_WEB_XFRAME_WARN', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Warn when website X-Frame-Options is set to sameorigin', Help = ' - When creating a Web Site monitor, if the target web site has - X-Frame-Options set to sameorigin in the header, the site will - not display in ZoneMinder. This is a design feature in most modern - browsers. When this condition occurs, ZoneMinder will write a - warning to the log file. To get around this, one can install a browser - plugin or extension to ignore X-Frame headers, and then the page will - display properly. Once the plugin or extenstion has ben installed, - the end user may choose to turn this warning off. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 165, Name = 'ZM_WEB_FILTER_SOURCE', Value = 'Hostname', Type = 'string', DefaultValue = 'Hostname', Hint = 'None|Hostname|NoCredentials', Pattern = '(?^i:^([NH]))', Format = ' ($1 =~ /^Non/) - ? \'None\' - : ($1 =~ /^H/ ? \'Hostname\' : \'NoCredentials\' ) - ', Prompt = 'How to filter information in the source column.', Help = ' - This option only affects monitors with a source type of Ffmpeg, - Libvlc, or WebSite. This setting controls what information is - displayed in the Source column on the console. Selecting \'None\' - will not filter anything. The entire source string will be - displayed, which may contain sensitive information. Selecting - \'NoCredentials\' will strip out usernames and passwords from the - string. If there are any port numbers in the string and they are - common (80, 554, etc) then those will be removed as well. - Selecting \'Hostname\' will filter out all information except for - the hostname or ip address. When in doubt, stay with the default - \'Hostname\'. This feature uses the php function \'url_parts\' to - identify the various pieces of the url. If the url in question - is unusual or not standard in some way, then filtering may not - produce the desired results. - ', Category = 'web', Readonly = '0', Requires = ''; -insert into Config set Id = 166, Name = 'ZM_WEB_H_REFRESH_MAIN', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = ' - The main console window lists a general status and the event - totals for all monitors. This is not a trivial task and should - not be repeated too frequently or it may affect the performance - of the rest of the system. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 167, Name = 'ZM_WEB_H_REFRESH_NAVBAR', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the navigation header should refresh itself', Help = ' - The navigation header contains the general status information about server load and storage space. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 168, Name = 'ZM_WEB_H_REFRESH_CYCLE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = ' - The cycle watch window is a method of continuously cycling - between images from all of your monitors. This option - determines how often to refresh with a new image. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 169, Name = 'ZM_WEB_H_REFRESH_IMAGE', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = ' - The live images from a monitor can be viewed in either streamed - or stills mode. This option determines how often a stills image - is refreshed, it has no effect if streaming is selected. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 170, Name = 'ZM_WEB_H_REFRESH_STATUS', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = ' - The monitor window is actually made from several frames. The - one in the middle merely contains a monitor status which needs - to refresh fairly frequently to give a true indication. This - option determines that frequency. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 171, Name = 'ZM_WEB_H_REFRESH_EVENTS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = ' - The monitor window is actually made from several frames. The - lower framme contains a listing of the last few events for easy - access. This option determines how often this is refreshed. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 172, Name = 'ZM_WEB_H_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : ($1 =~ /^n/ ? \'no\' : \'auto\' ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = ' - If you know that your browser can handle image streams of the - type \'multipart/x-mixed-replace\' but ZoneMinder does not detect - this correctly you can set this option to ensure that the - stream is delivered with or without the use of the Cambozola - plugin. Selecting \'yes\' will tell ZoneMinder that your browser - can handle the streams natively, \'no\' means that it can\'t and - so the plugin will be used while \'auto\' lets ZoneMinder decide. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 173, Name = 'ZM_WEB_H_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \'mpeg\' : \'jpeg\' ', Prompt = 'Which method should be used to send video streams to your browser.', Help = ' - ZoneMinder can be configured to use either mpeg encoded video - or a series or still jpeg images when sending video streams. - This option defines which is used. If you choose mpeg you - should ensure that you have the appropriate plugins available - on your browser whereas choosing jpeg will work natively on - Mozilla and related browsers and with a Java applet on Internet - Explorer - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 174, Name = 'ZM_WEB_H_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = ' - Normally ZoneMinder will display \'live\' or \'event\' streams in - their native size. However if you have monitors with large - dimensions or a slow link you may prefer to reduce this size, - alternatively for small monitors you can enlarge it. This - options lets you specify what the default scaling factor will - be. It is expressed as a percentage so 100 is normal size, 200 - is double size etc. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 175, Name = 'ZM_WEB_H_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = ' - Normally ZoneMinder will display \'event\' streams at their - native rate, i.e. as close to real-time as possible. However if - you have long events it is often convenient to replay them at a - faster rate for review. This option lets you specify what the - default replay rate will be. It is expressed as a percentage so - 100 is normal rate, 200 is double speed etc. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 176, Name = 'ZM_WEB_H_VIDEO_BITRATE', Value = '150000', Type = 'integer', DefaultValue = '150000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = ' - When encoding real video via the ffmpeg library a bit rate can - be specified which roughly corresponds to the available - bandwidth used for the stream. This setting effectively - corresponds to a \'quality\' setting for the video. A low value - will result in a blocky image whereas a high value will produce - a clearer view. Note that this setting does not control the - frame rate of the video however the quality of the video - produced is affected both by this setting and the frame rate - that the video is produced at. A higher frame rate at a - particular bit rate result in individual frames being at a - lower quality. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 177, Name = 'ZM_WEB_H_VIDEO_MAXFPS', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = ' - When using streamed video the main control is the bitrate which - determines how much data can be transmitted. However a lower - bitrate at high frame rates results in a lower quality image. - This option allows you to limit the maximum frame rate to - ensure that video quality is maintained. An additional - advantage is that encoding video at high frame rates is a - processor intensive task when for the most part a very high - frame rate offers little perceptible improvement over one that - has a more manageable resource requirement. Note, this option - is implemented as a cap beyond which binary reduction takes - place. So if you have a device capturing at 15fps and set this - option to 10fps then the video is not produced at 10fps, but - rather at 7.5fps (15 divided by 2) as the final frame rate must - be the original divided by a power of 2. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 178, Name = 'ZM_WEB_H_SCALE_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = ' - If unset, this option sends the whole image to the browser - which resizes it in the window. If set the image is scaled down - on the server before sending a reduced size image to the - browser to conserve bandwidth at the cost of cpu on the server. - Note that ZM can only perform the resizing if the appropriate - PHP graphics functionality is installed. This is usually - available in the php-gd package. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 179, Name = 'ZM_WEB_H_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \'events\' : \'timeline\' ', Prompt = 'What the default view of multiple events should be.', Help = ' - Stored events can be viewed in either an events list format or - in a timeline based one. This option sets the default view that - will be used. Choosing one view here does not prevent the other - view being used as it will always be selectable from whichever - view is currently being used. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 180, Name = 'ZM_WEB_H_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Show the progress of replay in event view.', Help = ' - When viewing events an event navigation panel and progress bar - is shown below the event itself. This allows you to jump to - specific points in the event, but can can also dynamically - update to display the current progress of the event replay - itself. This progress is calculated from the actual event - duration and is not directly linked to the replay itself, so on - limited bandwidth connections may be out of step with the - replay. This option allows you to turn off the progress - display, whilst still keeping the navigation aspect, where - bandwidth prevents it functioning effectively. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 181, Name = 'ZM_WEB_H_AJAX_TIMEOUT', Value = '3000', Type = 'integer', DefaultValue = '3000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = ' - The newer versions of the live feed and event views use Ajax to - request information from the server and populate the views - dynamically. This option allows you to specify a timeout if - required after which requests are abandoned. A timeout may be - necessary if requests would overwise hang such as on a slow - connection. This would tend to consume a lot of browser memory - and make the interface unresponsive. Ordinarily no requests - should timeout so this setting should be set to a value greater - than the slowest expected response. This value is in - milliseconds but if set to zero then no timeout will be used. - ', Category = 'highband', Readonly = '0', Requires = ''; -insert into Config set Id = 182, Name = 'ZM_WEB_M_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = ' - The main console window lists a general status and the event - totals for all monitors. This is not a trivial task and should - not be repeated too frequently or it may affect the performance - of the rest of the system. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 183, Name = 'ZM_WEB_M_REFRESH_NAVBAR', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the navigation header should refresh itself', Help = ' - The navigation header contains the general status information about server load and storage space. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 184, Name = 'ZM_WEB_M_REFRESH_CYCLE', Value = '20', Type = 'integer', DefaultValue = '20', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = ' - The cycle watch window is a method of continuously cycling - between images from all of your monitors. This option - determines how often to refresh with a new image. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 185, Name = 'ZM_WEB_M_REFRESH_IMAGE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = ' - The live images from a monitor can be viewed in either streamed - or stills mode. This option determines how often a stills image - is refreshed, it has no effect if streaming is selected. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 186, Name = 'ZM_WEB_M_REFRESH_STATUS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = ' - The monitor window is actually made from several frames. The - one in the middle merely contains a monitor status which needs - to refresh fairly frequently to give a true indication. This - option determines that frequency. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 187, Name = 'ZM_WEB_M_REFRESH_EVENTS', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = ' - The monitor window is actually made from several frames. The - lower framme contains a listing of the last few events for easy - access. This option determines how often this is refreshed. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 188, Name = 'ZM_WEB_M_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : ($1 =~ /^n/ ? \'no\' : \'auto\' ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = ' - If you know that your browser can handle image streams of the - type \'multipart/x-mixed-replace\' but ZoneMinder does not detect - this correctly you can set this option to ensure that the - stream is delivered with or without the use of the Cambozola - plugin. Selecting \'yes\' will tell ZoneMinder that your browser - can handle the streams natively, \'no\' means that it can\'t and - so the plugin will be used while \'auto\' lets ZoneMinder decide. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 189, Name = 'ZM_WEB_M_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \'mpeg\' : \'jpeg\' ', Prompt = 'Which method should be used to send video streams to your browser.', Help = ' - ZoneMinder can be configured to use either mpeg encoded video - or a series or still jpeg images when sending video streams. - This option defines which is used. If you choose mpeg you - should ensure that you have the appropriate plugins available - on your browser whereas choosing jpeg will work natively on - Mozilla and related browsers and with a Java applet on Internet - Explorer - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 190, Name = 'ZM_WEB_M_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = ' - Normally ZoneMinder will display \'live\' or \'event\' streams in - their native size. However if you have monitors with large - dimensions or a slow link you may prefer to reduce this size, - alternatively for small monitors you can enlarge it. This - options lets you specify what the default scaling factor will - be. It is expressed as a percentage so 100 is normal size, 200 - is double size etc. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 191, Name = 'ZM_WEB_M_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = ' - Normally ZoneMinder will display \'event\' streams at their - native rate, i.e. as close to real-time as possible. However if - you have long events it is often convenient to replay them at a - faster rate for review. This option lets you specify what the - default replay rate will be. It is expressed as a percentage so - 100 is normal rate, 200 is double speed etc. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 192, Name = 'ZM_WEB_M_VIDEO_BITRATE', Value = '75000', Type = 'integer', DefaultValue = '75000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = ' - When encoding real video via the ffmpeg library a bit rate can - be specified which roughly corresponds to the available - bandwidth used for the stream. This setting effectively - corresponds to a \'quality\' setting for the video. A low value - will result in a blocky image whereas a high value will produce - a clearer view. Note that this setting does not control the - frame rate of the video however the quality of the video - produced is affected both by this setting and the frame rate - that the video is produced at. A higher frame rate at a - particular bit rate result in individual frames being at a - lower quality. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 193, Name = 'ZM_WEB_M_VIDEO_MAXFPS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = ' - When using streamed video the main control is the bitrate which - determines how much data can be transmitted. However a lower - bitrate at high frame rates results in a lower quality image. - This option allows you to limit the maximum frame rate to - ensure that video quality is maintained. An additional - advantage is that encoding video at high frame rates is a - processor intensive task when for the most part a very high - frame rate offers little perceptible improvement over one that - has a more manageable resource requirement. Note, this option - is implemented as a cap beyond which binary reduction takes - place. So if you have a device capturing at 15fps and set this - option to 10fps then the video is not produced at 10fps, but - rather at 7.5fps (15 divided by 2) as the final frame rate must - be the original divided by a power of 2. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 194, Name = 'ZM_WEB_M_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = ' - If unset, this option sends the whole image to the browser - which resizes it in the window. If set the image is scaled down - on the server before sending a reduced size image to the - browser to conserve bandwidth at the cost of cpu on the server. - Note that ZM can only perform the resizing if the appropriate - PHP graphics functionality is installed. This is usually - available in the php-gd package. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 195, Name = 'ZM_WEB_M_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \'events\' : \'timeline\' ', Prompt = 'What the default view of multiple events should be.', Help = ' - Stored events can be viewed in either an events list format or - in a timeline based one. This option sets the default view that - will be used. Choosing one view here does not prevent the other - view being used as it will always be selectable from whichever - view is currently being used. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 196, Name = 'ZM_WEB_M_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Show the progress of replay in event view.', Help = ' - When viewing events an event navigation panel and progress bar - is shown below the event itself. This allows you to jump to - specific points in the event, but can can also dynamically - update to display the current progress of the event replay - itself. This progress is calculated from the actual event - duration and is not directly linked to the replay itself, so on - limited bandwidth connections may be out of step with the - replay. This option allows you to turn off the progress - display, whilst still keeping the navigation aspect, where - bandwidth prevents it functioning effectively. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 197, Name = 'ZM_WEB_M_AJAX_TIMEOUT', Value = '5000', Type = 'integer', DefaultValue = '5000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = ' - The newer versions of the live feed and event views use Ajax to - request information from the server and populate the views - dynamically. This option allows you to specify a timeout if - required after which requests are abandoned. A timeout may be - necessary if requests would overwise hang such as on a slow - connection. This would tend to consume a lot of browser memory - and make the interface unresponsive. Ordinarily no requests - should timeout so this setting should be set to a value greater - than the slowest expected response. This value is in - milliseconds but if set to zero then no timeout will be used. - ', Category = 'medband', Readonly = '0', Requires = ''; -insert into Config set Id = 198, Name = 'ZM_WEB_L_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = ' - The main console window lists a general status and the event - totals for all monitors. This is not a trivial task and should - not be repeated too frequently or it may affect the performance - of the rest of the system. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 199, Name = 'ZM_WEB_L_REFRESH_NAVBAR', Value = '35', Type = 'integer', DefaultValue = '35', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the navigation header should refresh itself', Help = ' - The navigation header contains the general status information about server load and storage space. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 200, Name = 'ZM_WEB_L_REFRESH_CYCLE', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = ' - The cycle watch window is a method of continuously cycling - between images from all of your monitors. This option - determines how often to refresh with a new image. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 201, Name = 'ZM_WEB_L_REFRESH_IMAGE', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = ' - The live images from a monitor can be viewed in either streamed - or stills mode. This option determines how often a stills image - is refreshed, it has no effect if streaming is selected. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 202, Name = 'ZM_WEB_L_REFRESH_STATUS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = ' - The monitor window is actually made from several frames. The - one in the middle merely contains a monitor status which needs - to refresh fairly frequently to give a true indication. This - option determines that frequency. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 203, Name = 'ZM_WEB_L_REFRESH_EVENTS', Value = '180', Type = 'integer', DefaultValue = '180', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = ' - The monitor window is actually made from several frames. The - lower framme contains a listing of the last few events for easy - access. This option determines how often this is refreshed. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 204, Name = 'ZM_WEB_L_CAN_STREAM', Value = 'auto', Type = 'string', DefaultValue = 'auto', Hint = 'auto|yes|no', Pattern = '(?^i:^([ayn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : ($1 =~ /^n/ ? \'no\' : \'auto\' ) ', Prompt = 'Override the automatic detection of browser streaming capability', Help = ' - If you know that your browser can handle image streams of the - type \'multipart/x-mixed-replace\' but ZoneMinder does not detect - this correctly you can set this option to ensure that the - stream is delivered with or without the use of the Cambozola - plugin. Selecting \'yes\' will tell ZoneMinder that your browser - can handle the streams natively, \'no\' means that it can\'t and - so the plugin will be used while \'auto\' lets ZoneMinder decide. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 205, Name = 'ZM_WEB_L_STREAM_METHOD', Value = 'jpeg', Type = 'string', DefaultValue = 'jpeg', Hint = 'mpeg|jpeg', Pattern = '(?^i:^([mj]))', Format = ' $1 =~ /^m/ ? \'mpeg\' : \'jpeg\' ', Prompt = 'Which method should be used to send video streams to your browser.', Help = ' - ZoneMinder can be configured to use either mpeg encoded video - or a series or still jpeg images when sending video streams. - This option defines which is used. If you choose mpeg you - should ensure that you have the appropriate plugins available - on your browser whereas choosing jpeg will work natively on - Mozilla and related browsers and with a Java applet on Internet - Explorer - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 206, Name = 'ZM_WEB_L_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = ' - Normally ZoneMinder will display \'live\' or \'event\' streams in - their native size. However if you have monitors with large - dimensions or a slow link you may prefer to reduce this size, - alternatively for small monitors you can enlarge it. This - options lets you specify what the default scaling factor will - be. It is expressed as a percentage so 100 is normal size, 200 - is double size etc. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 207, Name = 'ZM_WEB_L_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = ' - Normally ZoneMinder will display \'event\' streams at their - native rate, i.e. as close to real-time as possible. However if - you have long events it is often convenient to replay them at a - faster rate for review. This option lets you specify what the - default replay rate will be. It is expressed as a percentage so - 100 is normal rate, 200 is double speed etc. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 208, Name = 'ZM_WEB_L_VIDEO_BITRATE', Value = '25000', Type = 'integer', DefaultValue = '25000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = ' - When encoding real video via the ffmpeg library a bit rate can - be specified which roughly corresponds to the available - bandwidth used for the stream. This setting effectively - corresponds to a \'quality\' setting for the video. A low value - will result in a blocky image whereas a high value will produce - a clearer view. Note that this setting does not control the - frame rate of the video however the quality of the video - produced is affected both by this setting and the frame rate - that the video is produced at. A higher frame rate at a - particular bit rate result in individual frames being at a - lower quality. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 209, Name = 'ZM_WEB_L_VIDEO_MAXFPS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = ' - When using streamed video the main control is the bitrate which - determines how much data can be transmitted. However a lower - bitrate at high frame rates results in a lower quality image. - This option allows you to limit the maximum frame rate to - ensure that video quality is maintained. An additional - advantage is that encoding video at high frame rates is a - processor intensive task when for the most part a very high - frame rate offers little perceptible improvement over one that - has a more manageable resource requirement. Note, this option - is implemented as a cap beyond which binary reduction takes - place. So if you have a device capturing at 15fps and set this - option to 10fps then the video is not produced at 10fps, but - rather at 7.5fps (15 divided by 2) as the final frame rate must - be the original divided by a power of 2. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 210, Name = 'ZM_WEB_L_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Scale thumbnails in events, bandwidth versus cpu in rescaling', Help = ' - If unset, this option sends the whole image to the browser - which resizes it in the window. If set the image is scaled down - on the server before sending a reduced size image to the - browser to conserve bandwidth at the cost of cpu on the server. - Note that ZM can only perform the resizing if the appropriate - PHP graphics functionality is installed. This is usually - available in the php-gd package. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 211, Name = 'ZM_WEB_L_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?^i:^([lt]))', Format = ' $1 =~ /^e/ ? \'events\' : \'timeline\' ', Prompt = 'What the default view of multiple events should be.', Help = ' - Stored events can be viewed in either an events list format or - in a timeline based one. This option sets the default view that - will be used. Choosing one view here does not prevent the other - view being used as it will always be selectable from whichever - view is currently being used. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 212, Name = 'ZM_WEB_L_SHOW_PROGRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Show the progress of replay in event view.', Help = ' - When viewing events an event navigation panel and progress bar - is shown below the event itself. This allows you to jump to - specific points in the event, but can can also dynamically - update to display the current progress of the event replay - itself. This progress is calculated from the actual event - duration and is not directly linked to the replay itself, so on - limited bandwidth connections may be out of step with the - replay. This option allows you to turn off the progress - display, whilst still keeping the navigation aspect, where - bandwidth prevents it functioning effectively. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 213, Name = 'ZM_WEB_L_AJAX_TIMEOUT', Value = '10000', Type = 'integer', DefaultValue = '10000', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'How long to wait for Ajax request responses (ms)', Help = ' - The newer versions of the live feed and event views use Ajax to - request information from the server and populate the views - dynamically. This option allows you to specify a timeout if - required after which requests are abandoned. A timeout may be - necessary if requests would overwise hang such as on a slow - connection. This would tend to consume a lot of browser memory - and make the interface unresponsive. Ordinarily no requests - should timeout so this setting should be set to a value greater - than the slowest expected response. This value is in - milliseconds but if set to zero then no timeout will be used. - ', Category = 'lowband', Readonly = '0', Requires = ''; -insert into Config set Id = 214, Name = 'ZM_DYN_LAST_VERSION', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What the last version of ZoneMinder recorded from zoneminder.com is', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 215, Name = 'ZM_DYN_CURR_VERSION', Value = '1.33.0', Type = 'string', DefaultValue = '1.33.0', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = ' - What the effective current version of ZoneMinder is, might be - different from actual if versions ignored - ', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 216, Name = 'ZM_DYN_DB_VERSION', Value = '1.33.0', Type = 'string', DefaultValue = '1.33.0', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'What the version of the database is, from zmupdate', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 217, Name = 'ZM_DYN_LAST_CHECK', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the last check for version from zoneminder.com was', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 218, Name = 'ZM_DYN_NEXT_REMINDER', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about versions will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 219, Name = 'ZM_DYN_DONATE_REMINDER_TIME', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?^:^(\d+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about donations will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 220, Name = 'ZM_DYN_SHOW_DONATE_REMINDER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Remind about donations or not', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 221, Name = 'ZM_SHOW_PRIVACY', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = 'Present the privacy statment', Help = '', Category = 'dynamic', Readonly = '1', Requires = ''; -insert into Config set Id = 222, Name = 'ZM_SSMTP_MAIL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?^i:^([yn]))', Format = ' ($1 =~ /^y/) ? \'yes\' : \'no\' ', Prompt = ' - Use a SSMTP mail server if available. - NEW_MAIL_MODULES must be enabled - ', Help = ' - SSMTP is a lightweight and efficient method to send email. - The SSMTP application is not installed by default. - NEW_MAIL_MODULES must also be enabled. - Please visit the ZoneMinder [SSMTP Wiki page](http://www.zoneminder.com/wiki/index.php/How_to_get_ssmtp_working_with_Zoneminder) - for setup and configuration help. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1;ZM_NEW_MAIL_MODULES=1'; -insert into Config set Id = 223, Name = 'ZM_SSMTP_PATH', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?^:^(.+)$)', Format = ' $1 ', Prompt = 'SSMTP executable path', Help = ' - Recommend setting the path to the SSMTP application. - If path is not defined. Zoneminder will try to determine - the path via shell command. Example path: /usr/sbin/ssmtp. - ', Category = 'mail', Readonly = '0', Requires = 'ZM_SSMTP_MAIL=1'; - From 92aa29d8d0bc08fac3246ef4b4caf64398eea773 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Thu, 3 Jan 2019 16:00:30 -0600 Subject: [PATCH 31/47] Update zm_create.sql.in --- db/zm_create.sql.in | 1 - 1 file changed, 1 deletion(-) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 401a03cdc..e719daedc 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -789,7 +789,6 @@ INSERT INTO `Controls` VALUES (NULL,'PSIA','Remote','PSIA',0,0,0,1,0,0,1,0,0,0,0 INSERT INTO `Controls` VALUES (NULL,'Dahua','Remote','Dahua',0,0,0,1,0,0,1,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,0,1,1,1,0,0,1,0,1,0,0,0,0,1,1,8,0,0,1,0,0,0,0,1,1,8,0,0,0,0); INSERT INTO `Controls` VALUES (NULL,'FOSCAMR2C','Libvlc','FOSCAMR2C',1,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,0,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,1,NULL,NULL,NULL,NULL,1,0,4,0,NULL,0,0); - -- -- Add some monitor preset values -- From 151c7677d8e2a01308bb32da0a35881734ae7b36 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Thu, 3 Jan 2019 16:06:44 -0600 Subject: [PATCH 32/47] add WebSite type to enum (#2382) * add WebSite type to enum * add website enum to update script * update enum * bump the version --- db/zm_create.sql.in | 6 +++--- db/zm_update-1.33.1.sql | 16 ++++++++++++++++ version | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 db/zm_update-1.33.1.sql diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index e719daedc..4e6a6646c 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -63,7 +63,7 @@ DROP TABLE IF EXISTS `Controls`; CREATE TABLE `Controls` ( `Id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','Ffmpeg','Libvlc','cURL','WebSite') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL default 'Local', `Protocol` varchar(64) default NULL, `CanWake` tinyint(3) unsigned NOT NULL default '0', `CanSleep` tinyint(3) unsigned NOT NULL default '0', @@ -397,7 +397,7 @@ DROP TABLE IF EXISTS `MonitorPresets`; CREATE TABLE `MonitorPresets` ( `Id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','NVSocket') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL default 'Local', `Device` tinytext, `Channel` tinyint(3) unsigned default NULL, `Format` int(10) unsigned default NULL, @@ -430,7 +430,7 @@ CREATE TABLE `Monitors` ( `Name` varchar(64) NOT NULL default '', `ServerId` int(10) unsigned, `StorageId` smallint(5) unsigned default 0, - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL default 'Local', `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', `Enabled` tinyint(3) unsigned NOT NULL default '1', `LinkedMonitors` varchar(255), diff --git a/db/zm_update-1.33.1.sql b/db/zm_update-1.33.1.sql new file mode 100644 index 000000000..ddac8adae --- /dev/null +++ b/db/zm_update-1.33.1.sql @@ -0,0 +1,16 @@ +-- +-- This updates a 1.33.0 database to 1.33.1 +-- +-- Add WebSite enum to Monitor.Type +-- Add Refresh column to Monitors table +-- + +ALTER TABLE `Monitors` +CHANGE COLUMN `Type` `Type` ENUM('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL DEFAULT 'Local' ; + +ALTER TABLE `MonitorPresets` +CHANGE COLUMN `Type` `Type` ENUM('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL DEFAULT 'Local' ; + +ALTER TABLE `Controls` +CHANGE COLUMN `Type` `Type` ENUM('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket') NOT NULL DEFAULT 'Local' ; + diff --git a/version b/version index 7aa332e41..02261bead 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.33.0 +1.33.1 From dbe9817bc823225e3d00ea880fa0001c925b3d15 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 09:26:34 -0500 Subject: [PATCH 33/47] Split actions.php into individual files per view --- web/includes/actions.php | 959 --------------------------- web/includes/actions/bandwidth.php | 27 + web/includes/actions/console.php | 40 ++ web/includes/actions/control.php | 40 ++ web/includes/actions/controlcap.php | 36 + web/includes/actions/controlcaps.php | 37 ++ web/includes/actions/device.php | 45 ++ web/includes/actions/devices.php | 35 + web/includes/actions/donate.php | 54 ++ web/includes/actions/event.php | 51 ++ web/includes/actions/events.php | 68 ++ web/includes/actions/filters.php | 81 +++ web/includes/actions/function.php | 49 ++ web/includes/actions/group.php | 61 ++ web/includes/actions/groups.php | 49 ++ web/includes/actions/login.php | 35 + web/includes/actions/logout.php | 27 + web/includes/actions/monitor.php | 243 +++++++ web/includes/actions/montage.php | 48 ++ web/includes/actions/options.php | 92 +++ web/includes/actions/privacy.php | 41 ++ web/includes/actions/server.php | 53 ++ web/includes/actions/settings.php | 50 ++ web/includes/actions/state.php | 48 ++ web/includes/actions/storage.php | 49 ++ web/includes/actions/user.php | 67 ++ web/includes/actions/version.php | 52 ++ web/includes/actions/zone.php | 81 +++ web/includes/actions/zones.php | 49 ++ web/includes/functions.php | 19 + web/index.php | 9 +- web/skins/classic/views/group.php | 3 +- 32 files changed, 1636 insertions(+), 962 deletions(-) delete mode 100644 web/includes/actions.php create mode 100644 web/includes/actions/bandwidth.php create mode 100644 web/includes/actions/console.php create mode 100644 web/includes/actions/control.php create mode 100644 web/includes/actions/controlcap.php create mode 100644 web/includes/actions/controlcaps.php create mode 100644 web/includes/actions/device.php create mode 100644 web/includes/actions/devices.php create mode 100644 web/includes/actions/donate.php create mode 100644 web/includes/actions/event.php create mode 100644 web/includes/actions/events.php create mode 100644 web/includes/actions/filters.php create mode 100644 web/includes/actions/function.php create mode 100644 web/includes/actions/group.php create mode 100644 web/includes/actions/groups.php create mode 100644 web/includes/actions/login.php create mode 100644 web/includes/actions/logout.php create mode 100644 web/includes/actions/monitor.php create mode 100644 web/includes/actions/montage.php create mode 100644 web/includes/actions/options.php create mode 100644 web/includes/actions/privacy.php create mode 100644 web/includes/actions/server.php create mode 100644 web/includes/actions/settings.php create mode 100644 web/includes/actions/state.php create mode 100644 web/includes/actions/storage.php create mode 100644 web/includes/actions/user.php create mode 100644 web/includes/actions/version.php create mode 100644 web/includes/actions/zone.php create mode 100644 web/includes/actions/zones.php diff --git a/web/includes/actions.php b/web/includes/actions.php deleted file mode 100644 index 746454bec..000000000 --- a/web/includes/actions.php +++ /dev/null @@ -1,959 +0,0 @@ -beginTransaction(); - foreach( getAffectedIds('markEid') as $markEid ) { - dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', - array($_REQUEST['newEvent']['Cause'], $_REQUEST['newEvent']['Notes'], $markEid) ); - } - $dbConn->commit(); - } - $refreshParent = true; - $closePopup = true; - } elseif ( $action == 'archive' || $action == 'unarchive' ) { - $archiveVal = ($action == 'archive')?1:0; - if ( !empty($_REQUEST['eid']) ) { - dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array($archiveVal, $_REQUEST['eid'])); - } else { - $dbConn->beginTransaction(); - foreach( getAffectedIds('markEid') as $markEid ) { - dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array($archiveVal, $markEid)); - } - $dbConn->commit(); - $refreshParent = true; - } - } elseif ( $action == 'delete' ) { - $dbConn->beginTransaction(); - foreach( getAffectedIds('markEid') as $markEid ) { - deleteEvent($markEid); - } - $dbConn->commit(); - $refreshParent = true; - } - } // end if canEdit(Events) - } // end if filter or something else -} // end canView(Events) - -// Monitor control actions, require a monitor id and control view permissions for that monitor -if ( !empty($_REQUEST['mid']) && canView('Control', $_REQUEST['mid']) ) { - require_once('control_functions.php'); - require_once('Monitor.php'); - $mid = validInt($_REQUEST['mid']); - if ( $action == 'control' ) { - $monitor = new Monitor($mid); - - $ctrlCommand = buildControlCommand($monitor); - sendControlCommand($monitor->Id(), $ctrlCommand); - } else if ( $action == 'settings' ) { - $args = ' -m ' . escapeshellarg($mid); - $args .= ' -B' . escapeshellarg($_REQUEST['newBrightness']); - $args .= ' -C' . escapeshellarg($_REQUEST['newContrast']); - $args .= ' -H' . escapeshellarg($_REQUEST['newHue']); - $args .= ' -O' . escapeshellarg($_REQUEST['newColour']); - - $zmuCommand = getZmuCommand($args); - - $zmuOutput = exec($zmuCommand); - list($brightness, $contrast, $hue, $colour) = explode(' ', $zmuOutput); - dbQuery( - 'UPDATE Monitors SET Brightness = ?, Contrast = ?, Hue = ?, Colour = ? WHERE Id = ?', - array($brightness, $contrast, $hue, $colour, $mid)); - } -} - -// Control capability actions, require control edit permissions -if ( canEdit('Control') ) { - if ( $action == 'controlcap' ) { - require_once('Control.php'); - $Control = new Control( !empty($_REQUEST['cid']) ? $_REQUEST['cid'] : null ); - - //$changes = getFormChanges( $control, $_REQUEST['newControl'], $types, $columns ); - $Control->save($_REQUEST['newControl']); - $refreshParent = true; - $view = 'none'; - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markCids']) ) { - foreach( $_REQUEST['markCids'] as $markCid ) { - dbQuery('DELETE FROM Controls WHERE Id = ?', array($markCid)); - dbQuery('UPDATE Monitors SET Controllable = 0, ControlId = 0 WHERE ControlId = ?', array($markCid)); - $refreshParent = true; - } - } - } // end if action -} // end if canEdit Controls - -if ( isset($_REQUEST['object']) and $_REQUEST['object'] == 'Monitor' ) { - if ( $action == 'save' ) { - foreach ( $_REQUEST['mids'] as $mid ) { - $mid = ValidInt($mid); - if ( ! canEdit('Monitors', $mid) ) { - Warning("Cannot edit monitor $mid"); - continue; - } - $Monitor = new Monitor($mid); - if ( $Monitor->Type() != 'WebSite' ) { - $Monitor->zmaControl('stop'); - $Monitor->zmcControl('stop'); - } - $Monitor->save($_REQUEST['newMonitor']); - if ( $Monitor->Function() != 'None' && $Monitor->Type() != 'WebSite' ) { - $Monitor->zmcControl('start'); - if ( $Monitor->Enabled() ) { - $Monitor->zmaControl('start'); - } - } - } // end foreach mid - $refreshParent = true; - } // end if action == save -} // end if object is Monitor - -// Monitor edit actions, require a monitor id and edit permissions for that monitor -if ( !empty($_REQUEST['mid']) && canEdit('Monitors', $_REQUEST['mid']) ) { - $mid = validInt($_REQUEST['mid']); - if ( $action == 'function' ) { - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id=?', NULL, array($mid)); - - $newFunction = validStr($_REQUEST['newFunction']); - # Because we use a checkbox, it won't get passed in the request. So not being in _REQUEST means 0 - $newEnabled = ( !isset($_REQUEST['newEnabled']) or $_REQUEST['newEnabled'] != '1' ) ? '0' : '1'; - $oldFunction = $monitor['Function']; - $oldEnabled = $monitor['Enabled']; - if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled ) { - dbQuery('UPDATE Monitors SET Function=?, Enabled=? WHERE Id=?', - array($newFunction, $newEnabled, $mid)); - - $monitor['Function'] = $newFunction; - $monitor['Enabled'] = $newEnabled; - if ( daemonCheck() && ($monitor['Type'] != 'WebSite') ) { - $restart = ($oldFunction == 'None') || ($newFunction == 'None') || ($newEnabled != $oldEnabled); - zmaControl($monitor, 'stop'); - zmcControl($monitor, $restart?'restart':''); - zmaControl($monitor, 'start'); - } - $refreshParent = true; - } - } else if ( $action == 'zone' && isset($_REQUEST['zid']) ) { - $zid = validInt($_REQUEST['zid']); - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id=?', NULL, array($mid)); - - if ( !empty($zid) ) { - $zone = dbFetchOne('SELECT * FROM Zones WHERE MonitorId=? AND Id=?', NULL, array($mid, $zid)); - } else { - $zone = array(); - } - - if ( $_REQUEST['newZone']['Units'] == 'Percent' ) { - $_REQUEST['newZone']['MinAlarmPixels'] = intval(($_REQUEST['newZone']['MinAlarmPixels']*$_REQUEST['newZone']['Area'])/100); - $_REQUEST['newZone']['MaxAlarmPixels'] = intval(($_REQUEST['newZone']['MaxAlarmPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MinFilterPixels']) ) - $_REQUEST['newZone']['MinFilterPixels'] = intval(($_REQUEST['newZone']['MinFilterPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MaxFilterPixels']) ) - $_REQUEST['newZone']['MaxFilterPixels'] = intval(($_REQUEST['newZone']['MaxFilterPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MinBlobPixels']) ) - $_REQUEST['newZone']['MinBlobPixels'] = intval(($_REQUEST['newZone']['MinBlobPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MaxBlobPixels']) ) - $_REQUEST['newZone']['MaxBlobPixels'] = intval(($_REQUEST['newZone']['MaxBlobPixels']*$_REQUEST['newZone']['Area'])/100); - } - - unset( $_REQUEST['newZone']['Points'] ); - - # convert these fields to integer e.g. NULL -> 0 - $types = array( - 'OverloadFrames' => 'integer', - 'ExtendAlarmFrames' => 'integer', - ); - - $changes = getFormChanges($zone, $_REQUEST['newZone'], $types); - - if ( count($changes) ) { - if ( $zid > 0 ) { - dbQuery('UPDATE Zones SET '.implode(', ', $changes).' WHERE MonitorId=? AND Id=?', array($mid, $zid)); - } else { - dbQuery('INSERT INTO Zones SET MonitorId=?, '.implode(', ', $changes), array($mid)); - } - if ( daemonCheck() && ($monitor['Type'] != 'WebSite') ) { - if ( $_REQUEST['newZone']['Type'] == 'Privacy' ) { - zmaControl($monitor, 'stop'); - zmcControl($monitor, 'restart'); - zmaControl($monitor, 'start'); - } else { - zmaControl($monitor, 'restart'); - } - } - if ( ($_REQUEST['newZone']['Type'] == 'Privacy') && $monitor['Controllable'] ) { - require_once('control_functions.php'); - sendControlCommand($mid, 'quit'); - } - $refreshParent = true; - } - $view = 'none'; - } elseif ( $action == 'plugin' && isset($_REQUEST['pl']) ) { - $sql = 'SELECT * FROM PluginsConfig WHERE MonitorId=? AND ZoneId=? AND pluginName=?'; - $pconfs=dbFetchAll($sql, NULL, array($mid, $_REQUEST['zid'], $_REQUEST['pl'])); - $changes = 0; - foreach ( $pconfs as $pconf ) { - $value = $_REQUEST['pluginOpt'][$pconf['Name']]; - if ( array_key_exists($pconf['Name'], $_REQUEST['pluginOpt']) && ($pconf['Value'] != $value) ) { - dbQuery('UPDATE PluginsConfig SET Value=? WHERE id=?', array($value, $pconf['Id'])); - $changes++; - } - } - if ( $changes > 0 ) { - if ( daemonCheck() && ($monitor['Type'] != 'WebSite') ) { - zmaControl($mid, 'restart'); - } - $refreshParent = true; - } - $view = 'none'; - } elseif ( ($action == 'sequence') && isset($_REQUEST['smid']) ) { - $smid = validInt($_REQUEST['smid']); - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id = ?', NULL, array($mid)); - $smonitor = dbFetchOne('SELECT * FROM Monitors WHERE Id = ?', NULL, array($smid)); - - dbQuery('UPDATE Monitors SET Sequence=? WHERE Id=?', array($smonitor['Sequence'], $monitor['Id'])); - dbQuery('UPDATE Monitors SET Sequence=? WHERE Id=?', array($monitor['Sequence'], $smonitor['Id'])); - - $refreshParent = true; - fixSequences(); - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markZids']) ) { - $deletedZid = 0; - foreach ( $_REQUEST['markZids'] as $markZid ) { - $zone = dbFetchOne('SELECT * FROM Zones WHERE Id=?', NULL, array($markZid)); - dbQuery('DELETE FROM Zones WHERE MonitorId=? AND Id=?', array($mid, $markZid)); - $deletedZid = 1; - } - if ( $deletedZid ) { - if ( daemonCheck() && $monitor['Type'] != 'WebSite' ) { - if ( $zone['Type'] == 'Privacy' ) { - zmaControl($mid, 'stop'); - zmcControl($mid, 'restart'); - zmaControl($mid, 'start'); - } else { - zmaControl($mid, 'restart'); - } - } // end if daemonCheck() - $refreshParent = true; - } // end if deletedzid - } // end if isset($_REQUEST['markZids']) - } // end if action -} // end if $mid and canEdit($mid) - -// Monitor edit actions, monitor id derived, require edit permissions for that monitor -if ( canEdit('Monitors') ) { - if ( $action == 'monitor' ) { - $mid = 0; - if ( !empty($_REQUEST['mid']) ) { - $mid = validInt($_REQUEST['mid']); - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id=?', NULL, array($mid)); - - if ( ZM_OPT_X10 ) { - $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId=?', NULL, array($mid)); - if ( !$x10Monitor ) - $x10Monitor = array(); - } - } else { - $monitor = array(); - if ( ZM_OPT_X10 ) { - $x10Monitor = array(); - } - } - $Monitor = new Monitor($monitor); - - // Define a field type for anything that's not simple text equivalent - $types = array( - 'Triggers' => 'set', - 'Controllable' => 'toggle', - 'TrackMotion' => 'toggle', - 'Enabled' => 'toggle', - 'DoNativeMotDet' => 'toggle', - 'Exif' => 'toggle', - 'RTSPDescribe' => 'toggle', - 'RecordAudio' => 'toggle', - 'Method' => 'raw', - ); - - if ( $_REQUEST['newMonitor']['ServerId'] == 'auto' ) { - $_REQUEST['newMonitor']['ServerId'] = dbFetchOne( - 'SELECT Id FROM Servers WHERE Status=\'Running\' ORDER BY FreeMem DESC, CpuLoad ASC LIMIT 1', 'Id'); - Logger::Debug('Auto selecting server: Got ' . $_REQUEST['newMonitor']['ServerId'] ); - if ( ( ! $_REQUEST['newMonitor'] ) and defined('ZM_SERVER_ID') ) { - $_REQUEST['newMonitor']['ServerId'] = ZM_SERVER_ID; - Logger::Debug('Auto selecting server to ' . ZM_SERVER_ID); - } - } - - $columns = getTableColumns('Monitors'); - $changes = getFormChanges($monitor, $_REQUEST['newMonitor'], $types, $columns); - - if ( count($changes) ) { - if ( $mid ) { - - # If we change anything that changes the shared mem size, zma can complain. So let's stop first. - if ( $monitor['Type'] != 'WebSite' ) { - zmaControl($monitor, 'stop'); - zmcControl($monitor, 'stop'); - } - dbQuery('UPDATE Monitors SET '.implode(', ', $changes).' WHERE Id=?', array($mid)); - // Groups will be added below - if ( isset($changes['Name']) or isset($changes['StorageId']) ) { - $OldStorage = new Storage($monitor['StorageId']); - $saferOldName = basename($monitor['Name']); - if ( file_exists($OldStorage->Path().'/'.$saferOldName) ) - unlink($OldStorage->Path().'/'.$saferOldName); - - $NewStorage = new Storage($_REQUEST['newMonitor']['StorageId']); - if ( ! file_exists($NewStorage->Path().'/'.$mid) ) - mkdir($NewStorage->Path().'/'.$mid, 0755); - $saferNewName = basename($_REQUEST['newMonitor']['Name']); - symlink($mid, $NewStorage->Path().'/'.$saferNewName); - } - if ( isset($changes['Width']) || isset($changes['Height']) ) { - $newW = $_REQUEST['newMonitor']['Width']; - $newH = $_REQUEST['newMonitor']['Height']; - $newA = $newW * $newH; - $oldW = $monitor['Width']; - $oldH = $monitor['Height']; - $oldA = $oldW * $oldH; - - $zones = dbFetchAll('SELECT * FROM Zones WHERE MonitorId=?', NULL, array($mid)); - foreach ( $zones as $zone ) { - $newZone = $zone; - $points = coordsToPoints($zone['Coords']); - for ( $i = 0; $i < count($points); $i++ ) { - $points[$i]['x'] = intval(($points[$i]['x']*($newW-1))/($oldW-1)); - $points[$i]['y'] = intval(($points[$i]['y']*($newH-1))/($oldH-1)); - } - $newZone['Coords'] = pointsToCoords($points); - $newZone['Area'] = intval(round(($zone['Area']*$newA)/$oldA)); - $newZone['MinAlarmPixels'] = intval(round(($newZone['MinAlarmPixels']*$newA)/$oldA)); - $newZone['MaxAlarmPixels'] = intval(round(($newZone['MaxAlarmPixels']*$newA)/$oldA)); - $newZone['MinFilterPixels'] = intval(round(($newZone['MinFilterPixels']*$newA)/$oldA)); - $newZone['MaxFilterPixels'] = intval(round(($newZone['MaxFilterPixels']*$newA)/$oldA)); - $newZone['MinBlobPixels'] = intval(round(($newZone['MinBlobPixels']*$newA)/$oldA)); - $newZone['MaxBlobPixels'] = intval(round(($newZone['MaxBlobPixels']*$newA)/$oldA)); - - $changes = getFormChanges($zone, $newZone, $types); - - if ( count($changes) ) { - dbQuery('UPDATE Zones SET '.implode(', ', $changes).' WHERE MonitorId=? AND Id=?', - array($mid, $zone['Id'])); - } - } // end foreach zone - } // end if width and height - $restart = true; - } else if ( ! $user['MonitorIds'] ) { - // Can only create new monitors if we are not restricted to specific monitors -# FIXME This is actually a race condition. Should lock the table. - $maxSeq = dbFetchOne('SELECT MAX(Sequence) AS MaxSequence FROM Monitors', 'MaxSequence'); - $changes[] = 'Sequence = '.($maxSeq+1); - - $sql = 'INSERT INTO Monitors SET '.implode(', ', $changes); - if ( dbQuery($sql) ) { - $mid = dbInsertId(); - $zoneArea = $_REQUEST['newMonitor']['Width'] * $_REQUEST['newMonitor']['Height']; - dbQuery("INSERT INTO Zones SET MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) ); - //$view = 'none'; - $Storage = new Storage($_REQUEST['newMonitor']['StorageId']); - mkdir($Storage->Path().'/'.$mid, 0755); - $saferName = basename($_REQUEST['newMonitor']['Name']); - symlink($mid, $Storage->Path().'/'.$saferName); - - } else { - Error('Error saving new Monitor.'); - $error_message = dbError($sql); - return; - } - } else { - Error('Users with Monitors restrictions cannot create new monitors.'); - return; - } - - $restart = true; - } else { - Logger::Debug('No action due to no changes to Monitor'); - } # end if count(changes) - - if ( - ( !isset($_POST['newMonitor']['GroupIds']) ) - or - ( count($_POST['newMonitor']['GroupIds']) != count($Monitor->GroupIds()) ) - or - array_diff($_POST['newMonitor']['GroupIds'], $Monitor->GroupIds()) - ) { - if ( $Monitor->Id() ) - dbQuery('DELETE FROM Groups_Monitors WHERE MonitorId=?', array($mid)); - - if ( isset($_POST['newMonitor']['GroupIds']) ) { - foreach ( $_POST['newMonitor']['GroupIds'] as $group_id ) { - dbQuery('INSERT INTO Groups_Monitors (GroupId,MonitorId) VALUES (?,?)', array($group_id, $mid)); - } - } - } // end if there has been a change of groups - - if ( ZM_OPT_X10 ) { - $x10Changes = getFormChanges($x10Monitor, $_REQUEST['newX10Monitor']); - - if ( count($x10Changes) ) { - if ( $x10Monitor && isset($_REQUEST['newX10Monitor']) ) { - dbQuery('UPDATE TriggersX10 SET '.implode(', ', $x10Changes).' WHERE MonitorId=?', array($mid)); - } elseif ( !$user['MonitorIds'] ) { - if ( !$x10Monitor ) { - dbQuery('INSERT INTO TriggersX10 SET MonitorId = ?, '.implode(', ', $x10Changes), array($mid)); - } else { - dbQuery('DELETE FROM TriggersX10 WHERE MonitorId = ?', array($mid)); - } - } - $restart = true; - } # end if has x10Changes - } # end if ZM_OPT_X10 - - if ( $restart ) { - - $new_monitor = new Monitor($mid); - //fixDevices(); - - if ( $new_monitor->Type() != 'WebSite' ) { - $new_monitor->zmcControl('start'); - $new_monitor->zmaControl('start'); - } - - if ( $new_monitor->Controllable() ) { - require_once('control_functions.php'); - sendControlCommand($mid, 'quit'); - } - // really should thump zmwatch and maybe zmtrigger too. - //daemonControl( 'restart', 'zmwatch.pl' ); - $refreshParent = true; - } // end if restart - $view = 'none'; - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markMids']) && !$user['MonitorIds'] ) { - require_once('Monitor.php'); - foreach ( $_REQUEST['markMids'] as $markMid ) { - if ( canEdit('Monitors', $markMid) ) { - // This could be faster as a select all - if ( $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id = ?', NULL, array($markMid)) ) { - $Monitor = new Monitor($monitor); - $Monitor->delete(); - } // end if monitor found in db - } // end if canedit this monitor - } // end foreach monitor in MarkMid - } // markMids is set and we aren't limited to specific monitors - } // end if action == Delete -} - -// Device view actions -if ( canEdit('Devices') ) { - if ( $action == 'device' ) { - if ( !empty($_REQUEST['command']) ) { - setDeviceStatusX10($_REQUEST['key'], $_REQUEST['command']); - } else if ( isset($_REQUEST['newDevice']) ) { - if ( isset($_REQUEST['did']) ) { - dbQuery('UPDATE Devices SET Name=?, KeyString=? WHERE Id=?', - array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString'], $_REQUEST['did']) ); - } else { - dbQuery('INSERT INTO Devices SET Name=?, KeyString=?', - array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString']) ); - } - $refreshParent = true; - $view = 'none'; - } - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markDids']) ) { - foreach( $_REQUEST['markDids'] as $markDid ) { - dbQuery('DELETE FROM Devices WHERE Id=?', array($markDid)); - $refreshParent = true; - } - } - } // end if action -} // end if canedit devices - -// Group view actions -if ( canView('Groups') && ($action == 'setgroup') ) { - if ( !empty($_REQUEST['gid']) ) { - setcookie('zmGroup', validInt($_REQUEST['gid']), time()+3600*24*30*12*10); - } else { - setcookie('zmGroup', '', time()-3600*24*2); - } - $refreshParent = true; -} - -// Group edit actions -# Should probably verify that each monitor id is a valid monitor, that we have access to. -# However at the moment, you have to have System permissions to do this -if ( canEdit('Groups') ) { - if ( $action == 'group' ) { - $monitors = empty($_POST['newGroup']['MonitorIds']) ? '' : implode(',', $_POST['newGroup']['MonitorIds']); - $group_id = null; - if ( !empty($_POST['gid']) ) { - $group_id = $_POST['gid']; - dbQuery( - 'UPDATE Groups SET Name=?, ParentId=? WHERE Id=?', - array( - $_POST['newGroup']['Name'], - ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ), - $group_id, - ) - ); - dbQuery('DELETE FROM Groups_Monitors WHERE GroupId=?', array($group_id)); - } else { - dbQuery( - 'INSERT INTO Groups (Name,ParentId) VALUES (?,?)', - array( - $_POST['newGroup']['Name'], - ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ), - ) - ); - $group_id = dbInsertId(); - } - if ( $group_id ) { - foreach ( $_POST['newGroup']['MonitorIds'] as $mid ) { - dbQuery('INSERT INTO Groups_Monitors (GroupId,MonitorId) VALUES (?,?)', array($group_id, $mid)); - } - } - $view = 'none'; - $refreshParent = true; - } else if ( $action == 'delete' ) { - if ( !empty($_REQUEST['gid']) ) { - foreach ( Group::find(array('Id'=>$_REQUEST['gid'])) as $Group ) { - $Group->delete(); - } - } - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=groups'; - $refreshParent = true; - } # end if action -} // end if can edit groups - -// System edit actions -if ( canEdit('System') ) { - if ( isset($_REQUEST['object']) ) { - if ( $_REQUEST['object'] == 'MontageLayout' ) { - require_once('MontageLayout.php'); - if ( $action == 'Save' ) { - $Layout = null; - if ( $_REQUEST['Name'] != '' ) { - $Layout = new MontageLayout(); - $Layout->Name($_REQUEST['Name']); - } else { - $Layout = new MontageLayout($_REQUEST['zmMontageLayout']); - } - $Layout->Positions($_REQUEST['Positions']); - $Layout->save(); - session_start(); - $_SESSION['zmMontageLayout'] = $Layout->Id(); - setcookie('zmMontageLayout', $Layout->Id(), 1); - session_write_close(); - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=montage'; - } // end if save - - } else if ( $_REQUEST['object'] == 'server' ) { - - if ( $action == 'Save' ) { - if ( !empty($_REQUEST['id']) ) { - $dbServer = dbFetchOne( - 'SELECT * FROM Servers WHERE Id=?', - NULL, - array($_REQUEST['id']) ); - } else { - $dbServer = array(); - } - - $types = array(); - $changes = getFormChanges($dbServer, $_REQUEST['newServer'], $types); - - if ( count($changes) ) { - if ( !empty($_REQUEST['id']) ) { - dbQuery('UPDATE Servers SET '.implode(', ', $changes).' WHERE Id = ?', - array($_REQUEST['id']) ); - } else { - dbQuery('INSERT INTO Servers SET '.implode(', ', $changes)); - } - $refreshParent = true; - } - $view = 'none'; - } else if ( $action == 'delete' ) { - if ( !empty($_REQUEST['markIds']) ) { - foreach( $_REQUEST['markIds'] as $Id ) - dbQuery('DELETE FROM Servers WHERE Id=?', array($Id)); - } - $refreshParent = true; - } else { - Error("Unknown action $action in saving Server"); - } - } else if ( $_REQUEST['object'] == 'storage' ) { - if ( $action == 'Save' ) { - if ( !empty($_REQUEST['id']) ) - $dbStorage = dbFetchOne('SELECT * FROM Storage WHERE Id=?', NULL, array($_REQUEST['id'])); - else - $dbStorage = array(); - - $types = array(); - $changes = getFormChanges($dbStorage, $_REQUEST['newStorage'], $types); - - if ( count($changes) ) { - if ( !empty($_REQUEST['id']) ) { - dbQuery('UPDATE Storage SET '.implode(', ', $changes).' WHERE Id = ?', array($_REQUEST['id'])); - } else { - dbQuery('INSERT INTO Storage set '.implode(', ', $changes)); - } - $refreshParent = true; - } - $view = 'none'; - } else if ( $action == 'delete' ) { - if ( !empty($_REQUEST['markIds']) ) { - foreach( $_REQUEST['markIds'] as $Id ) - dbQuery('DELETE FROM Storage WHERE Id=?', array($Id)); - } - $refreshParent = true; - } else { - Error("Unknown action $action in saving Storage"); - } - } # end if isset($_REQUEST['object'] ) - - } else if ( $action == 'version' && isset($_REQUEST['option']) ) { - $option = $_REQUEST['option']; - switch( $option ) { - case 'go' : - { - // Ignore this, the caller will open the page itself - break; - } - case 'ignore' : - { - dbQuery("UPDATE Config SET Value = '".ZM_DYN_LAST_VERSION."' WHERE Name = 'ZM_DYN_CURR_VERSION'"); - break; - } - case 'hour' : - case 'day' : - case 'week' : - { - $nextReminder = time(); - if ( $option == 'hour' ) { - $nextReminder += 60*60; - } elseif ( $option == 'day' ) { - $nextReminder += 24*60*60; - } elseif ( $option == 'week' ) { - $nextReminder += 7*24*60*60; - } - dbQuery("UPDATE Config SET Value = '".$nextReminder."' WHERE Name = 'ZM_DYN_NEXT_REMINDER'"); - break; - } - case 'never' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_CHECK_FOR_UPDATES'"); - break; - } - } - } - if ( $action == 'donate' && isset($_REQUEST['option']) ) { - $option = $_REQUEST['option']; - switch( $option ) { - case 'go' : - { - // Ignore this, the caller will open the page itself - break; - } - case 'hour' : - case 'day' : - case 'week' : - case 'month' : - { - $nextReminder = time(); - if ( $option == 'hour' ) { - $nextReminder += 60*60; - } elseif ( $option == 'day' ) { - $nextReminder += 24*60*60; - } elseif ( $option == 'week' ) { - $nextReminder += 7*24*60*60; - } elseif ( $option == 'month' ) { - $nextReminder += 30*24*60*60; - } - dbQuery("UPDATE Config SET Value = '".$nextReminder."' WHERE Name = 'ZM_DYN_DONATE_REMINDER_TIME'"); - break; - } - case 'never' : - case 'already' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_DYN_SHOW_DONATE_REMINDER'"); - break; - } - } // end switch option - } - if ( ($action == 'privacy') && isset($_REQUEST['option']) ) { - switch( $_REQUEST['option'] ) { - case 'decline' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_SHOW_PRIVACY'"); - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_TELEMETRY_DATA'"); - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=console'; - break; - } - case 'accept' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_SHOW_PRIVACY'"); - dbQuery("UPDATE Config SET Value = '1' WHERE Name = 'ZM_TELEMETRY_DATA'"); - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=console'; - break; - } - default: # Enable the privacy statement if we somehow submit something other than accept or decline - dbQuery("UPDATE Config SET Value = '1' WHERE Name = 'ZM_SHOW_PRIVACY'"); - } // end switch option - return; - } - if ( $action == 'options' && isset($_REQUEST['tab']) ) { - $configCat = $configCats[$_REQUEST['tab']]; - $changed = false; - foreach ( $configCat as $name=>$value ) { - unset($newValue); - if ( $value['Type'] == 'boolean' && empty($_REQUEST['newConfig'][$name]) ) { - $newValue = 0; - } else if ( isset($_REQUEST['newConfig'][$name]) ) { - $newValue = preg_replace("/\r\n/", "\n", stripslashes($_REQUEST['newConfig'][$name])); - } - - if ( isset($newValue) && ($newValue != $value['Value']) ) { - dbQuery('UPDATE Config SET Value=? WHERE Name=?', array($newValue, $name)); - $changed = true; - } - } - if ( $changed ) { - switch( $_REQUEST['tab'] ) { - case 'system' : - case 'config' : - $restartWarning = true; - break; - case 'web' : - case 'tools' : - break; - case 'logging' : - case 'network' : - case 'mail' : - case 'upload' : - $restartWarning = true; - break; - case 'highband' : - case 'medband' : - case 'lowband' : - break; - } - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=options&tab='.$_REQUEST['tab']; - } - loadConfig(false); - return; - } elseif ( $action == 'user' ) { - if ( !empty($_REQUEST['uid']) ) - $dbUser = dbFetchOne('SELECT * FROM Users WHERE Id=?', NULL, array($_REQUEST['uid'])); - else - $dbUser = array(); - - $types = array(); - $changes = getFormChanges($dbUser, $_REQUEST['newUser'], $types); - - if ( $_REQUEST['newUser']['Password'] ) - $changes['Password'] = 'Password = password('.dbEscape($_REQUEST['newUser']['Password']).')'; - else - unset($changes['Password']); - - if ( count($changes) ) { - if ( !empty($_REQUEST['uid']) ) { - dbQuery('UPDATE Users SET '.implode(', ', $changes).' WHERE Id = ?', array($_REQUEST['uid'])); - # If we are updating the logged in user, then update our session user data. - if ( $user and ( $dbUser['Username'] == $user['Username'] ) ) - userLogin($dbUser['Username'], $dbUser['Password']); - } else { - dbQuery('INSERT INTO Users SET '.implode(', ', $changes)); - } - $refreshParent = true; - } - $view = 'none'; - } elseif ( $action == 'state' ) { - if ( !empty($_REQUEST['runState']) ) { - //if ( $cookies ) session_write_close(); - packageControl($_REQUEST['runState']); - $refreshParent = true; - } - } elseif ( $action == 'save' ) { - if ( !empty($_REQUEST['runState']) || !empty($_REQUEST['newState']) ) { - $sql = 'SELECT Id,Function,Enabled FROM Monitors ORDER BY Id'; - $definitions = array(); - foreach( dbFetchAll($sql) as $monitor ) { - $definitions[] = $monitor['Id'].':'.$monitor['Function'].':'.$monitor['Enabled']; - } - $definition = join(',', $definitions); - if ( $_REQUEST['newState'] ) - $_REQUEST['runState'] = $_REQUEST['newState']; - dbQuery('REPLACE INTO States SET Name=?, Definition=?', array($_REQUEST['runState'],$definition)); - } - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['runState']) ) - dbQuery('DELETE FROM States WHERE Name=?', array($_REQUEST['runState'])); - - if ( isset($_REQUEST['markUids']) ) { - foreach( $_REQUEST['markUids'] as $markUid ) - dbQuery('DELETE FROM Users WHERE Id = ?', array($markUid)); - if ( $markUid == $user['Id'] ) - userLogout(); - } - } -} else { - if ( ZM_USER_SELF_EDIT && $action == 'user' ) { - $uid = $user['Id']; - - $dbUser = dbFetchOne('SELECT Id, Password, Language FROM Users WHERE Id = ?', NULL, array($uid)); - - $types = array(); - $changes = getFormChanges($dbUser, $_REQUEST['newUser'], $types); - - if ( !empty($_REQUEST['newUser']['Password']) ) - $changes['Password'] = 'Password = password('.dbEscape($_REQUEST['newUser']['Password']).')'; - else - unset($changes['Password']); - if ( count($changes) ) { - dbQuery('UPDATE Users SET '.implode(', ', $changes).' WHERE Id=?', array($uid)); - $refreshParent = true; - } - $view = 'none'; - } -} - -if ( $action == 'reset' ) { - session_start(); - $_SESSION['zmEventResetTime'] = strftime(STRF_FMT_DATETIME_DB); - setcookie('zmEventResetTime', $_SESSION['zmEventResetTime'], time()+3600*24*30*12*10); - session_write_close(); -} - -?> diff --git a/web/includes/actions/bandwidth.php b/web/includes/actions/bandwidth.php new file mode 100644 index 000000000..8a9056cd2 --- /dev/null +++ b/web/includes/actions/bandwidth.php @@ -0,0 +1,27 @@ + diff --git a/web/includes/actions/console.php b/web/includes/actions/console.php new file mode 100644 index 000000000..5f02d655a --- /dev/null +++ b/web/includes/actions/console.php @@ -0,0 +1,40 @@ +delete(); + } // end if monitor found in db + } // end if canedit this monitor + } // end foreach monitor in MarkMid + } // markMids is set and we aren't limited to specific monitors +} // end if action == Delete +?> diff --git a/web/includes/actions/control.php b/web/includes/actions/control.php new file mode 100644 index 000000000..d3a75a751 --- /dev/null +++ b/web/includes/actions/control.php @@ -0,0 +1,40 @@ +Id(), $ctrlCommand); +} +?> diff --git a/web/includes/actions/controlcap.php b/web/includes/actions/controlcap.php new file mode 100644 index 000000000..ec21e0dcd --- /dev/null +++ b/web/includes/actions/controlcap.php @@ -0,0 +1,36 @@ +save($_REQUEST['newControl']); + $refreshParent = true; + $view = 'none'; +} // end if action +?> diff --git a/web/includes/actions/controlcaps.php b/web/includes/actions/controlcaps.php new file mode 100644 index 000000000..f67a37dad --- /dev/null +++ b/web/includes/actions/controlcaps.php @@ -0,0 +1,37 @@ + diff --git a/web/includes/actions/device.php b/web/includes/actions/device.php new file mode 100644 index 000000000..a9d1f9e5a --- /dev/null +++ b/web/includes/actions/device.php @@ -0,0 +1,45 @@ + diff --git a/web/includes/actions/devices.php b/web/includes/actions/devices.php new file mode 100644 index 000000000..4cb5d43a3 --- /dev/null +++ b/web/includes/actions/devices.php @@ -0,0 +1,35 @@ + diff --git a/web/includes/actions/donate.php b/web/includes/actions/donate.php new file mode 100644 index 000000000..74361c4e5 --- /dev/null +++ b/web/includes/actions/donate.php @@ -0,0 +1,54 @@ + diff --git a/web/includes/actions/event.php b/web/includes/actions/event.php new file mode 100644 index 000000000..89a2694c8 --- /dev/null +++ b/web/includes/actions/event.php @@ -0,0 +1,51 @@ + diff --git a/web/includes/actions/events.php b/web/includes/actions/events.php new file mode 100644 index 000000000..dff69d738 --- /dev/null +++ b/web/includes/actions/events.php @@ -0,0 +1,68 @@ +beginTransaction(); + foreach ( getAffectedIds('markEid') as $markEid ) { + dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', + array( + $_REQUEST['newEvent']['Cause'], + $_REQUEST['newEvent']['Notes'], + $markEid + ) + ); + } + $dbConn->commit(); + $refreshParent = true; + $closePopup = true; +} else if ( $action == 'archive' ) { + $dbConn->beginTransaction(); + foreach( getAffectedIds('markEid') as $markEid ) { + dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array(1, $markEid)); + } + $dbConn->commit(); + $refreshParent = true; +} else if ( $action == 'unarchive' ) { + $dbConn->beginTransaction(); + foreach( getAffectedIds('markEid') as $markEid ) { + dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array(0, $markEid)); + } + $dbConn->commit(); + $refreshParent = true; +} else if ( $action == 'delete' ) { + $dbConn->beginTransaction(); + foreach ( getAffectedIds('markEid') as $markEid ) { + deleteEvent($markEid); + } + $dbConn->commit(); + $refreshParent = true; +} +?> diff --git a/web/includes/actions/filters.php b/web/includes/actions/filters.php new file mode 100644 index 000000000..4067bdf9c --- /dev/null +++ b/web/includes/actions/filters.php @@ -0,0 +1,81 @@ + diff --git a/web/includes/actions/function.php b/web/includes/actions/function.php new file mode 100644 index 000000000..8fcd411b6 --- /dev/null +++ b/web/includes/actions/function.php @@ -0,0 +1,49 @@ + diff --git a/web/includes/actions/group.php b/web/includes/actions/group.php new file mode 100644 index 000000000..36a3f8faa --- /dev/null +++ b/web/includes/actions/group.php @@ -0,0 +1,61 @@ + diff --git a/web/includes/actions/groups.php b/web/includes/actions/groups.php new file mode 100644 index 000000000..200f65f99 --- /dev/null +++ b/web/includes/actions/groups.php @@ -0,0 +1,49 @@ +$_REQUEST['gid'])) as $Group ) { + $Group->delete(); + } + } + $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=groups'; + $refreshParent = true; +} # end if action +?> diff --git a/web/includes/actions/login.php b/web/includes/actions/login.php new file mode 100644 index 000000000..a6e78632d --- /dev/null +++ b/web/includes/actions/login.php @@ -0,0 +1,35 @@ + diff --git a/web/includes/actions/logout.php b/web/includes/actions/logout.php new file mode 100644 index 000000000..140b04670 --- /dev/null +++ b/web/includes/actions/logout.php @@ -0,0 +1,27 @@ + diff --git a/web/includes/actions/monitor.php b/web/includes/actions/monitor.php new file mode 100644 index 000000000..2e73e4184 --- /dev/null +++ b/web/includes/actions/monitor.php @@ -0,0 +1,243 @@ +Type() != 'WebSite' ) { + $Monitor->zmaControl('stop'); + $Monitor->zmcControl('stop'); + } + $Monitor->save($_REQUEST['newMonitor']); + if ( $Monitor->Function() != 'None' && $Monitor->Type() != 'WebSite' ) { + $Monitor->zmcControl('start'); + if ( $Monitor->Enabled() ) { + $Monitor->zmaControl('start'); + } + } + } // end foreach mid + $refreshParent = true; + } // end if action == save +} // end if object is Monitor + +// Monitor edit actions, monitor id derived, require edit permissions for that monitor +if ( ! canEdit('Monitors') ) { + Warning("Monitor actions require Monitors Permissions"); + return; +} + +if ( $action == 'monitor' ) { + $mid = 0; + if ( !empty($_REQUEST['mid']) ) { + $mid = validInt($_REQUEST['mid']); + $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id=?', NULL, array($mid)); + + if ( ZM_OPT_X10 ) { + $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId=?', NULL, array($mid)); + if ( !$x10Monitor ) + $x10Monitor = array(); + } + } else { + $monitor = array(); + if ( ZM_OPT_X10 ) { + $x10Monitor = array(); + } + } + $Monitor = new Monitor($monitor); + + // Define a field type for anything that's not simple text equivalent + $types = array( + 'Triggers' => 'set', + 'Controllable' => 'toggle', + 'TrackMotion' => 'toggle', + 'Enabled' => 'toggle', + 'DoNativeMotDet' => 'toggle', + 'Exif' => 'toggle', + 'RTSPDescribe' => 'toggle', + 'RecordAudio' => 'toggle', + 'Method' => 'raw', + ); + + if ( $_REQUEST['newMonitor']['ServerId'] == 'auto' ) { + $_REQUEST['newMonitor']['ServerId'] = dbFetchOne( + 'SELECT Id FROM Servers WHERE Status=\'Running\' ORDER BY FreeMem DESC, CpuLoad ASC LIMIT 1', 'Id'); + Logger::Debug('Auto selecting server: Got ' . $_REQUEST['newMonitor']['ServerId'] ); + if ( ( ! $_REQUEST['newMonitor'] ) and defined('ZM_SERVER_ID') ) { + $_REQUEST['newMonitor']['ServerId'] = ZM_SERVER_ID; + Logger::Debug('Auto selecting server to ' . ZM_SERVER_ID); + } + } + + $columns = getTableColumns('Monitors'); + $changes = getFormChanges($monitor, $_REQUEST['newMonitor'], $types, $columns); + + if ( count($changes) ) { + if ( $mid ) { + + # If we change anything that changes the shared mem size, zma can complain. So let's stop first. + if ( $monitor['Type'] != 'WebSite' ) { + zmaControl($monitor, 'stop'); + zmcControl($monitor, 'stop'); + } + dbQuery('UPDATE Monitors SET '.implode(', ', $changes).' WHERE Id=?', array($mid)); + // Groups will be added below + if ( isset($changes['Name']) or isset($changes['StorageId']) ) { + $OldStorage = new Storage($monitor['StorageId']); + $saferOldName = basename($monitor['Name']); + if ( file_exists($OldStorage->Path().'/'.$saferOldName) ) + unlink($OldStorage->Path().'/'.$saferOldName); + + $NewStorage = new Storage($_REQUEST['newMonitor']['StorageId']); + if ( ! file_exists($NewStorage->Path().'/'.$mid) ) + mkdir($NewStorage->Path().'/'.$mid, 0755); + $saferNewName = basename($_REQUEST['newMonitor']['Name']); + symlink($mid, $NewStorage->Path().'/'.$saferNewName); + } + if ( isset($changes['Width']) || isset($changes['Height']) ) { + $newW = $_REQUEST['newMonitor']['Width']; + $newH = $_REQUEST['newMonitor']['Height']; + $newA = $newW * $newH; + $oldW = $monitor['Width']; + $oldH = $monitor['Height']; + $oldA = $oldW * $oldH; + + $zones = dbFetchAll('SELECT * FROM Zones WHERE MonitorId=?', NULL, array($mid)); + foreach ( $zones as $zone ) { + $newZone = $zone; + $points = coordsToPoints($zone['Coords']); + for ( $i = 0; $i < count($points); $i++ ) { + $points[$i]['x'] = intval(($points[$i]['x']*($newW-1))/($oldW-1)); + $points[$i]['y'] = intval(($points[$i]['y']*($newH-1))/($oldH-1)); + } + $newZone['Coords'] = pointsToCoords($points); + $newZone['Area'] = intval(round(($zone['Area']*$newA)/$oldA)); + $newZone['MinAlarmPixels'] = intval(round(($newZone['MinAlarmPixels']*$newA)/$oldA)); + $newZone['MaxAlarmPixels'] = intval(round(($newZone['MaxAlarmPixels']*$newA)/$oldA)); + $newZone['MinFilterPixels'] = intval(round(($newZone['MinFilterPixels']*$newA)/$oldA)); + $newZone['MaxFilterPixels'] = intval(round(($newZone['MaxFilterPixels']*$newA)/$oldA)); + $newZone['MinBlobPixels'] = intval(round(($newZone['MinBlobPixels']*$newA)/$oldA)); + $newZone['MaxBlobPixels'] = intval(round(($newZone['MaxBlobPixels']*$newA)/$oldA)); + + $changes = getFormChanges($zone, $newZone, $types); + + if ( count($changes) ) { + dbQuery('UPDATE Zones SET '.implode(', ', $changes).' WHERE MonitorId=? AND Id=?', + array($mid, $zone['Id'])); + } + } // end foreach zone + } // end if width and height + $restart = true; + } else if ( ! $user['MonitorIds'] ) { + // Can only create new monitors if we are not restricted to specific monitors +# FIXME This is actually a race condition. Should lock the table. + $maxSeq = dbFetchOne('SELECT MAX(Sequence) AS MaxSequence FROM Monitors', 'MaxSequence'); + $changes[] = 'Sequence = '.($maxSeq+1); + + $sql = 'INSERT INTO Monitors SET '.implode(', ', $changes); + if ( dbQuery($sql) ) { + $mid = dbInsertId(); + $zoneArea = $_REQUEST['newMonitor']['Width'] * $_REQUEST['newMonitor']['Height']; + dbQuery("INSERT INTO Zones SET MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) ); + //$view = 'none'; + $Storage = new Storage($_REQUEST['newMonitor']['StorageId']); + mkdir($Storage->Path().'/'.$mid, 0755); + $saferName = basename($_REQUEST['newMonitor']['Name']); + symlink($mid, $Storage->Path().'/'.$saferName); + + } else { + Error('Error saving new Monitor.'); + $error_message = dbError($sql); + return; + } + } else { + Error('Users with Monitors restrictions cannot create new monitors.'); + return; + } + + $restart = true; + } else { + Logger::Debug('No action due to no changes to Monitor'); + } # end if count(changes) + + if ( + ( !isset($_POST['newMonitor']['GroupIds']) ) + or + ( count($_POST['newMonitor']['GroupIds']) != count($Monitor->GroupIds()) ) + or + array_diff($_POST['newMonitor']['GroupIds'], $Monitor->GroupIds()) + ) { + if ( $Monitor->Id() ) + dbQuery('DELETE FROM Groups_Monitors WHERE MonitorId=?', array($mid)); + + if ( isset($_POST['newMonitor']['GroupIds']) ) { + foreach ( $_POST['newMonitor']['GroupIds'] as $group_id ) { + dbQuery('INSERT INTO Groups_Monitors (GroupId,MonitorId) VALUES (?,?)', array($group_id, $mid)); + } + } + } // end if there has been a change of groups + + if ( ZM_OPT_X10 ) { + $x10Changes = getFormChanges($x10Monitor, $_REQUEST['newX10Monitor']); + + if ( count($x10Changes) ) { + if ( $x10Monitor && isset($_REQUEST['newX10Monitor']) ) { + dbQuery('UPDATE TriggersX10 SET '.implode(', ', $x10Changes).' WHERE MonitorId=?', array($mid)); + } elseif ( !$user['MonitorIds'] ) { + if ( !$x10Monitor ) { + dbQuery('INSERT INTO TriggersX10 SET MonitorId = ?, '.implode(', ', $x10Changes), array($mid)); + } else { + dbQuery('DELETE FROM TriggersX10 WHERE MonitorId = ?', array($mid)); + } + } + $restart = true; + } # end if has x10Changes + } # end if ZM_OPT_X10 + + if ( $restart ) { + + $new_monitor = new Monitor($mid); + //fixDevices(); + + if ( $new_monitor->Type() != 'WebSite' ) { + $new_monitor->zmcControl('start'); + $new_monitor->zmaControl('start'); + } + + if ( $new_monitor->Controllable() ) { + require_once('includes/control_functions.php'); + sendControlCommand($mid, 'quit'); + } + // really should thump zmwatch and maybe zmtrigger too. + //daemonControl( 'restart', 'zmwatch.pl' ); + $refreshParent = true; + } // end if restart + $view = 'none'; +} else { + Warning("Unknown action $action in Monitor"); +} // end if action == Delete +?> diff --git a/web/includes/actions/montage.php b/web/includes/actions/montage.php new file mode 100644 index 000000000..97a45e72a --- /dev/null +++ b/web/includes/actions/montage.php @@ -0,0 +1,48 @@ +Name($_REQUEST['Name']); + } else { + $Layout = new MontageLayout($_REQUEST['zmMontageLayout']); + } + $Layout->Positions($_REQUEST['Positions']); + $Layout->save(); + session_start(); + $_SESSION['zmMontageLayout'] = $Layout->Id(); + setcookie('zmMontageLayout', $Layout->Id(), 1); + session_write_close(); + $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=montage'; + } // end if save + + } # end if isset($_REQUEST['object'] ) +} # end if isset($_REQUEST['object'] ) +?> diff --git a/web/includes/actions/options.php b/web/includes/actions/options.php new file mode 100644 index 000000000..4b1aefa4e --- /dev/null +++ b/web/includes/actions/options.php @@ -0,0 +1,92 @@ +$value ) { + unset($newValue); + if ( $value['Type'] == 'boolean' && empty($_REQUEST['newConfig'][$name]) ) { + $newValue = 0; + } else if ( isset($_REQUEST['newConfig'][$name]) ) { + $newValue = preg_replace("/\r\n/", "\n", stripslashes($_REQUEST['newConfig'][$name])); + } + + if ( isset($newValue) && ($newValue != $value['Value']) ) { + dbQuery('UPDATE Config SET Value=? WHERE Name=?', array($newValue, $name)); + $changed = true; + } + } + if ( $changed ) { + switch( $_REQUEST['tab'] ) { + case 'system' : + case 'config' : + $restartWarning = true; + break; + case 'web' : + case 'tools' : + break; + case 'logging' : + case 'network' : + case 'mail' : + case 'upload' : + $restartWarning = true; + break; + case 'highband' : + case 'medband' : + case 'lowband' : + break; + } + $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=options&tab='.$_REQUEST['tab']; + } + loadConfig(false); + return; +} // end if object vs action + +?> diff --git a/web/includes/actions/privacy.php b/web/includes/actions/privacy.php new file mode 100644 index 000000000..94fce81cd --- /dev/null +++ b/web/includes/actions/privacy.php @@ -0,0 +1,41 @@ + diff --git a/web/includes/actions/server.php b/web/includes/actions/server.php new file mode 100644 index 000000000..d991fd228 --- /dev/null +++ b/web/includes/actions/server.php @@ -0,0 +1,53 @@ + diff --git a/web/includes/actions/settings.php b/web/includes/actions/settings.php new file mode 100644 index 000000000..872dae95e --- /dev/null +++ b/web/includes/actions/settings.php @@ -0,0 +1,50 @@ + diff --git a/web/includes/actions/state.php b/web/includes/actions/state.php new file mode 100644 index 000000000..70666145e --- /dev/null +++ b/web/includes/actions/state.php @@ -0,0 +1,48 @@ + diff --git a/web/includes/actions/storage.php b/web/includes/actions/storage.php new file mode 100644 index 000000000..94b76bae7 --- /dev/null +++ b/web/includes/actions/storage.php @@ -0,0 +1,49 @@ + diff --git a/web/includes/actions/user.php b/web/includes/actions/user.php new file mode 100644 index 000000000..af569627f --- /dev/null +++ b/web/includes/actions/user.php @@ -0,0 +1,67 @@ + diff --git a/web/includes/actions/version.php b/web/includes/actions/version.php new file mode 100644 index 000000000..0e89b2457 --- /dev/null +++ b/web/includes/actions/version.php @@ -0,0 +1,52 @@ + 0 + $types = array( + 'OverloadFrames' => 'integer', + 'ExtendAlarmFrames' => 'integer', + ); + + $changes = getFormChanges($zone, $_REQUEST['newZone'], $types); + + if ( count($changes) ) { + if ( $zid > 0 ) { + dbQuery('UPDATE Zones SET '.implode(', ', $changes).' WHERE MonitorId=? AND Id=?', array($mid, $zid)); + } else { + dbQuery('INSERT INTO Zones SET MonitorId=?, '.implode(', ', $changes), array($mid)); + } + if ( daemonCheck() && ($monitor['Type'] != 'WebSite') ) { + if ( $_REQUEST['newZone']['Type'] == 'Privacy' ) { + zmaControl($monitor, 'stop'); + zmcControl($monitor, 'restart'); + zmaControl($monitor, 'start'); + } else { + zmaControl($monitor, 'restart'); + } + } + if ( ($_REQUEST['newZone']['Type'] == 'Privacy') && $monitor['Controllable'] ) { + require_once('control_functions.php'); + sendControlCommand($mid, 'quit'); + } + $refreshParent = true; + } + $view = 'none'; + } // end if action +} // end if $mid and canEdit($mid) +?> diff --git a/web/includes/actions/zones.php b/web/includes/actions/zones.php new file mode 100644 index 000000000..f7ee15c9d --- /dev/null +++ b/web/includes/actions/zones.php @@ -0,0 +1,49 @@ +Type() != 'WebSite' ) { + zmaControl($mid, 'stop'); + if ( $restart_zmc ) + zmcControl($mid, 'restart'); + zmaControl($mid, 'start'); + } // end if daemonCheck() + $refreshParent = true; + } // end if isset($_REQUEST['markZids']) + } // end if action +} // end if $mid and canEdit($mid) + +?> diff --git a/web/includes/functions.php b/web/includes/functions.php index 6f2877530..005a81d57 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2349,4 +2349,23 @@ if( !function_exists('ftok') ) { } } +function getAffectedIds( $name ) { + $names = $name.'s'; + $ids = array(); + if ( isset($_REQUEST[$names]) ) { + if ( is_array($_REQUEST[$names]) ) { + $ids = $_REQUEST[$names]; + } else { + $ids = array($_REQUEST[$names]); + } + } else if ( isset($_REQUEST[$name]) ) { + if ( is_array($_REQUEST[$name]) ) { + $ids = $_REQUEST[$name]; + } else { + $ids = array($_REQUEST[$name]); + } + } + return $ids; +} + ?> diff --git a/web/index.php b/web/index.php index 2331809bc..ef55a81d6 100644 --- a/web/index.php +++ b/web/index.php @@ -210,7 +210,14 @@ if ( } # Need to include actions because it does auth -require_once('includes/actions.php'); +if ( $action ) { + if ( file_exists('includes/actions/'.$view.'.php') ) { + Logger::Debug("Including includes/actions/$view.php"); + require_once('includes/actions/'.$view.'.php'); + } else { + Warning("No includes/actions/$view.php for action $action"); + } +} # If I put this here, it protects all views and popups, but it has to go after actions.php because actions.php does the actual logging in. if ( ZM_OPT_USE_AUTH and !isset($user) ) { diff --git a/web/skins/classic/views/group.php b/web/skins/classic/views/group.php index d765e445f..49fb558b2 100644 --- a/web/skins/classic/views/group.php +++ b/web/skins/classic/views/group.php @@ -39,7 +39,6 @@ xhtmlHeaders(__FILE__, translate('Group').' - '.$newGroup->Name());
- @@ -119,7 +118,7 @@ echo htmlSelect('newGroup[ParentId]', $options, $newGroup->ParentId(), array('on
- From 6cad852e115ea2d4e8032a5a122a7acb758bfb89 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 09:34:18 -0500 Subject: [PATCH 34/47] fix path to MontageLayout --- web/includes/actions/montage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/includes/actions/montage.php b/web/includes/actions/montage.php index 97a45e72a..7182ba2dc 100644 --- a/web/includes/actions/montage.php +++ b/web/includes/actions/montage.php @@ -25,7 +25,7 @@ if ( isset($_REQUEST['object']) ) { Warning("Need System permissions to edit layouts"); return; } - require_once('MontageLayout.php'); + require_once('includes/MontageLayout.php'); if ( $action == 'Save' ) { $Layout = null; if ( $_REQUEST['Name'] != '' ) { From edeaa07c126a0eba97038a0d6ca77fb3b88ef26e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 09:34:42 -0500 Subject: [PATCH 35/47] Fix no quotes around Id --- web/includes/MontageLayout.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/includes/MontageLayout.php b/web/includes/MontageLayout.php index 082dbde70..e8530f19a 100644 --- a/web/includes/MontageLayout.php +++ b/web/includes/MontageLayout.php @@ -118,13 +118,13 @@ class MontageLayout { $sql = 'UPDATE MontageLayouts SET '.implode(', ', array_map( function($field) {return $field.'=?';}, $fields ) ) . ' WHERE Id=?'; $values = array_map( function($field){return $this->{$field};}, $fields ); $values[] = $this->{'Id'}; - dbQuery( $sql, $values ); + dbQuery($sql, $values); } else { $sql = 'INSERT INTO MontageLayouts ('.implode( ',', $fields ).') VALUES ('.implode(',',array_map( function(){return '?';}, $fields ) ).')'; $values = array_map( function($field){return $this->{$field};}, $fields ); - dbQuery( $sql, $values ); + dbQuery($sql, $values); global $dbConn; - $this->{Id} = $dbConn->lastInsertId(); + $this->{'Id'} = $dbConn->lastInsertId(); } } // end function save From 7ec96655c3eb1c3f43f99f378f43686d1c097b6b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 09:37:26 -0500 Subject: [PATCH 36/47] fix missing ! when testing for permission on editing config --- web/includes/actions/options.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/includes/actions/options.php b/web/includes/actions/options.php index 4b1aefa4e..f6cae406b 100644 --- a/web/includes/actions/options.php +++ b/web/includes/actions/options.php @@ -19,7 +19,7 @@ // // System edit actions -if ( canEdit('System') ) { +if ( !canEdit('System') ) { Warning("Must have System permissions to perform options actions"); return; } From e2f32ab0917b8d1b2bfb3719a9cff721fa2fd001 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 09:43:36 -0500 Subject: [PATCH 37/47] Upgrade config saving --- web/includes/actions/options.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/web/includes/actions/options.php b/web/includes/actions/options.php index f6cae406b..263a592f8 100644 --- a/web/includes/actions/options.php +++ b/web/includes/actions/options.php @@ -48,18 +48,24 @@ if ( $action == 'delete' ) { } } else if ( $action == 'options' && isset($_REQUEST['tab']) ) { - $configCat = $configCats[$_REQUEST['tab']]; + + $result = dbQuery('SELECT Name,Value,Type FROM Config WHERE Category=? ORDER BY Id ASC', array($_REQUEST['tab'])); + if ( !$result ) { + echo mysql_error(); + return; + } + $changed = false; - foreach ( $configCat as $name=>$value ) { + while( $config = dbFetchNext($result) ) { unset($newValue); - if ( $value['Type'] == 'boolean' && empty($_REQUEST['newConfig'][$name]) ) { + if ( $config['Type'] == 'boolean' && empty($_REQUEST['newConfig'][$config['Name']]) ) { $newValue = 0; - } else if ( isset($_REQUEST['newConfig'][$name]) ) { - $newValue = preg_replace("/\r\n/", "\n", stripslashes($_REQUEST['newConfig'][$name])); + } else if ( isset($_REQUEST['newConfig'][$config['Name']]) ) { + $newValue = preg_replace("/\r\n/", "\n", stripslashes($_REQUEST['newConfig'][$config['Name']])); } - if ( isset($newValue) && ($newValue != $value['Value']) ) { - dbQuery('UPDATE Config SET Value=? WHERE Name=?', array($newValue, $name)); + if ( isset($newValue) && ($newValue != $config['Value']) ) { + dbQuery('UPDATE Config SET Value=? WHERE Name=?', array($newValue, $config['Name'])); $changed = true; } } From ab198bfd75ab188878f9440d1b8c328b801118ec Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 15:29:21 -0500 Subject: [PATCH 38/47] remove master version of actions.php --- web/includes/actions.php | 975 --------------------------------------- 1 file changed, 975 deletions(-) delete mode 100644 web/includes/actions.php diff --git a/web/includes/actions.php b/web/includes/actions.php deleted file mode 100644 index 47c74546f..000000000 --- a/web/includes/actions.php +++ /dev/null @@ -1,975 +0,0 @@ -beginTransaction(); - foreach( getAffectedIds('markEid') as $markEid ) { - dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', - array($_REQUEST['newEvent']['Cause'], $_REQUEST['newEvent']['Notes'], $markEid) ); - } - $dbConn->commit(); - } - $refreshParent = true; - $closePopup = true; - } elseif ( $action == 'archive' || $action == 'unarchive' ) { - $archiveVal = ($action == 'archive')?1:0; - if ( !empty($_REQUEST['eid']) ) { - dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array($archiveVal, $_REQUEST['eid'])); - } else { - $dbConn->beginTransaction(); - foreach( getAffectedIds('markEid') as $markEid ) { - dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array($archiveVal, $markEid)); - } - $dbConn->commit(); - $refreshParent = true; - } - } elseif ( $action == 'delete' ) { - $dbConn->beginTransaction(); - foreach( getAffectedIds('eids') as $markEid ) { - deleteEvent($markEid); - } - $dbConn->commit(); - $refreshParent = true; - } - } // end if canEdit(Events) - } // end if filter or something else -} // end canView(Events) - -// Monitor control actions, require a monitor id and control view permissions for that monitor -if ( !empty($_REQUEST['mid']) && canView('Control', $_REQUEST['mid']) ) { - require_once('control_functions.php'); - require_once('Monitor.php'); - $mid = validInt($_REQUEST['mid']); - if ( $action == 'control' ) { - $monitor = new Monitor($mid); - - $ctrlCommand = buildControlCommand($monitor); - sendControlCommand($monitor->Id(), $ctrlCommand); - } else if ( $action == 'settings' ) { - $args = ' -m ' . escapeshellarg($mid); - $args .= ' -B' . escapeshellarg($_REQUEST['newBrightness']); - $args .= ' -C' . escapeshellarg($_REQUEST['newContrast']); - $args .= ' -H' . escapeshellarg($_REQUEST['newHue']); - $args .= ' -O' . escapeshellarg($_REQUEST['newColour']); - - $zmuCommand = getZmuCommand($args); - - $zmuOutput = exec($zmuCommand); - list($brightness, $contrast, $hue, $colour) = explode(' ', $zmuOutput); - dbQuery( - 'UPDATE Monitors SET Brightness = ?, Contrast = ?, Hue = ?, Colour = ? WHERE Id = ?', - array($brightness, $contrast, $hue, $colour, $mid)); - } -} - -// Control capability actions, require control edit permissions -if ( canEdit('Control') ) { - if ( $action == 'controlcap' ) { - require_once('Control.php'); - $Control = new Control( !empty($_REQUEST['cid']) ? $_REQUEST['cid'] : null ); - - //$changes = getFormChanges( $control, $_REQUEST['newControl'], $types, $columns ); - $Control->save($_REQUEST['newControl']); - $refreshParent = true; - $view = 'none'; - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markCids']) ) { - foreach( $_REQUEST['markCids'] as $markCid ) { - dbQuery('DELETE FROM Controls WHERE Id = ?', array($markCid)); - dbQuery('UPDATE Monitors SET Controllable = 0, ControlId = 0 WHERE ControlId = ?', array($markCid)); - $refreshParent = true; - } - } - } // end if action -} // end if canEdit Controls - -if ( isset($_REQUEST['object']) and $_REQUEST['object'] == 'Monitor' ) { - if ( $action == 'save' ) { - foreach ( $_REQUEST['mids'] as $mid ) { - $mid = ValidInt($mid); - if ( ! canEdit('Monitors', $mid) ) { - Warning("Cannot edit monitor $mid"); - continue; - } - $Monitor = new Monitor($mid); - if ( $Monitor->Type() != 'WebSite' ) { - $Monitor->zmaControl('stop'); - $Monitor->zmcControl('stop'); - } - $Monitor->save($_REQUEST['newMonitor']); - if ( $Monitor->Function() != 'None' && $Monitor->Type() != 'WebSite' ) { - $Monitor->zmcControl('start'); - if ( $Monitor->Enabled() ) { - $Monitor->zmaControl('start'); - } - } - } // end foreach mid - $refreshParent = true; - } // end if action == save -} // end if object is Monitor - -// Monitor edit actions, require a monitor id and edit permissions for that monitor -if ( !empty($_REQUEST['mid']) && canEdit('Monitors', $_REQUEST['mid']) ) { - $mid = validInt($_REQUEST['mid']); - if ( $action == 'function' ) { - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id=?', NULL, array($mid)); - - $newFunction = validStr($_REQUEST['newFunction']); - # Because we use a checkbox, it won't get passed in the request. So not being in _REQUEST means 0 - $newEnabled = ( !isset($_REQUEST['newEnabled']) or $_REQUEST['newEnabled'] != '1' ) ? '0' : '1'; - $oldFunction = $monitor['Function']; - $oldEnabled = $monitor['Enabled']; - if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled ) { - dbQuery('UPDATE Monitors SET Function=?, Enabled=? WHERE Id=?', - array($newFunction, $newEnabled, $mid)); - - $monitor['Function'] = $newFunction; - $monitor['Enabled'] = $newEnabled; - if ( daemonCheck() && ($monitor['Type'] != 'WebSite') ) { - $restart = ($oldFunction == 'None') || ($newFunction == 'None') || ($newEnabled != $oldEnabled); - zmaControl($monitor, 'stop'); - zmcControl($monitor, $restart?'restart':''); - zmaControl($monitor, 'start'); - } - $refreshParent = true; - } - } else if ( $action == 'zone' && isset($_REQUEST['zid']) ) { - $zid = validInt($_REQUEST['zid']); - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id=?', NULL, array($mid)); - - if ( !empty($zid) ) { - $zone = dbFetchOne('SELECT * FROM Zones WHERE MonitorId=? AND Id=?', NULL, array($mid, $zid)); - } else { - $zone = array(); - } - - if ( $_REQUEST['newZone']['Units'] == 'Percent' ) { - $_REQUEST['newZone']['MinAlarmPixels'] = intval(($_REQUEST['newZone']['MinAlarmPixels']*$_REQUEST['newZone']['Area'])/100); - $_REQUEST['newZone']['MaxAlarmPixels'] = intval(($_REQUEST['newZone']['MaxAlarmPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MinFilterPixels']) ) - $_REQUEST['newZone']['MinFilterPixels'] = intval(($_REQUEST['newZone']['MinFilterPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MaxFilterPixels']) ) - $_REQUEST['newZone']['MaxFilterPixels'] = intval(($_REQUEST['newZone']['MaxFilterPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MinBlobPixels']) ) - $_REQUEST['newZone']['MinBlobPixels'] = intval(($_REQUEST['newZone']['MinBlobPixels']*$_REQUEST['newZone']['Area'])/100); - if ( isset($_REQUEST['newZone']['MaxBlobPixels']) ) - $_REQUEST['newZone']['MaxBlobPixels'] = intval(($_REQUEST['newZone']['MaxBlobPixels']*$_REQUEST['newZone']['Area'])/100); - } - - unset( $_REQUEST['newZone']['Points'] ); - - # convert these fields to integer e.g. NULL -> 0 - $types = array( - 'OverloadFrames' => 'integer', - 'ExtendAlarmFrames' => 'integer', - ); - - $changes = getFormChanges($zone, $_REQUEST['newZone'], $types); - - if ( count($changes) ) { - if ( $zid > 0 ) { - dbQuery('UPDATE Zones SET '.implode(', ', $changes).' WHERE MonitorId=? AND Id=?', array($mid, $zid)); - } else { - dbQuery('INSERT INTO Zones SET MonitorId=?, '.implode(', ', $changes), array($mid)); - } - if ( daemonCheck() && ($monitor['Type'] != 'WebSite') ) { - if ( $_REQUEST['newZone']['Type'] == 'Privacy' ) { - zmaControl($monitor, 'stop'); - zmcControl($monitor, 'restart'); - zmaControl($monitor, 'start'); - } else { - zmaControl($monitor, 'restart'); - } - } - if ( ($_REQUEST['newZone']['Type'] == 'Privacy') && $monitor['Controllable'] ) { - require_once('control_functions.php'); - sendControlCommand($mid, 'quit'); - } - $refreshParent = true; - } - $view = 'none'; - } elseif ( $action == 'plugin' && isset($_REQUEST['pl']) ) { - $sql = 'SELECT * FROM PluginsConfig WHERE MonitorId=? AND ZoneId=? AND pluginName=?'; - $pconfs=dbFetchAll($sql, NULL, array($mid, $_REQUEST['zid'], $_REQUEST['pl'])); - $changes = 0; - foreach ( $pconfs as $pconf ) { - $value = $_REQUEST['pluginOpt'][$pconf['Name']]; - if ( array_key_exists($pconf['Name'], $_REQUEST['pluginOpt']) && ($pconf['Value'] != $value) ) { - dbQuery('UPDATE PluginsConfig SET Value=? WHERE id=?', array($value, $pconf['Id'])); - $changes++; - } - } - if ( $changes > 0 ) { - if ( daemonCheck() && ($monitor['Type'] != 'WebSite') ) { - zmaControl($mid, 'restart'); - } - $refreshParent = true; - } - $view = 'none'; - } elseif ( ($action == 'sequence') && isset($_REQUEST['smid']) ) { - $smid = validInt($_REQUEST['smid']); - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id = ?', NULL, array($mid)); - $smonitor = dbFetchOne('SELECT * FROM Monitors WHERE Id = ?', NULL, array($smid)); - - dbQuery('UPDATE Monitors SET Sequence=? WHERE Id=?', array($smonitor['Sequence'], $monitor['Id'])); - dbQuery('UPDATE Monitors SET Sequence=? WHERE Id=?', array($monitor['Sequence'], $smonitor['Id'])); - - $refreshParent = true; - fixSequences(); - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markZids']) ) { - $deletedZid = 0; - foreach ( $_REQUEST['markZids'] as $markZid ) { - $zone = dbFetchOne('SELECT * FROM Zones WHERE Id=?', NULL, array($markZid)); - dbQuery('DELETE FROM Zones WHERE MonitorId=? AND Id=?', array($mid, $markZid)); - $deletedZid = 1; - } - if ( $deletedZid ) { - if ( daemonCheck() && $monitor['Type'] != 'WebSite' ) { - if ( $zone['Type'] == 'Privacy' ) { - zmaControl($mid, 'stop'); - zmcControl($mid, 'restart'); - zmaControl($mid, 'start'); - } else { - zmaControl($mid, 'restart'); - } - } // end if daemonCheck() - $refreshParent = true; - } // end if deletedzid - } // end if isset($_REQUEST['markZids']) - } // end if action -} // end if $mid and canEdit($mid) - -// Monitor edit actions, monitor id derived, require edit permissions for that monitor -if ( canEdit('Monitors') ) { - if ( $action == 'monitor' ) { - $mid = 0; - if ( !empty($_REQUEST['mid']) ) { - $mid = validInt($_REQUEST['mid']); - $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id=?', NULL, array($mid)); - - if ( ZM_OPT_X10 ) { - $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId=?', NULL, array($mid)); - if ( !$x10Monitor ) - $x10Monitor = array(); - } - } else { - $monitor = array(); - if ( ZM_OPT_X10 ) { - $x10Monitor = array(); - } - } - $Monitor = new Monitor($monitor); - - // Define a field type for anything that's not simple text equivalent - $types = array( - 'Triggers' => 'set', - 'Controllable' => 'toggle', - 'TrackMotion' => 'toggle', - 'Enabled' => 'toggle', - 'DoNativeMotDet' => 'toggle', - 'Exif' => 'toggle', - 'RTSPDescribe' => 'toggle', - 'RecordAudio' => 'toggle', - 'Method' => 'raw', - ); - - if ( $_REQUEST['newMonitor']['ServerId'] == 'auto' ) { - $_REQUEST['newMonitor']['ServerId'] = dbFetchOne( - 'SELECT Id FROM Servers WHERE Status=\'Running\' ORDER BY FreeMem DESC, CpuLoad ASC LIMIT 1', 'Id'); - Logger::Debug('Auto selecting server: Got ' . $_REQUEST['newMonitor']['ServerId'] ); - if ( ( ! $_REQUEST['newMonitor'] ) and defined('ZM_SERVER_ID') ) { - $_REQUEST['newMonitor']['ServerId'] = ZM_SERVER_ID; - Logger::Debug('Auto selecting server to ' . ZM_SERVER_ID); - } - } - - $columns = getTableColumns('Monitors'); - $changes = getFormChanges($monitor, $_REQUEST['newMonitor'], $types, $columns); - - if ( count($changes) ) { - if ( $mid ) { - - # If we change anything that changes the shared mem size, zma can complain. So let's stop first. - if ( $monitor['Type'] != 'WebSite' ) { - zmaControl($monitor, 'stop'); - zmcControl($monitor, 'stop'); - } - dbQuery('UPDATE Monitors SET '.implode(', ', $changes).' WHERE Id=?', array($mid)); - // Groups will be added below - if ( isset($changes['Name']) or isset($changes['StorageId']) ) { - $OldStorage = new Storage($monitor['StorageId']); - $saferOldName = basename($monitor['Name']); - if ( file_exists($OldStorage->Path().'/'.$saferOldName) ) - unlink($OldStorage->Path().'/'.$saferOldName); - - $NewStorage = new Storage($_REQUEST['newMonitor']['StorageId']); - if ( ! file_exists($NewStorage->Path().'/'.$mid) ) - mkdir($NewStorage->Path().'/'.$mid, 0755); - $saferNewName = basename($_REQUEST['newMonitor']['Name']); - symlink($mid, $NewStorage->Path().'/'.$saferNewName); - } - if ( isset($changes['Width']) || isset($changes['Height']) ) { - $newW = $_REQUEST['newMonitor']['Width']; - $newH = $_REQUEST['newMonitor']['Height']; - $newA = $newW * $newH; - $oldW = $monitor['Width']; - $oldH = $monitor['Height']; - $oldA = $oldW * $oldH; - - $zones = dbFetchAll('SELECT * FROM Zones WHERE MonitorId=?', NULL, array($mid)); - foreach ( $zones as $zone ) { - $newZone = $zone; - $points = coordsToPoints($zone['Coords']); - for ( $i = 0; $i < count($points); $i++ ) { - $points[$i]['x'] = intval(($points[$i]['x']*($newW-1))/($oldW-1)); - $points[$i]['y'] = intval(($points[$i]['y']*($newH-1))/($oldH-1)); - } - $newZone['Coords'] = pointsToCoords($points); - $newZone['Area'] = intval(round(($zone['Area']*$newA)/$oldA)); - $newZone['MinAlarmPixels'] = intval(round(($newZone['MinAlarmPixels']*$newA)/$oldA)); - $newZone['MaxAlarmPixels'] = intval(round(($newZone['MaxAlarmPixels']*$newA)/$oldA)); - $newZone['MinFilterPixels'] = intval(round(($newZone['MinFilterPixels']*$newA)/$oldA)); - $newZone['MaxFilterPixels'] = intval(round(($newZone['MaxFilterPixels']*$newA)/$oldA)); - $newZone['MinBlobPixels'] = intval(round(($newZone['MinBlobPixels']*$newA)/$oldA)); - $newZone['MaxBlobPixels'] = intval(round(($newZone['MaxBlobPixels']*$newA)/$oldA)); - - $changes = getFormChanges($zone, $newZone, $types); - - if ( count($changes) ) { - dbQuery('UPDATE Zones SET '.implode(', ', $changes).' WHERE MonitorId=? AND Id=?', - array($mid, $zone['Id'])); - } - } // end foreach zone - } // end if width and height - $restart = true; - } else if ( ! $user['MonitorIds'] ) { - // Can only create new monitors if we are not restricted to specific monitors -# FIXME This is actually a race condition. Should lock the table. - $maxSeq = dbFetchOne('SELECT MAX(Sequence) AS MaxSequence FROM Monitors', 'MaxSequence'); - $changes[] = 'Sequence = '.($maxSeq+1); - - $sql = 'INSERT INTO Monitors SET '.implode(', ', $changes); - if ( dbQuery($sql) ) { - $mid = dbInsertId(); - $zoneArea = $_REQUEST['newMonitor']['Width'] * $_REQUEST['newMonitor']['Height']; - dbQuery("INSERT INTO Zones SET MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) ); - //$view = 'none'; - $Storage = new Storage($_REQUEST['newMonitor']['StorageId']); - mkdir($Storage->Path().'/'.$mid, 0755); - $saferName = basename($_REQUEST['newMonitor']['Name']); - symlink($mid, $Storage->Path().'/'.$saferName); - - } else { - Error('Error saving new Monitor.'); - $error_message = dbError($sql); - return; - } - } else { - Error('Users with Monitors restrictions cannot create new monitors.'); - return; - } - - $restart = true; - } else { - Logger::Debug('No action due to no changes to Monitor'); - } # end if count(changes) - - if ( - ( !isset($_POST['newMonitor']['GroupIds']) ) - or - ( count($_POST['newMonitor']['GroupIds']) != count($Monitor->GroupIds()) ) - or - array_diff($_POST['newMonitor']['GroupIds'], $Monitor->GroupIds()) - ) { - if ( $Monitor->Id() ) - dbQuery('DELETE FROM Groups_Monitors WHERE MonitorId=?', array($mid)); - - if ( isset($_POST['newMonitor']['GroupIds']) ) { - foreach ( $_POST['newMonitor']['GroupIds'] as $group_id ) { - dbQuery('INSERT INTO Groups_Monitors (GroupId,MonitorId) VALUES (?,?)', array($group_id, $mid)); - } - } - } // end if there has been a change of groups - - if ( ZM_OPT_X10 ) { - $x10Changes = getFormChanges($x10Monitor, $_REQUEST['newX10Monitor']); - - if ( count($x10Changes) ) { - if ( $x10Monitor && isset($_REQUEST['newX10Monitor']) ) { - dbQuery('UPDATE TriggersX10 SET '.implode(', ', $x10Changes).' WHERE MonitorId=?', array($mid)); - } elseif ( !$user['MonitorIds'] ) { - if ( !$x10Monitor ) { - dbQuery('INSERT INTO TriggersX10 SET MonitorId = ?, '.implode(', ', $x10Changes), array($mid)); - } else { - dbQuery('DELETE FROM TriggersX10 WHERE MonitorId = ?', array($mid)); - } - } - $restart = true; - } # end if has x10Changes - } # end if ZM_OPT_X10 - - if ( $restart ) { - - $new_monitor = new Monitor($mid); - //fixDevices(); - - if ( $new_monitor->Type() != 'WebSite' ) { - $new_monitor->zmcControl('start'); - $new_monitor->zmaControl('start'); - } - - if ( $new_monitor->Controllable() ) { - require_once('control_functions.php'); - sendControlCommand($mid, 'quit'); - } - // really should thump zmwatch and maybe zmtrigger too. - //daemonControl( 'restart', 'zmwatch.pl' ); - $refreshParent = true; - } // end if restart - $view = 'none'; - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markMids']) && !$user['MonitorIds'] ) { - require_once('Monitor.php'); - foreach ( $_REQUEST['markMids'] as $markMid ) { - if ( canEdit('Monitors', $markMid) ) { - // This could be faster as a select all - if ( $monitor = dbFetchOne('SELECT * FROM Monitors WHERE Id = ?', NULL, array($markMid)) ) { - $Monitor = new Monitor($monitor); - $Monitor->delete(); - } // end if monitor found in db - } // end if canedit this monitor - } // end foreach monitor in MarkMid - } // markMids is set and we aren't limited to specific monitors - } // end if action == Delete -} - -// Device view actions -if ( canEdit('Devices') ) { - if ( $action == 'device' ) { - if ( !empty($_REQUEST['command']) ) { - setDeviceStatusX10($_REQUEST['key'], $_REQUEST['command']); - } else if ( isset($_REQUEST['newDevice']) ) { - if ( isset($_REQUEST['did']) ) { - dbQuery('UPDATE Devices SET Name=?, KeyString=? WHERE Id=?', - array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString'], $_REQUEST['did']) ); - } else { - dbQuery('INSERT INTO Devices SET Name=?, KeyString=?', - array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString']) ); - } - $refreshParent = true; - $view = 'none'; - } - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['markDids']) ) { - foreach( $_REQUEST['markDids'] as $markDid ) { - dbQuery('DELETE FROM Devices WHERE Id=?', array($markDid)); - $refreshParent = true; - } - } - } // end if action -} // end if canedit devices - -// Group view actions -if ( canView('Groups') && ($action == 'setgroup') ) { - if ( !empty($_REQUEST['gid']) ) { - setcookie('zmGroup', validInt($_REQUEST['gid']), time()+3600*24*30*12*10); - } else { - setcookie('zmGroup', '', time()-3600*24*2); - } - $refreshParent = true; -} - -// Group edit actions -# Should probably verify that each monitor id is a valid monitor, that we have access to. -# However at the moment, you have to have System permissions to do this -if ( canEdit('Groups') ) { - if ( $action == 'group' ) { - $monitors = empty($_POST['newGroup']['MonitorIds']) ? '' : implode(',', $_POST['newGroup']['MonitorIds']); - $group_id = null; - if ( !empty($_POST['gid']) ) { - $group_id = $_POST['gid']; - dbQuery( - 'UPDATE Groups SET Name=?, ParentId=? WHERE Id=?', - array( - $_POST['newGroup']['Name'], - ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ), - $group_id, - ) - ); - dbQuery('DELETE FROM Groups_Monitors WHERE GroupId=?', array($group_id)); - } else { - dbQuery( - 'INSERT INTO Groups (Name,ParentId) VALUES (?,?)', - array( - $_POST['newGroup']['Name'], - ( $_POST['newGroup']['ParentId'] == '' ? null : $_POST['newGroup']['ParentId'] ), - ) - ); - $group_id = dbInsertId(); - } - if ( $group_id ) { - foreach ( $_POST['newGroup']['MonitorIds'] as $mid ) { - dbQuery('INSERT INTO Groups_Monitors (GroupId,MonitorId) VALUES (?,?)', array($group_id, $mid)); - } - } - $view = 'none'; - $refreshParent = true; - } else if ( $action == 'delete' ) { - if ( !empty($_REQUEST['gid']) ) { - foreach ( Group::find(array('Id'=>$_REQUEST['gid'])) as $Group ) { - $Group->delete(); - } - } - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=groups'; - $refreshParent = true; - } # end if action -} // end if can edit groups - -// System edit actions -if ( canEdit('System') ) { - if ( isset($_REQUEST['object']) ) { - if ( $_REQUEST['object'] == 'MontageLayout' ) { - require_once('MontageLayout.php'); - if ( $action == 'Save' ) { - $Layout = null; - if ( $_REQUEST['Name'] != '' ) { - $Layout = new MontageLayout(); - $Layout->Name($_REQUEST['Name']); - } else { - $Layout = new MontageLayout($_REQUEST['zmMontageLayout']); - } - $Layout->Positions($_REQUEST['Positions']); - $Layout->save(); - session_start(); - $_SESSION['zmMontageLayout'] = $Layout->Id(); - setcookie('zmMontageLayout', $Layout->Id(), 1); - session_write_close(); - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=montage'; - } // end if save - - } else if ( $_REQUEST['object'] == 'server' ) { - - if ( $action == 'Save' ) { - if ( !empty($_REQUEST['id']) ) { - $dbServer = dbFetchOne( - 'SELECT * FROM Servers WHERE Id=?', - NULL, - array($_REQUEST['id']) ); - } else { - $dbServer = array(); - } - - $types = array(); - $changes = getFormChanges($dbServer, $_REQUEST['newServer'], $types); - - if ( count($changes) ) { - if ( !empty($_REQUEST['id']) ) { - dbQuery('UPDATE Servers SET '.implode(', ', $changes).' WHERE Id = ?', - array($_REQUEST['id']) ); - } else { - dbQuery('INSERT INTO Servers SET '.implode(', ', $changes)); - } - $refreshParent = true; - } - $view = 'none'; - } else if ( $action == 'delete' ) { - if ( !empty($_REQUEST['markIds']) ) { - foreach( $_REQUEST['markIds'] as $Id ) - dbQuery('DELETE FROM Servers WHERE Id=?', array($Id)); - } - $refreshParent = true; - } else { - Error("Unknown action $action in saving Server"); - } - } else if ( $_REQUEST['object'] == 'storage' ) { - if ( $action == 'Save' ) { - if ( !empty($_REQUEST['id']) ) - $dbStorage = dbFetchOne('SELECT * FROM Storage WHERE Id=?', NULL, array($_REQUEST['id'])); - else - $dbStorage = array(); - - $types = array(); - $changes = getFormChanges($dbStorage, $_REQUEST['newStorage'], $types); - - if ( count($changes) ) { - if ( !empty($_REQUEST['id']) ) { - dbQuery('UPDATE Storage SET '.implode(', ', $changes).' WHERE Id = ?', array($_REQUEST['id'])); - } else { - dbQuery('INSERT INTO Storage set '.implode(', ', $changes)); - } - $refreshParent = true; - } - $view = 'none'; - } else if ( $action == 'delete' ) { - if ( !empty($_REQUEST['markIds']) ) { - foreach( $_REQUEST['markIds'] as $Id ) - dbQuery('DELETE FROM Storage WHERE Id=?', array($Id)); - } - $refreshParent = true; - } else { - Error("Unknown action $action in saving Storage"); - } - } # end if isset($_REQUEST['object'] ) - - } else if ( $action == 'version' && isset($_REQUEST['option']) ) { - $option = $_REQUEST['option']; - switch( $option ) { - case 'go' : - { - // Ignore this, the caller will open the page itself - break; - } - case 'ignore' : - { - dbQuery("UPDATE Config SET Value = '".ZM_DYN_LAST_VERSION."' WHERE Name = 'ZM_DYN_CURR_VERSION'"); - break; - } - case 'hour' : - case 'day' : - case 'week' : - { - $nextReminder = time(); - if ( $option == 'hour' ) { - $nextReminder += 60*60; - } elseif ( $option == 'day' ) { - $nextReminder += 24*60*60; - } elseif ( $option == 'week' ) { - $nextReminder += 7*24*60*60; - } - dbQuery("UPDATE Config SET Value = '".$nextReminder."' WHERE Name = 'ZM_DYN_NEXT_REMINDER'"); - break; - } - case 'never' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_CHECK_FOR_UPDATES'"); - break; - } - } - } - if ( $action == 'donate' && isset($_REQUEST['option']) ) { - $option = $_REQUEST['option']; - switch( $option ) { - case 'go' : - { - // Ignore this, the caller will open the page itself - break; - } - case 'hour' : - case 'day' : - case 'week' : - case 'month' : - { - $nextReminder = time(); - if ( $option == 'hour' ) { - $nextReminder += 60*60; - } elseif ( $option == 'day' ) { - $nextReminder += 24*60*60; - } elseif ( $option == 'week' ) { - $nextReminder += 7*24*60*60; - } elseif ( $option == 'month' ) { - $nextReminder += 30*24*60*60; - } - dbQuery("UPDATE Config SET Value = '".$nextReminder."' WHERE Name = 'ZM_DYN_DONATE_REMINDER_TIME'"); - break; - } - case 'never' : - case 'already' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_DYN_SHOW_DONATE_REMINDER'"); - break; - } - } // end switch option - } - if ( ($action == 'privacy') && isset($_REQUEST['option']) ) { - switch( $_REQUEST['option'] ) { - case 'decline' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_SHOW_PRIVACY'"); - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_TELEMETRY_DATA'"); - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=console'; - break; - } - case 'accept' : - { - dbQuery("UPDATE Config SET Value = '0' WHERE Name = 'ZM_SHOW_PRIVACY'"); - dbQuery("UPDATE Config SET Value = '1' WHERE Name = 'ZM_TELEMETRY_DATA'"); - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=console'; - break; - } - default: # Enable the privacy statement if we somehow submit something other than accept or decline - dbQuery("UPDATE Config SET Value = '1' WHERE Name = 'ZM_SHOW_PRIVACY'"); - } // end switch option - return; - } - if ( $action == 'options' && isset($_REQUEST['tab']) ) { - $config = array(); - $configCat = array(); - $configCats = array(); - - $result = $dbConn->query('SELECT * FROM Config ORDER BY Id ASC'); - if ( !$result ) - echo mysql_error(); - while( $row = dbFetchNext($result) ) { - $config[$row['Name']] = $row; - if ( !($configCat = &$configCats[$row['Category']]) ) { - $configCats[$row['Category']] = array(); - $configCat = &$configCats[$row['Category']]; - } - $configCat[$row['Name']] = $row; - } - - $configCat = $configCats[$_REQUEST['tab']]; - $changed = false; - foreach ( $configCat as $name=>$value ) { - unset($newValue); - if ( $value['Type'] == 'boolean' && empty($_REQUEST['newConfig'][$name]) ) { - $newValue = 0; - } else if ( isset($_REQUEST['newConfig'][$name]) ) { - $newValue = preg_replace("/\r\n/", "\n", stripslashes($_REQUEST['newConfig'][$name])); - } - - if ( isset($newValue) && ($newValue != $value['Value']) ) { - dbQuery('UPDATE Config SET Value=? WHERE Name=?', array($newValue, $name)); - $changed = true; - } - } - if ( $changed ) { - switch( $_REQUEST['tab'] ) { - case 'system' : - case 'config' : - $restartWarning = true; - break; - case 'web' : - case 'tools' : - break; - case 'logging' : - case 'network' : - case 'mail' : - case 'upload' : - $restartWarning = true; - break; - case 'highband' : - case 'medband' : - case 'lowband' : - break; - } - $redirect = ZM_BASE_URL.$_SERVER['PHP_SELF'].'?view=options&tab='.$_REQUEST['tab']; - } - loadConfig(false); - return; - } elseif ( $action == 'user' ) { - if ( !empty($_REQUEST['uid']) ) - $dbUser = dbFetchOne('SELECT * FROM Users WHERE Id=?', NULL, array($_REQUEST['uid'])); - else - $dbUser = array(); - - $types = array(); - $changes = getFormChanges($dbUser, $_REQUEST['newUser'], $types); - - if ( $_REQUEST['newUser']['Password'] ) - $changes['Password'] = 'Password = password('.dbEscape($_REQUEST['newUser']['Password']).')'; - else - unset($changes['Password']); - - if ( count($changes) ) { - if ( !empty($_REQUEST['uid']) ) { - dbQuery('UPDATE Users SET '.implode(', ', $changes).' WHERE Id = ?', array($_REQUEST['uid'])); - # If we are updating the logged in user, then update our session user data. - if ( $user and ( $dbUser['Username'] == $user['Username'] ) ) - userLogin($dbUser['Username'], $dbUser['Password']); - } else { - dbQuery('INSERT INTO Users SET '.implode(', ', $changes)); - } - $refreshParent = true; - } - $view = 'none'; - } elseif ( $action == 'state' ) { - if ( !empty($_REQUEST['runState']) ) { - //if ( $cookies ) session_write_close(); - packageControl($_REQUEST['runState']); - $refreshParent = true; - } - } elseif ( $action == 'save' ) { - if ( !empty($_REQUEST['runState']) || !empty($_REQUEST['newState']) ) { - $sql = 'SELECT Id,Function,Enabled FROM Monitors ORDER BY Id'; - $definitions = array(); - foreach( dbFetchAll($sql) as $monitor ) { - $definitions[] = $monitor['Id'].':'.$monitor['Function'].':'.$monitor['Enabled']; - } - $definition = join(',', $definitions); - if ( $_REQUEST['newState'] ) - $_REQUEST['runState'] = $_REQUEST['newState']; - dbQuery('REPLACE INTO States SET Name=?, Definition=?', array($_REQUEST['runState'],$definition)); - } - } elseif ( $action == 'delete' ) { - if ( isset($_REQUEST['runState']) ) - dbQuery('DELETE FROM States WHERE Name=?', array($_REQUEST['runState'])); - - if ( isset($_REQUEST['markUids']) ) { - foreach( $_REQUEST['markUids'] as $markUid ) - dbQuery('DELETE FROM Users WHERE Id = ?', array($markUid)); - if ( $markUid == $user['Id'] ) - userLogout(); - } - } -} else { - if ( ZM_USER_SELF_EDIT && $action == 'user' ) { - $uid = $user['Id']; - - $dbUser = dbFetchOne('SELECT Id, Password, Language FROM Users WHERE Id = ?', NULL, array($uid)); - - $types = array(); - $changes = getFormChanges($dbUser, $_REQUEST['newUser'], $types); - - if ( !empty($_REQUEST['newUser']['Password']) ) - $changes['Password'] = 'Password = password('.dbEscape($_REQUEST['newUser']['Password']).')'; - else - unset($changes['Password']); - if ( count($changes) ) { - dbQuery('UPDATE Users SET '.implode(', ', $changes).' WHERE Id=?', array($uid)); - $refreshParent = true; - } - $view = 'none'; - } -} - -if ( $action == 'reset' ) { - session_start(); - $_SESSION['zmEventResetTime'] = strftime(STRF_FMT_DATETIME_DB); - setcookie('zmEventResetTime', $_SESSION['zmEventResetTime'], time()+3600*24*30*12*10); - session_write_close(); -} - -?> From 0e20666992abcb1ee04def2e10a4abe8fa1ea49f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 15:43:31 -0500 Subject: [PATCH 39/47] fix eventdetail actions being in events --- web/includes/actions/eventdetail.php | 47 ++++++++++++++++++++++++++++ web/includes/actions/events.php | 16 +--------- 2 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 web/includes/actions/eventdetail.php diff --git a/web/includes/actions/eventdetail.php b/web/includes/actions/eventdetail.php new file mode 100644 index 000000000..c0507776f --- /dev/null +++ b/web/includes/actions/eventdetail.php @@ -0,0 +1,47 @@ +beginTransaction(); + foreach ( getAffectedIds('markEid') as $markEid ) { + dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', + array( + $_REQUEST['newEvent']['Cause'], + $_REQUEST['newEvent']['Notes'], + $markEid + ) + ); + } + $dbConn->commit(); + $refreshParent = true; + $closePopup = true; +} +?> diff --git a/web/includes/actions/events.php b/web/includes/actions/events.php index dff69d738..10642f329 100644 --- a/web/includes/actions/events.php +++ b/web/includes/actions/events.php @@ -29,21 +29,7 @@ if ( !canEdit('Events') ) { return; } // end if ! canEdit(Events) -if ( $action == 'eventdetail' ) { - $dbConn->beginTransaction(); - foreach ( getAffectedIds('markEid') as $markEid ) { - dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', - array( - $_REQUEST['newEvent']['Cause'], - $_REQUEST['newEvent']['Notes'], - $markEid - ) - ); - } - $dbConn->commit(); - $refreshParent = true; - $closePopup = true; -} else if ( $action == 'archive' ) { +if ( $action == 'archive' ) { $dbConn->beginTransaction(); foreach( getAffectedIds('markEid') as $markEid ) { dbQuery('UPDATE Events SET Archived=? WHERE Id=?', array(1, $markEid)); From dea64320f001fd9c91c2aaeed344fa8feef1db51 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 15:52:14 -0500 Subject: [PATCH 40/47] Fix a + that should be a . --- web/views/image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/views/image.php b/web/views/image.php index 16c88f908..d9b740059 100644 --- a/web/views/image.php +++ b/web/views/image.php @@ -103,7 +103,7 @@ if ( empty($_REQUEST['path']) ) { if ( !$Frame ) $Frame = Frame::find_one(array('EventId'=>$_REQUEST['eid'])); if ( !$Frame ) { - Warning("No frame found for event " + $_REQUEST['eid']); + Warning('No frame found for event ' . $_REQUEST['eid']); $Frame = new Frame(); $Frame->Delta(1); $Frame->FrameId('snapshot'); From e72e4e7ce41e9b3face8af9cdb161e461a3cd79a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 15:52:36 -0500 Subject: [PATCH 41/47] Spacing, remove some html4 stuff, clean up duplicated hidden form elements. --- web/skins/classic/views/eventdetail.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/web/skins/classic/views/eventdetail.php b/web/skins/classic/views/eventdetail.php index bad9a18bc..1afe23d9f 100644 --- a/web/skins/classic/views/eventdetail.php +++ b/web/skins/classic/views/eventdetail.php @@ -18,14 +18,14 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // -if ( !canEdit( 'Events' ) ) { +if ( !canEdit('Events') ) { $view = 'error'; return; } if ( isset($_REQUEST['eid']) ) { $mode = 'single'; $eid = validInt($_REQUEST['eid']); - $newEvent = dbFetchOne( 'SELECT E.* FROM Events AS E WHERE E.Id = ?', NULL, array($eid) ); + $newEvent = dbFetchOne('SELECT E.* FROM Events AS E WHERE E.Id = ?', NULL, array($eid)); } elseif ( isset($_REQUEST['eids']) ) { $mode = 'multi'; $sql = 'SELECT E.* FROM Events AS E WHERE '; @@ -35,8 +35,8 @@ if ( isset($_REQUEST['eid']) ) { $sqlWhere[] = 'E.Id = ?'; $sqlValues[] = $eid; } - unset( $eid ); - $sql .= join( " or ", $sqlWhere ); + unset($eid); + $sql .= join(' OR ', $sqlWhere); foreach( dbFetchAll( $sql, NULL, $sqlValues ) as $row ) { if ( !isset($newEvent) ) { $newEvent = $row; @@ -75,18 +75,15 @@ if ( $mode == 'single' ) {
- + + - - - - @@ -95,7 +92,7 @@ if ( $mode == 'single' ) { } } ?> - +
@@ -108,8 +105,10 @@ if ( $mode == 'single' ) {
- disabled="disabled"/> - + +
From 5b5905c83adf035dac2c4dc8223b54e0a2f781a9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Jan 2019 16:29:16 -0500 Subject: [PATCH 42/47] We always use markEids[] now --- web/includes/actions/eventdetail.php | 2 +- web/skins/classic/views/eventdetail.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/includes/actions/eventdetail.php b/web/includes/actions/eventdetail.php index c0507776f..561c2cb78 100644 --- a/web/includes/actions/eventdetail.php +++ b/web/includes/actions/eventdetail.php @@ -31,7 +31,7 @@ if ( !canEdit('Events') ) { if ( $action == 'eventdetail' ) { $dbConn->beginTransaction(); - foreach ( getAffectedIds('markEid') as $markEid ) { + foreach ( $_REQUEST['markEids'] as $markEid ) { dbQuery('UPDATE Events SET Cause=?, Notes=? WHERE Id=?', array( $_REQUEST['newEvent']['Cause'], diff --git a/web/skins/classic/views/eventdetail.php b/web/skins/classic/views/eventdetail.php index 1afe23d9f..388c7cfb2 100644 --- a/web/skins/classic/views/eventdetail.php +++ b/web/skins/classic/views/eventdetail.php @@ -33,7 +33,7 @@ if ( isset($_REQUEST['eid']) ) { $sqlValues = array(); foreach ( $_REQUEST['eids'] as $eid ) { $sqlWhere[] = 'E.Id = ?'; - $sqlValues[] = $eid; + $sqlValues[] = validInt($eid); } unset($eid); $sql .= join(' OR ', $sqlWhere); @@ -80,14 +80,14 @@ if ( $mode == 'single' ) { - + - + Date: Sat, 5 Jan 2019 08:14:39 -0600 Subject: [PATCH 43/47] Create issue-close-app.yml --- .github/issue-close-app.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/issue-close-app.yml diff --git a/.github/issue-close-app.yml b/.github/issue-close-app.yml new file mode 100644 index 000000000..ebe4cdcfa --- /dev/null +++ b/.github/issue-close-app.yml @@ -0,0 +1,16 @@ +# Comment that will be sent if an issue is judged to be closed +comment: "This issue is closed because it does not meet our bug report issue template. Please read it." +issueConfigs: +# There can be several configs for different kind of issues. +- content: +# Example 1: bug report + - "Describe Your Environment" + - "Describe the bug" + - "Expected behavior" +# Optional configuration: +# +# whether the keywords are case-insensitive +# default value is false, which means keywords are case-sensitive +caseInsensitive: true +# The issue is judged to be legal if it includes all keywords from any of these two configs. +# Or it will be closed by the app. From 16f272e3e0425f42a5f3d1a529b14209ea333e7b Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 5 Jan 2019 08:21:52 -0600 Subject: [PATCH 44/47] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..ce4347efe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,39 @@ +--- +name: Bug report +about: Issues that do not follow the template will be closed +title: '' +labels: '' +assignees: '' + +--- + +**Describe Your Environment** +- Version of ZoneMinder [release version, development version, or commit] +- How you installed ZoneMinder [e.g. PPA, RPMFusion, from-source, etc] +- Full name and version of OS + +**If the issue concerns a camera** +- Make and Model +- frame rate +- resolution +- ZoneMinder Source Type: + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Debug Logs** +``` + + + +``` From 7336cdaf0dee0b498ee0b982a37135cd49f8d9c2 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sat, 5 Jan 2019 08:29:58 -0600 Subject: [PATCH 45/47] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f52716c2d..809393c3e 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,6 +1,6 @@ **THIS FORUM IS FOR BUG REPORTS ONLY** -Do not post feature or enhancement requests, general discussions or support questions here. +Do not post feature or enhancement requests, general discussions, or support questions here. Feature and enhancement requests, general discussions, and support questions should occur in one of the following areas: @@ -9,7 +9,9 @@ Feature and enhancement requests, general discussions, and support questions sho Docker related issues should be posted here: https://github.com/ZoneMinder/zmdockerfiles -In order to submit a bug report, please populate the fields below. This is required. +In order to submit a bug report, please populate the fields below this line. This is required. + +---------------------------------------------------------------------------------------------------- **Describe Your Environment** - Version of ZoneMinder [release version, development version, or commit] From c4c6d5b6429e0c06dde25f1c9d42da88d8753901 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 5 Jan 2019 10:15:22 -0500 Subject: [PATCH 46/47] switch to swr_convert_frame as a test --- src/zm_ffmpeg_camera.cpp | 9 ++++---- src/zm_videostore.cpp | 48 ++++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 22dfa35ba..f1fe2528e 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -845,22 +845,23 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event packet_count += 1; //Write the packet to our video store - Debug(2, "Writing queued packet stream: %d KEY %d, remaining (%d)", avp->stream_index, avp->flags & AV_PKT_FLAG_KEY, packetqueue->size() ); + Debug(2, "Writing queued packet stream: %d KEY %d, remaining (%d)", + avp->stream_index, avp->flags & AV_PKT_FLAG_KEY, packetqueue->size()); if ( avp->stream_index == mVideoStreamId ) { ret = videoStore->writeVideoFramePacket( avp ); have_video_keyframe = true; } else if ( avp->stream_index == mAudioStreamId ) { ret = videoStore->writeAudioFramePacket( avp ); } else { - Warning("Unknown stream id in queued packet (%d)", avp->stream_index ); + Warning("Unknown stream id in queued packet (%d)", avp->stream_index); ret = -1; } if ( ret < 0 ) { - //Less than zero and we skipped a frame + // Less than zero and we skipped a frame } delete queued_packet; } // end while packets in the packetqueue - Debug(2, "Wrote %d queued packets", packet_count ); + Debug(2, "Wrote %d queued packets", packet_count); } } // end if ! was recording diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index cb7bac722..fe812d80e 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -350,7 +350,7 @@ VideoStore::~VideoStore() { if ( oc->pb ) { - if (audio_out_codec) { + if ( audio_out_codec ) { // The codec queues data. We need to send a flush command and out // whatever we get. Failures are not fatal. AVPacket pkt; @@ -366,7 +366,7 @@ VideoStore::~VideoStore() { ret = avcodec_receive_packet(audio_out_ctx, &pkt); if ( ret < 0 ) { if ( AVERROR_EOF != ret ) { - Error("ERror encoding audio while flushing (%d) (%s)", ret, + Error("Error encoding audio while flushing (%d) (%s)", ret, av_err2str(ret)); } break; @@ -411,7 +411,7 @@ VideoStore::~VideoStore() { Debug(1,"Writing trailer"); /* Write the trailer before close */ - if (int rc = av_write_trailer(oc)) { + if ( int rc = av_write_trailer(oc) ) { Error("Error writing trailer %s", av_err2str(rc)); } else { Debug(3, "Success Writing trailer"); @@ -421,7 +421,7 @@ VideoStore::~VideoStore() { if ( !(out_format->flags & AVFMT_NOFILE) ) { /* Close the out file. */ Debug(2, "Closing"); - if (int rc = avio_close(oc->pb)) { + if ( int rc = avio_close(oc->pb) ) { oc->pb = NULL; Error("Error closing avio %s", av_err2str(rc)); } @@ -510,8 +510,7 @@ bool VideoStore::setup_resampler() { #else audio_in_codec = avcodec_find_decoder(audio_in_ctx->codec_id); #endif - ret = avcodec_open2(audio_in_ctx, audio_in_codec, NULL); - if ( ret < 0 ) { + if ( (ret = avcodec_open2(audio_in_ctx, audio_in_codec, NULL)) < 0 ) { Error("Can't open in codec!"); return false; } @@ -540,11 +539,13 @@ bool VideoStore::setup_resampler() { audio_out_ctx = audio_out_stream->codec; #endif // Some formats (i.e. WAV) do not produce the proper channel layout - if ( audio_in_ctx->channel_layout == 0 ) + if ( audio_in_ctx->channel_layout == 0 ) { + Debug(2, "Setting input channel layout to mono"); audio_in_ctx->channel_layout = av_get_channel_layout("mono"); + } /* put sample parameters */ - audio_out_ctx->bit_rate = audio_in_ctx->bit_rate <= 96000 ? audio_in_ctx->bit_rate : 96000; + audio_out_ctx->bit_rate = audio_in_ctx->bit_rate <= 32768 ? audio_in_ctx->bit_rate : 32768; audio_out_ctx->sample_rate = audio_in_ctx->sample_rate; audio_out_ctx->channels = audio_in_ctx->channels; audio_out_ctx->channel_layout = audio_in_ctx->channel_layout; @@ -582,13 +583,12 @@ bool VideoStore::setup_resampler() { /* check that the encoder supports s16 pcm in */ if ( !check_sample_fmt(audio_out_codec, audio_out_ctx->sample_fmt) ) { - Debug(3, "Encoder does not support sample format %s, setting to FLTP", + Debug(2, "Encoder does not support sample format %s, setting to FLTP", av_get_sample_fmt_name(audio_out_ctx->sample_fmt)); audio_out_ctx->sample_fmt = AV_SAMPLE_FMT_FLTP; } - audio_out_ctx->time_base = - (AVRational){1, audio_out_ctx->sample_rate}; + audio_out_ctx->time_base = (AVRational){1, audio_out_ctx->sample_rate}; AVDictionary *opts = NULL; if ( (ret = av_dict_set(&opts, "strict", "experimental", 0)) < 0 ) { @@ -655,6 +655,7 @@ bool VideoStore::setup_resampler() { swr_free(&resample_ctx); return false; } + Debug(1,"Success setting up SWRESAMPLE"); #else #if defined(HAVE_LIBAVRESAMPLE) // Setup the audio resampler @@ -884,14 +885,12 @@ int VideoStore::writeAudioFramePacket(AVPacket *ipkt) { #if defined(HAVE_LIBSWRESAMPLE) || defined(HAVE_LIBAVRESAMPLE) #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - ret = avcodec_send_packet(audio_in_ctx, ipkt); - if ( ret < 0 ) { + if ( (ret = avcodec_send_packet(audio_in_ctx, ipkt)) < 0 ) { Error("avcodec_send_packet fail %s", av_make_error_string(ret).c_str()); return 0; } - ret = avcodec_receive_frame(audio_in_ctx, in_frame); - if (ret < 0) { + if ( (ret = avcodec_receive_frame(audio_in_ctx, in_frame)) < 0 ) { Error("avcodec_receive_frame fail %s", av_make_error_string(ret).c_str()); return 0; } @@ -928,17 +927,22 @@ int VideoStore::writeAudioFramePacket(AVPacket *ipkt) { Debug(2, "Converting %d to %d samples", in_frame->nb_samples, out_frame->nb_samples); if ( #if defined(HAVE_LIBSWRESAMPLE) +#if 0 (ret = swr_convert(resample_ctx, out_frame->data, frame_size, - (const uint8_t**)in_frame->data, - in_frame->nb_samples)) + (const uint8_t**)in_frame->data, in_frame->nb_samples + )) +#else + (ret = swr_convert_frame(resample_ctx, out_frame, in_frame)) + +#endif #else #if defined(HAVE_LIBAVRESAMPLE) (ret = avresample_convert(resample_ctx, NULL, 0, 0, in_frame->data, 0, in_frame->nb_samples)) #endif #endif - < 0) { + < 0 ) { Error("Could not resample frame (error '%s')", av_make_error_string(ret).c_str()); av_frame_unref(in_frame); @@ -971,7 +975,7 @@ int VideoStore::writeAudioFramePacket(AVPacket *ipkt) { Debug(5, "after init packet"); #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) - if ((ret = avcodec_send_frame(audio_out_ctx, out_frame)) < 0) { + if ( (ret = avcodec_send_frame(audio_out_ctx, out_frame)) < 0 ) { Error("Could not send frame (error '%s')", av_make_error_string(ret).c_str()); zm_av_packet_unref(&opkt); @@ -995,14 +999,14 @@ int VideoStore::writeAudioFramePacket(AVPacket *ipkt) { return 0; } #else - if ((ret = avcodec_encode_audio2(audio_out_ctx, &opkt, out_frame, - &data_present)) < 0) { + if ( (ret = avcodec_encode_audio2(audio_out_ctx, &opkt, out_frame, + &data_present)) < 0 ) { Error("Could not encode frame (error '%s')", av_make_error_string(ret).c_str()); zm_av_packet_unref(&opkt); return 0; } - if (!data_present) { + if ( !data_present ) { Debug(2, "Not ready to out a frame yet."); zm_av_packet_unref(&opkt); return 0; From e6ba8e58eff0688640a5bd2acd8483fdade0589b Mon Sep 17 00:00:00 2001 From: David Beitey Date: Sat, 5 Jan 2019 15:20:34 +0000 Subject: [PATCH 47/47] Fix #2391 by defining monitor variable (#2392) --- web/skins/classic/views/cycle.php | 1 + 1 file changed, 1 insertion(+) diff --git a/web/skins/classic/views/cycle.php b/web/skins/classic/views/cycle.php index 07bda5aaf..2ea5e48ab 100644 --- a/web/skins/classic/views/cycle.php +++ b/web/skins/classic/views/cycle.php @@ -38,6 +38,7 @@ ob_end_clean(); $monIdx = 0; $monitors = array(); +$monitor = NULL; foreach( $displayMonitors as &$row ) { if ( $row['Function'] == 'None' ) continue;