diff --git a/.travis.yml b/.travis.yml index 94c50c4b1..da5bf96b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ notifications: branches: except: - modern +addons: + sauce_connect: + username: "zoneminder" + access_key: "046ec7c1-c598-4e7e-949a-f86e725d1722" env: global: - LD_LIBRARY_PATH="/usr/local/lib:/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH" diff --git a/CMakeLists.txt b/CMakeLists.txt index d5608469f..f8c48a83d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,7 +224,11 @@ else(GCRYPT_LIBRARIES) endif(GCRYPT_LIBRARIES) # gnutls (using find_library and find_path) -find_library(GNUTLS_LIBRARIES gnutls) +find_library(GNUTLS_LIBRARIES gnutls-openssl) +if(NOT GNUTLS_LIBRARIES) + find_library(GNUTLS_LIBRARIES gnutls) +endif(NOT GNUTLS_LIBRARIES) + if(GNUTLS_LIBRARIES) set(HAVE_LIBGNUTLS 1) list(APPEND ZM_BIN_LIBS "${GNUTLS_LIBRARIES}") diff --git a/README.md b/README.md index e9c6dfdcd..1008c8560 100644 --- a/README.md +++ b/README.md @@ -108,29 +108,39 @@ root@host:~# gdebi /root/zoneminder_1.26.4-1_amd64.deb; Additional repositories must be added before one can build zoneminder on CentOS or RHEL: -1. RepoForge (formerly RPMForge) http://repoforge.org/use/ +1. Zmrepo [ZoneMinder WiKi](http://www.zoneminder.com/wiki/index.php/CentOS#Zmrepo_-_A_ZoneMinder_repository_for_RPM_based_distros) 2. EPEL https://fedoraproject.org/wiki/EPEL -3. Optional RPMFusion: http://rpmfusion.org/ [SEE NOTE] - -[NOTE]
-The RPMFusion repo contains significantly newer versions of ffmpeg and vlc. This leads to significantly better camera support. However, the RPMFusion repo contains packages that conflict with the other two repos. In order to resolve this, one must also install the yum priorities pacakge and use that to prioritize your repos in the following order: +3. RPMFusion: http://rpmfusion.org/ + +When adding third party repositories, it is highly recommended that the user also install and configure yum priorities as documented in the [CentOS WiKi](http://wiki.centos.org/PackageManagement/Yum/Priorities) + +Prioritize the repositories: 1. Base -2. RPMFusion -3. EPEL -4. RPMForge - -For instructions on yum priorities, visit this page: -http://wiki.centos.org/PackageManagement/Yum/Priorities +2. EPEL +3. RPMFusion +4. Zmrepo Once your repos are in order, install the following: ```bash -sudo yum install automake bzip2-devel ffmpeg ffmpeg-devel gnutls-devel httpd libjpeg-turbo libjpeg-turbo-devel mysql-devel mysql-server pcre-devel \ +sudo yum install cmake bzip2-devel ffmpeg ffmpeg-devel gnutls-devel httpd libjpeg-turbo libjpeg-turbo-devel mysql-devel mysql-server pcre-devel \ perl-Archive-Tar perl-Archive-Zip perl-Convert-BinHex perl-Date-Manip perl-DBD-MySQL perl-DBI perl-Device-SerialPort perl-Email-Date-Format perl-IO-stringy \ perl-IO-Zlib perl-MailTools perl-MIME-Lite perl-MIME-tools perl-MIME-Types perl-Module-Load perl-Package-Constants perl-Sys-Mmap perl-Time-HiRes \ -perl-TimeDate perl-YAML-Syck php php-cli php-mysql x264 vlc-devel vlc-core libcurl libcurl-devel +perl-TimeDate perl-YAML-Syck perl-X10 perl-URI-Encode php php-cli php-mysql x264 vlc-devel vlc-core \ +libcurl libcurl-devel polkit-devel git ``` +To build from the master branch: +```bash +git clone https://github.com/ZoneMinder/ZoneMinder.git +cd ZoneMinder +cmake . +make +sudo make install +``` + +IMPORTANT: Don't forget the trailing "." when calling cmake + #### Docker Docker is a system to run applications inside isolated containers. ZoneMinder, and the ZM webserver, will run using the @@ -162,4 +172,14 @@ the following steps. 6. Create new Pull Request 7. The team will then review, discuss and hopefully merge your changes. +### Package Maintainters +Many of the ZoneMinder configration variable default values are not configurable at build time through autotools or cmake. A new tool called *zmeditconfigdata.sh* has been added to allow package maintainers to manipulate any variable stored in ConfigData.pm without patching the source. + +For example, let's say I have created a new ZoneMinder package that contains the cambolzola javascript file. However, by default cambozola support is turned off. To fix that, add this to the pacakging script: +```bash +./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes +``` + +Note that zmeditconfigdata.sh is intended to be called, from the root build folder, prior to running cmake or configure. + [![Analytics](https://ga-beacon.appspot.com/UA-15147273-6/ZoneMinder/README.md)](https://github.com/igrigorik/ga-beacon) diff --git a/configure.ac b/configure.ac index efe61286d..026a058b0 100644 --- a/configure.ac +++ b/configure.ac @@ -446,7 +446,7 @@ AC_SUBST(PERL_MM_PARMS) AC_SUBST(EXTRA_PERL_LIB) -AC_CONFIG_FILES([Makefile zm.conf zmconfgen.pl db/Makefile db/zm_create.sql misc/Makefile misc/apache.conf misc/logrotate.conf misc/syslog.conf misc/com.zoneminder.systemctl.policy misc/com.zoneminder.systemctl.rules scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtrack.pl scripts/zmcamtool.pl scripts/zmsystemctl.pl scripts/zmtrigger.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zmwatch.pl scripts/zmx10.pl scripts/zmdbbackup scripts/zmdbrestore scripts/zmeventdump scripts/zmlogrotate.conf scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/Memory.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm src/Makefile src/zm_config.h web/Makefile web/ajax/Makefile web/css/Makefile web/graphics/Makefile web/includes/Makefile web/includes/config.php web/js/Makefile web/lang/Makefile web/skins/Makefile web/skins/classic/Makefile web/skins/classic/ajax/Makefile web/skins/classic/css/Makefile web/skins/classic/graphics/Makefile web/skins/classic/includes/Makefile web/skins/classic/js/Makefile web/skins/classic/lang/Makefile web/skins/classic/views/Makefile web/skins/classic/views/css/Makefile web/skins/classic/views/js/Makefile web/skins/mobile/Makefile web/skins/mobile/ajax/Makefile web/skins/mobile/css/Makefile web/skins/mobile/graphics/Makefile web/skins/mobile/includes/Makefile web/skins/mobile/lang/Makefile web/skins/mobile/views/Makefile web/skins/mobile/views/css/Makefile web/tools/Makefile web/tools/mootools/Makefile web/views/Makefile web/skins/xml/Makefile web/skins/xml/views/Makefile web/skins/xml/includes/Makefile web/skins/flat/Makefile web/skins/flat/ajax/Makefile web/skins/flat/css/Makefile web/skins/flat/graphics/Makefile web/skins/flat/includes/Makefile web/skins/flat/js/Makefile web/skins/flat/lang/Makefile web/skins/flat/views/Makefile web/skins/flat/views/css/Makefile web/skins/flat/views/js/Makefile]) +AC_CONFIG_FILES([Makefile zm.conf zmconfgen.pl db/Makefile db/zm_create.sql misc/Makefile misc/apache.conf misc/logrotate.conf misc/syslog.conf misc/com.zoneminder.systemctl.policy misc/com.zoneminder.systemctl.rules scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtrack.pl scripts/zmcamtool.pl scripts/zmsystemctl.pl scripts/zmtrigger.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zmwatch.pl scripts/zmx10.pl scripts/zmdbbackup scripts/zmdbrestore scripts/zmeventdump scripts/zmlogrotate.conf scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/Memory.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm src/Makefile src/zm_config.h web/Makefile web/ajax/Makefile web/css/Makefile web/graphics/Makefile web/includes/Makefile web/includes/config.php web/js/Makefile web/lang/Makefile web/skins/Makefile web/skins/classic/Makefile web/skins/classic/ajax/Makefile web/skins/classic/css/Makefile web/skins/classic/css/classic/Makefile web/skins/classic/css/classic/views/Makefile web/skins/classic/graphics/Makefile web/skins/classic/includes/Makefile web/skins/classic/js/Makefile web/skins/classic/lang/Makefile web/skins/classic/views/Makefile web/skins/classic/views/js/Makefile web/skins/mobile/Makefile web/skins/mobile/ajax/Makefile web/skins/mobile/css/Makefile web/skins/mobile/graphics/Makefile web/skins/mobile/includes/Makefile web/skins/mobile/lang/Makefile web/skins/mobile/views/Makefile web/skins/mobile/views/css/Makefile web/tools/Makefile web/tools/mootools/Makefile web/views/Makefile web/skins/xml/Makefile web/skins/xml/views/Makefile web/skins/xml/includes/Makefile web/skins/flat/Makefile web/skins/flat/ajax/Makefile web/skins/flat/css/Makefile web/skins/flat/graphics/Makefile web/skins/flat/includes/Makefile web/skins/flat/js/Makefile web/skins/flat/lang/Makefile web/skins/flat/views/Makefile web/skins/flat/views/css/Makefile web/skins/flat/views/js/Makefile]) # Create the definitions for compilation and defaults for the database AC_CONFIG_COMMANDS([src/zm_config_defines.h],[perl ./zmconfgen.pl]) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index c08bf06d8..416e0c513 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -557,7 +557,7 @@ INSERT INTO Controls VALUES (NULL,'Foscam FI9821W','Ffmpeg','FI9821W_Y2k',1,0,1, 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); -- -- Add some monitor preset values -- diff --git a/distros/debian/control b/distros/debian/control index 1949ef0b9..81ed17252 100644 --- a/distros/debian/control +++ b/distros/debian/control @@ -2,12 +2,12 @@ Source: zoneminder Section: net Priority: optional Maintainer: Isaac Connor -Build-Depends: debhelper (>= 7.0.50), autoconf, automake, dpatch, libphp-serialization-perl, libgnutls-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libpcre3, libarchive-zip-perl, libmime-lite-perl, libjpeg8, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev, libpolkit-gobject-1-dev +Build-Depends: debhelper (>= 7.0.50), autoconf, automake, dpatch, libphp-serialization-perl, libgnutls-dev|libgnutls28-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev|libgcrypt20-dev, libpolkit-gobject-1-dev Standards-Version: 3.9.2 Package: zoneminder Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2 | httpd, libapache2-mod-php5 | libapache2-mod-fcgid | php5-fpm, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0 +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl Recommends: mysql-server|mariadb-server Description: A video camera security and surveillance solution ZoneMinder is intended for use in single or multi-camera video security diff --git a/distros/debian/install b/distros/debian/install new file mode 100644 index 000000000..9e8953409 --- /dev/null +++ b/distros/debian/install @@ -0,0 +1,7 @@ +usr/bin +usr/lib/cgi-bin +usr/share/man +usr/share/perl5/ZoneMinder +usr/share/perl5/ZoneMinder.pm +usr/share/zoneminder +etc/zm diff --git a/distros/debian/links b/distros/debian/links new file mode 100644 index 000000000..9715ee428 --- /dev/null +++ b/distros/debian/links @@ -0,0 +1,4 @@ +var/cache/zoneminder/events usr/share/zoneminder/events +var/cache/zoneminder/images usr/share/zoneminder/images +var/cache/zoneminder/temp usr/share/zoneminder/temp +usr/lib/cgi-bin usr/share/zoneminder/cgi-bin diff --git a/distros/debian8/README.Debian b/distros/debian8/README.Debian new file mode 100644 index 000000000..a49b6be72 --- /dev/null +++ b/distros/debian8/README.Debian @@ -0,0 +1,51 @@ +zoneminder for Debian +--------------------- + +There is one manual step to get the web interface working. +You need to link /etc/zm/apache.conf to /etc/apache2/conf.d/zoneminder.conf, +then reload the apache config (i.e. /etc/init.d/apache2 reload) + +Changing the location for images and events +------------------------------------------- + +Zoneminder, in its upstream form, stores data in /usr/share/zoneminder/. This +package modifies that by changing /usr/share/zoneminder/images and +/usr/share/zoneminder/events to symlinks to directories under +/var/cache/zoneminder. + +There are numerous places these could be put and ways to do it. But, at the +moment, if you change this, an upgrade will fail with a warning about these +locations having changed (the reason for this was that previously, an upgrade +would silently revert the changes and cause event loss - refer +bug #608793). + +If you do want to change the location, here are a couple of suggestions. + +These lines would mount /dev/sdX1 to /video_storage, and then 'link' /video_storage +to the locations that ZoneMinder expects them to be at. + + /dev/sdX1 /video_storage ext4 defaults 0 2 + /video_storage/zoneminder/images /var/cache/zoneminder/images none bind 0 2 + /video_storage/zoneminder/events /var/cache/zoneminder/events none bind 0 2 + + or if you have a separate partition for each: + + /dev/sdX1 /var/cache/zoneminder/images ext4 defaults 0 2 + /dev/sdX2 /var/cache/zoneminder/events ext4 defaults 0 2 + + + + -- Peter Howard , Sun, 16 Jan 2010 01:35:51 +1100 + +Access to /dev/video* +--------------------- + +For cameras which require access to /dev/video*, zoneminder may need the +www-data user added to the video group in order to see those cameras: + + adduser www-data video + +Note that all web applications running on the zoneminder server will then have +access to all video devices on the system. + + -- Vagrant Cascadian Sun, 27 Mar 2011 13:06:56 -0700 diff --git a/distros/debian8/README.source b/distros/debian8/README.source new file mode 100644 index 000000000..b546508b2 --- /dev/null +++ b/distros/debian8/README.source @@ -0,0 +1,12 @@ +This package uses quilt to manage all modifications to the upstream source. +Changes are stored in the source package as diffs in debian/patches and applied +during the build. + +See /usr/share/doc/quilt/README.source for a detailed explanation. + + +This package uses the version 3.0 of the debian source package; An upstream +tarball is required to build it. This tarball can be generated automagically by +downloading the sources from the github repository with the following command: + +fakeroot debian/rules get-orig-source diff --git a/distros/debian8/apache.conf b/distros/debian8/apache.conf new file mode 100644 index 000000000..92a2b6414 --- /dev/null +++ b/distros/debian8/apache.conf @@ -0,0 +1,9 @@ +Alias /zm /usr/share/zoneminder + + + php_flag register_globals off + Options Indexes FollowSymLinks + + DirectoryIndex index.php + + diff --git a/distros/debian8/changelog b/distros/debian8/changelog new file mode 100644 index 000000000..410e17821 --- /dev/null +++ b/distros/debian8/changelog @@ -0,0 +1,33 @@ +zoneminder (1.28.0-0.2) testing; urgency=medium + + * Non-maintainer upload. + * Upstream release for debian jessie + * Package dependencies updated + * debhelper version upgraded + * Standards-Version upgraded + * Use debhelper commands instead of standard commands + * Install man pages in /usr/share/man (patch added) + * Switch to quilt + * Switch to systemd + * Some lintian fixes + + -- Emmanuel Papin Wed, 26 Nov 2014 00:26:01 +0100 + +zoneminder (1.28.0-0.1) stable; urgency=medium + + * Release + + -- Isaac Connor Fri, 17 Oct 2014 09:27:22 -0400 + +zoneminder (1.27.99+1-testing-SNAPSHOT2014072901) testing; urgency=medium + + * improve error messages + * Make zmupdate re-run the most recent patch so that people running the daily builds get their db updates + + -- Isaac Connor Tue, 29 Jul 2014 14:50:20 -0400 + +zoneminder (1.27.0+1-testing-v4ltomonitor-1) testing; urgency=high + + * Snapshot release - + + -- Isaac Connor Wed, 09 Jul 2014 21:35:29 -0400 diff --git a/distros/debian8/compat b/distros/debian8/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/distros/debian8/compat @@ -0,0 +1 @@ +9 diff --git a/distros/debian8/control b/distros/debian8/control new file mode 100644 index 000000000..0dac5a6c2 --- /dev/null +++ b/distros/debian8/control @@ -0,0 +1,40 @@ +Source: zoneminder +Section: net +Priority: optional +Maintainer: Isaac Connor +Build-Depends: debhelper (>= 9), dh-systemd (>= 1.5), autoconf, automake, quilt, libphp-serialization-perl, libgnutls28-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev|libgcrypt20-dev, libpolkit-gobject-1-dev +Standards-Version: 3.9.6 + +Package: zoneminder +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl, libgcrypt11|libgcrypt20 +Recommends: mysql-server|mariadb-server +Description: Video camera security and surveillance solution + ZoneMinder is intended for use in single or multi-camera video security + applications, including commercial or home CCTV, theft prevention and child + or family member or home monitoring and other care scenarios. It + supports capture, analysis, recording, and monitoring of video data coming + from one or more video or network cameras attached to a Linux system. + ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom + cameras using a variety of protocols. It is suitable for use as a home + video security system and for commercial or professional video security + and surveillance. It can also be integrated into a home automation system + via X.10 or other protocols. + +Package: zoneminder-dbg +Priority: extra +Section: debug +Architecture: any +Depends: zoneminder (= ${binary:Version}), ${misc:Depends} +Description: Debugging symbols for zoneminder. + ZoneMinder is a video camera security and surveillance solution. + ZoneMinder is intended for use in single or multi-camera video security + applications, including commercial or home CCTV, theft prevention and child + or family member or home monitoring and other care scenarios. It + supports capture, analysis, recording, and monitoring of video data coming + from one or more video or network cameras attached to a Linux system. + ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom + cameras using a variety of protocols. It is suitable for use as a home + video security system and for commercial or professional video security + and surveillance. It can also be integrated into a home automation system + via X.10 or other protocols. diff --git a/distros/debian8/copyright b/distros/debian8/copyright new file mode 100644 index 000000000..a177502a0 --- /dev/null +++ b/distros/debian8/copyright @@ -0,0 +1,22 @@ +Copyright: + +Copyright 2002 Philip Coombes + +License: + +This package 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 package 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 package; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian GNU/Linux systems, the text of the GPL can be found in +/usr/share/common-licenses/GPL. diff --git a/distros/debian8/docs b/distros/debian8/docs new file mode 100644 index 000000000..b43bf86b5 --- /dev/null +++ b/distros/debian8/docs @@ -0,0 +1 @@ +README.md diff --git a/distros/debian8/patches/01_vendor-perl.diff b/distros/debian8/patches/01_vendor-perl.diff new file mode 100644 index 000000000..df4f88d06 --- /dev/null +++ b/distros/debian8/patches/01_vendor-perl.diff @@ -0,0 +1,15 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -437,10 +437,10 @@ + PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"` + PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"` + EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path" +- PERL_MM_PARMS="PREFIX=$prefix" ++ PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\"" + else + EXTRA_PERL_LIB="# Include from system perl paths only" +- PERL_MM_PARMS= ++ PERL_MM_PARMS="\"INSTALLDIRS=vendor\"" + fi + AC_SUBST(PERL_MM_PARMS) + AC_SUBST(EXTRA_PERL_LIB) diff --git a/distros/debian8/patches/series b/distros/debian8/patches/series new file mode 100644 index 000000000..b479dc507 --- /dev/null +++ b/distros/debian8/patches/series @@ -0,0 +1 @@ +01_vendor-perl.diff diff --git a/distros/debian8/rules b/distros/debian8/rules new file mode 100755 index 000000000..3bd92f795 --- /dev/null +++ b/distros/debian8/rules @@ -0,0 +1,147 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall +CPPFLAGS = -D__STDC_CONSTANT_MACROS +CXXFLAGS = -DHAVE_LIBCRYPTO + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +DEBOPT = --enable-debug +CFLAGS += -g +CXXFLAGS += -g +else +DEBOPT = +endif + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +else +CFLAGS += -O2 +endif + +# These are used to get the most recent version of the original sources from github +UURL = $(shell git config --get remote.origin.url) +BRANCH = $(shell git rev-parse --abbrev-ref HEAD) +HEAD = $(shell git rev-parse HEAD) +PKD = $(abspath $(dir $(MAKEFILE_LIST))) +PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source)) +VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};') +DTYPE = +TARBALL = ../$(PKG)_$(VER)$(DTYPE).orig.tar.xz + +%: + dh $@ --with quilt,autoreconf,systemd + +override_dh_auto_configure: + CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" dh_auto_configure -- \ + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --sysconfdir=/etc/zm --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info --with-mysql=/usr \ + --with-mariadb=/usr --with-webdir=/usr/share/zoneminder \ + --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin \ + --with-webuser=www-data --with-webgroup=www-data \ + --enable-crashtrace=no --enable-mmap=yes $(DEBOPT) + +override_dh_clean: + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean src/zm_config_defines.h + # + # Delete remaining auto-generated Makefile if Makefile.in exists + find $(CURDIR)/ -type f -name "Makefile" | while read file; do \ + [ -f $$file.in ] && rm -f $$file; \ + done || true + # + # Delete remaining auto-generated Makefile.in if Makefile.am exists + find $(CURDIR)/ -type f -name "Makefile.in" | while read filein; do \ + fileam=`echo $$filein | sed 's/\(.*\)\.in/\1\.am/'`; \ + [ -f $$fileam ] && rm -f $$filein; \ + done || true + +override_dh_install: + # + # NOTE: This is a short-term kludge; hopefully changes in the next + # upstream version will render this unnecessary. + rm -rf debian/zoneminder/usr/share/zoneminder/events + rm -rf debian/zoneminder/usr/share/zoneminder/images + rm -rf debian/zoneminder/usr/share/zoneminder/temp + dh_link var/cache/zoneminder/events usr/share/zoneminder/events + dh_link var/cache/zoneminder/images usr/share/zoneminder/images + dh_link var/cache/zoneminder/temp usr/share/zoneminder/temp + + # + # This is a slightly lesser kludge; moving the cgi stuff to + # /usr/share/zoneminder/cgi-bin breaks one set of behavior, + # having it just in /usr/lib/cgi-bin breaks another bit of + # behavior. + # + dh_link usr/lib/cgi-bin usr/share/zoneminder/cgi-bin + + dh_install --fail-missing + +override_dh_fixperms: + dh_fixperms + chown root:root debian/zoneminder/etc/zm/zm.conf + +override_dh_auto_test: + # do not run tests... + +override_dh_systemd_start: + dh_systemd_start --restart-after-upgrade + +.PHONY: override_dh_strip +override_dh_strip: + dh_strip --dbg-package=zoneminder-dbg + +# Inspired by https://wiki.debian.org/onlyjob/get-orig-source +.PHONY: get-orig-source +get-orig-source: $(TARBALL) $(info I: $(PKG)_$(VER)$(DTYPE)) + @ + +$(TARBALL): + $(if $(wildcard $(PKG)-$(VER)),$(error folder '$(PKG)-$(VER)' exists, aborting...)) + @echo "# Cloning origin repository..."; \ + if ! git clone $(UURL) $(PKG)-$(VER); then \ + $(RM) -r $(PKG)-$(VER); \ + echo "failed to clone repository, aborting..."; \ + false; \ + fi + @if [ $(BRANCH) != "master" ]; then \ + cd $(PKG)-$(VER); \ + echo "# Not on master branch, fetching origin branch '$(BRANCH)'..."; \ + git fetch origin $(BRANCH):$(BRANCH) || false; \ + echo "# Switching to branch '$(BRANCH)'..."; \ + git checkout $(BRANCH) || false; \ + fi + @echo "# Checking local source..." + @if [ $$(cd $(PKG)-$(VER) && git rev-parse HEAD) = $(HEAD) ]; then \ + echo "even with origin, ok"; \ + true; \ + else \ + echo "not even with origin, aborting..."; \ + false; \ + fi + @echo "# Setting times..." + @cd $(PKG)-$(VER) \ + && for F in $$(git ls-tree -r --name-only HEAD | sed -e "s/\s/\*/g"); do \ + touch --no-dereference -d "$$(git log -1 --format="%ai" -- $$F)" "$$F"; \ + done + @echo "# Cleaning-up..." + cd $(PKG)-$(VER) && $(RM) -r .git + @echo "# Packing file '$(TARBALL)'..." + @find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \ + | XZ_OPT="-6v" tar -caf "$(TARBALL)" -T- --owner=root --group=root --mode=a+rX \ + && $(RM) -r "$(PKG)-$(VER)" diff --git a/distros/debian8/source/format b/distros/debian8/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/distros/debian8/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/distros/debian8/source/local-options b/distros/debian8/source/local-options new file mode 100644 index 000000000..9cdfca9f9 --- /dev/null +++ b/distros/debian8/source/local-options @@ -0,0 +1,2 @@ +unapply-patches +abort-on-upstream-changes diff --git a/distros/debian8/source/options b/distros/debian8/source/options new file mode 100644 index 000000000..8bd61fce6 --- /dev/null +++ b/distros/debian8/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile|aclocal.m4|compile|config.h.in|configure|depcomp|install-sh|missing)$" diff --git a/distros/debian8/watch b/distros/debian8/watch new file mode 100644 index 000000000..5a8a9c4d7 --- /dev/null +++ b/distros/debian8/watch @@ -0,0 +1,3 @@ +version=3 +http://www.zoneminder.com/downloads.html \ + .*/ZoneMinder-(.*).tar.gz diff --git a/distros/debian8/zoneminder.dirs b/distros/debian8/zoneminder.dirs new file mode 100644 index 000000000..4178482c1 --- /dev/null +++ b/distros/debian8/zoneminder.dirs @@ -0,0 +1,6 @@ +var/log/zm +var/lib/zm +var/cache/zoneminder/events +var/cache/zoneminder/images +var/cache/zoneminder/temp +usr/share/zoneminder/db diff --git a/distros/debian8/zoneminder.init b/distros/debian8/zoneminder.init new file mode 100644 index 000000000..41d3cb9dc --- /dev/null +++ b/distros/debian8/zoneminder.init @@ -0,0 +1,36 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: zoneminder +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Do nothing more than fixing a lintian error +# Description: This script is provided by the Zoneminder package +# Zomeminder init configuration has been switched to systemd +# This dummy script can be safely deleted; It does nothing +# more than fixing a lintian error when testing the package +### END INIT INFO + +. /lib/lsb/init-functions + +case "$1" in + start) + ;; + stop) + ;; + status) + ;; + restart|reload) + ;; + force-reload) + ;; + *) + echo "Usage: ${0:-} {start|stop|status|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 + diff --git a/distros/debian8/zoneminder.install b/distros/debian8/zoneminder.install new file mode 100644 index 000000000..86fe0a0a6 --- /dev/null +++ b/distros/debian8/zoneminder.install @@ -0,0 +1,22 @@ +usr/bin +usr/lib/cgi-bin +usr/share/man +usr/share/perl5/ZoneMinder +usr/share/perl5/ZoneMinder.pm +usr/share/polkit-1/actions +usr/share/polkit-1/rules.d +usr/share/zoneminder/ajax +usr/share/zoneminder/css +usr/share/zoneminder/db +usr/share/zoneminder/graphics +usr/share/zoneminder/includes +usr/share/zoneminder/index.php +usr/share/zoneminder/js +usr/share/zoneminder/lang +usr/share/zoneminder/skins +usr/share/zoneminder/tools +usr/share/zoneminder/views +etc/zm +db/zm_create.sql usr/share/zoneminder/db +db/zm_update-*.sql usr/share/zoneminder/db +debian/apache.conf etc/zm diff --git a/distros/debian8/zoneminder.links b/distros/debian8/zoneminder.links new file mode 100644 index 000000000..9715ee428 --- /dev/null +++ b/distros/debian8/zoneminder.links @@ -0,0 +1,4 @@ +var/cache/zoneminder/events usr/share/zoneminder/events +var/cache/zoneminder/images usr/share/zoneminder/images +var/cache/zoneminder/temp usr/share/zoneminder/temp +usr/lib/cgi-bin usr/share/zoneminder/cgi-bin diff --git a/distros/debian8/zoneminder.postinst b/distros/debian8/zoneminder.postinst new file mode 100644 index 000000000..6229f9b78 --- /dev/null +++ b/distros/debian8/zoneminder.postinst @@ -0,0 +1,68 @@ +#! /bin/sh + +set -e + +apache_install() { + mkdir -p /etc/apache2/conf-available + ln -sf ../../zm/apache.conf /etc/apache2/conf-available/zoneminder.conf + + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke enconf zoneminder + elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + [ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/zoneminder.conf ] && ln -s ../conf-available/zoneminder.conf /etc/apache2/conf.d/zoneminder.conf + fi +} + +if [ "$1" = "configure" ]; then + if [ -e "/etc/init.d/mysql" ]; then + # + # Get mysql started if it isn't + # + if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then + invoke-rc.d mysql start + fi + if $(/etc/init.d/mysql status >/dev/null 2>&1); then + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload + # test if database if already present... + if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then + cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf + echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + fi + + deb-systemd-invoke stop zoneminder.service || true + zmupdate.pl --nointeractive + + else + echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' + fi + else + echo 'mysql not found, assuming remote server.' + fi + chown www-data:www-data /var/log/zm + chown www-data:www-data /var/lib/zm/ + if [ -z "$2" ]; then + chown www-data:www-data -R /var/cache/zoneminder + fi +fi +# Ensure zoneminder is stopped... +deb-systemd-invoke stop zoneminder.service || exit $? + +if [ "$1" = "configure" ]; then + if [ -z "$2" ]; then + chown www-data:www-data /var/log/zm + chown www-data:www-data /var/lib/zm/ + chown www-data:www-data -R /var/cache/zoneminder + else + chown www-data:www-data /var/log/zm + zmupdate.pl + fi + apache_install $1 + a2enmod cgi >/dev/null 2>&1 + if [ -f /etc/init.d/apache2 ] ; then + invoke-rc.d apache2 reload 3>/dev/null || true + fi +fi +#DEBHELPER# diff --git a/distros/debian8/zoneminder.postrm b/distros/debian8/zoneminder.postrm new file mode 100644 index 000000000..27f440290 --- /dev/null +++ b/distros/debian8/zoneminder.postrm @@ -0,0 +1,32 @@ +#! /bin/sh + +set -e + +apache_remove() { + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke disconf zoneminder + elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + rm -f /etc/apache2/conf.d/zoneminder.conf + fi + rm -f /etc/apache2/conf-available/zoneminder.conf +} + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + apache_remove $1 + if [ -f /etc/init.d/apache2 ] ; then + invoke-rc.d apache2 reload 3>/dev/null || true + fi +fi + +if [ "$1" = "purge" ]; then + if [ -e "/etc/init.d/mysql" ]; then + echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm + else + echo 'mysql not found, assuming remote server.' + fi +fi +#DEBHELPER# diff --git a/distros/debian8/zoneminder.preinst b/distros/debian8/zoneminder.preinst new file mode 100644 index 000000000..6cd01ba55 --- /dev/null +++ b/distros/debian8/zoneminder.preinst @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +abort=false +if [ -L /usr/share/zoneminder/events ]; then + l=$(readlink /usr/share/zoneminder/events) + if [ "$l" != "/var/cache/zoneminder/events" ]; then + abort=true + fi +fi +if [ -L /usr/share/zoneminder/images ]; then + l=$(readlink /usr/share/zoneminder/images ) + if [ "$l" != "/var/cache/zoneminder/images" ]; then + abort=true + fi +fi + +if [ "$abort" = "true" ]; then + cat >&2 << EOF +Aborting installation of zoneminder due to non-default symlinks in +/usr/share/zoneminder for the images and/or events directory, which could +result in loss of data. Please move your data in each of these directories to +/var/cache/zoneminder before installing zoneminder from the package. +EOF + exit 1 + +fi + +#DEBHELPER# + +exit 0 diff --git a/distros/debian8/zoneminder.service b/distros/debian8/zoneminder.service new file mode 100644 index 000000000..d788f90c7 --- /dev/null +++ b/distros/debian8/zoneminder.service @@ -0,0 +1,18 @@ +# ZoneMinder systemd unit file +# This file is intended to work with debian distributions + +[Unit] +Description=ZoneMinder CCTV recording and security system +After=network.target mysql.service apache2.service +Requires=mysql.service apache2.service + +[Service] +User=www-data +Type=forking +ExecStart=/usr/bin/zmpkg.pl start +ExecReload=/usr/bin/zmpkg.pl restart +ExecStop=/bin/bash -c '[[ "$(/usr/bin/pgrep zmdc.pl)" > 0 ]] && /usr/bin/zmpkg.pl stop' +PIDFile=/var/run/zm/zm.pid + +[Install] +WantedBy=multi-user.target diff --git a/distros/debian8/zoneminder.tmpfile b/distros/debian8/zoneminder.tmpfile new file mode 100644 index 000000000..6ea70bf35 --- /dev/null +++ b/distros/debian8/zoneminder.tmpfile @@ -0,0 +1 @@ +d /var/run/zm 0755 www-data www-data diff --git a/distros/debian_cmake/README.Debian b/distros/debian_cmake/README.Debian new file mode 100644 index 000000000..a49b6be72 --- /dev/null +++ b/distros/debian_cmake/README.Debian @@ -0,0 +1,51 @@ +zoneminder for Debian +--------------------- + +There is one manual step to get the web interface working. +You need to link /etc/zm/apache.conf to /etc/apache2/conf.d/zoneminder.conf, +then reload the apache config (i.e. /etc/init.d/apache2 reload) + +Changing the location for images and events +------------------------------------------- + +Zoneminder, in its upstream form, stores data in /usr/share/zoneminder/. This +package modifies that by changing /usr/share/zoneminder/images and +/usr/share/zoneminder/events to symlinks to directories under +/var/cache/zoneminder. + +There are numerous places these could be put and ways to do it. But, at the +moment, if you change this, an upgrade will fail with a warning about these +locations having changed (the reason for this was that previously, an upgrade +would silently revert the changes and cause event loss - refer +bug #608793). + +If you do want to change the location, here are a couple of suggestions. + +These lines would mount /dev/sdX1 to /video_storage, and then 'link' /video_storage +to the locations that ZoneMinder expects them to be at. + + /dev/sdX1 /video_storage ext4 defaults 0 2 + /video_storage/zoneminder/images /var/cache/zoneminder/images none bind 0 2 + /video_storage/zoneminder/events /var/cache/zoneminder/events none bind 0 2 + + or if you have a separate partition for each: + + /dev/sdX1 /var/cache/zoneminder/images ext4 defaults 0 2 + /dev/sdX2 /var/cache/zoneminder/events ext4 defaults 0 2 + + + + -- Peter Howard , Sun, 16 Jan 2010 01:35:51 +1100 + +Access to /dev/video* +--------------------- + +For cameras which require access to /dev/video*, zoneminder may need the +www-data user added to the video group in order to see those cameras: + + adduser www-data video + +Note that all web applications running on the zoneminder server will then have +access to all video devices on the system. + + -- Vagrant Cascadian Sun, 27 Mar 2011 13:06:56 -0700 diff --git a/distros/debian_cmake/apache.conf b/distros/debian_cmake/apache.conf new file mode 100644 index 000000000..92a2b6414 --- /dev/null +++ b/distros/debian_cmake/apache.conf @@ -0,0 +1,9 @@ +Alias /zm /usr/share/zoneminder + + + php_flag register_globals off + Options Indexes FollowSymLinks + + DirectoryIndex index.php + + diff --git a/distros/debian_cmake/changelog b/distros/debian_cmake/changelog new file mode 100644 index 000000000..0edaefce7 --- /dev/null +++ b/distros/debian_cmake/changelog @@ -0,0 +1,29 @@ +zoneminder (1.28.0-0.1) wheezy; urgency=low + + * Use CMake instead of Autotools to simplify + debian/rules and have less build-depends. + * Some lintian love in debian/{control,copyright} + and perl ZoneMinder modules. + * Don't purge database if we use a remote + MySQL server. + + -- Cosme Domínguez Díaz Sun, 09 Nov 2014 02:20:20 +0100 + +zoneminder (1.28.0-wheezy) wheezy; urgency=medium + + * Release + + -- Isaac Connor Fri, 17 Oct 2014 09:27:22 -0400 + +zoneminder (1.27.99+1-testing-SNAPSHOT2014072901) testing; urgency=medium + + * improve error messages + * Make zmupdate re-run the most recent patch so that people running the daily builds get their db updates + + -- Isaac Connor Tue, 29 Jul 2014 14:50:20 -0400 + +zoneminder (1.27.0+1-testing-v4ltomonitor-1) testing; urgency=high + + * Snapshot release - + + -- Isaac Connor Wed, 09 Jul 2014 21:35:29 -0400 diff --git a/distros/debian_cmake/compat b/distros/debian_cmake/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/distros/debian_cmake/compat @@ -0,0 +1 @@ +9 diff --git a/distros/debian_cmake/control b/distros/debian_cmake/control new file mode 100644 index 000000000..01adf14df --- /dev/null +++ b/distros/debian_cmake/control @@ -0,0 +1,40 @@ +Source: zoneminder +Section: net +Priority: optional +Maintainer: Isaac Connor +Build-Depends: debhelper (>= 9), cmake, libphp-serialization-perl, libgnutls-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libsys-mmap-perl, libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libarchive-zip-perl, libmime-lite-perl, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev, libpolkit-gobject-1-dev +Standards-Version: 3.9.4 + +Package: zoneminder +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2 | httpd, libapache2-mod-php5 | libapache2-mod-fcgid | php5-fpm, php5-mysqlnd | php5-mysql, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client | mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0 +Recommends: mysql-server | mariadb-server +Description: Video camera security and surveillance solution + ZoneMinder is intended for use in single or multi-camera video security + applications, including commercial or home CCTV, theft prevention and child + or family member or home monitoring and other care scenarios. It + supports capture, analysis, recording, and monitoring of video data coming + from one or more video or network cameras attached to a Linux system. + ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom + cameras using a variety of protocols. It is suitable for use as a home + video security system and for commercial or professional video security + and surveillance. It can also be integrated into a home automation system + via X.10 or other protocols. + +Package: zoneminder-dbg +Architecture: any +Priority: extra +Section: debug +Depends: zoneminder (= ${binary:Version}), ${misc:Depends} +Description: debugging syumbols for zoneminder. + ZoneMinder is a video camera security and surveillance solution. + ZoneMinder is intended for use in single or multi-camera video security + applications, including commercial or home CCTV, theft prevention and child + or family member or home monitoring and other care scenarios. It + supports capture, analysis, recording, and monitoring of video data coming + from one or more video or network cameras attached to a Linux system. + ZoneMinder also support web and semi-automatic control of Pan/Tilt/Zoom + cameras using a variety of protocols. It is suitable for use as a home + video security system and for commercial or professional video security + and surveillance. It can also be integrated into a home automation system + via X.10 or other protocols. diff --git a/distros/debian_cmake/copyright b/distros/debian_cmake/copyright new file mode 100644 index 000000000..1c10c59db --- /dev/null +++ b/distros/debian_cmake/copyright @@ -0,0 +1,57 @@ +Copyright: + +Copyright 2002 Philip Coombes + +License: + +This package 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 package 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 package; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian GNU/Linux systems, the text of the GPL can be found in +/usr/share/common-licenses/GPL. + +/usr/share/zoneminder/api/lib/Cake/*: +Copyright: + +Copyright (c) 2005-2013, Cake Software Foundation, Inc. + +License: + +CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org) + +The MIT License + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +Cake Software Foundation, Inc. +1785 E. Sahara Avenue, +Suite 490-204 +Las Vegas, Nevada 89104, +United States of America. diff --git a/distros/debian_cmake/dirs b/distros/debian_cmake/dirs new file mode 100644 index 000000000..9e29e6113 --- /dev/null +++ b/distros/debian_cmake/dirs @@ -0,0 +1,5 @@ +var/log/zm +var/lib/zm +var/cache/zoneminder/events +var/cache/zoneminder/images +var/cache/zoneminder/temp diff --git a/distros/debian_cmake/docs b/distros/debian_cmake/docs new file mode 100644 index 000000000..b43bf86b5 --- /dev/null +++ b/distros/debian_cmake/docs @@ -0,0 +1 @@ +README.md diff --git a/distros/debian_cmake/init.d b/distros/debian_cmake/init.d new file mode 100644 index 000000000..cbc8fb10e --- /dev/null +++ b/distros/debian_cmake/init.d @@ -0,0 +1,87 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: zoneminder +# Required-Start: $network $remote_fs $syslog +# Required-Stop: $network $remote_fs $syslog +# Should-Start: mysql +# Should-Stop: mysql +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Control ZoneMinder as a Service +### END INIT INFO +# description: Control ZoneMinder as a Service +# chkconfig: 2345 20 20 + +# Source function library. +#. /etc/rc.d/init.d/functions + +prog=ZoneMinder +ZM_PATH_BIN="/usr/bin" +RUNDIR=/var/run/zm +TMPDIR=/tmp/zm +command="$ZM_PATH_BIN/zmpkg.pl" + +start() { + echo -n "Starting $prog: " + mkdir -p $RUNDIR $TMPDIR && chown www-data:www-data $RUNDIR $TMPDIR + $command start + RETVAL=$? + [ $RETVAL = 0 ] && echo success || echo failure + echo + [ $RETVAL = 0 ] && touch /var/lock/zm + return $RETVAL +} +stop() { + echo -n "Stopping $prog: " + # + # Why is this status check being done? + # as $command stop returns 1 if zoneminder + # is stopped, which will result in + # this returning 1, which will stuff + # dpkg when it tries to stop zoneminder before + # uninstalling . . . + # + result=`$command status` + if [ ! "$result" = "running" ]; then + echo "Zoneminder already stopped" + echo + RETVAL=0 + else + $command stop + RETVAL=$? + [ $RETVAL = 0 ] && echo success || echo failure + echo + [ $RETVAL = 0 ] && rm -f /var/lock/zm + fi +} +status() { + result=`$command status` + if [ "$result" = "running" ]; then + echo "ZoneMinder is running" + RETVAL=0 + else + echo "ZoneMinder is stopped" + RETVAL=1 + fi +} + +case "$1" in +'start') + start + ;; +'stop') + stop + ;; +'restart' | 'force-reload') + stop + start + ;; +'status') + status + ;; +*) + echo "Usage: $0 { start | stop | restart | status }" + RETVAL=1 + ;; +esac +exit $RETVAL diff --git a/distros/debian_cmake/install b/distros/debian_cmake/install new file mode 100644 index 000000000..9e8953409 --- /dev/null +++ b/distros/debian_cmake/install @@ -0,0 +1,7 @@ +usr/bin +usr/lib/cgi-bin +usr/share/man +usr/share/perl5/ZoneMinder +usr/share/perl5/ZoneMinder.pm +usr/share/zoneminder +etc/zm diff --git a/distros/debian_cmake/links b/distros/debian_cmake/links new file mode 100644 index 000000000..9715ee428 --- /dev/null +++ b/distros/debian_cmake/links @@ -0,0 +1,4 @@ +var/cache/zoneminder/events usr/share/zoneminder/events +var/cache/zoneminder/images usr/share/zoneminder/images +var/cache/zoneminder/temp usr/share/zoneminder/temp +usr/lib/cgi-bin usr/share/zoneminder/cgi-bin diff --git a/distros/debian_cmake/postinst b/distros/debian_cmake/postinst new file mode 100644 index 000000000..d06f9c641 --- /dev/null +++ b/distros/debian_cmake/postinst @@ -0,0 +1,53 @@ +#! /bin/sh + +set -e + +if [ "$1" = "configure" ]; then + if [ -e "/etc/init.d/mysql" ]; then + # + # Get mysql started if it isn't + # + if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then + invoke-rc.d mysql start + fi + if $(/etc/init.d/mysql status >/dev/null 2>&1); then + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload + # test if database if already present... + if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then + cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf + echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + fi + + invoke-rc.d zoneminder stop || true + zmupdate.pl --nointeractive + + else + echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' + fi + else + echo 'mysql not found, assuming remote server.' + fi + chown www-data:www-data /var/log/zm + chown www-data:www-data /var/lib/zm/ + if [ -z "$2" ]; then + chown www-data:www-data -R /var/cache/zoneminder + fi +fi +# Ensure zoneminder is stopped... +if [ -x "/etc/init.d/zoneminder" ]; then + if invoke-rc.d zoneminder status ; then + invoke-rc.d zoneminder stop || exit $? + fi +fi + +if [ "$1" = "configure" ]; then + if [ -z "$2" ]; then + chown www-data:www-data /var/log/zm + chown www-data:www-data /var/lib/zm/ + chown www-data:www-data -R /var/cache/zoneminder + else + chown www-data:www-data /var/log/zm + zmupdate.pl + fi +fi +#DEBHELPER# diff --git a/distros/debian_cmake/postrm b/distros/debian_cmake/postrm new file mode 100644 index 000000000..fde590981 --- /dev/null +++ b/distros/debian_cmake/postrm @@ -0,0 +1,11 @@ +#! /bin/sh +set -e + +if [ "$1" = "purge" ]; then + if [ -e "/etc/init.d/mysql" ]; then + echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm + fi +fi +#DEBHELPER# diff --git a/distros/debian_cmake/preinst b/distros/debian_cmake/preinst new file mode 100644 index 000000000..6cd01ba55 --- /dev/null +++ b/distros/debian_cmake/preinst @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +abort=false +if [ -L /usr/share/zoneminder/events ]; then + l=$(readlink /usr/share/zoneminder/events) + if [ "$l" != "/var/cache/zoneminder/events" ]; then + abort=true + fi +fi +if [ -L /usr/share/zoneminder/images ]; then + l=$(readlink /usr/share/zoneminder/images ) + if [ "$l" != "/var/cache/zoneminder/images" ]; then + abort=true + fi +fi + +if [ "$abort" = "true" ]; then + cat >&2 << EOF +Aborting installation of zoneminder due to non-default symlinks in +/usr/share/zoneminder for the images and/or events directory, which could +result in loss of data. Please move your data in each of these directories to +/var/cache/zoneminder before installing zoneminder from the package. +EOF + exit 1 + +fi + +#DEBHELPER# + +exit 0 diff --git a/distros/debian_cmake/rules b/distros/debian_cmake/rules new file mode 100755 index 000000000..0bf0f3362 --- /dev/null +++ b/distros/debian_cmake/rules @@ -0,0 +1,42 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export CFLAGS = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -pipe +export CXXFLAGS = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -pipe +INSTDIR = debian/tmp + +override_dh_auto_configure: + dh_auto_configure -- \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_SKIP_RPATH=ON \ + -DCMAKE_VERBOSE_MAKEFILE=OFF \ + -DCMAKE_COLOR_MAKEFILE=ON \ + -DZM_RUNDIR=/var/run/zm \ + -DZM_SOCKDIR=/var/run/zm \ + -DZM_TMPDIR=/var/tmp/zm \ + -DZM_LOGDIR=/var/log/zm \ + -DZM_WEBDIR=/usr/share/zoneminder \ + -DZM_CONTENTDIR=/var/cache/zoneminder \ + -DZM_CGIDIR=/usr/lib/cgi-bin \ + -DZM_WEB_USER=www-data \ + -DZM_WEB_GROUP=www-data \ + -DZM_PERL_SUBPREFIX=/share/perl5 \ + -DCMAKE_INSTALL_SYSCONFDIR=etc/zm + +override_dh_auto_install: + dh_auto_install --buildsystem=cmake + install -D -m 0644 debian/apache.conf $(INSTDIR)/etc/zm/apache.conf + rm $(INSTDIR)/usr/share/zoneminder/api/lib/Cake/LICENSE.txt + rm $(INSTDIR)/usr/share/zoneminder/api/.gitignore + rm -r $(INSTDIR)/usr/share/zoneminder/api/lib/Cake/Test + +override_dh_auto_test: + # do not run tests... + +override_dh_strip: + dh_strip --dbg-package=zoneminder-dbg + +%: + dh $@ --buildsystem=cmake --parallel diff --git a/distros/debian_cmake/watch b/distros/debian_cmake/watch new file mode 100644 index 000000000..5a8a9c4d7 --- /dev/null +++ b/distros/debian_cmake/watch @@ -0,0 +1,3 @@ +version=3 +http://www.zoneminder.com/downloads.html \ + .*/ZoneMinder-(.*).tar.gz diff --git a/distros/fedora/zoneminder.cmake.f20.spec b/distros/fedora/zoneminder.cmake.f20.spec index 5eea7150c..003371f69 100644 --- a/distros/fedora/zoneminder.cmake.f20.spec +++ b/distros/fedora/zoneminder.cmake.f20.spec @@ -22,8 +22,6 @@ URL: http://www.zoneminder.com/ #Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz Source: ZoneMinder-%{version}.tar.gz -Patch1: zoneminder-1.28.0-defaults.patch - BuildRequires: cmake gnutls-devel systemd-units bzip2-devel BuildRequires: community-mysql-devel pcre-devel libjpeg-turbo-devel BuildRequires: perl(Archive::Tar) perl(Archive::Zip) @@ -66,7 +64,14 @@ too much degradation of performance. %prep %setup -q -n ZoneMinder-%{version} -%patch1 -p0 -b .defaults +# Change the following default values +./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin/zm/nph-zms +./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes +./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm +./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload +./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes +./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no +./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no %build %cmake \ diff --git a/distros/redhat/local_zoneminder.te b/distros/redhat/local_zoneminder.te index 4a060ffc3..c49505785 100644 --- a/distros/redhat/local_zoneminder.te +++ b/distros/redhat/local_zoneminder.te @@ -1,11 +1,12 @@ - -module local_zoneminder 1.1; +module local_zoneminder 1.2; require { type afs_ka_port_t; type netsupport_port_t; type port_t; type presence_port_t; + type postfix_master_t; + type postfix_qmgr_t; type postfix_pickup_t; type httpd_t; type var_lib_t; @@ -28,74 +29,75 @@ require { type git_port_t; type ipp_port_t; type aol_port_t; - type unconfined_t; - type kernel_t; - type init_t; - type auditd_t; - type mysqld_t; - type httpd_log_t; - type syslogd_t; - type httpd_t; - type initrc_state_t; - type initrc_t; - type var_lib_t; - type udev_t; - type mysqld_safe_t; - type sshd_t; - type crond_t; - type getty_t; - type httpd_var_lib_t; - type initrc_var_run_t; - type tmpfs_t; - type dhcpc_t; - type v4l_device_t; - type file_t; - class sock_file { write create unlink }; - class unix_stream_socket { read connectto }; - class lnk_file { write create getattr read lock unlink }; - class dir search; + type unconfined_t; + type kernel_t; + type init_t; + type auditd_t; + type mysqld_t; + type httpd_log_t; + type syslogd_t; + type httpd_t; + type initrc_state_t; + type initrc_t; + type var_lib_t; + type udev_t; + type mysqld_safe_t; + type sshd_t; + type crond_t; + type getty_t; + type httpd_var_lib_t; + type initrc_var_run_t; + type tmpfs_t; + type dhcpc_t; + type v4l_device_t; + type file_t; + class sock_file { write create unlink }; + class unix_stream_socket { read connectto }; + class lnk_file { write create getattr read lock unlink }; + class dir {search getattr }; class udp_socket name_bind; - class file { write getattr read lock unlink open }; - class shm { unix_read unix_write associate read write getattr }; - class chr_file getattr; + class file { write getattr read lock unlink open }; + class shm { unix_read unix_write associate read write getattr }; + class chr_file getattr; } #============= httpd_t ============== -allow httpd_t auditd_t:dir search; +allow httpd_t auditd_t:dir { search getattr }; allow httpd_t auditd_t:file { read getattr open }; -allow httpd_t crond_t:dir search; +allow httpd_t crond_t:dir { search getattr }; allow httpd_t crond_t:file { read getattr open }; -allow httpd_t dhcpc_t:dir search; +allow httpd_t dhcpc_t:dir { search getattr }; allow httpd_t dhcpc_t:file { read getattr open }; -allow httpd_t getty_t:dir search; +allow httpd_t getty_t:dir { search getattr }; allow httpd_t getty_t:file { read getattr open }; allow httpd_t httpd_log_t:file write; allow httpd_t httpd_var_lib_t:lnk_file { write getattr read lock unlink }; -allow httpd_t init_t:dir search; +allow httpd_t init_t:dir { search getattr }; allow httpd_t init_t:file { read getattr open }; #!!!! The source type 'httpd_t' can write to a 'file' of the following types: -# squirrelmail_spool_t, dirsrvadmin_config_t, httpd_lock_t, dirsrv_config_t, httpd_tmp_t, dirsrvadmin_tmp_t, httpd_cache_t, httpd_tmpfs_t, httpd_squirrelmail_t, dirsrv_var_log_t, zarafa_var_lib_t, dirsrv_var_run_t, httpd_var_lib_t, httpd_var_run_t, passenger_tmp_t, httpd_nutups_cgi_rw_content_t, httpd_apcupsd_cgi_rw_content_t, httpd_dspam_rw_content_t, httpd_mediawiki_rw_content_t, httpd_squid_rw_content_t, httpd_prewikka_rw_content_t, httpd_smokeping_cgi_rw_content_t, passenger_var_run_t, httpd_openshift_rw_content_t, httpd_dirsrvadmin_rw_content_t, httpd_w3c_validator_rw_content_t, httpd_user_rw_content_t, httpd_awstats_rw_content_t, httpdcontent, httpd_cobbler_rw_content_t, root_t, httpd_munin_rw_content_t, httpd_bugzilla_rw_content_t, httpd_cvs_rw_content_t, httpd_git_rw_content_t, httpd_sys_rw_content_t, httpd_sys_rw_content_t, httpd_nagios_rw_content_t +#squirrelmail_spool_t, mirrormanager_var_run_t, dirsrvadmin_config_t, httpd_lock_t, httpd_tmp_t, dirsrv_config_t, dirsrvadmin_tmp_t, httpd_cache_t, httpd_tmpfs_t, httpd_squirrelmail_t, dirsrv_var_run_t, dirsrv_var_log_t, httpd_var_lib_t, httpd_var_run_t, zarafa_var_lib_t, httpd_prewikka_rw_content_t, httpd_mediawiki_rw_content_t, httpd_squid_rw_content_t, passenger_var_run_t, httpd_smokeping_cgi_rw_content_t, httpd_openshift_rw_content_t, httpd_dirsrvadmin_rw_content_t, httpd_w3c_validator_rw_content_t, httpd_collectd_rw_content_t, cluster_var_lib_t, cluster_var_run_t, httpd_user_rw_content_t, httpd_awstats_rw_content_t, httpdcontent, root_t, httpd_cobbler_rw_content_t, httpd_munin_rw_content_t, cluster_conf_t, httpd_bugzilla_rw_content_t, passenger_tmp_t, httpd_cvs_rw_content_t, httpd_git_rw_content_t, httpd_sys_rw_content_t, httpd_sys_rw_content_t, httpd_nagios_rw_content_t, httpd_apcupsd_cgi_rw_content_t, httpd_nutups_cgi_rw_content_t, httpd_dspam_rw_content_t allow httpd_t initrc_state_t:file { read write getattr unlink open }; allow httpd_t initrc_t:unix_stream_socket connectto; allow httpd_t initrc_t:shm { unix_read unix_write associate read write getattr }; -allow httpd_t initrc_var_run_t:file { read lock open }; -allow httpd_t kernel_t:dir search; +allow httpd_t initrc_var_run_t:file { write read lock open }; +allow httpd_t kernel_t:dir { search getattr }; allow httpd_t kernel_t:file { read getattr open }; -allow httpd_t mysqld_safe_t:dir search; +allow httpd_t mysqld_safe_t:dir { search getattr }; allow httpd_t mysqld_safe_t:file { read getattr open }; -allow httpd_t mysqld_t:dir search; +allow httpd_t mysqld_t:dir { search getattr }; allow httpd_t mysqld_t:file { read getattr open }; -allow httpd_t sshd_t:dir search; +allow httpd_t sshd_t:dir { search getattr }; allow httpd_t sshd_t:file { read getattr open }; -allow httpd_t syslogd_t:dir search; +allow httpd_t syslogd_t:dir { search getattr }; allow httpd_t syslogd_t:file { read getattr open }; allow httpd_t tmpfs_t:sock_file write; -allow httpd_t udev_t:dir search; +allow httpd_t udev_t:dir { search getattr }; allow httpd_t udev_t:file { read getattr open }; -allow httpd_t unconfined_t:dir search; +allow httpd_t unconfined_t:dir { search getattr }; allow httpd_t unconfined_t:file { read getattr open }; allow httpd_t var_lib_t:lnk_file { write getattr read lock unlink }; +allow httpd_t var_lib_t:sock_file { write unlink }; allow httpd_t v4l_device_t:chr_file getattr; allow httpd_t afs_fs_port_t:udp_socket name_bind; allow httpd_t afs_ka_port_t:udp_socket name_bind; @@ -114,10 +116,10 @@ allow httpd_t mmcc_port_t:udp_socket name_bind; allow httpd_t netsupport_port_t:udp_socket name_bind; allow httpd_t nodejs_debug_port_t:udp_socket name_bind; allow httpd_t port_t:udp_socket name_bind; -allow httpd_t postfix_master_t:dir search; +allow httpd_t postfix_master_t:dir { search getattr }; allow httpd_t postfix_master_t:file { read getattr open }; -allow httpd_t postfix_pickup_t:dir search; +allow httpd_t postfix_pickup_t:dir { search getattr }; allow httpd_t postfix_pickup_t:file { read getattr open }; -allow httpd_t postfix_qmgr_t:dir search; +allow httpd_t postfix_qmgr_t:dir { search getattr }; allow httpd_t postfix_qmgr_t:file { read getattr open }; allow httpd_t presence_port_t:udp_socket name_bind; diff --git a/distros/redhat/zoneminder.cmake.el6.spec b/distros/redhat/zoneminder.cmake.el6.spec index f40291faf..9e0bcaee0 100644 --- a/distros/redhat/zoneminder.cmake.el6.spec +++ b/distros/redhat/zoneminder.cmake.el6.spec @@ -17,8 +17,6 @@ URL: http://www.zoneminder.com/ #Source0: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz Source0: ZoneMinder-%{version}.tar.gz -Patch1: zoneminder-1.28.0-defaults.patch - BuildRequires: cmake gnutls-devel bzip2-devel BuildRequires: mysql-devel pcre-devel libjpeg-turbo-devel BuildRequires: perl(Archive::Tar) perl(Archive::Zip) @@ -63,7 +61,14 @@ too much degradation of performance. %prep %setup -q -n ZoneMinder-%{version} -%patch1 -p0 -b .defaults +# Change the following default values +./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin/zm/nph-zms +./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes +./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm +./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload +./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes +./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no +./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no %build # Have to override CMAKE_INSTALL_LIBDIR for cmake < 2.8.7 due to this bug: diff --git a/distros/ubuntu1204/changelog b/distros/ubuntu1204/changelog index 2884e449c..994f653b7 100644 --- a/distros/ubuntu1204/changelog +++ b/distros/ubuntu1204/changelog @@ -1,3 +1,9 @@ +zoneminder (1.28.0+1-utopic-SNAPSHOT2014112001) utopic; urgency=medium + + * Various fixes and developments since 1.28.0. Includes Digest-Auth for HTTP and better for RTSP + + -- Isaac Connor Thu, 20 Nov 2014 10:57:57 -0500 + zoneminder (1.28.0-trusty) trusty; urgency=medium * Release diff --git a/distros/ubuntu1204/control b/distros/ubuntu1204/control index 7ad729070..9c4dc5995 100644 --- a/distros/ubuntu1204/control +++ b/distros/ubuntu1204/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.2 Package: zoneminder Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl Recommends: mysql-server|mariadb-server Description: A video camera security and surveillance solution ZoneMinder is intended for use in single or multi-camera video security diff --git a/docs/conf.py b/docs/conf.py index a934a71c5..1bbefead2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,9 +51,9 @@ copyright = u'2014, https://github.com/ZoneMinder/ZoneMinder/graphs/contributors # built documents. # # The short X.Y version. -version = '1.27.0' +version = '1.28.0' # The full version, including alpha/beta/rc tags. -release = '1.27.0' +release = '1.28.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/installationguide/ubuntu.rst b/docs/installationguide/ubuntu.rst index a6a266c5c..4f6d8289d 100644 --- a/docs/installationguide/ubuntu.rst +++ b/docs/installationguide/ubuntu.rst @@ -3,14 +3,10 @@ Ubuntu PPA Install ----------- -Follow these instructions to install current release version on Ubuntu 13.04 or under.: +Follow these instructions to install current release version on Ubuntu.: sudo apt-add-repository ppa:iconnor/zoneminder -Or Ubuntu 14.10 you will need to install the Snapshot PPA from the master branch instead.: - - sudo apt-add-repository ppa:iconnor/zoneminder-master - Once you have updated the repository then update and install the package.: sudo apt-get update diff --git a/docs/userguide/images/Console.png b/docs/userguide/images/Console.png new file mode 100644 index 000000000..f8e5e166e Binary files /dev/null and b/docs/userguide/images/Console.png differ diff --git a/docs/userguide/monitor/images/Monitor_Misc.png b/docs/userguide/monitor/images/Monitor_Misc.png new file mode 100644 index 000000000..0d7ab50be Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_Misc.png differ diff --git a/docs/userguide/monitor/images/Monitor_Source_ffmpeg.png b/docs/userguide/monitor/images/Monitor_Source_ffmpeg.png new file mode 100644 index 000000000..c3de6b2d9 Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_Source_ffmpeg.png differ diff --git a/docs/userguide/monitor/images/Monitor_Source_local.png b/docs/userguide/monitor/images/Monitor_Source_local.png new file mode 100644 index 000000000..3dd4f2855 Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_Source_local.png differ diff --git a/docs/userguide/monitor/images/Monitor_buffers.png b/docs/userguide/monitor/images/Monitor_buffers.png new file mode 100644 index 000000000..402084392 Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_buffers.png differ diff --git a/docs/userguide/monitor/images/Monitor_general.png b/docs/userguide/monitor/images/Monitor_general.png new file mode 100644 index 000000000..f4c39cd5f Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_general.png differ diff --git a/docs/userguide/monitor/images/Monitor_preset.png b/docs/userguide/monitor/images/Monitor_preset.png new file mode 100644 index 000000000..3faf1954e Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_preset.png differ diff --git a/docs/userguide/monitor/images/Monitor_source_curl.png b/docs/userguide/monitor/images/Monitor_source_curl.png new file mode 100644 index 000000000..b276ca64d Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_source_curl.png differ diff --git a/docs/userguide/monitor/images/Monitor_source_file.png b/docs/userguide/monitor/images/Monitor_source_file.png new file mode 100644 index 000000000..d68751cff Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_source_file.png differ diff --git a/docs/userguide/monitor/images/Monitor_source_libvlc.png b/docs/userguide/monitor/images/Monitor_source_libvlc.png new file mode 100644 index 000000000..3cc38ddc0 Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_source_libvlc.png differ diff --git a/docs/userguide/monitor/images/Monitor_source_remote.png b/docs/userguide/monitor/images/Monitor_source_remote.png new file mode 100644 index 000000000..e77fb2a41 Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_source_remote.png differ diff --git a/docs/userguide/monitor/images/Monitor_timestamp.png b/docs/userguide/monitor/images/Monitor_timestamp.png new file mode 100644 index 000000000..e7d473d0d Binary files /dev/null and b/docs/userguide/monitor/images/Monitor_timestamp.png differ diff --git a/docs/userguide/options.rst b/docs/userguide/options.rst index 085b87c90..4a0b357f6 100644 --- a/docs/userguide/options.rst +++ b/docs/userguide/options.rst @@ -1,17 +1,24 @@ Options ======= -The final area covered by the tutorial is the options and user section. If you are running in authenticated mode and don’t have system privileges then you will not see this section at all and if you are running in un-authenticated mode then no user section will be displayed. The various options you can specify are displayed in a tabbed dialog with each group of options displayed under a different heading. Each option is displayed with its name, a short description and the current value. You can also click on the ‘?’ link following each description to get a fuller explanation about each option. This is the same as you would get from zmconfig.pl. A number of option groups have a master option near the top which enables or disables the whole group so you should be aware of the state of this before modifying options and expecting them to make any difference. If you have changed the value of an option you should then ‘save’ it. A number of the option groups will then prompt you to let you know that the option(s) you have changed will require a system restart. This is not done automatically in case you will be changing many values in the same session, however once you have made all of your changes you should restart ZoneMinder as soon as possible. The reason for this is that web and some scripts will pick up the new changes immediately but some of the daemons will still be using the old values and this can lead to data inconsistency or loss. -One of the options you may notice in the ‘System’ tab allows you to specify the default language for your installation of ZoneMinder. Versions 1.17.0 and later support multiple languages but rely on users to assist in creating language files for specific languages. To specify a language you will have to give the applicable code, thus for UK English this is en_gb, and for US English it would be en_us, if no language is given then UK English is assumed. Most languages will be specified in this nn_mm format and to check which languages are available look for files named zm_lang_*.php in the ZoneMinder build directory where the parts represented by the ‘*’ would be what you would enter as a language. This is slightly unwieldy and will probably be improved in future to make it easier to determine language availability. On checking which languages are available it may be that your preferred language is not currently included and if this is the case please consider doing a translation and sending it back to it may be included in future releases. All the language elements are given in the zm_lang_en_gb.php file along with a few notes to help you understand the format. +.. toctree:: -As mentioned above, you may also see a ‘users’ tab in the Options area. In this section you will see a list of the current users defined on the system. You can also add or delete users from here. It is recommended you do not delete the admin user unless you have created another fully privileged user to take over the same role. Each user is defined with a name and password (which is hidden) as well as an enabled setting which you can use to temporarily enable or disable users, for example a guest user for limited time access. As well as that there is a language setting that allows you to define user specific languages. Setting a language here that is different than the system language will mean that when that user logs in they will have the web interface presented in their own language rather than the system default, if it is available. Specifying a language here is done in the same way as for the system default language described above. - -There are also five values that define the user permissions, these are ‘Stream’, ‘Events’, ‘Control’, ‘Monitors’ and ‘System’ Each can have values of ‘None’, ‘View’ or ‘Edit’ apart from ‘Stream’ which has no ‘Edit’ setting. These values cover access to the following areas; ‘Stream’ defines whether a user is allowed to view the ‘live’ video feeds coming from the cameras. You may wish to allow a user to view historical events only in which case this setting should be ‘none’. The ‘Events’ setting determines whether a user can view and modify or delete any retained historical events. The ‘Control’ setting allows you to indicate whether the user is able to control any Pan/Tilt/Zoom type cameras you may have on your system. The ‘Monitors’ setting specifies whether a user can see the current monitor settings and change them. Finally the ‘System’ setting determines whether a user can view or modify the system settings as a whole, such as options and users or controlling the running of the system as a whole. - -As well as these settings there is also a ‘Bandwidth’ setting which can be used to limit the maximum bandwidth that a user can view at and a ‘Monitor Ids’ setting that can be used for non-’System’ users to restrict them to only being able to access streams, events or monitors for the given monitors ids as a comma separated list with no spaces. If a user with ‘Monitors’ edit privileges is limited to specific monitors here they will not be able to add or delete monitors but only change the details of those they have access to. If a user has ‘System’ privileges then the ‘Monitors Ids’ setting is ignored and has no effect.’ - -That’s pretty much is it for the tour, though there is a lot more to ZoneMinder as you will discover. You should experiment with the various settings to get the results you think are right for your requirements. + options/options_display + options/options_system + options/options_config + options/options_paths + options/options_web + options/options_images + options/options_logging + options/options_network + options/options_email + options/options_upload + options/options_x10 + options/options_bw + options/options_phonebw + options/options_eyezm + options/options_users diff --git a/docs/userguide/options/images/Options_BW.png b/docs/userguide/options/images/Options_BW.png new file mode 100644 index 000000000..614944b41 Binary files /dev/null and b/docs/userguide/options/images/Options_BW.png differ diff --git a/docs/userguide/options/images/Options_BW_Phone.png b/docs/userguide/options/images/Options_BW_Phone.png new file mode 100644 index 000000000..dd3e27a50 Binary files /dev/null and b/docs/userguide/options/images/Options_BW_Phone.png differ diff --git a/docs/userguide/options/images/Options_Config.png b/docs/userguide/options/images/Options_Config.png new file mode 100644 index 000000000..d61ecf32e Binary files /dev/null and b/docs/userguide/options/images/Options_Config.png differ diff --git a/docs/userguide/options/images/Options_Display.png b/docs/userguide/options/images/Options_Display.png new file mode 100644 index 000000000..05ad5b506 Binary files /dev/null and b/docs/userguide/options/images/Options_Display.png differ diff --git a/docs/userguide/options/images/Options_Logging.png b/docs/userguide/options/images/Options_Logging.png new file mode 100644 index 000000000..a0b00d767 Binary files /dev/null and b/docs/userguide/options/images/Options_Logging.png differ diff --git a/docs/userguide/options/images/Options_Network.png b/docs/userguide/options/images/Options_Network.png new file mode 100644 index 000000000..d94ab9992 Binary files /dev/null and b/docs/userguide/options/images/Options_Network.png differ diff --git a/docs/userguide/options/images/Options_Paths.png b/docs/userguide/options/images/Options_Paths.png new file mode 100644 index 000000000..6da6da4b9 Binary files /dev/null and b/docs/userguide/options/images/Options_Paths.png differ diff --git a/docs/userguide/options/images/Options_System.png b/docs/userguide/options/images/Options_System.png new file mode 100644 index 000000000..f100dd7f0 Binary files /dev/null and b/docs/userguide/options/images/Options_System.png differ diff --git a/docs/userguide/options/images/Options_Users.png b/docs/userguide/options/images/Options_Users.png new file mode 100644 index 000000000..31a697cc1 Binary files /dev/null and b/docs/userguide/options/images/Options_Users.png differ diff --git a/docs/userguide/options/images/Options_X10.png b/docs/userguide/options/images/Options_X10.png new file mode 100644 index 000000000..34e9e87ad Binary files /dev/null and b/docs/userguide/options/images/Options_X10.png differ diff --git a/docs/userguide/options/images/Options_email.png b/docs/userguide/options/images/Options_email.png new file mode 100644 index 000000000..c1c17f569 Binary files /dev/null and b/docs/userguide/options/images/Options_email.png differ diff --git a/docs/userguide/options/images/Options_eyezm.png b/docs/userguide/options/images/Options_eyezm.png new file mode 100644 index 000000000..397a92d3b Binary files /dev/null and b/docs/userguide/options/images/Options_eyezm.png differ diff --git a/docs/userguide/options/images/Options_images.png b/docs/userguide/options/images/Options_images.png new file mode 100644 index 000000000..2f73ee7a0 Binary files /dev/null and b/docs/userguide/options/images/Options_images.png differ diff --git a/docs/userguide/options/images/Options_upload.png b/docs/userguide/options/images/Options_upload.png new file mode 100644 index 000000000..46cd6dd89 Binary files /dev/null and b/docs/userguide/options/images/Options_upload.png differ diff --git a/docs/userguide/options/images/Options_web.png b/docs/userguide/options/images/Options_web.png new file mode 100644 index 000000000..2376030f0 Binary files /dev/null and b/docs/userguide/options/images/Options_web.png differ diff --git a/docs/userguide/options/options_bw.rst b/docs/userguide/options/options_bw.rst new file mode 100644 index 000000000..8dddf9f85 --- /dev/null +++ b/docs/userguide/options/options_bw.rst @@ -0,0 +1,42 @@ +Options - High, Medium and Low B/W +---------------------------------- + +.. image:: images/Options_BW.png + +There are now a number of options that are grouped into bandwidth categories, this allows you to configure the ZoneMinder client to work optimally over the various access methods you might to access the client. The following options are available in H, M and L options. These 3 groups control what happens when the client is running in 'high', 'medium' and 'low' bandwidth mode respectively. In most cases the default values will be suitable as a starting point. + +High - You should set these options for when accessing the ZoneMinder client over a local network or high speed link. + +Medium - You should set these options for when accessing the ZoneMinder client over a slower cable or DSL link. + +Slow - You should set these options for when accessing Zoneminder client over a slow network link. + +WEB_H_REFRESH_MAIN, WEB_M_REFRESH_MAIN, WEB_L_REFRESH_MAIN - How often (in seconds) the main console window should refresh itself. The main console window lists a general status and the event totals for all monitors. 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. + +WEB_H_REFRESH_CYCLE, WEB_M_REFRESH_CYCLE, WEB_L_REFRESH_CYCLE - How often (in seconds) the cycle watch window swaps to the next monitor. The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image. + +WEB_H_REFRESH_IMAGE, WEB_M_REFRESH_IMAGE, WEB_L_REFRESH_IMAGE - How often (in seconds) the watched image is refreshed (if not streaming). 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. + +WEB_H_REFRESH_STATUS, WEB_M_REFRESH_STATUS, WEB_L_REFRESH_STATUS - How often (in seconds) the status refreshes itself in the watch window. 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. + +WEB_H_REFRESH_EVENTS, WEB_M_REFRESH_EVENTS, WEB_L_REFRESH_EVENTS - How often (in seconds) the event listing is refreshed in the watch window. 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. + +WEB_H_CAN_STREAM, WEB_M_CAN_STREAM, WEB_L_CAN_STREAM - 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 nativ + +WEB_H_STREAM_METHOD, WEB_M_STREAM_METHOD, WEB_H_STREAM_METHOD - ZoneMinder can be configured to use either mpeg encoded video or a series or still jpeg images when sending video streams. 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 + +WEB_H_DEFAULT_SCALE, WEB_M_DEFAULT_SCALE, WEB_L_DEFAULT_SCALE - 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. + +WEB_H_DEFAULT_RATE, WEB_M_DEFAULT_RATE, WEB_L_DEFAULT_RATE - 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. + +WEB_H_VIDEO_BITRATE, WEB_M_VIDEO_BITRATE, WEB_L_VIDEO_BITRATE - When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a 'quality' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality. + +WEB_H_VIDEO_MAXFPS, WEB_M_VIDEO_MAXFPS, WEB_L_VIDEO_MAXFPS - 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. + +WEB_H_SCALE_THUMBS, WEB_M_SCALE_THUMBS, WEB_L_SCALE_THUMBS - 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. + +WEB_H_EVENTS_VIEW, WEB_M_EVENTS_VIEW, WEB_L_EVENTS_VIEW - 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. + +WEB_H_SHOW_PROGRESS, WEB_M_SHOW_PROGRESS, WEB_L_SHOW_PROGRESS - 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. + +WEB_H_AJAX_TIMEOUT, WEB_M_AJAX_TIMEOUT, WEB_L_AJAX_TIMEOUT - The newer versions of the live feed and event views use Ajax to request 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. \ No newline at end of file diff --git a/docs/userguide/options/options_config.rst b/docs/userguide/options/options_config.rst new file mode 100644 index 000000000..7918361ba --- /dev/null +++ b/docs/userguide/options/options_config.rst @@ -0,0 +1,38 @@ +Options - Config +---------------- + +.. image:: images/Options_Config.png + +TIMESTAMP_ON_CAPTURE - ZoneMinder can add a timestamp to images in two ways. The default method, when this option is set, is that each image 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. + +CPU_EXTENSIONS - 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. + +FAST_IMAGE_BLENDS - To detect alarms ZoneMinder needs to blend the captured image with the stored reference image to update it for comparison with the next image. The reference blend percentage 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. + +OPT_ADAPTIVE_SKIP - 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. + +MAX_SUSPEND_TIME - 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. + +STRICT_VIDEO_CONFIG - 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. + +SIGNAL_CHECK_POINTS - For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked. + +V4L_MULTI_BUFFER - 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 ovveride them in each individual monitor on the source page. + +CAPTURES_PER_FRAME - 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 ovveride them in each individual monitor on the source page. + +FORCED_ALARM_SCORE - 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. + +BULK_FRAME_INTERVAL - 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. + +EVENT_CLOSE_MODE - 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 occuring 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. + +CREATE_ANALYSIS_IMAGES - 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 occured. 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. + +WEIGHTED_ALARM_CENTRES - ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method 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. + +EVENT_IMAGE_DIGITS - 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. + +DEFAULT_ASPECT_RATIO - 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. + +USER_SELF_EDIT - 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 \ No newline at end of file diff --git a/docs/userguide/options/options_display.rst b/docs/userguide/options/options_display.rst new file mode 100644 index 000000000..db76b7505 --- /dev/null +++ b/docs/userguide/options/options_display.rst @@ -0,0 +1,13 @@ +Options - Display +----------------- + +.. image:: images/Options_Display.png + +This option screen allows user to select the skin for ZoneMinder. Currently available skins are: + +* Classic +* Flat +* XML (Deprecated in favour of web/API) +* Mobile (Deprecated) + + diff --git a/docs/userguide/options/options_email.rst b/docs/userguide/options/options_email.rst new file mode 100644 index 000000000..741ae0b6d --- /dev/null +++ b/docs/userguide/options/options_email.rst @@ -0,0 +1,96 @@ +Options - Email +--------------- + +.. image:: images/Options_email.png + +OPT_EMAIL - 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. + +EMAIL_ADDRESS - This option is used to define the email address that any events that match the appropriate filters will be sent to. + +EMAIL_SUBJECT - This option is used to define the subject of the email that is sent for any events that match the appropriate filters. + +EMAIL_BODY - This option is used to define the content of the email that is sent for any events that match the appropriate filters. + ++--------+--------------------------------------------------------+ +| Token | Description | ++========+========================================================+ +| %EI% | Id of the event | ++--------+--------------------------------------------------------+ +| %EN% | Name of the event | ++--------+--------------------------------------------------------+ +| %EC% | Cause of the event | ++--------+--------------------------------------------------------+ +| %ED% | Event description | ++--------+--------------------------------------------------------+ +| %ET% | Time of the event | ++--------+--------------------------------------------------------+ +| %EL% | Length of the event | ++--------+--------------------------------------------------------+ +| %EF% | Number of frames in the event | ++--------+--------------------------------------------------------+ +| %EFA% | Number of alarm frames in the event | ++--------+--------------------------------------------------------+ +| %EST% | Total score of the event | ++--------+--------------------------------------------------------+ +| %ESA% | Average score of the event | ++--------+--------------------------------------------------------+ +| %ESM% | Maximum score of the event | ++--------+--------------------------------------------------------+ +| %EP% | Path to the event | ++--------+--------------------------------------------------------+ +| %EPS% | Path to the event stream | ++--------+--------------------------------------------------------+ +| %EPI% | Path to the event images | ++--------+--------------------------------------------------------+ +| %EPI1% | Path to the first alarmed event image | ++--------+--------------------------------------------------------+ +| %EPIM% | Path to the (first) event image with the highest score | ++--------+--------------------------------------------------------+ +| %EI1% | Attach first alarmed event image | ++--------+--------------------------------------------------------+ +| %EIM% | Attach (first) event image with the highest score | ++--------+--------------------------------------------------------+ +| %EV% | Attach event mpeg video | ++--------+--------------------------------------------------------+ +| %MN% | Name of the monitor | ++--------+--------------------------------------------------------+ +| %MET% | Total number of events for the monitor | ++--------+--------------------------------------------------------+ +| %MEH% | Number of events for the monitor in the last hour | ++--------+--------------------------------------------------------+ +| %MED% | Number of events for the monitor in the last day | ++--------+--------------------------------------------------------+ +| %MEW% | Number of events for the monitor in the last week | ++--------+--------------------------------------------------------+ +| %MEM% | Number of events for the monitor in the last month | ++--------+--------------------------------------------------------+ +| %MEA% | Number of archived events for the monitor | ++--------+--------------------------------------------------------+ +| %MP% | Path to the monitor window | ++--------+--------------------------------------------------------+ +| %MPS% | Path to the monitor stream | ++--------+--------------------------------------------------------+ +| %MPI% | Path to the monitor recent image | ++--------+--------------------------------------------------------+ +| %FN% | Name of the current filter that matched | ++--------+--------------------------------------------------------+ +| %FP% | Path to the current filter that matched | ++--------+--------------------------------------------------------+ +| %ZP% | Path to your ZoneMinder console | ++--------+--------------------------------------------------------+ + +OPT_MESSAGE - 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. + +MESSAGE_ADDRESS - This option is used to define the short message email address that any events that match the appropriate filters will be sent to. + +MESSAGE_SUBJECT - This option is used to define the subject of the message that is sent for any events that match the appropriate filters. + +MESSAGE_BODY - This option is used to define the content of the message that is sent for any events that match the appropriate filters. + +NEW_MAIL_MODULES - 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. + +EMAIL_HOST - 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. + +FROM_EMAIL - 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. + +URL - 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. \ No newline at end of file diff --git a/docs/userguide/options/options_eyezm.rst b/docs/userguide/options/options_eyezm.rst new file mode 100644 index 000000000..8a63e205b --- /dev/null +++ b/docs/userguide/options/options_eyezm.rst @@ -0,0 +1,22 @@ +Options - eyeZM +--------------- + +.. image:: images/Options_eyezm.png + +EYEZM_DEBUG - Enable or Disable extra debugging from the eyeZm Plugin. Extra debugging information will be displayed in it's own file (EYEZM_LOG_TO_FILE is set), or your Apache error log + +EYEZM_LOG_TO_FILE - When EYEZM_DEBUG is on and EYEZM_LOG_TO_FILE is on, output generated from the eyeZm Plugin will go to it's own file. Otherwise it will go to the apache error log. + +EYEZM_LOG_FILE - Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled. This file will contain it's own output from the eyeZm Plugin when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled. + +EYEZM_EVENT_VCODEC - The eyeZm Plugin calls FFMPEG externally to encode the captured images. If your FFMPEG is not built with support for H264, change this to MPEG-4. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+). + +EYEZM_FEED_VCODEC - Determines whether the live stream is generated using native MJPEG streaming with ZoneMinder, or H264 using FFMPEG and HTML-5 streaming. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+). This is just a default parameter, and can be overridden with eyeZm. + +EYEZM_H264_DEFAULT_BR - Default bit-rate to use with FFMPEG for H264 streaming. When using the eyeZm Plugin to stream H264 data, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm. + +EYEZM_H264_DEFAULT_EVBR - Default bit-rate to use with FFMPEG for H264 event viewing. When using the eyeZm Plugin to view events in H264, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm. + +EYEZM_H264_TIMEOUT - Timeout (sec) to wait for H264 stream to start before terminating. The eyeZm Plugin will attempt to spawn an H264 stream when requested, and require that it complete within the timeout specified. If you have a slow system or find through the logs that the H264 stream is not starting because the timeout is expiring, even though FFMPEG is running, try increasing this value. If you have a fast system, decreasing this value can improve the responsiveness when there are issues starting H264 streams. + +EYEZM_SEG_DURATION - Segment duration used for streaming using HTTP-5 Streaming protocol. The HTTP-5 Live Streaming Protocol segments the input video stream into small chunks of a duration specified by this parameter. Increasing the segment duration will help with choppy connections on the other end, but will increase the latency in starting a stream. \ No newline at end of file diff --git a/docs/userguide/options/options_images.rst b/docs/userguide/options/options_images.rst new file mode 100644 index 000000000..3e8598425 --- /dev/null +++ b/docs/userguide/options/options_images.rst @@ -0,0 +1,44 @@ +Options - Images +---------------- + +.. image:: images/Options_images.png + +OPT_FFMPEG - ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option as events can still be reviewed as video streams without it. + +PATH_FFMPEG - This path should point to where ffmpeg has been installed. + +FFMPEG_INPUT_OPTIONS - Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here. + +FFMPEG_OUTPUT_OPTIONS - Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder. + +FFMPEG_FORMATS - Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a '*' after a format indicates that this will be the default format used for web video, adding '**' defines the default format for phone video. + +FFMPEG_OPEN_TIMEOUT - When Ffmpeg is opening a stream, it can take a long time before failing; certain circumstances even seem to be able to lock indefinitely. This option allows you to set a maximum time in seconds to pass before closing the stream and trying to reopen it again. + +JPEG_STREAM_QUALITY - When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view images but at the price of lower quality images. This option does not apply when viewing events or still images as these are usually just read from disk and so will be encoded at the quality specified by the previous options. + +MPEG_TIMED_FRAMES - When using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected then the timestamp for each frame, taken from 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. + +MPEG_LIVE_FORMAT - When using MPEG mode ZoneMinder can output live video. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player but 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 + +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. + +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. + +PATH_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. Leave this as 'cambozola.jar' if cambozola is installed in the same directory as the ZoneMinder web client files. + +RELOAD_CAMBOZOLA - Cambozola allows for the viewing of streaming MJPEG however it caches the entire stream into cache space on the computer, setting this to a number > 0 will cause it to automatically reload after that many seconds to avoid filling up a hard drive. + +OPT_FFMPEG - ZoneMinder can optionally encode a series of video images into an MPEG encoded movie file for viewing, downloading or storage. This option allows you to specify whether you have the ffmpeg tools installed. Note that creating MPEG files can be fairly CPU and disk intensive and is not a required option as events can still be reviewed as video streams without it. + +PATH_FFMPEG - This path should point to where ffmpeg has been installed. + +FFMPEG_INPUT_OPTIONS - Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the input to ffmpeg (options that are given before the -i option). Check the ffmpeg documentation for a full list of options which may be used here. + +FFMPEG_OUTPUT_OPTIONS - Ffmpeg can take many options on the command line to control the quality of video produced. This option allows you to specify your own set that apply to the output from ffmpeg (options that are given after the -i option). Check the ffmpeg documentation for a full list of options which may be used here. The most common one will often be to force an output frame rate supported by the video encoder. + +FFMPEG_FORMATS - Ffmpeg can generate video in many different formats. This option allows you to list the ones you want to be able to select. As new formats are supported by ffmpeg you can add them here and be able to use them immediately. Adding a '*' after a format indicates that this will be the default format used for web video, adding '**' defines the default format for phone video. + +FFMPEG_OPEN_TIMEOUT - When Ffmpeg is opening a stream, it can take a long time before failing; certain circumstances even seem to be able to lock indefinitely. This option allows you to set a maximum time in seconds to pass before closing the stream and trying to reopen it again. diff --git a/docs/userguide/options/options_logging.rst b/docs/userguide/options/options_logging.rst new file mode 100644 index 000000000..75cfe4098 --- /dev/null +++ b/docs/userguide/options/options_logging.rst @@ -0,0 +1,42 @@ +Options - Logging +----------------- + +.. image:: images/Options_Logging.png + +LOG_LEVEL_SYSLOG - 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 + +LOG_LEVEL_FILE - 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 + +LOG_LEVEL_WEBLOG - 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 + +LOG_LEVEL_DATABASE - 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 + +LOG_DATABASE_LIMIT - If you are using database logging then it is possible to quickly build up a large number of entries in the Logs table. This option allows you to specify how many of these entries are kept. If you set this option to a number greater than zero then that number is used to determine the maximum number of rows, less than or equal to zero indicates no limit and is not recommended. You can also set this value to time values such as ' day' which will limit the log entries to those newer than that time. You can specify 'hour', 'day', 'week', 'month' and 'year', note that the values should be singular (no 's' at the end). The Logs table is pruned periodically so it is possible for more than the expected number of rows to be present briefly in the meantime. + +LOG_DEBUG" - ZoneMinder components usually support debug logging available to help with diagnosing problems. Binary components have several levels of debug whereas more other components have only one. Normally this is disabled to minimise performance penalties and avoid filling logs too quickly. This option lets you switch on other options that allow you to configure additional debug information to be output. Components will pick up this instruction when they are restarted. + +LOG_DEBUG_TARGET - There are three scopes of debug available. Leaving this option blank means that all components will use extra debug (not recommended). Setting this option to '_', 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. + +LOG_DEBUG_LEVEL - There are 9 levels of debug available, with higher numbers being more debug and level 0 being no debug. However not all levels are used by all components. Also if there is debug at a high level it is usually likely to be output at such a volume that it may obstruct normal operation. For this reason you should set the level carefully and cautiously until the degree of debug you wish to see is present. Scripts and the web interface only have one level so this is an on/off type option for them. + +LOG_DEBUG_FILE - This option allows you to specify a different target for debug output. All components have a default log file which will 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. + +LOG_CHECK_PERIOD - When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to indicate what period of historical events are used in this calculation. This value is expressed in seconds and is ignored if LOG_LEVEL_DATABASE is set to None. + +LOG_ALERT_WAR_COUNT - When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alert state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None. + +LOG_ALERT_ERR_COUNT - When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alert state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None. + +LOG_ALERT_FAT_COUNT - When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alert state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None. + +LOG_ALARM_WAR_COUNT - When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many warnings must have occurred within the defined time period to generate an overall system alarm state. A value of zero means warnings are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None. + +LOG_ALARM_ERR_COUNT - When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many errors must have occurred within the defined time period to generate an overall system alarm state. A value of zero means errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None. + +LOG_ALARM_FAT_COUNT - When ZoneMinder is logging events to the database it can retrospectively examine the number of warnings and errors that have occurred to calculate an overall state of system health. This option allows you to specify how many fatal errors (including panics) must have occurred within the defined time period to generate an overall system alarm state. A value of zero means fatal errors are not considered. This value is ignored if LOG_LEVEL_DATABASE is set to None. + +RECORD_EVENT_STATS - 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. + +RECORD_DIAG_IMAGES - 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. + +DUMP_CORES - 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. \ No newline at end of file diff --git a/docs/userguide/options/options_network.rst b/docs/userguide/options/options_network.rst new file mode 100644 index 000000000..0ff0704f7 --- /dev/null +++ b/docs/userguide/options/options_network.rst @@ -0,0 +1,14 @@ +Options - Network +----------------- + +.. image:: images/Options_Network.png + +HTTP_VERSION - 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. + +HTTP_UA - 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. + +HTTP_TIMEOUT - 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. + +MIN_RTP_PORT - 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. + +MAX_RTP_PORT - 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. \ No newline at end of file diff --git a/docs/userguide/options/options_paths.rst b/docs/userguide/options/options_paths.rst new file mode 100644 index 000000000..024998194 --- /dev/null +++ b/docs/userguide/options/options_paths.rst @@ -0,0 +1,22 @@ +Options - Paths +--------------- + +.. image:: images/Options_Paths.png + +ZM_DIR_EVENTS - This is the path to the events directory where all the event images and other miscellaneous files are stored. 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 record events to a second disk or network share, then you should mount the drive or share directly to the ZoneMinder events folder or follow the instructions in the ZoneMinder Wiki titled Using a dedicated Hard Drive. + +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'. + +PATH_MAP - ZoneMinder has historically used IPC shared memory for shared data between processes. This has it's advantages and limitations. This version of ZoneMinder can use an alternate method, mapped memory, instead with can be enabled with the --enable--mmap directive to configure. This requires less system configuration and is generally more flexible. However it requires each shared data segment to map onto a filesystem file. This option indicates where those mapped files go. You should ensure that this location has sufficient space for these files and for the best performance it should be a tmpfs file system or ramdisk otherwise disk access may render this method slower than the regular shared memory one. + +PATH_SOCKS - ZoneMinder generally uses Unix domain sockets where possible. This reduces the need for port assignments and prevents external applications from possibly compromising the daemons. However each Unix socket requires a .sock file to be created. This option indicates where those socket files go. + +PATH_LOGS - There are various daemons that are used by ZoneMinder to perform various tasks. Most generate helpful log files and this is where they go. They can be deleted if not required for debugging. + +PATH_SWAP - Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time. diff --git a/docs/userguide/options/options_phonebw.rst b/docs/userguide/options/options_phonebw.rst new file mode 100644 index 000000000..e2389bccf --- /dev/null +++ b/docs/userguide/options/options_phonebw.rst @@ -0,0 +1,20 @@ +Options - Phone Bandwidth +------------------------- + +.. image:: images/Options_BW_Phone.png + +WEB_P_CAN_STREAM - Override the automatic detection of browser streaming capability. 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. + +WEB_P_STREAM_METHOD - 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" + +WEB_P_DEFAULT_SCALE - 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. + +WEB_P_DEFAULT_RATE - 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. + +WEB_P_VIDEO_BITRATE - When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a 'quality' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality. + +WEB_P_VIDEO_MAXFPS - 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. + +WEB_P_SCALE_THUMBS - 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. + +WEB_P_AJAX_TIMEOUT - 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. \ No newline at end of file diff --git a/docs/userguide/options/options_system.rst b/docs/userguide/options/options_system.rst new file mode 100644 index 000000000..83aa28bec --- /dev/null +++ b/docs/userguide/options/options_system.rst @@ -0,0 +1,48 @@ +Options - System +---------------- + +.. image:: images/Options_System.png + +LANG_DEFAULT - ZoneMinder allows the web interface to use languages other than English if the appropriate language file has been created and is present. This option allows you to change the default language that is used from the shipped language, British English, to another language. + +OPT_USE_AUTH - ZoneMinder can run in two modes. The simplest is an entirely unauthenticated mode where anyone can access ZoneMinder and perform all tasks. This is most suitable for installations where the web server access is limited in other ways. The other mode enables user accounts with varying sets of permissions. Users must login or authenticate to access ZoneMinder and are limited by their defined permissions. Authenticated mode alone should not be relied up for securing Internet connected ZoneMinder. + +AUTH_TYPE - ZoneMinder can use two methods to authenticate users when running in authenticated mode. The first is a builtin method where ZoneMinder provides facilities for users to log in and maintains track of their identity. The second method allows interworking with other methods such as http basic authentication which passes an independently 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. + +AUTH_RELAY - When ZoneMinder is running in authenticated mode it can pass user details between the web pages and the back end processes. There are two methods for doing this. This first is to use a time limited hashed string which contains no direct username or password details, the second method is to pass the username and passwords around in plaintext. This method is not recommend except where you do not have the md5 libraries available on your system or you have a completely isolated system with no external access. You can also switch off authentication relaying if your system is isolated in other ways. + +AUTH_HASH_SECRET - When ZoneMinder is running in hashed authenticated mode it is necessary to generate hashed strings containing encrypted sensitive information such as usernames and password. Although these string are reasonably secure the addition of a random secret increases security substantially. + +AUTH_HASH_IPS - When ZoneMinder is running in hashed authenticated mode it can optionally include the requesting IP address in the resultant hash. This adds an extra level of security as only requests from that address may use that authentication key. However in some circumstances, such as access over mobile networks, the requesting address can change for each request which will cause most requests to fail. This option allows you to control whether IP addresses are included in the authentication hash on your system. If you experience intermitent problems with authentication, switching this option off may help. + +AUTH_HASH_LOGINS - 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 hae 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 somethign unique to your system. + +OPT_FAST_DELETE - Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later. + +FILTER_RELOAD_DELAY - 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 in seconds the filters are reloaded from the database to get the latest versions or new filters. If you don't change filters very often this value can be set to a large value. + +FILTER_EXECUTE_INTERVAL - 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. + +MAX_RESTART_DELAY - 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. + +WATCH_CHECK_INTERVAL - 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 indefinately). This option determines how often the daemons are checked. + +WATCH_MAX_DELAY - 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 indefinately). 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. + +RUN_AUDIT - 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. + +AUDIT_CHECK_INTERVAL - 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. + +OPT_FRAME_SERVER - In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon. + +FRAME_SOCKET_SIZE - For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option + +OPT_CONTROL - 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. + +OPT_TRIGGERS - 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. + +CHECK_FOR_UPDATES - 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 +UPDATE_CHECK_PROXY - 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://:/ + +SHM_KEY - 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. + diff --git a/docs/userguide/options/options_upload.rst b/docs/userguide/options/options_upload.rst new file mode 100644 index 000000000..16e3f5588 --- /dev/null +++ b/docs/userguide/options/options_upload.rst @@ -0,0 +1,32 @@ +Options - Upload +---------------- + +.. image:: images/Options_upload.png + +OPT_UPLOAD - 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 + +UPLOAD_ARCH_FORMAT - 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. + +UPLOAD_ARCH_COMPRESS - 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. + +UPLOAD_ARCH_ANALYSE - 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. + +UPLOAD_PROTOCOL - 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. + +UPLOAD_HOST - 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. + +UPLOAD_PORT - 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. + +UPLOAD_USER - 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. + +UPLOAD_PASS - 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 certicate based logins for SFTP servers you can leave this option blank. + +UPLOAD_LOC_DIR - 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. + +UPLOAD_REM_DIR - 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. + +UPLOAD_TIMEOUT - 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. + +UPLOAD_FTP_PASSIVE - You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates that ftp transfers should be done in passive mode. This uses a single connection for all ftp activity and, whilst slower than active transfers, is more robust and likely to work from behind filewalls. This option is ignored for SFTP transfers. + +UPLOAD_DEBUG - 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. \ No newline at end of file diff --git a/docs/userguide/options/options_users.rst b/docs/userguide/options/options_users.rst new file mode 100644 index 000000000..4599cea9b --- /dev/null +++ b/docs/userguide/options/options_users.rst @@ -0,0 +1,10 @@ +Options - Users +--------------- + +.. image:: images/Options_Users.png + +In this section you will see a list of the current users defined on the system. You can also add or delete users from here. It is recommended you do not delete the admin user unless you have created another fully privileged user to take over the same role. Each user is defined with a name and password (which is hidden) as well as an enabled setting which you can use to temporarily enable or disable users, for example a guest user for limited time access. As well as that there is a language setting that allows you to define user specific languages. Setting a language here that is different than the system language will mean that when that user logs in they will have the web interface presented in their own language rather than the system default, if it is available. + +There are also five values that define the user permissions, these are ‘Stream’, ‘Events’, ‘Control’, ‘Monitors’ and ‘System’ Each can have values of ‘None’, ‘View’ or ‘Edit’ apart from ‘Stream’ which has no ‘Edit’ setting. These values cover access to the following areas; ‘Stream’ defines whether a user is allowed to view the ‘live’ video feeds coming from the cameras. You may wish to allow a user to view historical events only in which case this setting should be ‘none’. The ‘Events’ setting determines whether a user can view and modify or delete any retained historical events. The ‘Control’ setting allows you to indicate whether the user is able to control any Pan/Tilt/Zoom type cameras you may have on your system. The ‘Monitors’ setting specifies whether a user can see the current monitor settings and change them. Finally the ‘System’ setting determines whether a user can view or modify the system settings as a whole, such as options and users or controlling the running of the system as a whole. + +As well as these settings there is also a ‘Bandwidth’ setting which can be used to limit the maximum bandwidth that a user can view at and a ‘Monitor Ids’ setting that can be used for non-’System’ users to restrict them to only being able to access streams, events or monitors for the given monitors ids as a comma separated list with no spaces. If a user with ‘Monitors’ edit privileges is limited to specific monitors here they will not be able to add or delete monitors but only change the details of those they have access to. If a user has ‘System’ privileges then the ‘Monitors Ids’ setting is ignored and has no effect.’ \ No newline at end of file diff --git a/docs/userguide/options/options_web.rst b/docs/userguide/options/options_web.rst new file mode 100644 index 000000000..9425e3fe8 --- /dev/null +++ b/docs/userguide/options/options_web.rst @@ -0,0 +1,30 @@ +Options - Web +------------- + +.. image:: images/Options_web.png + +WEB_TITLE_PREFIX - If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification. + +WEB_RESIZE_CONSOLE - Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more 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 + +WEB_POPUP_ON_ALARM - When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway. + +WEB_SOUND_ON_ALARM - When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs. + +WEB_ALARM_SOUND - You can specify a sound file to play if an alarm occurs whilst you 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. + +WEB_COMPACT_MONTAGE - 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. + +WEB_EVENT_SORT_FIELD - Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering. + +WEB_EVENT_SORT_ORDER - Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the 'Prev' and 'Next' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering. + +WEB_EVENTS_PER_PAGE - In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode. + +WEB_LIST_THUMBS - Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options. + +WEB_LIST_THUMB_WIDTH - This 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. + +WEB_LIST_THUMB_HEIGHT - 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. + +WEB_USE_OBJECT_TAGS - 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. \ No newline at end of file diff --git a/docs/userguide/options/options_x10.rst b/docs/userguide/options/options_x10.rst new file mode 100644 index 000000000..dc41d8dd6 --- /dev/null +++ b/docs/userguide/options/options_x10.rst @@ -0,0 +1,12 @@ +Options - X10 +------------- + +.. image:: images/Options_X10.png + +OPT_X10 - 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. + +X10_DEVICE - If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1. + +X10_HOUSE_CODE - 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. + +X10_DB_RELOAD_INTERVAL - 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. \ No newline at end of file diff --git a/misc/zoneminder.service.in b/misc/zoneminder.service.in index ddda8eaa5..23ba45601 100644 --- a/misc/zoneminder.service.in +++ b/misc/zoneminder.service.in @@ -11,7 +11,7 @@ User=@WEB_USER@ Type=forking ExecStart=@BINDIR@/zmpkg.pl start ExecReload=@BINDIR@/zmpkg.pl restart -ExecStop=/bin/bash -c '[[ "$(@BINDIR@/pgrep zmdc.pl)" > 0 ]] && @BINDIR@/zmpkg.pl stop' +ExecStop=@BINDIR@/zmpkg.pl stop PIDFile="@ZM_RUNDIR@/zm.pid" [Install] diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index d2e00f46f..36c0ca255 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -450,6 +450,15 @@ our @options = type => $types{string}, category => "images", }, + { + name => "ZM_FFMPEG_OPEN_TIMEOUT", + default => "10", + description => "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.", + requires => [ { name=>"ZM_OPT_FFMPEG", value=>"yes" } ], + type => $types{integer}, + category => "images", + }, { name => "ZM_LOG_LEVEL_SYSLOG", default => "0", diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/3S.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/3S.pm new file mode 100644 index 000000000..f825af109 --- /dev/null +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/3S.pm @@ -0,0 +1,606 @@ +# ========================================================================== +# +# ZoneMinder 3S API Control Protocol Module, $Date: 2014-11-12 08:00:00 +0300 (Tue, 21 Jun 2011) $, $Revision: 1 $ +# Copyright (C) 2014 Juan Manuel Castro +# +# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# ========================================================================== +# +# This module contains the implementation of the 3S camera control +# protocol +#Model: N5071 +#Hardware Version: 00 +#Firmware Version: V1.03_STD-1 +#Firmware Build Time: Jun 19 2012 15:28:17 + +package ZoneMinder::Control::3S; + +use 5.006; +use strict; +use warnings; + +require ZoneMinder::Base; +require ZoneMinder::Control; + +our @ISA = qw(ZoneMinder::Control); + +our $VERSION = $ZoneMinder::Base::VERSION; + +# ========================================================================== +# +# 3S Control Protocol +# +# ========================================================================== + +use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); + +use Time::HiRes qw( usleep ); + +sub new +{ + my $class = shift; + my $id = shift; + my $self = ZoneMinder::Control->new( $id ); + 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" ); +} + +sub open +{ + my $self = shift; + + $self->loadMonitor(); + + use LWP::UserAgent; + $self->{ua} = LWP::UserAgent->new; + #$self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + $self->{ua}->agent( "ZoneMinder Control Agent/" . ZoneMinder::Base::ZM_VERSION ); + $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" ); + + #print("http://".$self->{Monitor}->{ControlAddress}."/$cmd"); + my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" ); + my $res = $self->{ua}->request($req); + + if ( $res->is_success ) + { + $result = !undef; + } + else + { + Error( "Error check failed: '".$res->status_line()."'" ); + } + + return( $result ); +} + +sub cameraReset +{ + my $self = shift; + Debug( "Camera Reset" ); + my $cmd = "/restart.cgi"; + $self->sendCmd( $cmd ); +} + +#Custom# +#Move X or Y Axis +sub Up +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "/ptz.cgi?move=up"; + $self->sendCmd( $cmd ); +} + +sub Down +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "/ptz.cgi?move=down"; + $self->sendCmd( $cmd ); +} + +sub Left +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "/ptz.cgi?move=left"; + $self->sendCmd( $cmd ); +} + +sub Right +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "/ptz.cgi?move=right"; + $self->sendCmd( $cmd ); +} + +##Zoom +sub Tele +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Tele" ); + my $cmd = "/ptz.cgi?rzoom=$step"; + $self->sendCmd( $cmd ); +} + +sub Wide +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Wide" ); + my $cmd = "/ptz.cgi?rzoom=-$step"; + $self->sendCmd( $cmd ); +} + +#Move X and Y Axis +sub UpRight +{ + my $self = shift; + Debug( "Move Up/Right" ); + my $cmd = "/ptz.cgi?move=upright"; + $self->sendCmd( $cmd ); +} + +sub UpLeft +{ + my $self = shift; + Debug( "Move Up/Left" ); + my $cmd = "/ptz.cgi?move=upleft"; + $self->sendCmd( $cmd ); +} + +sub DownRight +{ + my $self = shift; + Debug( "Move Down/Right" ); + my $cmd = "/ptz.cgi?move=downright"; + $self->sendCmd( $cmd ); +} + +sub DownLeft +{ + my $self = shift; + Debug( "Move Down/Left" ); + my $cmd = "/ptz.cgi?move=downleft"; + $self->sendCmd( $cmd ); +} + +#Foco +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my $cmd = "/ptz.cgi?Autofocus=on"; + $self->sendCmd( $cmd ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Manual" ); + my $cmd = "/ptz.cgi?Autofocus=off"; + $self->sendCmd( $cmd ); +} + +sub Near +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Near" ); + my $cmd = "/ptz.cgi?rfocus=-$step"; + $self->sendCmd( $cmd ); +} + +sub Far +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Far" ); + my $cmd = "/ptz.cgi?rfocus=$step"; + $self->sendCmd( $cmd ); +} + +#Iris +sub Open +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Open" ); + my $cmd = "/ptz.cgi?riris=$step"; + $self->sendCmd( $cmd ); +} + +sub Close +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Close" ); + my $cmd = "/ptz.cgi?riris=-$step"; + $self->sendCmd( $cmd ); +} + +#Custom# + +sub moveConUp +{ + my $self = shift; + Debug( "Move Up" ); + my $cmd = "/ptz.cgi?move=up"; + $self->sendCmd( $cmd ); +} + +sub moveConDown +{ + my $self = shift; + Debug( "Move Down" ); + my $cmd = "/ptz.cgi?move=down"; + $self->sendCmd( $cmd ); +} + +sub moveConLeft +{ + my $self = shift; + Debug( "Move Left" ); + my $cmd = "/ptz.cgi?move=left"; + $self->sendCmd( $cmd ); +} + +sub moveConRight +{ + my $self = shift; + Debug( "Move Right" ); + my $cmd = "/ptz.cgi?move=right"; + $self->sendCmd( $cmd ); +} + +sub moveConUpRight +{ + my $self = shift; + Debug( "Move Up/Right" ); + my $cmd = "/ptz.cgi?move=upright"; + $self->sendCmd( $cmd ); +} + +sub moveConUpLeft +{ + my $self = shift; + Debug( "Move Up/Left" ); + my $cmd = "/ptz.cgi?move=upleft"; + $self->sendCmd( $cmd ); +} + +sub moveConDownRight +{ + my $self = shift; + Debug( "Move Down/Right" ); + my $cmd = "/ptz.cgi?move=downright"; + $self->sendCmd( $cmd ); +} + +sub moveConDownLeft +{ + my $self = shift; + Debug( "Move Down/Left" ); + my $cmd = "/ptz.cgi?move=downleft"; + $self->sendCmd( $cmd ); +} + +sub moveRelUp +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up $step" ); + my $cmd = "/ptz.cgi?tilt=$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelDown +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down $step" ); + my $cmd = "/ptz.cgi?tilt=-$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelLeft +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + Debug( "Step Left $step" ); + my $cmd = "/ptz.cgi?pan=-$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelRight +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'panstep' ); + Debug( "Step Right $step" ); + my $cmd = "/ptz.cgi?pan=$step"; + $self->sendCmd( $cmd ); +} + +sub moveRelUpRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up/Right $tiltstep/$panstep" ); + my $cmd = "/ptz.cgi?pan=$panstep&tilt=$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelUpLeft +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Up/Left $tiltstep/$panstep" ); + my $cmd = "/ptz.cgi?pan=-$panstep&tilt=$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelDownRight +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down/Right $tiltstep/$panstep" ); + my $cmd = "/ptz.cgi?pan=$panstep&tilt=-$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub moveRelDownLeft +{ + my $self = shift; + my $params = shift; + my $panstep = $self->getParam( $params, 'panstep' ); + my $tiltstep = $self->getParam( $params, 'tiltstep' ); + Debug( "Step Down/Left $tiltstep/$panstep" ); + my $cmd = "/ptz.cgi?pan=-$panstep&tilt=-$tiltstep"; + $self->sendCmd( $cmd ); +} + +sub zoomRelTele +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Tele" ); + my $cmd = "/ptz.cgi?rzoom=$step"; + $self->sendCmd( $cmd ); +} + +sub zoomRelWide +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Zoom Wide" ); + my $cmd = "/ptz.cgi?rzoom=-$step"; + $self->sendCmd( $cmd ); +} + +sub focusRelNear +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Near" ); + my $cmd = "/ptz.cgi?rfocus=-$step"; + $self->sendCmd( $cmd ); +} + +sub focusRelFar +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Focus Far" ); + my $cmd = "/ptz.cgi?rfocus=$step"; + $self->sendCmd( $cmd ); +} + +sub focusAuto +{ + my $self = shift; + Debug( "Focus Auto" ); + my $cmd = "/ptz.cgi?Autofocus=on"; + $self->sendCmd( $cmd ); +} + +sub focusMan +{ + my $self = shift; + Debug( "Focus Manual" ); + my $cmd = "/ptz.cgi?Autofocus=off"; + $self->sendCmd( $cmd ); +} + +sub irisRelOpen +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Open" ); + my $cmd = "/ptz.cgi?riris=$step"; + $self->sendCmd( $cmd ); +} + +sub irisRelClose +{ + my $self = shift; + my $params = shift; + my $step = $self->getParam( $params, 'step' ); + Debug( "Iris Close" ); + my $cmd = "/ptz.cgi?riris=-$step"; + $self->sendCmd( $cmd ); +} + +sub irisAuto +{ + my $self = shift; + Debug( "Iris Auto" ); + my $cmd = "/ptz.cgi?autoiris=on"; + $self->sendCmd( $cmd ); +} + +sub irisMan +{ + my $self = shift; + Debug( "Iris Manual" ); + my $cmd = "/ptz.cgi?autoiris=off"; + $self->sendCmd( $cmd ); +} + +sub presetClear +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Clear Preset $preset" ); + my $cmd = "/ptz.cgi?removeserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetGoto +{ + my $self = shift; + my $params = shift; + my $preset = $self->getParam( $params, 'preset' ); + Debug( "Goto Preset $preset" ); + my $cmd = "/ptz.cgi?gotoserverpresetno=$preset"; + $self->sendCmd( $cmd ); +} + +sub presetHome +{ + my $self = shift; + Debug( "Home Preset" ); + my $cmd = "/ptz.cgi?move=home"; + $self->sendCmd( $cmd ); +} + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +ZoneMinder::Database - Perl extension for blah blah blah + +=head1 SYNOPSIS + + use ZoneMinder::Database; + blah blah blah + +=head1 DESCRIPTION + +Stub documentation for ZoneMinder, created by h2xs. It looks like the +author of the extension was negligent enough to leave the stub +unedited. + +Blah blah blah. + +=head2 EXPORT + +None by default. + + + +=head1 SEE ALSO + +Mention other useful documentation such as the documentation of +related modules or operating system documentation (such as man pages +in UNIX), or any relevant external documentation such as RFCs or +standards. + +If you have a mailing list set up for your module, mention it here. + +If you have a web site set up for your module, mention it here. + +=head1 AUTHOR + +Juan Manuel Castro, Ejuanmanuel.castro@gmail.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2014 Juan Manuel Castro + +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 diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm index e5a5882b9..2372a2d81 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/AxisV2.pm @@ -33,8 +33,6 @@ require ZoneMinder::Control; our @ISA = qw(ZoneMinder::Control); -our $VERSION = $ZoneMinder::Base::VERSION; - # ========================================================================== # # Axis V2 Control Protocol @@ -79,7 +77,7 @@ sub open use LWP::UserAgent; $self->{ua} = LWP::UserAgent->new; - $self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); + $self->{ua}->agent( "ZoneMinder Control Agent/".ZoneMinder::Base::ZM_VERSION ); $self->{state} = 'open'; } diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm index 356bb5aea..353dc4a32 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm @@ -87,7 +87,7 @@ sub write() my $nbytes = syswrite( $self->{handle}, $buffer ); if ( !defined( $nbytes) || $nbytes < length($buffer) ) { - Error( "Unable to write buffer '".$buffer.", expected ".length($buffer)." bytes, sent ".$nbytes.": $!\n" ); + Error( "Unable to write buffer '".$buffer.", expected ".length($buffer)." bytes, sent ".($nbytes?$nbytes:'undefined').": $!\n" ); return( undef ); } Debug( "Wrote '$buffer' ($nbytes bytes)\n" ); @@ -106,11 +106,11 @@ __END__ =head1 NAME -ZoneMinder::Database - Perl extension for blah blah blah +ZoneMinder::Trigger::Channel::Handle - Perl extension for blah blah blah =head1 SYNOPSIS - use ZoneMinder::Database; + use ZoneMinder::Trigger::Channel::Handle; blah blah blah =head1 DESCRIPTION diff --git a/scripts/zm.in b/scripts/zm.in index a46a89280..33c32ac6c 100755 --- a/scripts/zm.in +++ b/scripts/zm.in @@ -3,6 +3,9 @@ # chkconfig: 2345 99 00 # processname: zmpkg.pl +# This script is intended for use with legacy SysV init environments ONLY +# For systemd environments, use the ZoneMinder systemd unit file instead + # Source function library. . /etc/rc.d/init.d/functions diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in index 5df490947..23cd02a2e 100644 --- a/scripts/zmdc.pl.in +++ b/scripts/zmdc.pl.in @@ -49,7 +49,7 @@ use ZoneMinder; use POSIX; use Socket; use IO::Handle; -use Data::Dumper; +#use Data::Dumper; use constant SOCK_FILE => $Config{ZM_PATH_SOCKS}.'/zmdc.sock'; @@ -214,7 +214,7 @@ use ZoneMinder; use POSIX; use Socket; use IO::Handle; -use Data::Dumper; +#use Data::Dumper; our %cmd_hash; our %pid_hash; diff --git a/scripts/zmupdate.pl.in b/scripts/zmupdate.pl.in index 83502154c..41a081fc1 100644 --- a/scripts/zmupdate.pl.in +++ b/scripts/zmupdate.pl.in @@ -89,6 +89,8 @@ Parameters are :- -u, --user= - Alternate DB user with privileges to alter DB -p, --pass= - Password of alternate DB user with privileges to alter DB -d,--dir= - Directory containing update files if not in default build location +-interactive - interact with the user +-nointeractive - do not interact with the user "); exit( -1 ); } @@ -319,34 +321,37 @@ if ( $freshen ) saveConfigToDB(); } -# Now check for MyISAM Tables -my @MyISAM_Tables; -my $sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='zm' AND engine = 'MyISAM'"; -my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); -my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); +# Don't do innoDB upgrade if not interactive +if ( $interactive ) { + # Now check for MyISAM Tables + my @MyISAM_Tables; + my $sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='zm' AND engine = 'MyISAM'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); -while( my $dbTable = $sth->fetchrow() ) { - push @MyISAM_Tables, $dbTable; -} -$sth->finish(); + while( my $dbTable = $sth->fetchrow() ) { + push @MyISAM_Tables, $dbTable; + } + $sth->finish(); -if ( @MyISAM_Tables ) { - print( "\nPrevious versions of ZoneMinder used the MyISAM database engine.\nHowever, the recommended database engine is InnoDB.\n"); - print( "\nHint: InnoDB tables are much less likely to be corrupted during an unclean shutdown.\n\nPress 'y' to convert your tables to InnoDB or 'n' to skip : "); - my $response = ; - chomp( $response ); - if ( $response =~ /^[yY]$/ ) { - print "\nConverting MyISAM tables to InnoDB. Please wait.\n"; - foreach (@MyISAM_Tables) { + if ( @MyISAM_Tables ) { + print( "\nPrevious versions of ZoneMinder used the MyISAM database engine.\nHowever, the recommended database engine is InnoDB.\n"); + print( "\nHint: InnoDB tables are much less likely to be corrupted during an unclean shutdown.\n\nPress 'y' to convert your tables to InnoDB or 'n' to skip : "); + my $response = ; + chomp( $response ); + if ( $response =~ /^[yY]$/ ) { $dbh->do(q|SET sql_mode='traditional'|); # Elevate warnings to errors - my $sql = "ALTER TABLE $_ ENGINE = InnoDB"; - my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); - my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); - $sth->finish(); + print "\nConverting MyISAM tables to InnoDB. Please wait.\n"; + foreach (@MyISAM_Tables) { + my $sql = "ALTER TABLE $_ ENGINE = InnoDB"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + $sth->finish(); + } $dbh->do(q|SET sql_mode=''|); # Set mode back to default } } -} +} # end if interactive if ( $version ) { diff --git a/src/zm_buffer.h b/src/zm_buffer.h index 3f2343b1a..af043ae13 100644 --- a/src/zm_buffer.h +++ b/src/zm_buffer.h @@ -151,7 +151,7 @@ public: { if ( mSize == 0 ) mHead = mTail = mStorage; - else if ( level >= 1 ) + else if ( level ) { if ( (mHead-mStorage) > mSize ) { @@ -159,12 +159,6 @@ public: mHead = mStorage; mTail = mHead + mSize; } - else if ( level >= 2 ) - { - memmove( mStorage, mHead, mSize ); - mHead = mStorage; - mTail = mHead + mSize; - } } } } diff --git a/src/zm_config.cpp b/src/zm_config.cpp index 2b54cfeb1..a25f7a39a 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -29,7 +29,6 @@ void zmLoadConfig() { FILE *cfg; char line[512]; - char *val; if ( (cfg = fopen( ZM_CONFIG, "r")) == NULL ) { Fatal( "Can't open %s: %s", ZM_CONFIG, strerror(errno) ); @@ -82,19 +81,16 @@ void zmLoadConfig() white_len = strspn( val_ptr, " \t" ); val_ptr += white_len; - val = (char *)malloc( strlen(val_ptr)+1 ); - strncpy( val, val_ptr, strlen(val_ptr)+1 ); - if ( strcasecmp( name_ptr, "ZM_DB_HOST" ) == 0 ) - staticConfig.DB_HOST = val; + staticConfig.DB_HOST = std::string(val_ptr); else if ( strcasecmp( name_ptr, "ZM_DB_NAME" ) == 0 ) - staticConfig.DB_NAME = val; + staticConfig.DB_NAME = std::string(val_ptr); else if ( strcasecmp( name_ptr, "ZM_DB_USER" ) == 0 ) - staticConfig.DB_USER = val; + staticConfig.DB_USER = std::string(val_ptr); else if ( strcasecmp( name_ptr, "ZM_DB_PASS" ) == 0 ) - staticConfig.DB_PASS = val; + staticConfig.DB_PASS = std::string(val_ptr); else if ( strcasecmp( name_ptr, "ZM_PATH_WEB" ) == 0 ) - staticConfig.PATH_WEB = val; + staticConfig.PATH_WEB = std::string(val_ptr); else { // We ignore this now as there may be more parameters than the diff --git a/src/zm_db.cpp b/src/zm_db.cpp index 26a33d6f5..4ebc2f11f 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -64,3 +64,14 @@ void zmDbConnect() zmDbConnected = true; } +void zmDbClose() +{ + if ( zmDbConnected ) + { + mysql_close( &dbconn ); + // mysql_init() call implicitly mysql_library_init() but + // mysql_close() does not call mysql_library_end() + mysql_library_end(); + zmDbConnected = false; + } +} diff --git a/src/zm_db.h b/src/zm_db.h index dda2dd30f..07fd188a2 100644 --- a/src/zm_db.h +++ b/src/zm_db.h @@ -30,6 +30,8 @@ extern MYSQL dbconn; extern int zmDbConnected; void zmDbConnect(); +void zmDbClose(); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 594d44b24..dcf8c5d1a 100755 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -26,6 +26,9 @@ extern "C"{ #include "libavutil/time.h" } +#ifndef AV_ERROR_MAX_STRING_SIZE +#define AV_ERROR_MAX_STRING_SIZE 64 +#endif FfmpegCamera::FfmpegCamera( int p_id, const std::string &p_path, const std::string &p_method, const std::string &p_options, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture ) : Camera( p_id, FFMPEG_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture ), @@ -47,7 +50,10 @@ FfmpegCamera::FfmpegCamera( int p_id, const std::string &p_path, const std::stri mFrame = NULL; frameCount = 0; startTime=0; - + mIsOpening = false; + mCanCapture = false; + mOpenStart = 0; + mReopenThread = 0; wasRecording = false; #if HAVE_LIBSWSCALE @@ -71,35 +77,7 @@ FfmpegCamera::FfmpegCamera( int p_id, const std::string &p_path, const std::stri FfmpegCamera::~FfmpegCamera() { - if(videoStore){ - delete videoStore; - videoStore = NULL; - } - av_freep( &mFrame ); - av_freep( &mRawFrame ); - -#if HAVE_LIBSWSCALE - if ( mConvertContext ) - { - sws_freeContext( mConvertContext ); - mConvertContext = NULL; - } -#endif - - if ( mCodecContext ) - { - avcodec_close( mCodecContext ); - mCodecContext = NULL; // Freed by av_close_input_file - } - if ( mFormatContext ) - { -#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0) - avformat_close_input( &mFormatContext ); -#else - av_close_input_file( mFormatContext ); -#endif - mFormatContext = NULL; - } + CloseFfmpeg(); if ( capture ) { @@ -126,136 +104,11 @@ int FfmpegCamera::PrimeCapture() mVideoStreamId = -1; mAudioStreamId = -1; Info( "Priming capture from %s", mPath.c_str() ); - - // Open the input, not necessarily a file -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) - if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 ) -#else - // Handle options - AVDictionary *opts = 0; - StringVector opVect = split(Options(), ","); - - // Set transport method as specified by method field, rtpUni is default - if ( Method() == "rtpMulti" ) - opVect.push_back("rtsp_transport=udp_multicast"); - else if ( Method() == "rtpRtsp" ) - opVect.push_back("rtsp_transport=tcp"); - else if ( Method() == "rtpRtspHttp" ) - opVect.push_back("rtsp_transport=http"); - - Debug(2, "Number of Options: %d",opVect.size()); - for (size_t i=0; i 1) { - parts[0] = trimSpaces(parts[0]); - parts[1] = trimSpaces(parts[1]); - if ( av_dict_set(&opts, parts[0].c_str(), parts[1].c_str(), 0) == 0 ) { - Debug(2, "set option %d '%s' to '%s'", i, parts[0].c_str(), parts[1].c_str()); - } - else - { - Warning( "Error trying to set option %d '%s' to '%s'", i, parts[0].c_str(), parts[1].c_str() ); - } - - } + + if (OpenFfmpeg() != 0){ + ReopenFfmpeg(); } - - if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, &opts ) !=0 ) -#endif - Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) ); - - Info( "Stream open %s", mPath.c_str() ); - startTime=av_gettime();//FIXME here or after find_Stream_info - - //FIXME can speed up initial analysis but need sensible parameters... - //mFormatContext->probesize = 32; - //mFormatContext->max_analyze_duration = 32; - // Locate stream info from input -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) - if ( av_find_stream_info( mFormatContext ) < 0 ) -#else - if ( avformat_find_stream_info( mFormatContext, 0 ) < 0 ) -#endif - Fatal( "Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno) ); - - Info( "Find stream info complete %s", mPath.c_str() ); - - // Find first video stream present - for (unsigned int i=0; i < mFormatContext->nb_streams; i++ ) - { - if(mVideoStreamId == -1) - { -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) - if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) -#else - if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO ) -#endif - { - mVideoStreamId = i; - } - } - if(mAudioStreamId == -1) //FIXME best way to copy all other streams? - { -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) - if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO ) -#else - if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO ) -#endif - { - mAudioStreamId = i; - } - } - } - if ( mVideoStreamId == -1 ) - Fatal( "Unable to locate video stream in %s", mPath.c_str() ); - - mCodecContext = mFormatContext->streams[mVideoStreamId]->codec; - - // Try and get the codec from the codec context - if ( (mCodec = avcodec_find_decoder( mCodecContext->codec_id )) == NULL ) - Fatal( "Can't find codec for video stream from %s", mPath.c_str() ); - - // Open the codec -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 7, 0) - if ( avcodec_open( mCodecContext, mCodec ) < 0 ) -#else - if ( avcodec_open2( mCodecContext, mCodec, 0 ) < 0 ) -#endif - Fatal( "Unable to open codec for video stream from %s", mPath.c_str() ); - - // Allocate space for the native video frame - mRawFrame = avcodec_alloc_frame(); - - // Allocate space for the converted video frame - mFrame = avcodec_alloc_frame(); - - if(mRawFrame == NULL || mFrame == NULL) - Fatal( "Unable to allocate frame for %s", mPath.c_str() ); - - int pSize = avpicture_get_size( imagePixFormat, width, height ); - if( (unsigned int)pSize != imagesize) { - Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize); - } - -#if HAVE_LIBSWSCALE -#if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0, 8, 0) - if(!sws_isSupportedInput(mCodecContext->pix_fmt)) { - Fatal("swscale does not support the codec format: %c%c%c%c",(mCodecContext->pix_fmt)&0xff,((mCodecContext->pix_fmt>>8)&0xff),((mCodecContext->pix_fmt>>16)&0xff),((mCodecContext->pix_fmt>>24)&0xff)); - } - - if(!sws_isSupportedOutput(imagePixFormat)) { - Fatal("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff)); - } -#endif - -#else // HAVE_LIBSWSCALE - Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" ); -#endif // HAVE_LIBSWSCALE - - Info( "Primed capture from %s, video=%d, audio=%d", mPath.c_str(), mVideoStreamId, mAudioStreamId); - - return( 0 ); + return 0; } int FfmpegCamera::PreCapture() @@ -266,6 +119,24 @@ int FfmpegCamera::PreCapture() int FfmpegCamera::Capture( Image &image ) { + if (!mCanCapture){ + return -1; + } + + // If the reopen thread has a value, but mCanCapture != 0, then we have just reopened the connection to the ffmpeg device, and we can clean up the thread. + if (mReopenThread != 0) { + void *retval = 0; + int ret; + + ret = pthread_tryjoin_np(mReopenThread, &retval); + if (ret != 0){ + Error("Could not join reopen thread."); + } + + Info( "Successfully reopened stream." ); + mReopenThread = 0; + } + AVPacket packet; uint8_t* directbuffer; @@ -282,7 +153,20 @@ int FfmpegCamera::Capture( Image &image ) int avResult = av_read_frame( mFormatContext, &packet ); if ( avResult < 0 ) { - Error( "Unable to read packet from stream %d: error %d", packet.stream_index, avResult ); + char errbuf[AV_ERROR_MAX_STRING_SIZE]; + av_strerror(avResult, errbuf, AV_ERROR_MAX_STRING_SIZE); + if ( + // Check if EOF. + (avResult == AVERROR_EOF || (mFormatContext->pb && mFormatContext->pb->eof_reached)) || + // Check for Connection failure. + (avResult == -110) + ) + { + Info( "av_read_frame returned \"%s\". Reopening stream.", errbuf); + ReopenFfmpeg(); + } + + Error( "Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, avResult, errbuf ); return( -1 ); } Debug( 5, "Got packet from stream %d", packet.stream_index ); @@ -328,6 +212,262 @@ int FfmpegCamera::Capture( Image &image ) return (0); } +int FfmpegCamera::PostCapture() +{ + // Nothing to do here + return( 0 ); +} + +int FfmpegCamera::OpenFfmpeg() { + + Debug ( 2, "OpenFfmpeg called." ); + + mOpenStart = time(NULL); + mIsOpening = true; + + // Open the input, not necessarily a file +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + Debug ( 1, "Calling av_open_input_file" ); + if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 ) +#else + // Handle options + AVDictionary *opts = 0; + StringVector opVect = split(Options(), ","); + + // Set transport method as specified by method field, rtpUni is default + if ( Method() == "rtpMulti" ) + opVect.push_back("rtsp_transport=udp_multicast"); + else if ( Method() == "rtpRtsp" ) + opVect.push_back("rtsp_transport=tcp"); + else if ( Method() == "rtpRtspHttp" ) + opVect.push_back("rtsp_transport=http"); + + Debug(2, "Number of Options: %d",opVect.size()); + for (size_t i=0; i 1) { + parts[0] = trimSpaces(parts[0]); + parts[1] = trimSpaces(parts[1]); + if ( av_dict_set(&opts, parts[0].c_str(), parts[1].c_str(), 0) == 0 ) { + Debug(2, "set option %d '%s' to '%s'", i, parts[0].c_str(), parts[1].c_str()); + } + else + { + Warning( "Error trying to set option %d '%s' to '%s'", i, parts[0].c_str(), parts[1].c_str() ); + } + + } + } + Debug ( 1, "Calling avformat_open_input" ); + + mFormatContext = avformat_alloc_context( ); + mFormatContext->interrupt_callback.callback = FfmpegInterruptCallback; + mFormatContext->interrupt_callback.opaque = this; + + if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, &opts ) !=0 ) +#endif + { + mIsOpening = false; + Error( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) ); + return -1; + } + + mIsOpening = false; + Debug ( 1, "Opened input" ); + + Info( "Stream open %s", mPath.c_str() ); + startTime=av_gettime();//FIXME here or after find_Stream_info + + //FIXME can speed up initial analysis but need sensible parameters... + //mFormatContext->probesize = 32; + //mFormatContext->max_analyze_duration = 32; + // Locate stream info from avformat_open_input +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + Debug ( 1, "Calling av_find_stream_info" ); + if ( av_find_stream_info( mFormatContext ) < 0 ) +#else + Debug ( 1, "Calling avformat_find_stream_info" ); + if ( avformat_find_stream_info( mFormatContext, 0 ) < 0 ) +#endif + Fatal( "Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno) ); + + Info( "Find stream info complete %s", mPath.c_str() ); + Debug ( 1, "Got stream info" ); + + // Find first video stream present + mVideoStreamId = -1; + for (unsigned int i=0; i < mFormatContext->nb_streams; i++ ) + { +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) +#else + if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO ) +#endif + { + mVideoStreamId = i; + break; + } + if(mAudioStreamId == -1) //FIXME best way to copy all other streams? + { +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) + if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO ) +#else + if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO ) +#endif + { + mAudioStreamId = i; + } + } + } + if ( mVideoStreamId == -1 ) + Fatal( "Unable to locate video stream in %s", mPath.c_str() ); + + Debug ( 1, "Found video stream" ); + + mCodecContext = mFormatContext->streams[mVideoStreamId]->codec; + + // Try and get the codec from the codec context + if ( (mCodec = avcodec_find_decoder( mCodecContext->codec_id )) == NULL ) + Fatal( "Can't find codec for video stream from %s", mPath.c_str() ); + + Debug ( 1, "Found decoder" ); + + // Open the codec +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 7, 0) + Debug ( 1, "Calling avcodec_open" ); + if ( avcodec_open( mCodecContext, mCodec ) < 0 ) +#else + Debug ( 1, "Calling avcodec_open2" ); + if ( avcodec_open2( mCodecContext, mCodec, 0 ) < 0 ) +#endif + Fatal( "Unable to open codec for video stream from %s", mPath.c_str() ); + + Debug ( 1, "Opened codec" ); + + // Allocate space for the native video frame + mRawFrame = avcodec_alloc_frame(); + + // Allocate space for the converted video frame + mFrame = avcodec_alloc_frame(); + + if(mRawFrame == NULL || mFrame == NULL) + Fatal( "Unable to allocate frame for %s", mPath.c_str() ); + + Debug ( 1, "Allocated frames" ); + + int pSize = avpicture_get_size( imagePixFormat, width, height ); + if( (unsigned int)pSize != imagesize) { + Fatal("Image size mismatch. Required: %d Available: %d",pSize,imagesize); + } + + Debug ( 1, "Validated imagesize" ); + +#if HAVE_LIBSWSCALE + Debug ( 1, "Calling sws_isSupportedInput" ); + if(!sws_isSupportedInput(mCodecContext->pix_fmt)) { + Fatal("swscale does not support the codec format: %c%c%c%c",(mCodecContext->pix_fmt)&0xff,((mCodecContext->pix_fmt>>8)&0xff),((mCodecContext->pix_fmt>>16)&0xff),((mCodecContext->pix_fmt>>24)&0xff)); + } + + if(!sws_isSupportedOutput(imagePixFormat)) { + Fatal("swscale does not support the target format: %c%c%c%c",(imagePixFormat)&0xff,((imagePixFormat>>8)&0xff),((imagePixFormat>>16)&0xff),((imagePixFormat>>24)&0xff)); + } + +#else // HAVE_LIBSWSCALE + Fatal( "You must compile ffmpeg with the --enable-swscale option to use ffmpeg cameras" ); +#endif // HAVE_LIBSWSCALE + + Info( "Primed capture from %s, video=%d, audio=%d", mPath.c_str(), mVideoStreamId, mAudioStreamId); + + mCanCapture = true; + + return( 0 ); +} + +int FfmpegCamera::ReopenFfmpeg() { + + Debug(2, "ReopenFfmpeg called."); + + mCanCapture = false; + if (pthread_create( &mReopenThread, NULL, ReopenFfmpegThreadCallback, (void*) this) != 0){ + // Log a fatal error and exit the process. + Fatal( "ReopenFfmpeg failed to create worker thread." ); + } + + return 0; +} + +int FfmpegCamera::CloseFfmpeg(){ + + Debug(2, "CloseFfmpeg called."); + + mCanCapture = false; + + av_freep( &mFrame ); + av_freep( &mRawFrame ); + +#if HAVE_LIBSWSCALE + if ( mConvertContext ) + { + sws_freeContext( mConvertContext ); + mConvertContext = NULL; + } +#endif + + if ( mCodecContext ) + { + avcodec_close( mCodecContext ); + mCodecContext = NULL; // Freed by av_close_input_file + } + if ( mFormatContext ) + { +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 4, 0) + av_close_input_file( mFormatContext ); +#else + avformat_close_input( &mFormatContext ); +#endif + mFormatContext = NULL; + } + + return 0; +} + +int FfmpegCamera::FfmpegInterruptCallback(void *ctx) +{ + FfmpegCamera* camera = reinterpret_cast(ctx); + if (camera->mIsOpening){ + int now = time(NULL); + if ((now - camera->mOpenStart) > config.ffmpeg_open_timeout) { + Error ( "Open video took more than %d seconds.", config.ffmpeg_open_timeout ); + return 1; + } + } + + return 0; +} + +void *FfmpegCamera::ReopenFfmpegThreadCallback(void *ctx){ + if (ctx == NULL) return NULL; + + FfmpegCamera* camera = reinterpret_cast(ctx); + + while (1){ + // Close current stream. + camera->CloseFfmpeg(); + + // Sleep if neccessary to not reconnect too fast. + int wait = config.ffmpeg_open_timeout - (time(NULL) - camera->mOpenStart); + wait = wait < 0 ? 0 : wait; + if (wait > 0){ + Debug( 1, "Sleeping %d seconds before reopening stream.", wait ); + sleep(wait); + } + + if (camera->OpenFfmpeg() == 0){ + return NULL; + } + } +} //Function to handle capture and store int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_directory ) @@ -442,18 +582,4 @@ int FfmpegCamera::CaptureAndRecord( Image &image, bool recording, char* event_di } - - - - - - - - -int FfmpegCamera::PostCapture() -{ - // Nothing to do here - return( 0 ); -} - #endif // HAVE_LIBAVFORMAT diff --git a/src/zm_ffmpeg_camera.h b/src/zm_ffmpeg_camera.h index f11403403..b51a8b6f7 100755 --- a/src/zm_ffmpeg_camera.h +++ b/src/zm_ffmpeg_camera.h @@ -49,6 +49,16 @@ protected: AVFrame *mRawFrame; AVFrame *mFrame; PixelFormat imagePixFormat; + + int OpenFfmpeg(); + int ReopenFfmpeg(); + int CloseFfmpeg(); + static int FfmpegInterruptCallback(void *ctx); + static void* ReopenFfmpegThreadCallback(void *ctx); + bool mIsOpening; + bool mCanCapture; + int mOpenStart; + pthread_t mReopenThread; #endif // HAVE_LIBAVFORMAT bool wasRecording; diff --git a/src/zm_image.cpp b/src/zm_image.cpp index e2aaabc55..be5a50ce3 100644 --- a/src/zm_image.cpp +++ b/src/zm_image.cpp @@ -140,6 +140,22 @@ Image::Image( const Image &p_image ) Image::~Image() { DumpImgBuffer(); + if ( initialised ) + { + delete[] y_table; + delete[] uv_table; + delete[] r_v_table; + delete[] g_v_table; + delete[] g_u_table; + delete[] b_u_table; + initialised = false; + } + if ( jpg_dcinfo ) + { + jpeg_destroy_decompress( jpg_dcinfo ); + delete jpg_dcinfo; + jpg_dcinfo = 0; + } } void Image::Initialise() @@ -339,21 +355,23 @@ void Image::AssignDirect( const unsigned int p_width, const unsigned int p_heigh Error("Attempt to directly assign buffer from a NULL pointer"); return; } - - if(buffer_size < (unsigned int)((p_width*p_height)*p_colours)) { - Error("Attempt to directly assign buffer from an undersized buffer of size: %zu",buffer_size); - return; - } - + if(!p_height || !p_width) { Error("Attempt to directly assign buffer with invalid width or height: %d %d",p_width,p_height); return; } - + if(p_colours != ZM_COLOUR_GRAY8 && p_colours != ZM_COLOUR_RGB24 && p_colours != ZM_COLOUR_RGB32) { Error("Attempt to directly assign buffer with unexpected colours per pixel: %d",p_colours); return; } + + unsigned int new_buffer_size = ((p_width*p_height)*p_colours); + + if(buffer_size < new_buffer_size) { + Error("Attempt to directly assign buffer from an undersized buffer of size: %zu, needed %dx%d*%d colours = %zu",buffer_size, p_width, p_height, p_colours ); + return; + } if(holdbuffer && buffer) { if((unsigned int)((p_height*p_width)*p_colours) > allocation) { @@ -365,7 +383,7 @@ void Image::AssignDirect( const unsigned int p_width, const unsigned int p_heigh colours = p_colours; subpixelorder = p_subpixelorder; pixels = height*width; - size = pixels*colours; + size = new_buffer_size; // was pixels*colours, but we already calculated it above as new_buffer_size /* Copy into the held buffer */ if(new_buffer != buffer) @@ -383,7 +401,7 @@ void Image::AssignDirect( const unsigned int p_width, const unsigned int p_heigh colours = p_colours; subpixelorder = p_subpixelorder; pixels = height*width; - size = pixels*colours; + size = new_buffer_size; // was pixels*colours, but we already calculated it above as new_buffer_size allocation = buffer_size; buffertype = p_buffertype; diff --git a/src/zm_logger.cpp b/src/zm_logger.cpp index 19886ef1c..c64f6e7c0 100644 --- a/src/zm_logger.cpp +++ b/src/zm_logger.cpp @@ -239,6 +239,9 @@ void Logger::terminate() if ( mSyslogLevel > NOLOG ) closeSyslog(); + + if ( mDatabaseLevel > NOLOG ) + closeDatabase(); } bool Logger::boolEnv( const std::string &name, bool defaultValue ) @@ -468,6 +471,15 @@ void Logger::closeFile() } } +void Logger::closeDatabase() +{ + if ( mDbConnected ) + { + mysql_close( &mDbConnection ); + mDbConnected = false; + } +} + void Logger::openSyslog() { (void) openlog( mId.c_str(), LOG_PID|LOG_NDELAY, LOG_LOCAL1 ); @@ -604,5 +616,6 @@ void logInit( const char *name, const Logger::Options &options ) void logTerm() { - Logger::fetch()->terminate(); + if ( Logger::smInstance ) + delete Logger::smInstance; } diff --git a/src/zm_logger.h b/src/zm_logger.h index 50dce970c..90238fd19 100644 --- a/src/zm_logger.h +++ b/src/zm_logger.h @@ -115,6 +115,7 @@ private: public: friend void logInit( const char *name, const Options &options ); + friend void logTerm(); static Logger *fetch() { @@ -182,6 +183,7 @@ private: void closeFile(); void openSyslog(); void closeSyslog(); + void closeDatabase(); public: void logPrint( bool hex, const char * const file, const int line, const int level, const char *fstring, ... ); diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 3bb148c6f..f89ff2d22 100755 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -317,7 +317,9 @@ Monitor::Monitor( last_motion_score(0), camera( p_camera ), n_zones( p_n_zones ), - zones( p_zones ) + zones( p_zones ), + timestamps( 0 ), + images( 0 ) { strncpy( name, p_name, sizeof(name) ); @@ -421,12 +423,12 @@ Monitor::Monitor( { if ( purpose != QUERY ) { - Error( "Shared data not initialised by capture daemon" ); + Error( "Shared data not initialised by capture daemon for monitor %s", name ); exit( -1 ); } else { - Warning( "Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results" ); + Warning( "Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor %s", name ); } } @@ -573,6 +575,14 @@ bool Monitor::connect() { Monitor::~Monitor() { + if ( timestamps ) { + delete[] timestamps; + timestamps = 0; + } + if ( images ) { + delete[] images; + images = 0; + } if ( mem_ptr ) { if ( event ) Info( "%s: %03d - Closing event %d, shutting down", name, image_count, event->Id() ); @@ -1240,8 +1250,6 @@ bool Monitor::Analyse() } static bool static_undef = true; - static struct timeval **timestamps; - static Image **images; static int last_section_mod = 0; static bool last_signal; diff --git a/src/zm_monitor.h b/src/zm_monitor.h index 3f6490564..caad0c253 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -298,12 +298,15 @@ protected: Event *event; - int n_zones; + int n_zones; Zone **zones; - int iDoNativeMotDet; + struct timeval **timestamps; + Image **images; - int n_linked_monitors; + int iDoNativeMotDet; + + int n_linked_monitors; MonitorLink **linked_monitors; public: diff --git a/src/zm_remote_camera.cpp b/src/zm_remote_camera.cpp index 5d04e013e..608311649 100644 --- a/src/zm_remote_camera.cpp +++ b/src/zm_remote_camera.cpp @@ -63,8 +63,16 @@ void RemoteCamera::Initialise() auth = host.substr( 0, authIndex ); host.erase( 0, authIndex+1 ); auth64 = base64Encode( auth ); + + authIndex = auth.rfind( ':' ); + username = auth.substr(0,authIndex); + password = auth.substr( authIndex+1, auth.length() ); + } + mNeedAuth = false; + mAuthenticator = new Authenticator(username,password); + struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; diff --git a/src/zm_remote_camera.h b/src/zm_remote_camera.h index fbdbb7649..20218ebce 100644 --- a/src/zm_remote_camera.h +++ b/src/zm_remote_camera.h @@ -21,6 +21,7 @@ #define ZM_REMOTE_CAMERA_H #include "zm_camera.h" +#include "zm_rtsp_auth.h" #include #include @@ -39,8 +40,17 @@ protected: std::string port; std::string path; std::string auth; + std::string username; + std::string password; std::string auth64; + // Reworked authentication system + // First try without authentication, even if we have a username and password + // on receiving a 401 response, select authentication method (basic or digest) + // fill required fields and set needAuth + // subsequent requests can set the required authentication header. + bool mNeedAuth; + Authenticator* mAuthenticator; protected: struct addrinfo *hp; @@ -53,6 +63,8 @@ public: const std::string &Port() const { return( port ); } const std::string &Path() const { return( path ); } const std::string &Auth() const { return( auth ); } + const std::string &Username() const { return( username ); } + const std::string &Password() const { return( password ); } virtual void Initialise(); virtual void Terminate() = 0; diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 07d0e6a41..3f518b1c2 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -62,7 +62,7 @@ void RemoteCameraHttp::Initialise() { request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); - request += stringtf( "Host: %s\r\n", host .c_str()); + request += stringtf( "Host: %s\r\n", host.c_str()); if ( strcmp( config.http_version, "1.0" ) == 0 ) request += stringtf( "Connection: Keep-Alive\r\n" ); if ( !auth.empty() ) @@ -130,6 +130,7 @@ int RemoteCameraHttp::Disconnect() int RemoteCameraHttp::SendRequest() { + Debug( 2, "Sending request: %s", request.c_str() ); if ( write( sd, request.data(), request.length() ) < 0 ) { Error( "Can't write: %s", strerror(errno) ); @@ -216,6 +217,8 @@ int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected ) } while ( total_bytes_to_read ); + Debug( 3, buffer ); + return( total_bytes_read ); } @@ -280,9 +283,31 @@ int RemoteCameraHttp::GetResponse() status_code = atoi( status_expr->MatchString( 2 ) ); status_mesg = status_expr->MatchString( 3 ); - if ( status_code < 200 || status_code > 299 ) - { - Error( "Invalid response status %d: %s", status_code, status_mesg ); + if ( status_code == 401 ) { + if ( mNeedAuth ) { + Error( "Failed authentication: " ); + return( -1 ); + } + mNeedAuth = true; + std::string Header = header; + + mAuthenticator->checkAuthResponse(Header); + if ( mAuthenticator->auth_method() == AUTH_DIGEST ) { + Debug( 2, "Need Digest Authentication" ); + request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); + request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); + request += stringtf( "Host: %s\r\n", host.c_str()); + if ( strcmp( config.http_version, "1.0" ) == 0 ) + request += stringtf( "Connection: Keep-Alive\r\n" ); + request += mAuthenticator->getAuthHeader( "GET", path.c_str() ); + request += "\r\n"; + + Debug( 2, "New request header: %s", request.c_str() ); + return( 0 ); + } + + } else if ( status_code < 200 || status_code > 299 ) { + Error( "Invalid response status %d: %s\n%s", status_code, status_mesg, (char *)buffer ); return( -1 ); } Debug( 3, "Got status '%d' (%s), http version %s", status_code, status_mesg, http_version ); @@ -545,11 +570,13 @@ int RemoteCameraHttp::GetResponse() static const char *content_length_match = "Content-length:"; static const char *content_type_match = "Content-type:"; static const char *boundary_match = "boundary="; + static const char *authenticate_match = "WWW-Authenticate:"; static int http_match_len = 0; static int connection_match_len = 0; static int content_length_match_len = 0; static int content_type_match_len = 0; static int boundary_match_len = 0; + static int authenticate_match_len = 0; if ( !http_match_len ) http_match_len = strlen( http_match ); @@ -561,6 +588,8 @@ int RemoteCameraHttp::GetResponse() content_type_match_len = strlen( content_type_match ); if ( !boundary_match_len ) boundary_match_len = strlen( boundary_match ); + if ( !authenticate_match_len ) + authenticate_match_len = strlen( authenticate_match ); static int n_headers; //static char *headers[32]; @@ -573,6 +602,7 @@ int RemoteCameraHttp::GetResponse() static char *content_length_header; static char *content_type_header; static char *boundary_header; + static char *authenticate_header; static char subcontent_length_header[32]; static char subcontent_type_header[64]; @@ -596,6 +626,7 @@ int RemoteCameraHttp::GetResponse() connection_header = 0; content_length_header = 0; content_type_header = 0; + authenticate_header = 0; http_version[0] = '\0'; status_code [0]= '\0'; @@ -674,6 +705,12 @@ int RemoteCameraHttp::GetResponse() content_length_header = header_ptr+content_length_match_len; Debug( 6, "Got content length header '%s'", header_ptr ); } + + else if ( !authenticate_header && (strncasecmp( header_ptr, authenticate_match, authenticate_match_len) == 0) ) + { + authenticate_header = header_ptr; + Debug( 6, "Got authenticate header '%s'", header_ptr ); + } else if ( !content_type_header && (strncasecmp( header_ptr, content_type_match, content_type_match_len) == 0) ) { content_type_header = header_ptr+content_type_match_len; @@ -721,7 +758,36 @@ int RemoteCameraHttp::GetResponse() start_ptr += strspn( start_ptr, " " ); strcpy( status_mesg, start_ptr ); - if ( status < 200 || status > 299 ) + if ( status == 401 ) { + if ( mNeedAuth ) { + Error( "Failed authentication: " ); + return( -1 ); + } + if ( ! authenticate_header ) { + Error( "Failed authentication, but don't have an authentication header: " ); + return( -1 ); + } + mNeedAuth = true; + std::string Header = authenticate_header; + Debug(2, "Checking for digest auth in %s", authenticate_header ); + + mAuthenticator->checkAuthResponse(Header); + if ( mAuthenticator->auth_method() == AUTH_DIGEST ) { + Debug( 2, "Need Digest Authentication" ); + request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); + request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); + request += stringtf( "Host: %s\r\n", host.c_str()); + if ( strcmp( config.http_version, "1.0" ) == 0 ) + request += stringtf( "Connection: Keep-Alive\r\n" ); + request += mAuthenticator->getAuthHeader( "GET", path.c_str() ); + request += "\r\n"; + + Debug( 2, "New request header: %s", request.c_str() ); + return( 0 ); + } else { + Debug( 2, "Need some other kind of Authentication" ); + } + } else if ( status < 200 || status > 299 ) { Error( "Invalid response status %s: %s", status_code, status_mesg ); return( -1 ); diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp index aeec18379..910b2ac42 100644 --- a/src/zm_remote_camera_rtsp.cpp +++ b/src/zm_remote_camera_rtsp.cpp @@ -91,7 +91,7 @@ RemoteCameraRtsp::~RemoteCameraRtsp() if ( mCodecContext ) { avcodec_close( mCodecContext ); - mCodecContext = NULL; // Freed by av_close_input_file + mCodecContext = NULL; // Freed by avformat_free_context in the destructor of RtspThread class } if ( capture ) diff --git a/src/zm_rtp_ctrl.cpp b/src/zm_rtp_ctrl.cpp index 01a0b535a..618d09f19 100644 --- a/src/zm_rtp_ctrl.cpp +++ b/src/zm_rtp_ctrl.cpp @@ -129,10 +129,10 @@ int RtpCtrlThread::recvPacket( const unsigned char *packet, ssize_t packetLen ) } } int paddedLen = 4+2+item->len+1; // Add null byte - paddedLen = (((paddedLen-1)/4)+1)*4; + paddedLen = (((paddedLen-1)/4)+1)*4; // Round to nearest multiple of 4 Debug( 5, "RTCP PL:%d", paddedLen ); sdesPtr += paddedLen; - contentLen -= paddedLen; + contentLen = ( paddedLen <= contentLen ) ? ( contentLen - paddedLen ) : 0; } } break; @@ -175,13 +175,13 @@ int RtpCtrlThread::generateRr( const unsigned char *packet, ssize_t packetLen ) mRtpSource.updateRtcpStats(); - Debug( 5, "Ssrc = %d", mRtspThread.getSsrc() ); + Debug( 5, "Ssrc = %d", mRtspThread.getSsrc()+1 ); Debug( 5, "Ssrc_1 = %d", mRtpSource.getSsrc() ); Debug( 5, "Last Seq = %d", mRtpSource.getMaxSeq() ); Debug( 5, "Jitter = %d", mRtpSource.getJitter() ); Debug( 5, "Last SR = %d", mRtpSource.getLastSrTimestamp() ); - rtcpPacket->body.rr.ssrcN = htonl(mRtspThread.getSsrc()); + rtcpPacket->body.rr.ssrcN = htonl(mRtspThread.getSsrc()+1); rtcpPacket->body.rr.rr[0].ssrcN = htonl(mRtpSource.getSsrc()); rtcpPacket->body.rr.rr[0].lost = mRtpSource.getLostPackets(); rtcpPacket->body.rr.rr[0].fraction = mRtpSource.getLostFraction(); @@ -208,7 +208,7 @@ int RtpCtrlThread::generateSdes( const unsigned char *packet, ssize_t packetLen rtcpPacket->header.count = 1; rtcpPacket->header.lenN = htons(wordLen-1); - rtcpPacket->body.sdes.srcN = htonl(mRtpSource.getSsrc()); + rtcpPacket->body.sdes.srcN = htonl(mRtpSource.getSsrc()+1); rtcpPacket->body.sdes.item[0].type = RTCP_SDES_CNAME; rtcpPacket->body.sdes.item[0].len = cname.size(); memcpy( rtcpPacket->body.sdes.item[0].data, cname.data(), cname.size() ); diff --git a/src/zm_rtsp.cpp b/src/zm_rtsp.cpp index ad15ec023..8c0386e9a 100644 --- a/src/zm_rtsp.cpp +++ b/src/zm_rtsp.cpp @@ -26,7 +26,6 @@ #include "zm_rtp_data.h" #include "zm_rtp_ctrl.h" #include "zm_db.h" -#include "zm_sdp.h" #include #include @@ -68,34 +67,6 @@ bool RtspThread::sendCommand( std::string message ) return( true ); } -// find WWW-Authenticate header, send to Authenticator to extract required subfields -void RtspThread::checkAuthResponse(std::string &response) -{ - std::string authLine; - StringVector lines = split( response, "\r\n" ); - const char* authenticate_match = "WWW-Authenticate:"; - size_t authenticate_match_len = strlen(authenticate_match); - - for ( size_t i = 0; i < lines.size(); i++ ) - { - // stop at end of headers - if (lines[i].length()==0) - break; - - if (strncasecmp(lines[i].c_str(),authenticate_match,authenticate_match_len) == 0) - { - authLine = lines[i]; - Debug( 2, "Found auth line at %d", i); - break; - } - } - if (!authLine.empty()) - { - Debug( 2, "Analyze auth line %s", authLine.c_str()); - mAuthenticator->authHandleHeader( trimSpaces(authLine.substr(authenticate_match_len,authLine.length()-authenticate_match_len)) ); - } -} - bool RtspThread::recvResponse( std::string &response ) { if ( mRtspSocket.recv( response ) < 0 ) @@ -121,7 +92,7 @@ bool RtspThread::recvResponse( std::string &response ) if ( respCode == 401) { Debug( 2, "Got 401 access denied response code, check WWW-Authenticate header and retry"); - checkAuthResponse(response); + mAuthenticator->checkAuthResponse(response); mNeedAuth = true; return( false ); } @@ -171,6 +142,7 @@ int RtspThread::requestPorts() nMonitors = 1; position = 0; } + mysql_free_result(result); int portRange = int(((config.max_rtp_port-config.min_rtp_port)+1)/nMonitors); smMinDataPort = config.min_rtp_port + (position * portRange); smMaxDataPort = smMinDataPort + portRange - 1; @@ -202,6 +174,7 @@ RtspThread::RtspThread( int id, RtspMethod method, const std::string &protocol, mHost( host ), mPort( port ), mPath( path ), + mSessDesc( 0 ), mFormatContext( 0 ), mSeq( 0 ), mSession( 0 ), @@ -236,6 +209,17 @@ RtspThread::RtspThread( int id, RtspMethod method, const std::string &protocol, RtspThread::~RtspThread() { + if ( mFormatContext ) + { + avformat_free_context( mFormatContext ); + mFormatContext = NULL; + } + if ( mSessDesc ) + { + delete mSessDesc; + mSessDesc = NULL; + } + delete mAuthenticator; } int RtspThread::run() @@ -314,7 +298,7 @@ int RtspThread::run() // for requested authentication method if (respCode == 401 && !authTried) { mNeedAuth = true; - checkAuthResponse(response); + mAuthenticator->checkAuthResponse(response); Debug(2, "Processed 401 response"); mRtspSocket.close(); if ( !mRtspSocket.connect( mHost.c_str(), strtol( mPort.c_str(), NULL, 10 ) ) ) @@ -348,9 +332,23 @@ int RtspThread::run() std::string localHost = ""; int localPorts[2] = { 0, 0 }; - //message = "OPTIONS * RTSP/1.0\r\n"; - //sendCommand( message ); - //recvResponse( response ); + // Request supported RTSP commands by the server + message = "OPTIONS "+mUrl+" RTSP/1.0\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); + + char publicLine[256] = ""; + StringVector lines = split( response, "\r\n" ); + for ( size_t i = 0; i < lines.size(); i++ ) + sscanf( lines[i].c_str(), "Public: %[^\r\n]\r\n", publicLine ); + + // Check if the server supports the GET_PARAMETER command + // If yes, it is likely that the server will request this command as a keepalive message + bool sendKeepalive = false; + if ( publicLine[0] && strstr(publicLine, "GET_PARAMETER") ) + sendKeepalive = true; message = "DESCRIBE "+mUrl+" RTSP/1.0\r\n"; bool res; @@ -373,11 +371,10 @@ int RtspThread::run() std::string sdp = response.substr( sdpStart ); Debug( 1, "Processing SDP '%s'", sdp.c_str() ); - SessionDescriptor *sessDesc = 0; try { - sessDesc = new SessionDescriptor( mUrl, sdp ); - mFormatContext = sessDesc->generateFormatContext(); + mSessDesc = new SessionDescriptor( mUrl, sdp ); + mFormatContext = mSessDesc->generateFormatContext(); } catch( const Exception &e ) { @@ -407,14 +404,23 @@ int RtspThread::run() { for ( unsigned int i = 0; i < mFormatContext->nb_streams; i++ ) { - SessionDescriptor::MediaDescriptor *mediaDesc = sessDesc->getStream( i ); + SessionDescriptor::MediaDescriptor *mediaDesc = mSessDesc->getStream( i ); #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1) if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) #else if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO ) #endif { - trackUrl += "/"+mediaDesc->getControlUrl(); + // Check if control Url is absolute or relative + std::string controlUrl = mediaDesc->getControlUrl(); + if (std::equal(trackUrl.begin(), trackUrl.end(), controlUrl.begin())) + { + trackUrl = controlUrl; + } + else + { + trackUrl += "/" + controlUrl; + } rtpClock = mediaDesc->getClock(); codecId = mFormatContext->streams[i]->codec->codec_id; // Hackery pokery @@ -457,21 +463,27 @@ int RtspThread::run() if ( !recvResponse( response ) ) return( -1 ); - StringVector lines = split( response, "\r\n" ); - char *session = 0; + lines = split( response, "\r\n" ); + std::string session; int timeout = 0; char transport[256] = ""; for ( size_t i = 0; i < lines.size(); i++ ) { - sscanf( lines[i].c_str(), "Session: %a[0-9a-fA-F]; timeout=%d", &session, &timeout ); + if ( ( lines[i].size() > 8 ) && ( lines[i].substr( 0, 8 ) == "Session:" ) ) + { + StringVector sessionLine = split( lines[i].substr(9), ";" ); + session = trimSpaces( sessionLine[0] ); + if ( sessionLine.size() == 2 ) + sscanf( trimSpaces( sessionLine[1] ).c_str(), "timeout=%d", &timeout ); + } sscanf( lines[i].c_str(), "Transport: %s", transport ); } - if ( !session ) + if ( session.empty() ) Fatal( "Unable to get session identifier from response '%s'", response.c_str() ); - Debug( 2, "Got RTSP session %s, timeout %d secs", session, timeout ); + Debug( 2, "Got RTSP session %s, timeout %d secs", session.c_str(), timeout ); if ( !transport[0] ) Fatal( "Unable to get transport details from response '%s'", response.c_str() ); @@ -539,20 +551,21 @@ int RtspThread::run() return( -1 ); lines = split( response, "\r\n" ); - char *rtpInfo = 0; + std::string rtpInfo; for ( size_t i = 0; i < lines.size(); i++ ) { - sscanf( lines[i].c_str(), "RTP-Info: %as", &rtpInfo ); + if ( ( lines[i].size() > 9 ) && ( lines[i].substr( 0, 9 ) == "RTP-Info:" ) ) + rtpInfo = trimSpaces( lines[i].substr( 9 ) ); } - if ( !rtpInfo ) + if ( rtpInfo.empty() ) Fatal( "Unable to get RTP Info identifier from response '%s'", response.c_str() ); - Debug( 2, "Got RTP Info %s", rtpInfo ); + Debug( 2, "Got RTP Info %s", rtpInfo.c_str() ); int seq = 0; unsigned long rtpTime = 0; - parts = split( rtpInfo, ";" ); + parts = split( rtpInfo.c_str(), ";" ); for ( size_t i = 0; i < parts.size(); i++ ) { if ( startsWith( parts[i], "seq=" ) ) @@ -570,6 +583,9 @@ int RtspThread::run() Debug( 2, "RTSP Seq is %d", seq ); Debug( 2, "RTSP Rtptime is %ld", rtpTime ); + time_t lastKeepalive = time(NULL); + message = "GET_PARAMETER "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + switch( mMethod ) { case RTP_UNICAST : @@ -584,6 +600,13 @@ int RtspThread::run() while( !mStop ) { + // Send a keepalive message if the server supports this feature and we are close to the timeout expiration + if ( sendKeepalive && (timeout > 0) && ((time(NULL)-lastKeepalive) > (timeout-5)) ) + { + if ( !sendCommand( message ) ) + return( -1 ); + lastKeepalive = time(NULL); + } usleep( 100000 ); } #if 0 @@ -629,8 +652,7 @@ int RtspThread::run() select.addReader( &mRtspSocket ); Buffer buffer( ZM_NETWORK_BUFSIZ ); - time_t lastKeepalive = time(NULL); - std::string keepaliveMessage = "OPTIONS * RTSP/1.0\r\n"; + std::string keepaliveMessage = "OPTIONS "+mUrl+" RTSP/1.0\r\n"; std::string keepaliveResponse = "RTSP/1.0 200 OK\r\n"; while ( !mStop && select.wait() >= 0 ) { @@ -719,7 +741,9 @@ int RtspThread::run() } } } - if ( (timeout > 0) && ((time(NULL)-lastKeepalive) > (timeout-5)) ) + // Send a keepalive message if the server supports this feature and we are close to the timeout expiration + // FIXME: Is this really necessary when using tcp ? + if ( sendKeepalive && (timeout > 0) && ((time(NULL)-lastKeepalive) > (timeout-5)) ) { if ( !sendCommand( message ) ) return( -1 ); @@ -734,11 +758,10 @@ int RtspThread::run() if ( !recvResponse( response ) ) return( -1 ); #endif + // Send a teardown message but don't expect a response as this may not be implemented on the server when using TCP message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; if ( !sendCommand( message ) ) return( -1 ); - if ( !recvResponse( response ) ) - return( -1 ); delete mSources[ssrc]; mSources.clear(); @@ -757,6 +780,13 @@ int RtspThread::run() while( !mStop ) { + // Send a keepalive message if the server supports this feature and we are close to the timeout expiration + if ( sendKeepalive && (timeout > 0) && ((time(NULL)-lastKeepalive) > (timeout-5)) ) + { + if ( !sendCommand( message ) ) + return( -1 ); + lastKeepalive = time(NULL); + } usleep( 100000 ); } #if 0 diff --git a/src/zm_rtsp.h b/src/zm_rtsp.h index 4ecf99a92..937646b6d 100644 --- a/src/zm_rtsp.h +++ b/src/zm_rtsp.h @@ -26,6 +26,7 @@ #include "zm_thread.h" #include "zm_rtp_source.h" #include "zm_rtsp_auth.h" +#include "zm_sdp.h" #include #include @@ -73,6 +74,7 @@ private: SourceMap mSources; + SessionDescriptor *mSessDesc; AVFormatContext *mFormatContext; uint16_t mSeq; diff --git a/src/zm_rtsp_auth.cpp b/src/zm_rtsp_auth.cpp index da5a23552..b082ace01 100644 --- a/src/zm_rtsp_auth.cpp +++ b/src/zm_rtsp_auth.cpp @@ -38,6 +38,8 @@ Authenticator::Authenticator(std::string &username, std::string password) { fAuthMethod = AUTH_UNDEFINED; fUsername = username; fPassword = password; + nc = 1; + fCnonce = "0a4f113b"; } Authenticator::~Authenticator() { @@ -83,8 +85,12 @@ void Authenticator::authHandleHeader(std::string headerData) fNonce = trimSet( kvPair[1], "\""); continue; } + if (key == "qop") { + fQop = trimSet( kvPair[1], "\""); + continue; + } } - Debug( 2, "Auth data completed. User: %s, realm: %s, nonce: %s", username().c_str(), fRealm.c_str(), fNonce.c_str()); + Debug( 2, "Auth data completed. User: %s, realm: %s, nonce: %s, qop: %s", username().c_str(), fRealm.c_str(), fNonce.c_str(), fQop.c_str() ); } } @@ -104,8 +110,13 @@ std::string Authenticator::getAuthHeader(std::string method, std::string uri) { result += std::string("Digest ") + "username=\"" + quote(username()) + "\", realm=\"" + quote(realm()) + "\", " + - "nonce=\"" + quote(nonce()) + "\", uri=\"" + quote(uri) + "\", " + - "response=\"" + computeDigestResponse(method, uri) + "\""; + "nonce=\"" + quote(nonce()) + "\", uri=\"" + quote(uri) + "\""; + if ( ! fQop.empty() ) { + result += ", qop=" + fQop; + result += ", nc=" + stringtf("%08x",nc); + result += ", cnonce=" + fCnonce; + } + result += ", response=\"" + computeDigestResponse(method, uri) + "\""; //Authorization: Digest username="zm", // realm="NC-336PW-HD-1080P", @@ -133,6 +144,7 @@ std::string Authenticator::computeDigestResponse(std::string &method, std::strin // Step 1: md5(::) std::string ha1Data = username() + ":" + realm() + ":" + password(); + Debug( 2, "HA1 pre-md5: %s", ha1Data.c_str() ); #if HAVE_DECL_MD5 MD5((unsigned char*)ha1Data.c_str(), ha1Data.length(), md5buf); #elif HAVE_DECL_GNUTLS_FINGERPRINT @@ -148,6 +160,7 @@ std::string Authenticator::computeDigestResponse(std::string &method, std::strin // Step 2: md5(:) std::string ha2Data = method + ":" + uri; + Debug( 2, "HA2 pre-md5: %s", ha2Data.c_str() ); #if HAVE_DECL_MD5 MD5((unsigned char*)ha2Data.c_str(), ha2Data.length(), md5buf ); #elif HAVE_DECL_GNUTLS_FINGERPRINT @@ -162,7 +175,14 @@ std::string Authenticator::computeDigestResponse(std::string &method, std::strin std::string ha2Hash = md5HexBuf; // Step 3: md5(ha1::ha2) - std::string digestData = ha1Hash + ":" + nonce() + ":" + ha2Hash; + std::string digestData = ha1Hash + ":" + nonce(); + if ( ! fQop.empty() ) { + digestData += ":" + stringtf("%08x", nc) + ":"+fCnonce + ":" + fQop; + nc ++; + // if qop was specified, then we have to include t and a cnonce and an nccount + } + digestData += ":" + ha2Hash; + Debug( 2, "pre-md5: %s", digestData.c_str() ); #if HAVE_DECL_MD5 MD5((unsigned char*)digestData.c_str(), digestData.length(), md5buf); #elif HAVE_DECL_GNUTLS_FINGERPRINT @@ -181,3 +201,28 @@ std::string Authenticator::computeDigestResponse(std::string &method, std::strin #endif // HAVE_DECL_MD5 return( 0 ); } + +void Authenticator::checkAuthResponse(std::string &response) { + std::string authLine; + StringVector lines = split( response, "\r\n" ); + const char* authenticate_match = "WWW-Authenticate:"; + size_t authenticate_match_len = strlen(authenticate_match); + + for ( size_t i = 0; i < lines.size(); i++ ) { + // stop at end of headers + if (lines[i].length()==0) + break; + + if (strncasecmp(lines[i].c_str(),authenticate_match,authenticate_match_len) == 0) { + authLine = lines[i]; + Debug( 2, "Found auth line at %d", i); + break; + } + } + if (!authLine.empty()) { + Debug( 2, "Analyze auth line %s", authLine.c_str()); + authHandleHeader( trimSpaces(authLine.substr(authenticate_match_len,authLine.length()-authenticate_match_len)) ); + } else { + Debug( 2, "Didn't find auth line in %s", authLine.c_str()); + } +} diff --git a/src/zm_rtsp_auth.h b/src/zm_rtsp_auth.h index 032216b9c..23745f9c7 100644 --- a/src/zm_rtsp_auth.h +++ b/src/zm_rtsp_auth.h @@ -32,10 +32,9 @@ #include #endif // HAVE_GCRYPT_H || HAVE_LIBCRYPTO -class Authenticator -{ +enum AuthMethod { AUTH_UNDEFINED = 0, AUTH_BASIC = 1, AUTH_DIGEST = 2 }; +class Authenticator { public: - typedef enum { AUTH_UNDEFINED, AUTH_BASIC, AUTH_DIGEST } RtspAuthMethod; Authenticator(std::string &username, std::string password); virtual ~Authenticator(); void reset(); @@ -43,19 +42,24 @@ public: std::string realm() { return fRealm; } std::string nonce() { return fNonce; } std::string username() { return fUsername; } + AuthMethod auth_method() const { return fAuthMethod; } std::string computeDigestResponse( std::string &cmd, std::string &url ); void authHandleHeader( std::string headerData ); std::string getAuthHeader( std::string method, std::string path ); + void checkAuthResponse(std::string &response); private: std::string password() { return fPassword; } - RtspAuthMethod fAuthMethod; + AuthMethod fAuthMethod; std::string fRealm; std::string fNonce; + std::string fCnonce; + std::string fQop; std::string fUsername; std::string fPassword; std::string quote( std::string src ); + int nc; }; #endif // ZM_RTSP_AUTH_H diff --git a/src/zm_sdp.cpp b/src/zm_sdp.cpp index 077be08b9..9c10d89f2 100644 --- a/src/zm_sdp.cpp +++ b/src/zm_sdp.cpp @@ -184,9 +184,15 @@ SessionDescriptor::SessionDescriptor( const std::string &url, const std::string mInfo = line; break; case 'c' : + // This prevent a memory leak if the field appears more than one time + if ( mConnInfo ) + delete mConnInfo; mConnInfo = new ConnInfo( line ); break; case 'b' : + // This prevent a memory leak if the field appears more than one time + if ( mBandInfo ) + delete mBandInfo; mBandInfo = new BandInfo( line ); break; case 't' : @@ -339,6 +345,16 @@ SessionDescriptor::SessionDescriptor( const std::string &url, const std::string } } +SessionDescriptor::~SessionDescriptor() +{ + if ( mConnInfo ) + delete mConnInfo; + if ( mBandInfo ) + delete mBandInfo; + for ( unsigned int i = 0; i < mMediaList.size(); i++ ) + delete mMediaList[i]; +} + AVFormatContext *SessionDescriptor::generateFormatContext() const { AVFormatContext *formatContext = avformat_alloc_context(); diff --git a/src/zm_sdp.h b/src/zm_sdp.h index 28d2d8c52..fb56a2886 100644 --- a/src/zm_sdp.h +++ b/src/zm_sdp.h @@ -213,6 +213,7 @@ protected: public: SessionDescriptor( const std::string &url, const std::string &sdp ); + ~SessionDescriptor(); const std::string &getUrl() const { diff --git a/src/zm_utils.cpp b/src/zm_utils.cpp index 51beb377d..e0c65ca61 100644 --- a/src/zm_utils.cpp +++ b/src/zm_utils.cpp @@ -126,6 +126,17 @@ StringVector split( const std::string &string, const std::string chars, int limi return( stringVector ); } +const std::string join(const StringVector v, const char * delim ) { + std::stringstream ss; + + for(size_t i = 0; i < v.size(); ++i) { + if(i != 0) + ss << ","; + ss << v[i]; + } + return ss.str(); +} + const std::string base64Encode( const std::string &inString ) { static char base64_table[64] = { '\0' }; diff --git a/src/zm_utils.h b/src/zm_utils.h index 6536024a9..063c74b7d 100644 --- a/src/zm_utils.h +++ b/src/zm_utils.h @@ -23,6 +23,7 @@ #include #include #include +#include #include typedef std::vector StringVector; @@ -36,6 +37,7 @@ const std::string stringtf( const std::string &format, ... ); bool startsWith( const std::string &haystack, const std::string &needle ); StringVector split( const std::string &string, const std::string chars, int limit=0 ); +const std::string join( const StringVector, const char * ); const std::string base64Encode( const std::string &inString ); diff --git a/src/zma.cpp b/src/zma.cpp index 9a6658e54..117ada241 100644 --- a/src/zma.cpp +++ b/src/zma.cpp @@ -137,5 +137,7 @@ int main( int argc, char *argv[] ) { fprintf( stderr, "Can't find monitor with id of %d\n", id ); } + logTerm(); + zmDbClose(); return( 0 ); } diff --git a/src/zmc.cpp b/src/zmc.cpp index d84d30505..b403425ef 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -296,11 +296,14 @@ int main( int argc, char *argv[] ) { delete monitors[i]; } - delete monitors; + delete [] monitors; delete [] alarm_capture_delays; delete [] capture_delays; delete [] next_delays; delete [] last_capture_times; + logTerm(); + zmDbClose(); + return( result ); } diff --git a/src/zmf.cpp b/src/zmf.cpp index b10092a5c..663e57076 100644 --- a/src/zmf.cpp +++ b/src/zmf.cpp @@ -307,4 +307,6 @@ int main( int argc, char *argv[] ) sigprocmask( SIG_UNBLOCK, &block_set, 0 ); } + logTerm(); + zmDbClose(); } diff --git a/src/zms.cpp b/src/zms.cpp index 0eab29756..9527ae4db 100644 --- a/src/zms.cpp +++ b/src/zms.cpp @@ -223,6 +223,8 @@ int main( int argc, const char *argv[] ) if ( !user ) { Error( "Unable to authenticate user" ); + logTerm(); + zmDbClose(); return( -1 ); } ValidateAccess( user, monitor_id ); @@ -286,6 +288,8 @@ int main( int argc, const char *argv[] ) #else // HAVE_LIBAVCODEC Error( "MPEG streaming of '%s' attempted while disabled", query ); fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" ); + logTerm(); + zmDbClose(); return( -1 ); #endif // HAVE_LIBAVCODEC } @@ -320,10 +324,16 @@ int main( int argc, const char *argv[] ) #else // HAVE_LIBAVCODEC Error( "MPEG streaming of '%s' attempted while disabled", query ); fprintf( stderr, "MPEG streaming is disabled.\nYou should ensure the ffmpeg libraries are installed and detected and rebuild to use this functionality.\n" ); + logTerm(); + zmDbClose(); return( -1 ); #endif // HAVE_LIBAVCODEC } stream.runStream(); } + + logTerm(); + zmDbClose(); + return( 0 ); } diff --git a/src/zmstreamer.cpp b/src/zmstreamer.cpp index ea61c7ff9..873d2fcd5 100644 --- a/src/zmstreamer.cpp +++ b/src/zmstreamer.cpp @@ -169,6 +169,8 @@ int main(int argc, char** argv) { stream.setStreamBitrate(bitrate); // default = 100000 (bitrate) #else fprintf(stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n"); + logTerm(); + zmDbClose(); return EXIT_FAILURE; #endif } @@ -192,5 +194,8 @@ int main(int argc, char** argv) { } if (debug) printf("Done.\n"); + logTerm(); + zmDbClose(); + return (EXIT_SUCCESS); } diff --git a/src/zmu.cpp b/src/zmu.cpp index bc032639f..01ebb7f77 100644 --- a/src/zmu.cpp +++ b/src/zmu.cpp @@ -754,5 +754,8 @@ int main( int argc, char *argv[] ) } delete user; + logTerm(); + zmDbClose(); + return( 0 ); } diff --git a/utils/zmeditconfigdata.sh b/utils/zmeditconfigdata.sh new file mode 100755 index 000000000..71b73bb6e --- /dev/null +++ b/utils/zmeditconfigdata.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# This script allows the package maintainer to change the default value +# of any variable specified in ConfigData.pm without writing a patch. +# Run this script from your build folder, before running configure or cmake. + +usage() +{ +cat < /dev/null + + if [ $? -ne 0 ]; then + echo + echo "ERROR: The script cannot find the required command \"${CMD}\"." + echo + exit 1 + fi +done + +escape() +{ +escaped="" +local temp="$(printf %q "$1")" +escaped="$(echo $temp | sed 's/\//\\\//g')" +} + +# Assign variables once they are properly escaped +escape $1 +variable=$escaped +escape $2 +default=$escaped + +# Set the path to ConfigData +if [ -n "$3" ]; then + configdata="$3/ConfigData.pm.in" +else + configdata="./scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in" +fi + +# Check to make sure we can find ConfigData +if [ ! -e "$configdata" ]; then + echo "CONFIGDATA FILE NOT FOUND: $configdata" + exit 1 +fi + +# Now that we've found ConfidData, verify the supplied variable +# is defined inside the ConfigData file. +if [ -z "$(grep $variable $configdata)" ]; then + echo "ZONEMINDER VARIABLE NOT FOUND: $variable" + exit 1 +fi + +# Update the supplied variable with the new default value. +# Don't stare too closely. You will burn your eyes out. +sed -i '/.*'${variable}'.*/{ + $!{ N + s/\(.*'${variable}'.*\n.*\)\"\(.*\)\"/\1\"'${default}'\"/ + t yes + P + D + :yes + + } + }' $configdata + +if [ "$?" != "0" ]; then + echo "SED RETURNED FAILURE" + exit 1 +fi + + + diff --git a/web/ajax/log.php b/web/ajax/log.php index e5096b03d..4fb1ebed7 100644 --- a/web/ajax/log.php +++ b/web/ajax/log.php @@ -10,7 +10,8 @@ switch ( $_REQUEST['task'] ) logInit( array( 'id' => "web_js" ) ); $string = $_POST['message']; - $file = preg_replace( '/\w+:\/\/\w+\//', '', $_POST['file'] ); + + $file = !empty($_POST['file']) ? preg_replace( '/\w+:\/\/\w+\//', '', $_POST['file'] ) : ''; if ( !empty( $_POST['line'] ) ) $line = $_POST['line']; else diff --git a/web/api/app/Controller/Component/ConfigParserComponent.php b/web/api/app/Controller/Component/ConfigParserComponent.php new file mode 100644 index 000000000..18d06fba8 --- /dev/null +++ b/web/api/app/Controller/Component/ConfigParserComponent.php @@ -0,0 +1,80 @@ +$hint"; + } + return $string; + } + + public function getLabel($name) { + $width = 'col-md-4'; + + $string = '
'; + $string .= ''; + $label = sprintf($string, $name, $width, $name); + $label .= '
'; + + return $label; + } + + public function getInput($name, $type, $id) { + if ($type == 'checkbox') { + $string = '
'; + } elseif ($type == 'text') { + $string = '
'; + } elseif ($type == 'textarea') { + $string = ''; + } elseif ($type == 'select') { + $string = ' '; + } + break; + default: + $string .= $this->getInput($name, 'text', $id); + } + $string .= "\n"; + } + return $string; + } + + +} +?> diff --git a/web/api/app/Controller/ConfigsController.php b/web/api/app/Controller/ConfigsController.php index a6759a512..3198ae58e 100644 --- a/web/api/app/Controller/ConfigsController.php +++ b/web/api/app/Controller/ConfigsController.php @@ -88,4 +88,50 @@ class ConfigsController extends AppController { } else { return $this->flash(__('The config could not be deleted. Please, try again.'), array('action' => 'index')); } - }} + } + +/** + * categories method + * + * Either return a list of distinct categories + * Or all configs under a certain category + */ + + public function categories($category = null) { + if ($category != null) { + if (!$this->Config->find('first', array( 'conditions' => array('Config.Category' => $category)))) { + throw new NotFoundException(__('Invalid Config Category')); + } + + $config = $this->Config->find('all', array( + 'conditions' => array('Config.Category' => $category), + 'recursive' => 0 + )); + $this->set(array( + 'config' => $config, + '_serialize' => array('config') + )); + } else { + $categories = $this->Config->find('all', array( + 'fields' => array('DISTINCT Config.Category'), + 'conditions' => array('Config.Category !=' => 'hidden'), + 'recursive' => 0 + )); + $this->set(array( + 'categories' => $categories, + '_serialize' => array('categories') + )); + } + + } + + public function keyValue() { + $keyValues = $this->Config->find('list', array( + 'fields' => array('Config.Name', 'Config.Value') + )); + $this->set(array( + 'keyValues' => $keyValues, + '_serialize' => array('keyValues') + )); + } +} diff --git a/web/api/app/Controller/LogsController.php b/web/api/app/Controller/LogsController.php new file mode 100644 index 000000000..908c635e2 --- /dev/null +++ b/web/api/app/Controller/LogsController.php @@ -0,0 +1,96 @@ +Log->recursive = 0; + $this->set('logs', $this->Paginator->paginate()); + } + +/** + * view method + * + * @throws NotFoundException + * @param string $id + * @return void + */ + public function view($id = null) { + if (!$this->Log->exists($id)) { + throw new NotFoundException(__('Invalid log')); + } + $options = array('conditions' => array('Log.' . $this->Log->primaryKey => $id)); + $this->set('log', $this->Log->find('first', $options)); + } + +/** + * add method + * + * @return void + */ + public function add() { + if ($this->request->is('post')) { + $this->Log->create(); + if ($this->Log->save($this->request->data)) { + return $this->flash(__('The log has been saved.'), array('action' => 'index')); + } + } + } + +/** + * edit method + * + * @throws NotFoundException + * @param string $id + * @return void + */ + public function edit($id = null) { + if (!$this->Log->exists($id)) { + throw new NotFoundException(__('Invalid log')); + } + if ($this->request->is(array('post', 'put'))) { + if ($this->Log->save($this->request->data)) { + return $this->flash(__('The log has been saved.'), array('action' => 'index')); + } + } else { + $options = array('conditions' => array('Log.' . $this->Log->primaryKey => $id)); + $this->request->data = $this->Log->find('first', $options); + } + } + +/** + * delete method + * + * @throws NotFoundException + * @param string $id + * @return void + */ + public function delete($id = null) { + $this->Log->id = $id; + if (!$this->Log->exists()) { + throw new NotFoundException(__('Invalid log')); + } + $this->request->allowMethod('post', 'delete'); + if ($this->Log->delete()) { + return $this->flash(__('The log has been deleted.'), array('action' => 'index')); + } else { + return $this->flash(__('The log could not be deleted. Please, try again.'), array('action' => 'index')); + } + }} diff --git a/web/api/app/Controller/MonitorsController.php b/web/api/app/Controller/MonitorsController.php index 3e9556a19..da4339e8e 100644 --- a/web/api/app/Controller/MonitorsController.php +++ b/web/api/app/Controller/MonitorsController.php @@ -108,4 +108,21 @@ class MonitorsController extends AppController { } else { return $this->flash(__('The monitor could not be deleted. Please, try again.'), array('action' => 'index')); } - }} + } + + public function sourceTypes() { + $sourceTypes = $this->Monitor->query("describe Monitors Type;"); + + preg_match('/^enum\((.*)\)$/', $sourceTypes[0]['COLUMNS']['Type'], $matches); + foreach( explode(',', $matches[1]) as $value ) { + $enum[] = trim( $value, "'" ); + } + + $this->set(array( + 'sourceTypes' => $enum, + '_serialize' => array('sourceTypes') + )); + } + +} + diff --git a/web/api/app/Model/Log.php b/web/api/app/Model/Log.php new file mode 100644 index 000000000..4bbe69be9 --- /dev/null +++ b/web/api/app/Model/Log.php @@ -0,0 +1,23 @@ + +Form->create('Log'); ?> +
+ + Form->input('Component'); + echo $this->Form->input('Pid'); + echo $this->Form->input('Level'); + echo $this->Form->input('Code'); + echo $this->Form->input('Message'); + echo $this->Form->input('File'); + echo $this->Form->input('Line'); + ?> +
+Form->end(__('Submit')); ?> + +
+

+
    + +
  • Html->link(__('List Logs'), array('action' => 'index')); ?>
  • +
+
diff --git a/web/api/app/View/Logs/edit.ctp b/web/api/app/View/Logs/edit.ctp new file mode 100644 index 000000000..cdd5dab2b --- /dev/null +++ b/web/api/app/View/Logs/edit.ctp @@ -0,0 +1,25 @@ +
+Form->create('Log'); ?> +
+ + Form->input('TimeKey'); + echo $this->Form->input('Component'); + echo $this->Form->input('Pid'); + echo $this->Form->input('Level'); + echo $this->Form->input('Code'); + echo $this->Form->input('Message'); + echo $this->Form->input('File'); + echo $this->Form->input('Line'); + ?> +
+Form->end(__('Submit')); ?> +
+
+

+
    + +
  • Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Log.TimeKey')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Log.TimeKey'))); ?>
  • +
  • Html->link(__('List Logs'), array('action' => 'index')); ?>
  • +
+
diff --git a/web/api/app/View/Logs/index.ctp b/web/api/app/View/Logs/index.ctp new file mode 100644 index 000000000..47cbeb57f --- /dev/null +++ b/web/api/app/View/Logs/index.ctp @@ -0,0 +1,52 @@ +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Paginator->sort('TimeKey'); ?>Paginator->sort('Component'); ?>Paginator->sort('Pid'); ?>Paginator->sort('Level'); ?>Paginator->sort('Code'); ?>Paginator->sort('Message'); ?>Paginator->sort('File'); ?>Paginator->sort('Line'); ?>
         + Html->link(__('View'), array('action' => 'view', $log['Log']['TimeKey'])); ?> + Html->link(__('Edit'), array('action' => 'edit', $log['Log']['TimeKey'])); ?> + Form->postLink(__('Delete'), array('action' => 'delete', $log['Log']['TimeKey']), array(), __('Are you sure you want to delete # %s?', $log['Log']['TimeKey'])); ?> +
+

+ Paginator->counter(array( + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + )); + ?>

+
+ Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); + echo $this->Paginator->numbers(array('separator' => '')); + echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); + ?> +
+
+
+

+
    +
  • Html->link(__('New Log'), array('action' => 'add')); ?>
  • +
+
diff --git a/web/api/app/View/Logs/view.ctp b/web/api/app/View/Logs/view.ctp new file mode 100644 index 000000000..7f0b8f15a --- /dev/null +++ b/web/api/app/View/Logs/view.ctp @@ -0,0 +1,54 @@ +
+

+
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+ +   +
+
+
+
+

+
    +
  • Html->link(__('Edit Log'), array('action' => 'edit', $log['Log']['TimeKey'])); ?>
  • +
  • Form->postLink(__('Delete Log'), array('action' => 'delete', $log['Log']['TimeKey']), null, __('Are you sure you want to delete # %s?', $log['Log']['TimeKey'])); ?>
  • +
  • Html->link(__('List Logs'), array('action' => 'index')); ?>
  • +
  • Html->link(__('New Log'), array('action' => 'add')); ?>
  • +
+
diff --git a/web/includes/actions.php b/web/includes/actions.php index b00328d9f..bfe62190f 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -654,21 +654,14 @@ if ( !empty($action) ) } // System view actions - if ( canView( 'System' ) ) - { - if ( $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; - } - } + if ( $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; + } // System edit actions if ( canEdit( 'System' ) ) @@ -861,14 +854,14 @@ if ( !empty($action) ) } elseif ( $action == "group" ) { - if ( !empty($_REQUEST['gid']) ) - { - dbQuery( "update Groups set Name=?, MonitorIds=? WHERE Id=?", array($_REQUEST['newGroup']['Name'], join(',',$_REQUEST['newGroup']['MonitorIds']), $_REQUEST['gid']) ); - } - else - { - dbQuery( "insert into Groups set Name=?, MonitorIds=?", array( $_REQUEST['newGroup']['Name'], join(',',$_REQUEST['newGroup']['MonitorIds'])) ); - } + # Should probably verfy 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 + $monitors = empty( $_POST['newGroup']['MonitorIds'] ) ? NULL : implode(',', $_POST['newGroup']['MonitorIds']); + if ( !empty($_POST['gid']) ) { + dbQuery( "UPDATE Groups SET Name=?, MonitorIds=? WHERE Id=?", array($_POST['newGroup']['Name'], $monitors, $_POST['gid']) ); + } else { + dbQuery( "INSERT INTO Groups SET Name=?, MonitorIds=?", array( $_POST['newGroup']['Name'], $monitors ) ); + } + $refreshParent = true; $view = 'none'; } diff --git a/web/index.php b/web/index.php index 0fb8fd158..f6ca44ff2 100644 --- a/web/index.php +++ b/web/index.php @@ -63,6 +63,13 @@ elseif ( isset($_COOKIE['zmSkin']) ) else $skin = "classic"; +if ( isset($_GET['css']) ) + $css = $_GET['css']; +elseif ( isset($_COOKIE['zmCSS']) ) + $css = $_COOKIE['zmCSS']; +else + $css = "classic"; + define( "ZM_BASE_PATH", dirname( $_SERVER['REQUEST_URI'] ) ); define( "ZM_SKIN_PATH", "skins/$skin" ); @@ -82,6 +89,11 @@ if ( !isset($_SESSION['skin']) || isset($_REQUEST['skin']) ) setcookie( "zmSkin", $skin, time()+3600*24*30*12*10 ); } +if ( !isset($_SESSION['css']) || isset($_REQUEST['css']) ) { + $_SESSION['css'] = $css; + setcookie( "zmCSS", $css, time()+3600*24*30*12*10 ); +} + require_once( 'includes/config.php' ); require_once( 'includes/logger.php' ); diff --git a/web/js/logger.js b/web/js/logger.js index e7f98c301..1f4eb6752 100644 --- a/web/js/logger.js +++ b/web/js/logger.js @@ -57,8 +57,10 @@ function logReport( level, message, file, line ) requestParms += "&level="+level+"&message="+encodeURIComponent(message); if ( file ) requestParms += "&file="+file; - else + else if ( location.search ) { + //location.search is the querystring part, so ?blah=blah but there is almost never any value to this requestParms += "&file="+location.search; + } if ( line ) requestParms += "&line="+line; debugReq.send( requestParms ); diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php index ab3b35de6..92462f430 100644 --- a/web/lang/en_gb.php +++ b/web/lang/en_gb.php @@ -609,6 +609,7 @@ $SLANG = array( 'SignalCheckColour' => 'Signal Check Colour', 'Size' => 'Size', 'SkinDescription' => 'Change the default skin for this computer', + 'CSSDescription' => 'Change the default css for this computer', 'Sleep' => 'Sleep', 'SortAsc' => 'Asc', 'SortBy' => 'Sort by', diff --git a/web/lang/et_ee.php b/web/lang/et_ee.php index b4cfa6b44..e79550698 100644 --- a/web/lang/et_ee.php +++ b/web/lang/et_ee.php @@ -15,8 +15,13 @@ //Suite 330, Boston, MA 02111-1307, USA. // // ZoneMinder estonian Translation by Seston seston@gmail.com -// Kes viitsiks aidata tõlkida abitekste ja üldse kõike seda.Üksi on kuidagi igav ettevõtmine. -// Notes for Translators +// Who would care assistance to help to translate texts, and all this at all. Alone is somehow boring business.... +//Kes viitsiks aidata tõlkida abitekste ja üldse kõike seda.Üksi on kuidagi igav ettevõtmine.... + +// ZoneMinder Estonian Translation by Hannes hanzese@gmail.com +// I bother because zoneminder is cool..... Mina viitsin, sest ZoneMinder on lahe..... + +//Notes for Translators // 0. Get some credit, put your name in the line above (optional) // 1. When composing the language tokens in your language you should try and keep to roughly the // same length text if possible. Abbreviate where necessary as spacing is quite close in a number of places. @@ -46,7 +51,7 @@ // do this by default, uncomment this if required. // // Example -header( "Content-Type: text/html; charset=UTF-8" ); +header( "Content-Type: text/html; charset=utf-8' ); // You may need to change your locale here if your default one is incorrect for the // language described in this file, or if you have multiple languages supported. @@ -67,71 +72,71 @@ header( "Content-Type: text/html; charset=UTF-8" ); // Simple String Replacements $SLANG = array( - '24BitColour' => '24 bit colour', - '32BitColour' => '32 bit colour', // Added - 2011-06-15 - '8BitGrey' => '8 bit greyscale', + '24BitColour' => '24 bit värvid', + '32BitColour' => '32 bit värvid', // Added - 2011-06-15 + '8BitGrey' => '8 bit mustvalge', 'Action' => 'Action', - 'Actual' => 'Actual', - 'AddNewControl' => 'Add New Control', + 'Actual' => 'Aktuaalne', + 'AddNewControl' => 'Lisa uus Kontroll', 'AddNewMonitor' => 'Lisa uus Monitor', - 'AddNewUser' => 'Lisa uus kasutaja', - 'AddNewZone' => 'Lisa uus tsoon', + 'AddNewUser' => 'Lisa uus Kasutaja', + 'AddNewZone' => 'Lisa uus Tsoon', 'Alarm' => 'Alarm', 'AlarmBrFrames' => 'Alarmi
kaadrid', 'AlarmFrame' => 'Alarmi kaader', - 'AlarmFrameCount' => 'Alarm Frame Count', - 'AlarmLimits' => 'Alarm Limits', - 'AlarmMaximumFPS' => 'Alarm Maximum FPS', + 'AlarmFrameCount' => 'Alarmi kaadri hulk', + 'AlarmLimits' => 'Alarmi limiidid', + 'AlarmMaximumFPS' => 'Alarmi Maksimaalne FPS', 'AlarmPx' => 'Alarm Px', - 'AlarmRGBUnset' => 'You must set an alarm RGB colour', + 'AlarmRGBUnset' => 'Sa pead panema alarmi RGB värvi', 'Alert' => 'Hoiatus', 'All' => 'All', 'Apply' => 'Apply', 'ApplyingStateChange' => 'Applying State Change', - 'ArchArchived' => 'Archived Only', - 'ArchUnarchived' => 'Unarchived Only', - 'Archive' => 'Archive', + 'ArchArchived' => 'Arhiveeritud Ainult', + 'ArchUnarchived' => 'Arhiveerimatta Ainult', + 'Archive' => 'Arhiiv', 'Archived' => 'Arhiveeritud', 'Area' => 'Ala', 'AreaUnits' => 'Ala (px/%)', 'AttrAlarmFrames' => 'Alarmi kaadrid', - 'AttrArchiveStatus' => 'Archive Status', - 'AttrAvgScore' => 'Avg. Score', - 'AttrCause' => 'Cause', + 'AttrArchiveStatus' => 'Arhiivi Staatus', + 'AttrAvgScore' => 'Keskm. Skoor', + 'AttrCause' => 'Põhjus', 'AttrDate' => 'Kp.', 'AttrDateTime' => 'Kp/Kellaaeg', - 'AttrDiskBlocks' => 'Disk Blocks', - 'AttrDiskPercent' => 'Disk Percent', + 'AttrDiskBlocks' => 'Ketta Blokk', + 'AttrDiskPercent' => 'Ketta Protsent', 'AttrDuration' => 'Kestvus', 'AttrFrames' => 'Kaadrid', 'AttrId' => 'Id', - 'AttrMaxScore' => 'Max. Score', - 'AttrMonitorId' => 'Monitor Id', + 'AttrMaxScore' => 'Maks. Skoor', + 'AttrMonitorId' => 'Monitori Id', 'AttrMonitorName' => 'Monitori Nimi', 'AttrName' => 'Nimi', - 'AttrNotes' => 'Notes', - 'AttrSystemLoad' => 'System Load', + 'AttrNotes' => 'Märkmed', + 'AttrSystemLoad' => 'Süsteemi Koormus', 'AttrTime' => 'Kellaaeg', - 'AttrTotalScore' => 'Total Score', + 'AttrTotalScore' => 'Skoor Kokku', 'AttrWeekday' => 'Tööpäevad', 'Auto' => 'Auto', - 'AutoStopTimeout' => 'Auto Stop Timeout', + 'AutoStopTimeout' => 'Auto Stop Ajalimiit', 'Available' => 'Saadaval', - 'AvgBrScore' => 'Avg.
Score', + 'AvgBrScore' => 'Keskm.
Skoor', 'Background' => 'Taust', 'BackgroundFilter' => 'Käivita filter taustal', - 'BadAlarmFrameCount' => 'Alarm frame count must be an integer of one or more', - 'BadAlarmMaxFPS' => 'Alarm Maximum FPS must be a positive integer or floating point value', - 'BadChannel' => 'Channel must be set to an integer of zero or more', - 'BadColours' => 'Target colour must be set to a valid value', // Added - 2011-06-15 - 'BadDevice' => 'Device must be set to a valid value', - 'BadFPSReportInterval' => 'FPS report interval buffer count must be an integer of 0 or more', - 'BadFormat' => 'Format must be set to a valid value', - 'BadFrameSkip' => 'Frame skip count must be an integer of zero or more', - 'BadMotionFrameSkip' => 'Motion Frame skip count must be an integer of zero or more', - 'BadHeight' => 'Height must be set to a valid value', - 'BadHost' => 'Host must be set to a valid ip address or hostname, do not include http://', - 'BadImageBufferCount' => 'Image buffer size must be an integer of 10 or more', + 'BadAlarmFrameCount' => 'Alarmi kaadri hulga ühik peab olema integer. Kas üks või rohkem', + 'BadAlarmMaxFPS' => 'Alarmi maksimaalne FPS peab olema positiivne integer või floating point väärtus', + 'BadChannel' => 'Kanal peab olema integer, null või rohkem', + 'BadColours' => 'Sihtmärgi värv peab olema pandud õige väärtus', // Added - 2011-06-15 + 'BadDevice' => 'Seadmel peab olema õige väärtus', + 'BadFPSReportInterval' => 'FPS raporteerimise intervall puhvri hulk peab olema integer, null või rohkem', + 'BadFormat' => 'Formaadiks peab olema pandud õige väärtus', + 'BadFrameSkip' => 'Kaadri vahelejätmise hulk peab olema integer, null või rohkem', + 'BadMotionFrameSkip' => 'Liikumise kaadri vahelejätmise hulk peab olema integer, null või rohkem', + 'BadHeight' => 'Kõrguseks peab olema valitud õige väärtus', + 'BadHost' => 'Host ipeab olema õige. Ip aadress või hostinimi, ei tohi sisaldada http://', + 'BadImageBufferCount' => 'Pildi puhvri suurus peab olema integer, 10 või rohkem', 'BadLabelX' => 'Label X co-ordinate must be set to an integer of zero or more', 'BadLabelY' => 'Label Y co-ordinate must be set to an integer of zero or more', 'BadMaxFPS' => 'Maximum FPS must be a positive integer or floating point value', @@ -149,12 +154,12 @@ $SLANG = array( 'BadWebColour' => 'Web colour must be a valid web colour string', 'BadWidth' => 'Width must be set to a valid value', 'Bandwidth' => 'Ribalaius', - 'BandwidthHead' => 'Bandwidth', // This is the end of the bandwidth status on the top of the console, different in many language due to phrasing + 'BandwidthHead' => 'Ribalaius', // This is the end of the bandwidth status on the top of the console, different in many language due to phrasing 'BlobPx' => 'Blob Px', 'BlobSizes' => 'Blob Sizes', 'Blobs' => 'Blobs', 'Brightness' => 'Heledus', - 'Buffers' => 'Buffer', + 'Buffers' => 'Puhver', 'CanAutoFocus' => 'Can Auto Focus', 'CanAutoGain' => 'Can Auto Gain', 'CanAutoIris' => 'Can Auto Iris', @@ -208,10 +213,10 @@ $SLANG = array( 'ChoosePreset' => 'Choose Preset', 'Clear' => 'Clear', // Added - 2011-06-16 'Close' => 'Sule', - 'Colour' => 'Colour', - 'Command' => 'Command', - 'Component' => 'Component', // Added - 2011-06-16 - 'Config' => 'Config', + 'Colour' => 'Värv', + 'Command' => 'Käsk', + 'Component' => 'Komponent', // Added - 2011-06-16 + 'Config' => 'Seadistus', 'ConfiguredFor' => 'Seadistatud', 'ConfirmDeleteEvents' => 'Oled sa kindel kustamaks valitud sündmused?', 'ConfirmPassword' => 'Kinnita salasõna', @@ -230,74 +235,74 @@ $SLANG = array( 'Controllable' => 'Controllable', 'Cycle' => 'Cycle', 'CycleWatch' => 'Cycle Watch', - 'DateTime' => 'Date/Time', // Added - 2011-06-16 + 'DateTime' => 'Kuupäev/Aeg', // Added - 2011-06-16 'Day' => 'Päevas', 'Debug' => 'Debug', - 'DefaultRate' => 'Default Rate', - 'DefaultScale' => 'Default Scale', - 'DefaultView' => 'Default View', + 'DefaultRate' => 'Default Kiirus', + 'DefaultScale' => 'Default Suurus', + 'DefaultView' => 'Default Vaade', 'Delete' => 'Kustuta', - 'DeleteAndNext' => 'Delete & Next', - 'DeleteAndPrev' => 'Delete & Prev', + 'DeleteAndNext' => 'Kustuta & Järgmine', + 'DeleteAndPrev' => 'Kustuta & Eelmine', 'DeleteSavedFilter' => 'Kustuta salvestatud filter', 'Description' => 'Kirjeldus', 'DetectedCameras' => 'Tuvastatud kaamerad', - 'Device' => 'Device', - 'DeviceChannel' => 'Device Channel', - 'DeviceFormat' => 'Device Format', - 'DeviceNumber' => 'Device Number', - 'DevicePath' => 'Device Path', - 'Devices' => 'Devices', - 'Dimensions' => 'Dimensions', + 'Device' => 'Seade', + 'DeviceChannel' => 'Seadme Kanal, + 'DeviceFormat' => 'Seadme Formaat', + 'DeviceNumber' => 'Seadme Number', + 'DevicePath' => 'Seadme Path', + 'Devices' => 'Seadmed', + 'Dimensions' => 'Mõõdud', 'DisableAlarms' => 'Keela alarmid', - 'Disk' => 'Disk', - 'Display' => 'Display', // Added - 2011-03-02 - 'Displaying' => 'Displaying', // Added - 2011-06-16 - 'Donate' => 'Please Donate', - 'DonateAlready' => 'No, I\'ve already donated', - 'DonateEnticement' => 'You\'ve been running ZoneMinder for a while now and hopefully are finding it a useful addition to your home or workplace security. Although ZoneMinder is, and will remain, free and open source, it costs money to develop and support. If you would like to help support future development and new features then please consider donating. Donating is, of course, optional but very much appreciated and you can donate as much or as little as you like.

If you would like to donate please select the option below or go to http://www.zoneminder.com/donate.html in your browser.

Thank you for using ZoneMinder and don\'t forget to visit the forums on ZoneMinder.com for support or suggestions about how to make your ZoneMinder experience even better.', - 'DonateRemindDay' => 'Not yet, remind again in 1 day', - 'DonateRemindHour' => 'Not yet, remind again in 1 hour', - 'DonateRemindMonth' => 'Not yet, remind again in 1 month', - 'DonateRemindNever' => 'No, I don\'t want to donate, never remind', - 'DonateRemindWeek' => 'Not yet, remind again in 1 week', - 'DonateYes' => 'Yes, I\'d like to donate now', + 'Disk' => 'Ketas', + 'Display' => 'Ekraan', // Added - 2011-03-02 + 'Displaying' => 'Väljapanek', // Added - 2011-06-16 + 'Donate' => 'Palun Anneta', + 'DonateAlready' => 'EI, Ma olen juba annetanud', + 'DonateEnticement' => 'Sa oled juba kasutanud ZoneMinderit juba mõnda aega. Nüüd kus sa oled leidnud, et see on kasulik lisa sinu kodule või sinu töökohale. Kuigi ZoneMinder on, jääb alatiseks, vabaks ja avatud lähtekoodiks, siiski selle arendamiseks kulub aega ja raha. Kui sa soovid meid aidata, siis toeta meid tuleviku arendusteks ja uute lisade loomiseks. Palun mõelge annetuse peale. Donating is, of course, optional but very much appreciated and you can donate as much or as little as you like.

If you would like to donate please select the option below or go to http://www.zoneminder.com/donate.html in your browser.

Thank you for using ZoneMinder and don\'t forget to visit the forums on ZoneMinder.com for support or suggestions about how to make your ZoneMinder experience even better.', + 'DonateRemindDay' => 'Ei veel, tuleta meelde ühe päeva pärast', + 'DonateRemindHour' => 'Ei veel, tuleta meelde ühe tunni pärast', + 'DonateRemindMonth' => 'Ei veel, tuleta meelde ühe kuu pärast', + 'DonateRemindNever' => 'EI, Ma ei taha annetada, Vahet pole', + 'DonateRemindWeek' => 'EI veel, tuleta meelde nädala pärast, + 'DonateYes' => 'Jah, Ma soovin annetada', 'Download' => 'Lae alla', - 'DuplicateMonitorName' => 'Duplicate Monitor Name', + 'DuplicateMonitorName' => 'Dubleeri Monitori Nimi', 'Duration' => 'Kestvus', - 'Edit' => 'Edit', + 'Edit' => 'Muuda', 'Email' => 'Email', 'EnableAlarms' => 'Luba Alarmid', 'Enabled' => 'Lubatud', 'EnterNewFilterName' => 'Sisest uue filtri nimi', 'Error' => 'Viga', - 'ErrorBrackets' => 'Error, please check you have an equal number of opening and closing brackets', - 'ErrorValidValue' => 'Error, please check that all terms have a valid value', + 'ErrorBrackets' => 'Viga, please check you have an equal number of opening and closing brackets', + 'ErrorValidValue' => 'Viga, please check that all terms have a valid value', 'Etc' => 'etc', - 'Event' => 'Syndmus', + 'Event' => 'Sündmus', 'EventFilter' => 'Sündmuste filter', 'EventId' => 'Sündmuse Id', 'EventName' => 'Sündmuse nimi', - 'EventPrefix' => 'Event Prefix', + 'EventPrefix' => 'Sündmuse Prefix', 'Events' => 'Sündmuseid', - 'Exclude' => 'Exclude', + 'Exclude' => 'Jäta välja', 'Execute' => 'Käivita', - 'Export' => 'Export', - 'ExportDetails' => 'Export Event Details', - 'ExportFailed' => 'Export Failed', - 'ExportFormat' => 'Export File Format', + 'Export' => 'Eksport, + 'ExportDetails' => 'Ekspordi Sündmuste Detailid', + 'ExportFailed' => 'Eksportimine Ebaõnnestus', + 'ExportFormat' => 'Ekspordi Faili Formaat', 'ExportFormatTar' => 'Tar', 'ExportFormatZip' => 'Zip', - 'ExportFrames' => 'Export Frame Details', - 'ExportImageFiles' => 'Export Image Files', - 'ExportLog' => 'Export Log', // Added - 2011-06-17 - 'ExportMiscFiles' => 'Export Other Files (if present)', - 'ExportOptions' => 'Export Options', - 'ExportSucceeded' => 'Export Succeeded', - 'ExportVideoFiles' => 'Export Video Files (if present)', - 'Exporting' => 'Exporting', + 'ExportFrames' => 'Ekspordi Kaadri Detailid', + 'ExportImageFiles' => 'Ekspordi Pildi Failid', + 'ExportLog' => 'Ekspordi Logi', // Added - 2011-06-17 + 'ExportMiscFiles' => 'Ekspordi Teisi Faile (kui neid on)', + 'ExportOptions' => 'Ekspordi Valikud', + 'ExportSucceeded' => 'Eksportimine Õnnestus', + 'ExportVideoFiles' => 'Export Video Files (kui neid on)', + 'Exporting' => 'Eksportimine', 'FPS' => 'fps', - 'FPSReportInterval' => 'FPS Report Interval', + 'FPSReportInterval' => 'FPS Raporteerimise Intervall, 'FTP' => 'FTP', 'Far' => 'Far', 'FastForward' => 'Fast Forward', @@ -328,7 +333,7 @@ $SLANG = array( 'Format' => 'Format', 'Frame' => 'Kaader', 'FrameId' => 'Frame Id', - 'FrameRate' => 'Frame Rate', + 'FrameRate' => 'Kaadri Sagedus', 'FrameSkip' => 'Frame Skip', 'MotionFrameSkip' => 'Motion Frame Skip', 'Frames' => 'Kaadrid', @@ -360,7 +365,7 @@ $SLANG = array( 'Hue' => 'Hue', 'Id' => 'Id', 'Idle' => 'Idle', - 'Ignore' => 'Ignore', + 'Ignore' => 'Ignoreeri', 'Image' => 'Pilt', 'ImageBufferSize' => 'Image Buffer Size (frames)', 'Images' => 'Pildid', @@ -382,18 +387,18 @@ $SLANG = array( 'List' => 'List', 'Load' => 'Koormus', 'Local' => 'Local', - 'Log' => 'Log', // Added - 2011-06-16 + 'Log' => 'Logi', // Added - 2011-06-16 'LoggedInAs' => 'Sisse logitud', - 'Logging' => 'Logging', // Added - 2011-06-16 + 'Logging' => 'Logimine', // Added - 2011-06-16 'LoggingIn' => 'Login sisse', 'Login' => 'Login', 'Logout' => 'Logi välja', - 'Logs' => 'Logs', // Added - 2011-06-17 + 'Logs' => 'Logid', // Added - 2011-06-17 'Low' => 'Madal', 'LowBW' => 'Low B/W', - 'Main' => 'Main', + 'Main' => 'Pea', 'Man' => 'Man', - 'Manual' => 'Manual', + 'Manual' => 'Juhend', 'Mark' => 'Märgi', 'Max' => 'Max', 'MaxBandwidth' => 'Max Ribalaius', @@ -466,53 +471,53 @@ $SLANG = array( 'Monitors' => 'Monitors', 'Montage' => 'Montage', 'Month' => 'Kuus', - 'More' => 'More', // Added - 2011-06-16 - 'Move' => 'Move', + 'More' => 'Veel', // Added - 2011-06-16 + 'Move' => 'Liiguta', 'MtgDefault' => 'Default', // Added 2013.08.15. - 'Mtg2widgrd' => '2-wide grid', // Added 2013.08.15. - 'Mtg3widgrd' => '3-wide grid', // Added 2013.08.15. - 'Mtg4widgrd' => '4-wide grid', // Added 2013.08.15. - 'Mtg3widgrx' => '3-wide grid, scaled, enlarge on alarm', // Added 2013.08.15. - 'MustBeGe' => 'must be greater than or equal to', - 'MustBeLe' => 'must be less than or equal to', - 'MustConfirmPassword' => 'You must confirm the password', - 'MustSupplyPassword' => 'You must supply a password', - 'MustSupplyUsername' => 'You must supply a username', + 'Mtg2widgrd' => '2-pildi ruudustik', // Added 2013.08.15. + 'Mtg3widgrd' => '3-pildi ruudustik', // Added 2013.08.15. + 'Mtg4widgrd' => '4-pildi ruudustik', // Added 2013.08.15. + 'Mtg3widgrx' => '3-pildi ruudustik, skaleeritud, suurenda kui on alarm', // Added 2013.08.15. + 'MustBeGe' => 'peab olema suurem kui või võrdne ', + 'MustBeLe' => 'peab olema väiksem kui või võrdne', + 'MustConfirmPassword' => 'Sa pead kinnitama parooli', + 'MustSupplyPassword' => 'Sa pead panema parooli', + 'MustSupplyUsername' => 'Sa pead panema kasutaja nime', 'Name' => 'Sündmus', - 'Near' => 'Near', - 'Network' => 'Network', - 'New' => 'New', - 'NewGroup' => 'New Group', - 'NewLabel' => 'New Label', - 'NewPassword' => 'New Password', - 'NewState' => 'New State', - 'NewUser' => 'New User', - 'Next' => 'Next', - 'No' => 'No', - 'NoDetectedCameras' => 'No Detected Cameras', - 'NoFramesRecorded' => 'There are no frames recorded for this event', - 'NoGroup' => 'No Group', - 'NoSavedFilters' => 'NoSavedFilters', - 'NoStatisticsRecorded' => 'There are no statistics recorded for this event/frame', + 'Near' => 'Lähedal', + 'Network' => 'Võrk', + 'New' => 'Uus', + 'NewGroup' => 'Uus Krupp', + 'NewLabel' => 'Uus Nimi', + 'NewPassword' => 'Uus Parool', + 'NewState' => 'Uus Olek', + 'NewUser' => 'Uus Kasutaja', + 'Next' => 'Järgmine', + 'No' => 'Ei', + 'NoDetectedCameras' => 'Ei leidnud kaameraid', + 'NoFramesRecorded' => 'Ei ole kaadreid salvetatud selles sündmuses', + 'NoGroup' => 'Ei krupp', + 'NoSavedFilters' => 'EiSalvestatudFiltreid', + 'NoStatisticsRecorded' => 'Ei ole statistikat salvestatud selle sündmuse/kaadri kohta', 'None' => 'None', 'NoneAvailable' => 'None available', - 'Normal' => 'Normal', - 'Notes' => 'Notes', + 'Normal' => 'Normaalne', + 'Notes' => 'Märkmed', 'NumPresets' => 'Num Presets', - 'Off' => 'Off', - 'On' => 'On', - 'OpEq' => 'equal to', - 'OpGt' => 'greater than', - 'OpGtEq' => 'greater than or equal to', + 'Off' => 'Väljas', + 'On' => 'Sees', + 'OpEq' => 'Võrdne', + 'OpGt' => 'Suurem kui', + 'OpGtEq' => 'suurem kui või võrdne', 'OpIn' => 'in set', - 'OpLt' => 'less than', - 'OpLtEq' => 'less than or equal to', - 'OpMatches' => 'matches', - 'OpNe' => 'not equal to', + 'OpLt' => 'vähem kui', + 'OpLtEq' => 'vähem kui või võrdne', + 'OpMatches' => 'klapib', + 'OpNe' => 'ei võrdne', 'OpNotIn' => 'not in set', - 'OpNotMatches' => 'does not match', - 'Open' => 'Open', - 'OptionHelp' => 'Option Help', + 'OpNotMatches' => 'ei klapi', + 'Open' => 'Ava', + 'OptionHelp' => 'Valik Aita', 'OptionRestartWarning' => 'These changes may not come into effect fully\nwhile the system is running. When you have\nfinished making your changes please ensure that\nyou restart ZoneMinder.', 'Options' => 'Seaded', 'OrEnterNewName' => 'või sisesta uus nimi', @@ -530,27 +535,27 @@ $SLANG = array( 'PasswordsDifferent' => 'The new and confirm passwords are different', 'Paths' => 'Paths', 'Pause' => 'Pause', - 'Phone' => 'Phone', + 'Phone' => 'Telefon', 'PhoneBW' => 'Phone B/W', 'Pid' => 'PID', // Added - 2011-06-16 'PixelDiff' => 'Pixel Diff', - 'Pixels' => 'pixels', + 'Pixels' => 'pikslid', 'Play' => 'Play', - 'PlayAll' => 'Play All', - 'PleaseWait' => 'Please Wait', - 'Plugins' => 'Plugins', - 'Point' => 'Point', + 'PlayAll' => 'Play Kõike', + 'PleaseWait' => 'Palun Oota', + 'Plugins' => 'Pluginad', + 'Point' => 'Punkt', 'PostEventImageBuffer' => 'Post Event Image Count', 'PreEventImageBuffer' => 'Pre Event Image Count', 'PreserveAspect' => 'Preserve Aspect Ratio', - 'Preset' => 'Preset', - 'Presets' => 'Presets', + 'Preset' => 'Eelseatud', + 'Presets' => 'Eelseaded', 'Prev' => 'Prev', 'Probe' => 'Probe', 'Protocol' => 'Protocol', 'Rate' => 'Rate', - 'Real' => 'Real', - 'Record' => 'Record', + 'Real' => 'Reaaalne', + 'Record' => 'Salvesta', 'RefImageBlendPct' => 'Reference Image Blend %ge', 'Refresh' => 'Värskenda', 'Remote' => 'Remote', @@ -568,72 +573,72 @@ $SLANG = array( 'ReplaySingle' => 'Ãœksik sündmus', 'Reset' => 'Reset', 'ResetEventCounts' => 'Reset Event Counts', - 'Restart' => 'Restart', + 'Restart' => 'Taaskäivita', 'Restarting' => 'Restarting', 'RestrictedCameraIds' => 'Restricted Camera Ids', 'RestrictedMonitors' => 'Restricted Monitors', 'ReturnDelay' => 'Return Delay', 'ReturnLocation' => 'Return Location', 'Rewind' => 'Rewind', - 'RotateLeft' => 'Rotate Left', - 'RotateRight' => 'Rotate Right', + 'RotateLeft' => 'Pööra vasakule', + 'RotateRight' => 'Pööra paremale', 'RunLocalUpdate' => 'Please run zmupdate.pl to update', // Added - 2011-05-25 - 'RunMode' => 'Run Mode', - 'RunState' => 'Run State', + 'RunMode' => 'Käimis resiim', + 'RunState' => 'Käimis olek', 'Running' => 'Töötab', - 'Save' => 'Save', - 'SaveAs' => 'Save as', - 'SaveFilter' => 'Save Filter', - 'Scale' => 'Scale', - 'Score' => 'Score', + 'Save' => 'Salvesta', + 'SaveAs' => 'Salvesta kui', + 'SaveFilter' => 'Salvesta Filter', + 'Scale' => 'Skaala', + 'Score' => 'Skoor', 'Secs' => 'Secs', 'Sectionlength' => 'Section length', - 'Select' => 'Select', - 'SelectFormat' => 'Select Format', // Added - 2011-06-17 - 'SelectLog' => 'Select Log', // Added - 2011-06-17 - 'SelectMonitors' => 'Select Monitors', + 'Select' => 'Selekteeri', + 'SelectFormat' => 'Selekteeri Formaat', // Added - 2011-06-17 + 'SelectLog' => 'Selekteeri logi', // Added - 2011-06-17 + 'SelectMonitors' => 'Selekteeri Monitorid', 'SelfIntersecting' => 'Polygon edges must not intersect', - 'Set' => 'Set', - 'SetNewBandwidth' => 'Set New Bandwidth', + 'Set' => 'Säti', + 'SetNewBandwidth' => 'Vali uus riba laius', 'SetPreset' => 'Set Preset', - 'Settings' => 'Settings', - 'ShowFilterWindow' => 'Show Filter Window', - 'ShowTimeline' => 'Show Timeline', - 'SignalCheckColour' => 'Signal Check Colour', - 'Size' => 'Size', - 'SkinDescription' => 'Change the default skin for this computer', // Added - 2011-03-02 - 'Sleep' => 'Sleep', - 'SortAsc' => 'Asc', - 'SortBy' => 'Sort by', - 'SortDesc' => 'Desc', + 'Settings' => 'Sätted', + 'ShowFilterWindow' => 'Näita Filtri Akent', + 'ShowTimeline' => 'Näita Timeline', + 'SignalCheckColour' => 'Signaali Kontroll Värv', + 'Size' => 'Suurus', + 'SkinDescription' => 'Vaheta veebilehe välimus selles arvutis', // Added - 2011-03-02 + 'Sleep' => 'Maga', + 'SortAsc' => 'Kasvav', + 'SortBy' => 'Sorteeri', + 'SortDesc' => 'Kahanev', 'Source' => 'Allikas', - 'SourceColours' => 'Source Colours', - 'SourcePath' => 'Source Path', - 'SourceType' => 'Source Type', - 'Speed' => 'Speed', - 'SpeedHigh' => 'High Speed', - 'SpeedLow' => 'Low Speed', - 'SpeedMedium' => 'Medium Speed', - 'SpeedTurbo' => 'Turbo Speed', + 'SourceColours' => 'Allika Värvid', + 'SourcePath' => 'Allika Path', + 'SourceType' => 'Allika tüüp', + 'Speed' => 'Kiirus', + 'SpeedHigh' => 'Kiire Kiirus', + 'SpeedLow' => 'Madal Kiirus', + 'SpeedMedium' => 'Keskmine Kiirus', + 'SpeedTurbo' => 'Turbo Kiirus', 'Start' => 'Start', - 'State' => 'State', - 'Stats' => 'Stats', - 'Status' => 'Status', - 'Step' => 'Step', - 'StepBack' => 'Step Back', - 'StepForward' => 'Step Forward', - 'StepLarge' => 'Large Step', - 'StepMedium' => 'Medium Step', - 'StepNone' => 'No Step', - 'StepSmall' => 'Small Step', + 'State' => 'Olek', + 'Stats' => 'Statistika', + 'Status' => 'Staatus', + 'Step' => 'Samm', + 'StepBack' => 'Samm tagasi', + 'StepForward' => 'Samm edasi', + 'StepLarge' => 'Suur Samm', + 'StepMedium' => 'Keskmine Samm', + 'StepNone' => 'Ei Samm', + 'StepSmall' => 'Väike Samm', 'Stills' => 'Stills', 'Stop' => 'Stop', - 'Stopped' => 'Stopped', - 'Stream' => 'Stream', - 'StreamReplayBuffer' => 'Stream Replay Image Buffer', + 'Stopped' => 'Stopitud', + 'Stream' => 'Striim', + 'StreamReplayBuffer' => 'Striimi Replay Pildi Puhver', 'Submit' => 'Submit', - 'System' => 'System', - 'SystemLog' => 'System Log', // Added - 2011-06-16 + 'System' => 'Süsteem', + 'SystemLog' => 'Süsteemi Logi', // Added - 2011-06-16 'Tele' => 'Tele', 'Thumbnail' => 'Thumbnail', 'Tilt' => 'Tilt', @@ -641,7 +646,7 @@ $SLANG = array( 'TimeDelta' => 'Time Delta', 'TimeStamp' => 'Time Stamp', 'Timeline' => 'Timeline', - 'TimelineTip1' => 'Pass your mouse over the graph to view a snapshot image and event details.', // Added 2013.08.15. + 'TimelineTip1' => 'Liiguta hiir üle graafiku et näha pildi ja sündmuse detaile.', // Added 2013.08.15. 'TimelineTip2' => 'Click on the coloured sections of the graph, or the image, to view the event.', // Added 2013.08.15. 'TimelineTip3' => 'Click on the background to zoom in to a smaller time period based around your click.', // Added 2013.08.15. 'TimelineTip4' => 'Use the controls below to zoom out or navigate back and forward through the time range.', // Added 2013.08.15. @@ -649,55 +654,55 @@ $SLANG = array( 'TimestampLabelFormat' => 'Timestamp Label Format', 'TimestampLabelX' => 'Timestamp Label X', 'TimestampLabelY' => 'Timestamp Label Y', - 'Today' => 'Today', - 'Tools' => 'Tools', - 'Total' => 'Total', // Added - 2011-06-16 - 'TotalBrScore' => 'Total
Score', - 'TrackDelay' => 'Track Delay', - 'TrackMotion' => 'Track Motion', - 'Triggers' => 'Triggers', + 'Today' => 'Täna', + 'Tools' => 'Tööriistad', + 'Total' => 'Summa', // Added - 2011-06-16 + 'TotalBrScore' => 'Summa
Skoor', + 'TrackDelay' => 'Jälgimise Viide', + 'TrackMotion' => 'Jälgi Liikumist', + 'Triggers' => 'Trigerid', 'TurboPanSpeed' => 'Turbo Pan Speed', 'TurboTiltSpeed' => 'Turbo Tilt Speed', - 'Type' => 'Type', - 'Unarchive' => 'Unarchive', - 'Undefined' => 'Undefined', - 'Units' => 'Units', - 'Unknown' => 'Unknown', - 'Update' => 'Update', - 'UpdateAvailable' => 'An update to ZoneMinder is available.', - 'UpdateNotNecessary' => 'No update is necessary.', - 'Updated' => 'Updated', // Added - 2011-06-16 - 'Upload' => 'Upload', // Added - 2011-08-23 - 'UseFilter' => 'Use Filter', + 'Type' => 'Tüüp', + 'Unarchive' => 'Eemalda Arhiivist', + 'Undefined' => 'Defineerimatta', + 'Units' => 'Ãœhikud', + 'Unknown' => 'Tundmatu', + 'Update' => 'Uuenda', + 'UpdateAvailable' => 'Uuendus ZoneMinder-ile saadaval.', + 'UpdateNotNecessary' => 'Uuendus ei ole vajalik.', + 'Updated' => 'Uuendatud', // Added - 2011-06-16 + 'Upload' => 'Ãœles laadimine', // Added - 2011-08-23 + 'UseFilter' => 'Kasuta Filtrit', 'UseFilterExprsPost' => ' filter expressions', // This is used at the end of the phrase 'use N filter expressions' 'UseFilterExprsPre' => 'Use ', // This is used at the beginning of the phrase 'use N filter expressions' - 'User' => 'User', - 'Username' => 'Username', - 'Users' => 'Users', - 'Value' => 'Value', - 'Version' => 'Version', - 'VersionIgnore' => 'Ignore this version', - 'VersionRemindDay' => 'Remind again in 1 day', - 'VersionRemindHour' => 'Remind again in 1 hour', - 'VersionRemindNever' => 'Don\'t remind about new versions', - 'VersionRemindWeek' => 'Remind again in 1 week', + 'User' => 'Kasutaja', + 'Username' => 'Kasutajanimi', + 'Users' => 'Kasutajad', + 'Value' => 'Väärtus', + 'Version' => 'Versioon', + 'VersionIgnore' => 'Ignoreeri See Versioon', + 'VersionRemindDay' => 'Meenuta uuesti päeva pärast', + 'VersionRemindHour' => 'Meenuta uuesti tunni pärast', + 'VersionRemindNever' => 'Ära Meenuta Uuest Versioonist', + 'VersionRemindWeek' => 'Meenuta uuesti nädalapärast', 'Video' => 'Video', - 'VideoFormat' => 'Video Format', - 'VideoGenFailed' => 'Video Generation Failed!', + 'VideoFormat' => 'Video Formaat', + 'VideoGenFailed' => 'Video Genereerimine Ebaõnnestus!!!', 'VideoGenFiles' => 'Existing Video Files', - 'VideoGenNoFiles' => 'No Video Files Found', - 'VideoGenParms' => 'Video Generation Parameters', - 'VideoGenSucceeded' => 'Video Generation Succeeded!', - 'VideoSize' => 'Video Size', - 'View' => 'View', + 'VideoGenNoFiles' => 'Ei Leitud Video Faile', + 'VideoGenParms' => 'Video Genereerimise Parameetrid', + 'VideoGenSucceeded' => 'Video Genereerimine Õnnestus!!!', + 'VideoSize' => 'Video Suurus', + 'View' => 'Vaata', 'ViewAll' => 'View All', - 'ViewEvent' => 'View Event', + 'ViewEvent' => 'Vaata Sündmust', 'ViewPaged' => 'View Paged', 'Wake' => 'Wake', 'WarmupFrames' => 'Warmup Frames', - 'Watch' => 'Watch', - 'Web' => 'Web', - 'WebColour' => 'Web Colour', + 'Watch' => 'Vaata', + 'Web' => 'Veeb', + 'WebColour' => 'Veebi värv', 'Week' => 'Nädalas', 'White' => 'White', 'WhiteBalance' => 'White Balance', @@ -707,12 +712,12 @@ $SLANG = array( 'X10ActivationString' => 'X10 Activation String', 'X10InputAlarmString' => 'X10 Input Alarm String', 'X10OutputAlarmString' => 'X10 Output Alarm String', - 'Y' => 'Y', - 'Yes' => 'Yes', - 'YouNoPerms' => 'You do not have permissions to access this resource.', + 'Y' => 'J', + 'Yes' => 'Jah', + 'YouNoPerms' => 'Sul ei ole õigusi kasutada seda ressurssi.', 'Zone' => 'Tsoon', - 'ZoneAlarmColour' => 'Alarm Colour (Red/Green/Blue)', - 'ZoneArea' => 'Zone Area', + 'ZoneAlarmColour' => 'Alarmi Värv (Red"Punane"/Green"Roheline"/Blue"Sinine")', + 'ZoneArea' => 'Tsooni Ala', 'ZoneFilterSize' => 'Filter Width/Height (pixels)', 'ZoneMinMaxAlarmArea' => 'Min/Max Alarmed Area', 'ZoneMinMaxBlobArea' => 'Min/Max Blob Area', @@ -723,9 +728,9 @@ $SLANG = array( 'ZoneOverloadFrames' => 'Overload Frame Ignore Count', 'ZoneExtendAlarmFrames' => 'Extend Alarm Frame Count', 'Zones' => 'Tsoone', - 'Zoom' => 'Zoom', - 'ZoomIn' => 'Zoom In', - 'ZoomOut' => 'Zoom Out', + 'Zoom' => 'Suurenda', + 'ZoomIn' => 'Suurenda lähemale', + 'ZoomOut' => 'Suurenda kaugemale', ); // Complex replacements with formatting and/or placements, must be passed through sprintf diff --git a/web/lang/fr_fr.php b/web/lang/fr_fr.php index 0bc09ff40..def9d1575 100644 --- a/web/lang/fr_fr.php +++ b/web/lang/fr_fr.php @@ -75,9 +75,9 @@ $SLANG = array( '32BitColour' => 'Couleur 32 bit', // Added - 2011-06-15 '8BitGrey' => 'Gris 8 bit', 'Action' => 'Action', - 'Actual' => 'Réel', + 'Actual' => 'Réel', 'AddNewControl' => 'Add New Control', - 'AddNewMonitor' => 'Aj. nouv. écran', + 'AddNewMonitor' => 'Aj. nouv. écran', 'AddNewUser' => 'Aj. nouv. util.', 'AddNewZone' => 'Aj. nouv. zone', 'Alarm' => 'Alarme', @@ -91,8 +91,8 @@ $SLANG = array( 'Alert' => 'Alerte', 'All' => 'Tous', 'Apply' => 'Appliquer', - 'ApplyingStateChange' => 'Appl. chgt état', - 'ArchArchived' => 'Archivé seul.', + 'ApplyingStateChange' => 'Appl. chgt état', + 'ArchArchived' => 'Archivé seul.', 'ArchUnarchived' => 'Non-arch. seul.', 'Archive' => 'Archiver', 'Archived' => 'Archived', @@ -106,12 +106,12 @@ $SLANG = array( 'AttrDateTime' => 'Date/temps', 'AttrDiskBlocks' => 'Disk Blocks', 'AttrDiskPercent' => 'Disk Percent', - 'AttrDuration' => 'Durée', + 'AttrDuration' => 'Durée', 'AttrFrames' => 'Images', 'AttrId' => 'Id', 'AttrMaxScore' => 'Score max.', - 'AttrMonitorId' => 'N° écran', - 'AttrMonitorName' => 'Nom écran', + 'AttrMonitorId' => 'N° écran', + 'AttrMonitorName' => 'Nom écran', 'AttrName' => 'Name', 'AttrNotes' => 'Notes', 'AttrSystemLoad' => 'System Load', @@ -139,7 +139,7 @@ $SLANG = array( 'BadLabelX' => 'Label X co-ordinate must be set to an integer of zero or more', 'BadLabelY' => 'Label Y co-ordinate must be set to an integer of zero or more', 'BadMaxFPS' => 'Maximum FPS must be a positive integer or floating point value', - 'BadNameChars' => 'Les noms ne peuvent contenir que des lettres, chiffres, trait d\'union ou souligné', + 'BadNameChars' => 'Les noms ne peuvent contenir que des lettres, chiffres, trait d\'union ou souligné', 'BadPalette' => 'Palette must be set to a valid value', // Added - 2009-03-31 'BadPath' => 'Path must be set to a valid value', 'BadPort' => 'Port must be set to a valid number', @@ -157,7 +157,7 @@ $SLANG = array( 'BlobPx' => 'Px forme', 'BlobSizes' => 'Taille forme', 'Blobs' => 'Formes', - 'Brightness' => 'Luminosité;', + 'Brightness' => 'Luminosité;', 'Buffers' => 'Tampons', 'CanAutoFocus' => 'Can Auto Focus', 'CanAutoGain' => 'Can Auto Gain', @@ -204,7 +204,7 @@ $SLANG = array( 'CapturePalette' => 'palette capture', 'CaptureWidth' => 'Larg. capture', 'Cause' => 'Cause', - 'CheckMethod' => 'Méthode vérif. alarme', + 'CheckMethod' => 'Méthode vérif. alarme', 'ChooseDetectedCamera' => 'Choose Detected Camera', // Added - 2009-03-31 'ChooseFilter' => 'Choisir filtre', 'ChooseLogFormat' => 'Choose a log format', // Added - 2011-06-17 @@ -216,7 +216,7 @@ $SLANG = array( 'Command' => 'Command', 'Component' => 'Component', // Added - 2011-06-16 'Config' => 'Config', - 'ConfiguredFor' => 'Configuré pour', + 'ConfiguredFor' => 'Configuré pour', 'ConfirmDeleteEvents' => 'Are you sure you wish to delete the selected events?', 'ConfirmPassword' => 'Confirmer mt de pass.', 'ConjAnd' => 'et', @@ -243,13 +243,13 @@ $SLANG = array( 'Delete' => 'Eff.', 'DeleteAndNext' => 'Eff. & suiv.', 'DeleteAndPrev' => 'Eff. & prec.', - 'DeleteSavedFilter' => 'Eff. filtre sauvé', + 'DeleteSavedFilter' => 'Eff. filtre sauvé', 'Description' => 'Description', 'DetectedCameras' => 'Detected Cameras', // Added - 2009-03-31 'Device' => 'Device', // Added - 2009-02-08 - 'DeviceChannel' => 'Canal caméra', - 'DeviceFormat' => 'Format caméra', - 'DeviceNumber' => 'Numéro caméra', + 'DeviceChannel' => 'Canal caméra', + 'DeviceFormat' => 'Format caméra', + 'DeviceNumber' => 'Numéro caméra', 'DevicePath' => 'Device Path', 'Devices' => 'Devices', 'Dimensions' => 'Dimensions', @@ -269,22 +269,22 @@ $SLANG = array( 'DoNativeMotionDetection'=> 'Do Native Motion Detection', 'Download' => 'Download', 'DuplicateMonitorName' => 'Duplicate Monitor Name', // Added - 2009-03-31 - 'Duration' => 'Durée', + 'Duration' => 'Durée', 'Edit' => 'Editer', 'Email' => 'Courriel', 'EnableAlarms' => 'Enable Alarms', - 'Enabled' => 'Activé', + 'Enabled' => 'Activé', 'EnterNewFilterName' => 'Entrer nom nouv. filtre', 'Error' => 'Erreur', - 'ErrorBrackets' => 'Erreur, vérifiez que toutes les parenthèses ouvertes sont fermées', - 'ErrorValidValue' => 'Erreur, vérifiez que tous les termes ont une valeur valide', + 'ErrorBrackets' => 'Erreur, vérifiez que toutes les parenthèses ouvertes sont fermées', + 'ErrorValidValue' => 'Erreur, vérifiez que tous les termes ont une valeur valide', 'Etc' => 'etc', - 'Event' => 'Evènt', - 'EventFilter' => 'Filtre evènt', + 'Event' => 'Evènt', + 'EventFilter' => 'Filtre evènt', 'EventId' => 'Event Id', 'EventName' => 'Event Name', 'EventPrefix' => 'Event Prefix', - 'Events' => 'Evènts', + 'Events' => 'Evènts', 'Exclude' => 'Exclure', 'Execute' => 'Execute', 'Export' => 'Export', @@ -332,8 +332,8 @@ $SLANG = array( 'ForceAlarm' => 'Force Alarme', 'Format' => 'Format', 'Frame' => 'Image', - 'FrameId' => 'N° image', - 'FrameRate' => 'Débit image', + 'FrameId' => 'N° image', + 'FrameRate' => 'Débit image', 'FrameSkip' => 'Saut image', 'MotionFrameSkip' => 'Motion Frame Skip', 'Frames' => 'images', @@ -341,8 +341,8 @@ $SLANG = array( 'Function' => 'Fonction', 'Gain' => 'Gain', 'General' => 'General', - 'GenerateVideo' => 'Générer Vidéo', - 'GeneratingVideo' => 'Génération Vidéo', + 'GenerateVideo' => 'Générer Vidéo', + 'GeneratingVideo' => 'Génération Vidéo', 'GoToZoneMinder' => 'Aller sur ZoneMinder.com', 'Grey' => 'Gris', 'Group' => 'Group', @@ -363,7 +363,7 @@ $SLANG = array( 'Home' => 'Home', 'Hour' => 'Heure', 'Hue' => 'Teinte', - 'Id' => 'N°', + 'Id' => 'N°', 'Idle' => 'Vide', 'Ignore' => 'Ignorer', 'Image' => 'Image', @@ -371,7 +371,7 @@ $SLANG = array( 'Images' => 'Images', 'In' => 'In', 'Include' => 'Inclure', - 'Inverted' => 'Inversé', + 'Inverted' => 'Inversé', 'Iris' => 'Iris', 'KeyString' => 'Key String', 'Label' => 'Label', @@ -388,11 +388,11 @@ $SLANG = array( 'Load' => 'Load', 'Local' => 'Local', 'Log' => 'Log', // Added - 2011-06-16 - 'LoggedInAs' => 'Connecté cô', + 'LoggedInAs' => 'Connecté cô', 'Logging' => 'Logging', // Added - 2011-06-16 'LoggingIn' => 'Connexion', 'Login' => 'Login', - 'Logout' => 'Déconnexion', + 'Logout' => 'Déconnexion', 'Logs' => 'Logs', // Added - 2011-06-17 'Low' => 'Bas', 'LowBW' => 'Basse N/B', @@ -430,10 +430,10 @@ $SLANG = array( 'Message' => 'Message', // Added - 2011-06-16 'MinAlarmAreaLtMax' => 'Minimum alarm area should be less than maximum', 'MinAlarmAreaUnset' => 'You must specify the minimum alarm pixel count', - 'MinBlobAreaLtMax' => 'Aire blob min. doit ê < aire blob maximum', + 'MinBlobAreaLtMax' => 'Aire blob min. doit ê < aire blob maximum', 'MinBlobAreaUnset' => 'You must specify the minimum blob pixel count', 'MinBlobLtMinFilter' => 'Minimum blob area should be less than or equal to minimum filter area', - 'MinBlobsLtMax' => 'Blobs min. doit ê < blobs max.', + 'MinBlobsLtMax' => 'Blobs min. doit ê < blobs max.', 'MinBlobsUnset' => 'You must specify the minimum blob count', 'MinFilterAreaLtMax' => 'Minimum filter area should be less than maximum', 'MinFilterAreaUnset' => 'You must specify the minimum filter pixel count', @@ -450,7 +450,7 @@ $SLANG = array( 'MinPanRange' => 'Min Pan Range', 'MinPanSpeed' => 'Min Pan Speed', 'MinPanStep' => 'Min Pan Step', - 'MinPixelThresLtMax' => 'Seuil pixel min. doit ê < seuil pixel max.', + 'MinPixelThresLtMax' => 'Seuil pixel min. doit ê < seuil pixel max.', 'MinPixelThresUnset' => 'You must specify a minimum pixel threshold', 'MinTiltRange' => 'Min Tilt Range', 'MinTiltSpeed' => 'Min Tilt Speed', @@ -463,7 +463,7 @@ $SLANG = array( 'MinZoomStep' => 'Min Zoom Step', 'Misc' => 'Div.', 'Monitor' => 'Ecran', - 'MonitorIds' => 'N° écran', + 'MonitorIds' => 'N° Ã©cran', 'MonitorPreset' => 'Monitor Preset', 'MonitorPresetIntro' => 'Select an appropriate preset from the list below.

Please note that this may overwrite any values you already have configured for this monitor.

', 'MonitorProbe' => 'Monitor Probe', // Added - 2009-03-31 @@ -478,27 +478,27 @@ $SLANG = array( 'Mtg3widgrd' => '3-wide grid', // Added 2013.08.15. 'Mtg4widgrd' => '4-wide grid', // Added 2013.08.15. 'Mtg3widgrx' => '3-wide grid, scaled, enlarge on alarm', // Added 2013.08.15. - 'MustBeGe' => 'doit être sup. ou égal à', - 'MustBeLe' => 'doit être inf. ou égal à', + 'MustBeGe' => 'doit être sup. ou égal à', + 'MustBeLe' => 'doit être inf. ou égal à', 'MustConfirmPassword' => 'Confirmez le mot de passe', 'MustSupplyPassword' => 'Entrez un mot de passe', 'MustSupplyUsername' => 'Entrez un nom d\'utilisateur', 'Name' => 'Nom', 'Near' => 'Near', - 'Network' => 'Réseau', + 'Network' => 'Réseau', 'New' => 'Nouv.', 'NewGroup' => 'New Group', 'NewLabel' => 'New Label', 'NewPassword' => 'Nouv. mt de passe', - 'NewState' => 'Nv état', + 'NewState' => 'Nv état', 'NewUser' => 'Nv util.', 'Next' => 'Suiv.', 'No' => 'Non', 'NoDetectedCameras' => 'No Detected Cameras', // Added - 2009-03-31 - 'NoFramesRecorded' => 'Pas d\'image enregistrée pour cet évènement', + 'NoFramesRecorded' => 'Pas d\'image enregistrée pour cet évènement', 'NoGroup' => 'No Group', 'NoSavedFilters' => 'Pasfiltressauv', - 'NoStatisticsRecorded' => 'Pas de statistiques disponibles pour cet évènmnt/imag.', + 'NoStatisticsRecorded' => 'Pas de statistiques disponibles pour cet évènmnt/imag.', 'None' => 'Aucun', 'NoneAvailable' => 'Aucun disponible', 'Normal' => 'Normal', @@ -506,12 +506,12 @@ $SLANG = array( 'NumPresets' => 'Num Presets', 'Off' => 'Off', 'On' => 'On', - 'OpEq' => 'égal à', - 'OpGt' => 'sup. à', - 'OpGtEq' => 'plus grand ou égal à', + 'OpEq' => 'égal à', + 'OpGt' => 'sup. à', + 'OpGtEq' => 'plus grand ou égal à', 'OpIn' => 'en lot', - 'OpLt' => 'inf. à', - 'OpLtEq' => 'inf. ou égal à', + 'OpLt' => 'inf. à', + 'OpLtEq' => 'inf. ou égal à', 'OpMatches' => 'correspond', 'OpNe' => 'diff. de', 'OpNotIn' => 'pas en lot', @@ -530,9 +530,9 @@ $SLANG = array( 'PanLeft' => 'Pan Left', 'PanRight' => 'Pan Right', 'PanTilt' => 'Pan/Tilt', - 'Parameter' => 'Paramètre', + 'Parameter' => 'Paramètre', 'Password' => 'Mt de passe', - 'PasswordsDifferent' => 'Les 2 mots de passe sont différents', + 'PasswordsDifferent' => 'Les 2 mots de passe sont différents', 'Paths' => 'Paths', 'Pause' => 'Pause', 'Phone' => 'Phone', @@ -553,11 +553,11 @@ $SLANG = array( 'Prev' => 'Prec.', 'Probe' => 'Probe', // Added - 2009-03-31 'Protocol' => 'Protocol', - 'Rate' => 'Débit', - 'Real' => 'Réel', + 'Rate' => 'Débit', + 'Real' => 'Réel', 'Record' => 'Enreg.', 'RefImageBlendPct' => 'Reference Image Blend %ge', - 'Refresh' => 'Rafraîchir', + 'Refresh' => 'Rafraîchir', 'Remote' => 'Remote', 'RemoteHostName' => 'Remote Host Name', 'RemoteHostPath' => 'Remote Host Path', @@ -572,10 +572,10 @@ $SLANG = array( 'ReplayGapless' => 'Gapless Events', 'ReplaySingle' => 'Single Event', 'Reset' => 'Reset', - 'ResetEventCounts' => 'Rem. à 0 comptage des évts', - 'Restart' => 'Redémarrer', - 'Restarting' => 'Redémarrage', - 'RestrictedCameraIds' => 'N° caméras confid.', + 'ResetEventCounts' => 'Rem. à 0 comptage des évts', + 'Restart' => 'Redémarrer', + 'Restarting' => 'Redémarrage', + 'RestrictedCameraIds' => 'N° caméras confid.', 'RestrictedMonitors' => 'Restricted Monitors', 'ReturnDelay' => 'Return Delay', 'ReturnLocation' => 'Return Location', @@ -599,9 +599,9 @@ $SLANG = array( 'SelectMonitors' => 'Select Monitors', 'SelfIntersecting' => 'Polygon edges must not intersect', 'Set' => 'Set', - 'SetNewBandwidth' => 'Régler la bande passante', + 'SetNewBandwidth' => 'Régler la bande passante', 'SetPreset' => 'Set Preset', - 'Settings' => 'Réglages', + 'Settings' => 'Réglages', 'ShowFilterWindow' => 'Montrerfen.filtre', 'ShowTimeline' => 'Show Timeline', 'SignalCheckColour' => 'Signal Check Colour', @@ -620,7 +620,7 @@ $SLANG = array( 'SpeedLow' => 'Low Speed', 'SpeedMedium' => 'Medium Speed', 'SpeedTurbo' => 'Turbo Speed', - 'Start' => 'Démarrer', + 'Start' => 'Démarrer', 'State' => 'Etat', 'Stats' => 'Stats', 'Status' => 'Statut', @@ -633,11 +633,11 @@ $SLANG = array( 'StepSmall' => 'Small Step', 'Stills' => 'Photos', 'Stop' => 'Stop', - 'Stopped' => 'Arrêté', + 'Stopped' => 'Arrêté', 'Stream' => 'Flux', 'StreamReplayBuffer' => 'Stream Replay Image Buffer', 'Submit' => 'Submit', - 'System' => 'Système', + 'System' => 'Système', 'SystemLog' => 'System Log', // Added - 2011-06-16 'Tele' => 'Tele', 'Thumbnail' => 'Thumbnail', @@ -660,17 +660,17 @@ $SLANG = array( 'TotalBrScore' => 'Score
total', 'TrackDelay' => 'Track Delay', 'TrackMotion' => 'Track Motion', - 'Triggers' => 'Déclenchements', + 'Triggers' => 'Déclenchements', 'TurboPanSpeed' => 'Turbo Pan Speed', 'TurboTiltSpeed' => 'Turbo Tilt Speed', 'Type' => 'Type', - 'Unarchive' => 'Désarchiv.', + 'Unarchive' => 'Désarchiv.', 'Undefined' => 'Undefined', // Added - 2009-02-08 - 'Units' => 'Unités', + 'Units' => 'Unités', 'Unknown' => 'Inconnu', 'Update' => 'Update', - 'UpdateAvailable' => 'Mise à jour de ZM dispo.', - 'UpdateNotNecessary' => 'Pas de mise à jour dispo.', + 'UpdateAvailable' => 'Mise à jour de ZM dispo.', + 'UpdateNotNecessary' => 'Pas de mise à jour dispo.', 'Updated' => 'Updated', // Added - 2011-06-16 'Upload' => 'Upload', // Added - 2011-08-23 'UsedPlugins' => 'Used Plugins', @@ -687,18 +687,18 @@ $SLANG = array( 'VersionRemindHour' => 'Me rappleler dans 1 h.', 'VersionRemindNever' => 'Ne pas avertir des nvelles versions', 'VersionRemindWeek' => 'Me rappeler ds 1 sem.', - 'Video' => 'Vidéo', + 'Video' => 'Vidéo', 'VideoFormat' => 'Video Format', - 'VideoGenFailed' => 'Echec génération vidéo!', + 'VideoGenFailed' => 'Echec génération vidéo!', 'VideoGenFiles' => 'Existing Video Files', 'VideoGenNoFiles' => 'No Video Files Found', - 'VideoGenParms' => 'Paramètres génération vidéo', + 'VideoGenParms' => 'Paramètres génération vidéo', 'VideoGenSucceeded' => 'Video Generation Succeeded!', - 'VideoSize' => 'taille vidéo', + 'VideoSize' => 'taille vidéo', 'View' => 'Voir', 'ViewAll' => 'Voir tt', 'ViewEvent' => 'View Event', - 'ViewPaged' => 'Vue recherchée', + 'ViewPaged' => 'Vue recherchée', 'Wake' => 'Wake', 'WarmupFrames' => 'Images test', 'Watch' => 'Regarder', @@ -710,12 +710,12 @@ $SLANG = array( 'Wide' => 'Wide', 'X' => 'X', 'X10' => 'X10', - 'X10ActivationString' => 'X10:chaîne activation', - 'X10InputAlarmString' => 'X10:chaîne alarme entrée', - 'X10OutputAlarmString' => 'X10:chaîne alarme sortie', + 'X10ActivationString' => 'X10:chaîne activation', + 'X10InputAlarmString' => 'X10:chaîne alarme entrée', + 'X10OutputAlarmString' => 'X10:chaîne alarme sortie', 'Y' => 'Y', 'Yes' => 'Oui', - 'YouNoPerms' => 'Permissions nécessaires pour cette ressource.', + 'YouNoPerms' => 'Permissions nécessaires pour cette ressource.', 'Zone' => 'Zone', 'ZoneAlarmColour' => 'Couleur alarme (Red/Green/Blue)', 'ZoneArea' => 'Zone Area', @@ -737,12 +737,12 @@ $SLANG = array( // Complex replacements with formatting and/or placements, must be passed through sprintf $CLANG = array( 'CurrentLogin' => 'Util. Actuel: \'%1$s\'', - 'EventCount' => '%1$s %2$s', // par ex. '37 évènts' (voir Vlang ci-dessous) - 'LastEvents' => '%1$s derniers %2$s', // par ex. '37 derniers évènts' (voir Vlang ci-dessous) - 'LatestRelease' => 'La dernière version est v%1$s, vous avez v%2$s.', - 'MonitorCount' => '%1$s %2$s', // par exemple '4 écrans' (voir Vlang ci-dessous) + 'EventCount' => '%1$s %2$s', // par ex. '37 évènts' (voir Vlang ci-dessous) + 'LastEvents' => '%1$s derniers %2$s', // par ex. '37 derniers évènts' (voir Vlang ci-dessous) + 'LatestRelease' => 'La dernière version est v%1$s, vous avez v%2$s.', + 'MonitorCount' => '%1$s %2$s', // par exemple '4 écrans' (voir Vlang ci-dessous) 'MonitorFunction' => 'Ecran %1$s Fonction', - 'RunningRecentVer' => 'Vs avez la dernière version de ZoneMinder, v%s.', + 'RunningRecentVer' => 'Vs avez la dernière version de ZoneMinder, v%s.', 'VersionMismatch' => 'Version mismatch, system is version %1$s, database is %2$s.', // Added - 2011-05-25 ); @@ -780,8 +780,8 @@ $CLANG = array( // Variable arrays expressing plurality, see the zmVlang description above $VLANG = array( - 'Event' => array( 0=>'évènts', 1=>'évènt', 2=>'évènts' ), - 'Monitor' => array( 0=>'écrans', 1=>'écran', 2=>'écrans' ), + 'Event' => array( 0=>'évènts', 1=>'évènt', 2=>'évènts' ), + 'Monitor' => array( 0=>'écrans', 1=>'écran', 2=>'écrans' ), ); // You will need to choose or write a function that can correlate the plurality string arrays diff --git a/web/skins/classic/css/Makefile.am b/web/skins/classic/css/Makefile.am index 5b0cbe135..be278f7b4 100644 --- a/web/skins/classic/css/Makefile.am +++ b/web/skins/classic/css/Makefile.am @@ -2,7 +2,4 @@ AUTOMAKE_OPTIONS = gnu webdir = @WEB_PREFIX@/skins/classic/css -dist_web_DATA = \ - skin.css \ - control.css \ - export.css +SUBDIRS = classic diff --git a/web/skins/classic/css/classic/Makefile.am b/web/skins/classic/css/classic/Makefile.am new file mode 100644 index 000000000..48dc58ab7 --- /dev/null +++ b/web/skins/classic/css/classic/Makefile.am @@ -0,0 +1,10 @@ +AUTOMAKE_OPTIONS = gnu + +webdir = @WEB_PREFIX@/skins/classic/css/classic + +SUBDIRS = views + +dist_web_DATA = \ + skin.css \ + control.css \ + export.css diff --git a/web/skins/classic/css/control.css b/web/skins/classic/css/classic/control.css similarity index 100% rename from web/skins/classic/css/control.css rename to web/skins/classic/css/classic/control.css diff --git a/web/skins/classic/css/export.css b/web/skins/classic/css/classic/export.css similarity index 100% rename from web/skins/classic/css/export.css rename to web/skins/classic/css/classic/export.css diff --git a/web/skins/classic/css/skin.css b/web/skins/classic/css/classic/skin.css similarity index 100% rename from web/skins/classic/css/skin.css rename to web/skins/classic/css/classic/skin.css diff --git a/web/skins/classic/views/css/Makefile.am b/web/skins/classic/css/classic/views/Makefile.am similarity index 89% rename from web/skins/classic/views/css/Makefile.am rename to web/skins/classic/css/classic/views/Makefile.am index 39c270cf7..d07eaac4f 100644 --- a/web/skins/classic/views/css/Makefile.am +++ b/web/skins/classic/css/classic/views/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = gnu -webdir = @WEB_PREFIX@/skins/classic/views/css +webdir = @WEB_PREFIX@/skins/classic/css/classic/views dist_web_DATA = \ console.css \ diff --git a/web/skins/classic/views/css/console.css b/web/skins/classic/css/classic/views/console.css similarity index 100% rename from web/skins/classic/views/css/console.css rename to web/skins/classic/css/classic/views/console.css diff --git a/web/skins/classic/views/css/control.css b/web/skins/classic/css/classic/views/control.css similarity index 100% rename from web/skins/classic/views/css/control.css rename to web/skins/classic/css/classic/views/control.css diff --git a/web/skins/classic/views/css/controlcaps.css b/web/skins/classic/css/classic/views/controlcaps.css similarity index 100% rename from web/skins/classic/views/css/controlcaps.css rename to web/skins/classic/css/classic/views/controlcaps.css diff --git a/web/skins/classic/views/css/devices.css b/web/skins/classic/css/classic/views/devices.css similarity index 100% rename from web/skins/classic/views/css/devices.css rename to web/skins/classic/css/classic/views/devices.css diff --git a/web/skins/classic/views/css/event.css b/web/skins/classic/css/classic/views/event.css similarity index 100% rename from web/skins/classic/views/css/event.css rename to web/skins/classic/css/classic/views/event.css diff --git a/web/skins/classic/views/css/events.css b/web/skins/classic/css/classic/views/events.css similarity index 100% rename from web/skins/classic/views/css/events.css rename to web/skins/classic/css/classic/views/events.css diff --git a/web/skins/classic/views/css/export.css b/web/skins/classic/css/classic/views/export.css similarity index 100% rename from web/skins/classic/views/css/export.css rename to web/skins/classic/css/classic/views/export.css diff --git a/web/skins/classic/views/css/filter.css b/web/skins/classic/css/classic/views/filter.css similarity index 100% rename from web/skins/classic/views/css/filter.css rename to web/skins/classic/css/classic/views/filter.css diff --git a/web/skins/classic/views/css/frame.css b/web/skins/classic/css/classic/views/frame.css similarity index 100% rename from web/skins/classic/views/css/frame.css rename to web/skins/classic/css/classic/views/frame.css diff --git a/web/skins/classic/views/css/frames.css b/web/skins/classic/css/classic/views/frames.css similarity index 100% rename from web/skins/classic/views/css/frames.css rename to web/skins/classic/css/classic/views/frames.css diff --git a/web/skins/classic/views/css/groups.css b/web/skins/classic/css/classic/views/groups.css similarity index 100% rename from web/skins/classic/views/css/groups.css rename to web/skins/classic/css/classic/views/groups.css diff --git a/web/skins/classic/views/css/log.css b/web/skins/classic/css/classic/views/log.css similarity index 100% rename from web/skins/classic/views/css/log.css rename to web/skins/classic/css/classic/views/log.css diff --git a/web/skins/classic/views/css/monitor.css b/web/skins/classic/css/classic/views/monitor.css similarity index 100% rename from web/skins/classic/views/css/monitor.css rename to web/skins/classic/css/classic/views/monitor.css diff --git a/web/skins/classic/views/css/montage.css b/web/skins/classic/css/classic/views/montage.css similarity index 100% rename from web/skins/classic/views/css/montage.css rename to web/skins/classic/css/classic/views/montage.css diff --git a/web/skins/classic/views/css/montage_2wide.css b/web/skins/classic/css/classic/views/montage_2wide.css similarity index 100% rename from web/skins/classic/views/css/montage_2wide.css rename to web/skins/classic/css/classic/views/montage_2wide.css diff --git a/web/skins/classic/views/css/montage_3wide.css b/web/skins/classic/css/classic/views/montage_3wide.css similarity index 100% rename from web/skins/classic/views/css/montage_3wide.css rename to web/skins/classic/css/classic/views/montage_3wide.css diff --git a/web/skins/classic/views/css/montage_3wide50enlarge.css b/web/skins/classic/css/classic/views/montage_3wide50enlarge.css similarity index 100% rename from web/skins/classic/views/css/montage_3wide50enlarge.css rename to web/skins/classic/css/classic/views/montage_3wide50enlarge.css diff --git a/web/skins/classic/views/css/montage_4wide.css b/web/skins/classic/css/classic/views/montage_4wide.css similarity index 100% rename from web/skins/classic/views/css/montage_4wide.css rename to web/skins/classic/css/classic/views/montage_4wide.css diff --git a/web/skins/classic/views/css/montage_freeform.css b/web/skins/classic/css/classic/views/montage_freeform.css similarity index 100% rename from web/skins/classic/views/css/montage_freeform.css rename to web/skins/classic/css/classic/views/montage_freeform.css diff --git a/web/skins/classic/views/css/options.css b/web/skins/classic/css/classic/views/options.css similarity index 100% rename from web/skins/classic/views/css/options.css rename to web/skins/classic/css/classic/views/options.css diff --git a/web/skins/classic/views/css/plugin.css b/web/skins/classic/css/classic/views/plugin.css similarity index 100% rename from web/skins/classic/views/css/plugin.css rename to web/skins/classic/css/classic/views/plugin.css diff --git a/web/skins/classic/views/css/stats.css b/web/skins/classic/css/classic/views/stats.css similarity index 100% rename from web/skins/classic/views/css/stats.css rename to web/skins/classic/css/classic/views/stats.css diff --git a/web/skins/classic/views/css/timeline.css b/web/skins/classic/css/classic/views/timeline.css similarity index 100% rename from web/skins/classic/views/css/timeline.css rename to web/skins/classic/css/classic/views/timeline.css diff --git a/web/skins/classic/views/css/timeline.css.php b/web/skins/classic/css/classic/views/timeline.css.php similarity index 100% rename from web/skins/classic/views/css/timeline.css.php rename to web/skins/classic/css/classic/views/timeline.css.php diff --git a/web/skins/classic/views/css/video.css b/web/skins/classic/css/classic/views/video.css similarity index 100% rename from web/skins/classic/views/css/video.css rename to web/skins/classic/css/classic/views/video.css diff --git a/web/skins/classic/views/css/watch.css b/web/skins/classic/css/classic/views/watch.css similarity index 100% rename from web/skins/classic/views/css/watch.css rename to web/skins/classic/css/classic/views/watch.css diff --git a/web/skins/classic/views/css/zone.css b/web/skins/classic/css/classic/views/zone.css similarity index 100% rename from web/skins/classic/views/css/zone.css rename to web/skins/classic/css/classic/views/zone.css diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 66be5c668..8b329cd88 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -20,14 +20,16 @@ function xhtmlHeaders( $file, $title ) { - $skinCssFile = getSkinFile( 'css/skin.css' ); - $skinCssPhpFile = getSkinFile( 'css/skin.css.php' ); + global $css; + $skinCssFile = getSkinFile( 'css/'.$css.'/skin.css' ); + $skinCssPhpFile = getSkinFile( 'css/'.$css.'/skin.css.php' ); + $skinJsFile = getSkinFile( 'js/skin.js' ); $skinJsPhpFile = getSkinFile( 'js/skin.js.php' ); $basename = basename( $file, '.php' ); - $viewCssFile = getSkinFile( 'views/css/'.$basename.'.css' ); - $viewCssPhpFile = getSkinFile( 'views/css/'.$basename.'.css.php' ); + $viewCssFile = getSkinFile( '/css/'.$css.'/views/'.$basename.'.css' ); + $viewCssPhpFile = getSkinFile( '/css/'.$css.'/views/'.$basename.'.css.php' ); $viewJsFile = getSkinFile( 'views/js/'.$basename.'.js' ); $viewJsPhpFile = getSkinFile( 'views/js/'.$basename.'.js.php' ); diff --git a/web/skins/classic/views/Makefile.am b/web/skins/classic/views/Makefile.am index 58c72b78f..5cd01dcc3 100644 --- a/web/skins/classic/views/Makefile.am +++ b/web/skins/classic/views/Makefile.am @@ -1,7 +1,6 @@ AUTOMAKE_OPTIONS = gnu SUBDIRS = \ - css \ js webdir = @WEB_PREFIX@/skins/classic/views diff --git a/web/skins/classic/views/console.php b/web/skins/classic/views/console.php index 001d56e2d..ffe6f8821 100644 --- a/web/skins/classic/views/console.php +++ b/web/skins/classic/views/console.php @@ -190,7 +190,7 @@ xhtmlHeaders( __FILE__, $SLANG['Console'] );

: / : %

ZoneMinder - - v'.ZM_VERSION.'', canEdit( 'System' ) ) ?>

-
+
onclick="configureButtons( this );"/> - + onclick="configureButtons( this );"/> - +
diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index 34f6fc6f1..cf012ec52 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -83,11 +83,20 @@ foreach ( $tabs as $name=>$value ) window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\""; + $reload = true; } + $current_css = $_COOKIE['zmCSS']; + if ( isset($_GET['css-choice']) and ( $_GET['css-choice'] != $current_css ) ) { + setcookie('zmCSS',$_GET['css-choice'], time()+3600*24*30*12*10 ); + //header("Location: index.php?view=options&tab=skins&reset_parent=1"); + $reload = true; + } + if ( $reload ) + echo ""; ?>
@@ -96,17 +105,33 @@ if($tab == 'skins') { - - - + + + + + + + + + + +
ZM_SKIN -
ZM_SKIN +
ZM_CSS +
/> diff --git a/web/skins/flat/js/skin.js b/web/skins/flat/js/skin.js index 8087bc348..cc1476a9a 100644 --- a/web/skins/flat/js/skin.js +++ b/web/skins/flat/js/skin.js @@ -306,8 +306,5 @@ if ( focusWindow ) { windowToFront(); } -<<<<<<< HEAD -======= ->>>>>>> release-1.28 window.addEvent( 'domready', checkSize); diff --git a/web/skins/flat/views/console.php b/web/skins/flat/views/console.php index 27228444d..ffe6f8821 100644 --- a/web/skins/flat/views/console.php +++ b/web/skins/flat/views/console.php @@ -73,7 +73,7 @@ $status = $running?$SLANG['Running']:$SLANG['Stopped']; $group = NULL; if ( ! empty($_COOKIE['zmGroup']) ) { - if ( $group = dbFetchOne( 'SELECT * FROM Groups WHERE Id = ?', NULL, array($_COOKIE['zmGroup']) ) ) + if ( $group = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_COOKIE['zmGroup'])) ) $groupIds = array_flip(explode( ',', $group['MonitorIds'] )); } @@ -85,7 +85,7 @@ $cycleCount = 0; $minSequence = 0; $maxSequence = 1; $seqIdList = array(); -$monitors = dbFetchAll( 'SELECT * FROM Monitors ORDER BY Sequence ASC' ); +$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" ); $displayMonitors = array(); for ( $i = 0; $i < count($monitors); $i++ ) { @@ -108,7 +108,7 @@ for ( $i = 0; $i < count($monitors); $i++ ) } $monitors[$i]['zmc'] = zmcStatus( $monitors[$i] ); $monitors[$i]['zma'] = zmaStatus( $monitors[$i] ); - $monitors[$i]['ZoneCount'] = dbFetchOne( 'SELECT count(Id) AS ZoneCount FROM Zones WHERE MonitorId = ?', 'ZoneCount', array( $monitors[$i]['Id'] ) ); + $monitors[$i]['ZoneCount'] = dbFetchOne( 'select count(Id) as ZoneCount from Zones where MonitorId = ?', 'ZoneCount', array($monitors[$i]['Id']) ); $counts = array(); for ( $j = 0; $j < count($eventCounts); $j++ ) { @@ -117,8 +117,8 @@ for ( $i = 0; $i < count($monitors); $i++ ) $counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j"; $monitors[$i]['eventCounts'][$j]['filter'] = $filter; } - $sql = 'SELECT '.join($counts,', ').' FROM Events AS E WHERE MonitorId = ?'; - $counts = dbFetchOne( $sql, NULL, array( $monitors[$i]['Id'] ) ); + $sql = "select ".join($counts,", ")." from Events as E where MonitorId = ?"; + $counts = dbFetchOne( $sql, NULL, array($monitors[$i]['Id']) ); if ( $monitors[$i]['Function'] != 'None' ) { $cycleCount++; @@ -190,7 +190,7 @@ xhtmlHeaders( __FILE__, $SLANG['Console'] );

: / : %

ZoneMinder - - v'.ZM_VERSION.'', canEdit( 'System' ) ) ?>

-
+
  +?> 
@@ -302,7 +302,7 @@ foreach( $displayMonitors as $monitor ) $scale = max( reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); ?> - + diff --git a/web/skins/flat/views/groups.php b/web/skins/flat/views/groups.php index 87f8b9ebe..70dc79f9c 100644 --- a/web/skins/flat/views/groups.php +++ b/web/skins/flat/views/groups.php @@ -18,11 +18,6 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // -if ( !canView( 'System' ) ) -{ - $view = "error"; - return; -} $sql = "select * from Groups order by Name"; $groups = array(); @@ -66,18 +61,13 @@ xhtmlHeaders(__FILE__, $SLANG['Groups'] ); - + - +
'.$monitor['Function'].( empty($monitor['Enabled']) ? ', disabled' : '' ).'', canEdit( 'Monitors' ) ) ?>'.$SLANG['Fn'.$monitor['Function']].( empty($monitor['Enabled']) ? ', disabled' : '' ) .'', canEdit( 'Monitors' ) ) ?> '.$monitor['Device'].' ('.$monitor['Channel'].')', canEdit( 'Monitors' ) ) ?> onclick="configureButtons( this );"/>
onclick="configureButtons( this );"/>