Merge remote-tracking branch 'upstream/master' into feature-h264-videostorage
This commit is contained in:
commit
2712da614e
|
@ -12,3 +12,52 @@ scripts/ZoneMinder/blib
|
|||
Makefile.in
|
||||
Makefile
|
||||
docs/_build
|
||||
|
||||
config.guess
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
db/zm_create.sql
|
||||
misc/apache.conf
|
||||
misc/com.zoneminder.systemctl.policy
|
||||
misc/com.zoneminder.systemctl.rules
|
||||
misc/logrotate.conf
|
||||
misc/syslog.conf
|
||||
scripts/ZoneMinder/MYMETA.yml
|
||||
scripts/ZoneMinder/lib/ZoneMinder/Base.pm
|
||||
scripts/ZoneMinder/lib/ZoneMinder/Config.pm
|
||||
scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm
|
||||
scripts/ZoneMinder/lib/ZoneMinder/Memory.pm
|
||||
scripts/ZoneMinder/pm_to_blib
|
||||
scripts/zm
|
||||
scripts/zmaudit.pl
|
||||
scripts/zmcamtool.pl
|
||||
scripts/zmcontrol.pl
|
||||
scripts/zmdbbackup
|
||||
scripts/zmdbrestore
|
||||
scripts/zmdc.pl
|
||||
scripts/zmeventdump
|
||||
scripts/zmfilter.pl
|
||||
scripts/zmlogrotate.conf
|
||||
scripts/zmpkg.pl
|
||||
scripts/zmsystemctl.pl
|
||||
scripts/zmtrack.pl
|
||||
scripts/zmtrigger.pl
|
||||
scripts/zmupdate.pl
|
||||
scripts/zmvideo.pl
|
||||
scripts/zmwatch.pl
|
||||
scripts/zmx10.pl
|
||||
src/.deps/
|
||||
src/*.o
|
||||
src/zm_config.h
|
||||
src/zm_config_defines.h
|
||||
src/zma
|
||||
src/zmc
|
||||
src/zmf
|
||||
src/zms
|
||||
src/zmstreamer
|
||||
src/zmu
|
||||
web/includes/config.php
|
||||
zm.conf
|
||||
zmconfgen.pl
|
||||
|
|
|
@ -18,9 +18,9 @@ compiler:
|
|||
- gcc
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev 2>&1 > /dev/null
|
||||
- sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev libvlccore5 libvlc5 2>&1 > /dev/null
|
||||
install:
|
||||
- git clone -b n2.4.1 --depth=1 git://source.ffmpeg.org/ffmpeg.git
|
||||
- git clone -b n2.4.2 --depth=1 git://source.ffmpeg.org/ffmpeg.git
|
||||
- cd ffmpeg
|
||||
- ./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora
|
||||
- make -j `grep processor /proc/cpuinfo|wc -l`
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
project (zoneminder)
|
||||
set(zoneminder_VERSION "1.27.99.0")
|
||||
set(zoneminder_VERSION "1.28.0")
|
||||
|
||||
# CMake does not allow out-of-source build if CMakeCache.exists in the source folder. Abort and notify the user to save him from headache why it doesn't work.
|
||||
if((NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)) AND (EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt"))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
AC_PREREQ(2.59)
|
||||
AC_INIT(zm,1.27.99.0,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
|
||||
AC_INIT(zm,1.28.0,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_SRCDIR(src/zm.h)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
|
|
@ -1,3 +1,27 @@
|
|||
ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`;
|
||||
ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`;
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'Monitors'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'Colours'
|
||||
) > 0,
|
||||
"SELECT 'Column Colours exists in Monitors'",
|
||||
"ALTER TABLE `Monitors` ADD `Colours` TINYINT UNSIGNED NOT NULL DEFAULT '1' AFTER `Height`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'Monitors'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'Deinterlacing'
|
||||
) > 0,
|
||||
"SELECT 'Column Deinterlacing exists in Monitors'",
|
||||
"ALTER TABLE `Monitors` ADD `Deinterlacing` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `Orientation`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
--
|
||||
-- This updates a 1.27.99 database to 1.28.0
|
||||
--
|
||||
-- No changes required
|
||||
--
|
||||
|
|
@ -1,3 +1,9 @@
|
|||
zoneminder (1.28.0-wheezy) wheezy; urgency=medium
|
||||
|
||||
* Release
|
||||
|
||||
-- Isaac Connor <iconnor@connortechnology.com> Fri, 17 Oct 2014 09:27:22 -0400
|
||||
|
||||
zoneminder (1.27.99+1-testing-SNAPSHOT2014072901) testing; urgency=medium
|
||||
|
||||
* improve error messages
|
||||
|
|
|
@ -93,7 +93,7 @@ fi
|
|||
/usr/bin/gpasswd -a %{zmuid_final} dialout
|
||||
|
||||
# Display the README for post installation instructions
|
||||
/usr/bin/less %{_docdir}/%{name}-%{version}/README.Fedora
|
||||
/usr/bin/less %{_docdir}/%{name}/README.Fedora
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
zoneminder (1.28.0-trusty) trusty; urgency=medium
|
||||
|
||||
* Release
|
||||
|
||||
-- Isaac Connor <iconnor@connortechnology.com> Fri, 17 Oct 2014 09:25:55 -0400
|
||||
|
||||
zoneminder (1.27.99+1-trusty-SNAPSHOT2014101401) trusty; urgency=medium
|
||||
|
||||
* Several PR merges in big push for 1.28.0
|
||||
|
|
|
@ -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
|
||||
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
|
||||
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
|
||||
|
|
|
@ -38,8 +38,6 @@ require ZoneMinder::Control;
|
|||
|
||||
our @ISA = qw(ZoneMinder::Control);
|
||||
|
||||
our $VERSION = $ZoneMinder::Base::VERSION;
|
||||
|
||||
# ==========================================================================
|
||||
#
|
||||
# Axis V2 Control Protocol
|
||||
|
@ -52,8 +50,7 @@ use ZoneMinder::Config qw(:all);
|
|||
use Time::HiRes qw( usleep );
|
||||
use URI::Encode qw();
|
||||
|
||||
sub new
|
||||
{
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $id = shift;
|
||||
my $self = ZoneMinder::Control->new( $id );
|
||||
|
@ -64,8 +61,7 @@ sub new
|
|||
|
||||
our $AUTOLOAD;
|
||||
|
||||
sub AUTOLOAD
|
||||
{
|
||||
sub AUTOLOAD {
|
||||
my $self = shift;
|
||||
my $class = ref($self) || croak( "$self not object" );
|
||||
my $name = $AUTOLOAD;
|
||||
|
@ -111,8 +107,14 @@ sub sendCmd {
|
|||
printMsg( $cmd, "Tx" );
|
||||
#print( "http://$address/$cmd\n" );
|
||||
#my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd" );
|
||||
my $url = 'http://'.$self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time;
|
||||
Debug("Url: $url $cmd");
|
||||
|
||||
my $url;
|
||||
if ( $self->{Monitor}->{ControlAddress} =~ /^http/ ) {
|
||||
$url = $self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time;
|
||||
} else {
|
||||
$url = 'http://'.$self->{Monitor}->{ControlAddress}.'/cgi-bin/setGPIO.cgi?preventCache='.time;
|
||||
} # en dif
|
||||
Error("Url: $url $cmd");
|
||||
my $uri = URI::Encode->new( { encode_reserved => 0 } );
|
||||
my $encoded = $uri->encode( $cmd );
|
||||
my $res = $self->{ua}->post( $url, Content=>"data=$encoded" );
|
||||
|
|
|
@ -0,0 +1,504 @@
|
|||
# =========================================================================
|
||||
#
|
||||
# ZoneMinder Trendnet TV-IP862IC IP Control Protocol Module, $Date: $, $Revision: $
|
||||
# Copyright (C) 2014 Vincent Giovannone
|
||||
#
|
||||
#
|
||||
# ==========================================================================
|
||||
#
|
||||
# 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 Trendnet TV-IP672PI IP camera control
|
||||
# protocol. Also works or TV-IP862IC
|
||||
#
|
||||
#
|
||||
#
|
||||
# For Zoneminder 1.26+
|
||||
#
|
||||
# Under control capability:
|
||||
#
|
||||
# * Main: name it (suggest TVIP672PI), type is FFMPEG (or remote if you're using MJPEG), protocol is TVIP672PI
|
||||
# * Main (more): Can wake, can sleep, can reset
|
||||
# * Move: Can move, can move diagonally, can move mapped, can move relative
|
||||
# * Pan: Can pan
|
||||
# * Tilt: Can tilt
|
||||
# * Presets: Has presets, num presets 20, has home preset (don't set presets via camera's web server, only set via ZM.)
|
||||
#
|
||||
# Under control tab in the monitor itself:
|
||||
#
|
||||
# * Controllable
|
||||
# * Control type is the name you gave it in control capability above
|
||||
# * Control device is the password you use to authenticate to the camera (see further below if you need to change the username from "admin")
|
||||
# * Control address is the camera's ip address AND web port. example: 192.168.1.1:80
|
||||
#
|
||||
#
|
||||
# If using with anything but a TV-IP672PI (ex: TV-IP672WI), YOU MUST MATCH THE REALM TO MATCH YOUR CAMERA FURTHER DOWN!
|
||||
#
|
||||
#
|
||||
# Due to how the TVIP672 represents presets internally, you MUST define the presets in order... i.e. 1,2,3,4... not 1,10,3,4.
|
||||
# (see much further down for why, if you care...)
|
||||
#
|
||||
|
||||
|
||||
package ZoneMinder::Control::TVIP862;
|
||||
|
||||
use 5.006;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require ZoneMinder::Base;
|
||||
require ZoneMinder::Control;
|
||||
|
||||
our @ISA = qw(ZoneMinder::Control);
|
||||
|
||||
#
|
||||
# ******** YOU MUST CHANGE THE FOLLOWING LINES TO MATCH YOUR CAMERA! **********
|
||||
#
|
||||
# I assume that "TV-IP672WI" would work for the TV-IP672WI, but can't test since I don't own one.
|
||||
#
|
||||
# TV-IP672PI works for the PI version, of course.
|
||||
#
|
||||
# Finally, the username is the username you'd like to authenticate as.
|
||||
#
|
||||
our $REALM = "TV-IP862IC";
|
||||
our $USERNAME = "admin";
|
||||
|
||||
|
||||
# ==========================================================================
|
||||
#
|
||||
# Trendnet TV-IP672PI 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/".$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
|
||||
{
|
||||
|
||||
# This routine is used for all moving, which are all GET commands...
|
||||
|
||||
my $self = shift;
|
||||
my $cmd = shift;
|
||||
|
||||
my $result = undef;
|
||||
|
||||
Debug ( $cmd, "Tx" );
|
||||
|
||||
my $ua = LWP::UserAgent->new();
|
||||
|
||||
my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/cgi/ptdc.cgi?command=".$cmd );
|
||||
|
||||
# credentials: ("ip:port" (no prefix!), realm (string), username (string), password (string)
|
||||
$self->{ua}->credentials($self->{Monitor}->{ControlAddress},$REALM,$USERNAME,$self->{Monitor}->{ControlDevice});
|
||||
|
||||
Debug ( "sendCmd credentials control address:'".$self->{Monitor}->{ControlAddress}."' realm:'" . $REALM . "' username:'" . $USERNAME . "' password:'".$self->{Monitor}->{ControlDevice}."'");
|
||||
|
||||
Debug ("sendCmd command: " . $cmd);
|
||||
|
||||
my $res = $self->{ua}->request($req);
|
||||
|
||||
if ( $res->is_success ) {
|
||||
$result = !undef;
|
||||
} else {
|
||||
if ( $res->status_line() eq '401 Unauthorized' ) {
|
||||
Error( "Error check failed, trying again: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} );
|
||||
my $res = $self->{ua}->request($req);
|
||||
if ( $res->is_success ) {
|
||||
$result = !undef;
|
||||
}
|
||||
}
|
||||
if ( ! $result ) {
|
||||
Error( "Error check failed: '".$res->status_line()."' cmd:'".$cmd."'" );
|
||||
}
|
||||
}
|
||||
|
||||
return( $result );
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub sendCmdPost
|
||||
{
|
||||
|
||||
#
|
||||
# This routine is used for setting/clearing presets and IR commands, which are POST commands...
|
||||
#
|
||||
|
||||
my $self = shift;
|
||||
my $url = shift;
|
||||
my $cmd = shift;
|
||||
|
||||
my $result = undef;
|
||||
|
||||
|
||||
if ($url eq undef)
|
||||
{
|
||||
Error ("url passed to sendCmdPost is undefined.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
Debug ("sendCmdPost url: " . $url . " cmd: " . $cmd);
|
||||
|
||||
my $ua = LWP::UserAgent->new();
|
||||
|
||||
my $req = HTTP::Request->new(POST => "http://".$self->{Monitor}->{ControlAddress}.$url);
|
||||
$req->content_type('application/x-www-form-urlencoded');
|
||||
$req->content($cmd);
|
||||
|
||||
$self->{ua}->credentials($self->{Monitor}->{ControlAddress},$REALM,$USERNAME,$self->{Monitor}->{ControlDevice});
|
||||
|
||||
Debug ( "sendCmdPost credentials control address:'".$self->{Monitor}->{ControlAddress}."' realm:'" . $REALM . "' username:'" . $USERNAME . "'
|
||||
password:'".$self->{Monitor}->{ControlDevice}."'");
|
||||
|
||||
my $res = $self->{ua}->request($req);
|
||||
|
||||
if ( $res->is_success )
|
||||
{
|
||||
$result = !undef;
|
||||
}
|
||||
else
|
||||
{
|
||||
Error( "Error check failed: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} );
|
||||
Error( "Error check failed: '".$res->status_line()."' cmd:'".$cmd."'" );
|
||||
if ( $res->status_line() eq '401 Unauthorized' ) {
|
||||
Error( "Error check failed: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} );
|
||||
} else {
|
||||
Error( "Error check failed: USERNAME: $USERNAME realm: $REALM password: " . $self->{Monitor}->{ControlDevice} );
|
||||
} # endif
|
||||
}
|
||||
|
||||
return( $result );
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub move
|
||||
{
|
||||
my $self = shift;
|
||||
my $panSteps = shift;
|
||||
my $tiltSteps = shift;
|
||||
|
||||
my $cmd = "set_relative_pos&posX=$panSteps&posY=$tiltSteps";
|
||||
$self->sendCmd( $cmd );
|
||||
}
|
||||
|
||||
sub moveRelUpLeft
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Up Left" );
|
||||
$self->move(-3, 3);
|
||||
}
|
||||
|
||||
sub moveRelUp
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Up" );
|
||||
$self->move(0, 3);
|
||||
}
|
||||
|
||||
sub moveRelUpRight
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Up Right" );
|
||||
$self->move(3, 3);
|
||||
}
|
||||
|
||||
sub moveRelLeft
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Left" );
|
||||
$self->move(-3, 0);
|
||||
}
|
||||
|
||||
sub moveRelRight
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Right" );
|
||||
$self->move(3, 0);
|
||||
}
|
||||
|
||||
sub moveRelDownLeft
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Down Left" );
|
||||
$self->move(-3, -3);
|
||||
}
|
||||
|
||||
sub moveRelDown
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Down" );
|
||||
$self->move(0, -3);
|
||||
}
|
||||
|
||||
sub moveRelDownRight
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Move Down Right" );
|
||||
$self->move(3, -3);
|
||||
}
|
||||
|
||||
|
||||
# moves the camera to center on the point that the user clicked on in the video image.
|
||||
# This isn't mega accurate but good enough for most purposes
|
||||
|
||||
sub moveMap
|
||||
{
|
||||
|
||||
# If the camera moves too much, increase hscale and vscale. (...if it doesn't move enough, try decreasing!)
|
||||
# They scale the movement and are here to compensate for manufacturing variation.
|
||||
# It's never going to be perfect, so just get somewhere in the ballpark and call it a day.
|
||||
# (Don't forget to kill the zmcontrol process while tweaking!)
|
||||
|
||||
# 1280x800
|
||||
my $hscale = 31;
|
||||
my $vscale = 25;
|
||||
|
||||
# 1280x800 with fisheye
|
||||
#my $hscale = 15;
|
||||
#my $vscale = 15;
|
||||
|
||||
# 640x400
|
||||
#my $hscale = 14;
|
||||
#my $vscale = 12;
|
||||
|
||||
|
||||
my $self = shift;
|
||||
my $params = shift;
|
||||
my $xcoord = $self->getParam( $params, 'xcoord' );
|
||||
my $ycoord = $self->getParam( $params, 'ycoord' );
|
||||
|
||||
my $hor = ($xcoord - ($self->{Monitor}->{Width} / 2))/$hscale;
|
||||
my $ver = ($ycoord - ($self->{Monitor}->{Height} / 2))/$vscale;
|
||||
|
||||
$hor = int($hor);
|
||||
$ver = -1 * int($ver);
|
||||
|
||||
Debug( "Move Map to $xcoord,$ycoord, hor=$hor, ver=$ver" );
|
||||
$self->move( $hor, $ver );
|
||||
}
|
||||
|
||||
|
||||
# **** PRESETS ****
|
||||
#
|
||||
# OK, presets work a little funky but they DO work, provided you define them in order and don't skip any.
|
||||
#
|
||||
# The problem is that when you load the web page for this camera, it gives a list of preset names tied to index numbers.
|
||||
# So let's say you have four presets... A, B, C, and D, and defined them in that order.
|
||||
# So A is index 0, B is index 1, C is index 2, D is index 3. When you tell the camera to go to a preset, you actually tell it by number, not by name.
|
||||
# (So "Go to D" is really "go to index 3".)
|
||||
#
|
||||
# Now let's say somebody deletes C via the camera's web GUI. The camera re-numbers the existing presets A=0, B=1, D=2.
|
||||
# There's really no easy way for ZM to discover this re-numbering, so zoneminder would still send "go to preset 3" thinking
|
||||
# it's telling the camera to go to point D. In actuality it's telling the camera to go to a preset that no longer exists.
|
||||
#
|
||||
# As long as you define your presets in order (i.e. define preset 1, then preset 2, then preset 3, etc.) everything will work just
|
||||
# fine in ZoneMinder.
|
||||
#
|
||||
# (Home preset needs to be set via the camera's web gui, and is unaffected by any of this.)
|
||||
#
|
||||
# So that's the limitation: DEFINE YOUR PRESETS IN ORDER THROUGH (and only through!) ZM AND DON'T SKIP ANY.
|
||||
#
|
||||
|
||||
|
||||
sub presetClear
|
||||
{
|
||||
my $self = shift;
|
||||
my $params = shift;
|
||||
my $preset = $self->getParam( $params, 'preset' );
|
||||
my $cmd = "presetName=$preset&command=del";
|
||||
my $url = "/eng/admin/cam_control.cgi";
|
||||
Debug ("presetClear: " . $preset . " cmd: " . $cmd);
|
||||
$self->sendCmdPost($url,$cmd);
|
||||
}
|
||||
|
||||
|
||||
sub presetSet
|
||||
{
|
||||
my $self = shift;
|
||||
my $params = shift;
|
||||
my $preset = $self->getParam( $params, 'preset' );
|
||||
my $cmd = "presetName=$preset&command=add";
|
||||
my $url = "/eng/admin/cam_control.cgi";
|
||||
Debug ("presetSet " . $preset . " cmd: " . $cmd);
|
||||
$self->sendCmdPost ($url,$cmd);
|
||||
}
|
||||
|
||||
sub presetGoto
|
||||
{
|
||||
my $self = shift;
|
||||
my $params = shift;
|
||||
my $preset = $self->getParam( $params, 'preset' );
|
||||
$preset = $preset - 1;
|
||||
Debug( "Goto Preset $preset" );
|
||||
my $cmd = "goto_preset_position&index=$preset";
|
||||
$self->sendCmd( $cmd );
|
||||
}
|
||||
|
||||
sub presetHome
|
||||
{
|
||||
my $self = shift;
|
||||
Debug( "Home Preset" );
|
||||
my $cmd = "go_home";
|
||||
$self->sendCmd( $cmd );
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# **** IR CONTROLS ****
|
||||
#
|
||||
#
|
||||
# Wake: Force IR on, always. (always night mode)
|
||||
#
|
||||
# Sleep: Force IR off, always. (always day mode)
|
||||
#
|
||||
# Reset: Automatic IR mode. (day/night mode determined by camera)
|
||||
#
|
||||
|
||||
|
||||
sub wake
|
||||
{
|
||||
# force IR on ("always night mode")
|
||||
|
||||
my $self = shift;
|
||||
my $url = "/eng/admin/adv_audiovideo.cgi";
|
||||
my $cmd = "irMode=3";
|
||||
|
||||
Debug("Wake -- IR on");
|
||||
|
||||
$self->sendCmdPost ($url,$cmd);
|
||||
}
|
||||
|
||||
sub sleep
|
||||
{
|
||||
# force IR off ("always day mode")
|
||||
|
||||
my $self=shift;
|
||||
my $url = "/eng/admin/adv_audiovideo.cgi";
|
||||
my $cmd = "irMode=2";
|
||||
|
||||
Debug("Sleep -- IR off");
|
||||
|
||||
$self->sendCmdPost ($url,$cmd);
|
||||
}
|
||||
|
||||
sub reset
|
||||
{
|
||||
# IR auto
|
||||
|
||||
my $self=shift;
|
||||
my $url = "/eng/admin/adv_audiovideo.cgi";
|
||||
my $cmd = "irMode=0";
|
||||
|
||||
Debug("Reset -- IR auto");
|
||||
|
||||
$self->sendCmdPost ($url,$cmd);
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
# Below is stub documentation for your module. You'd better edit it!
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ZoneMinder::Database - Perl extension for Trendnet TVIP672
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use ZoneMinder::Database;
|
||||
stuff this in /usr/share/perl5/ZoneMinder/Control , then eat a sandwich
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Stub documentation for Trendnet TVIP672, created by Vince.
|
||||
|
||||
=head2 EXPORT
|
||||
|
||||
None by default.
|
||||
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
Read the comments at the beginning of this file to see the usage for zoneminder 1.25.0
|
||||
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Vincent Giovannone, I'd rather you not email me.
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
Copyright (C) 2014 by Vincent Giovannone
|
||||
|
||||
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
|
|
@ -32,7 +32,7 @@ use ZoneMinder;
|
|||
use Getopt::Long;
|
||||
use POSIX qw/strftime EPIPE/;
|
||||
use Socket;
|
||||
use Data::Dumper;
|
||||
#use Data::Dumper;
|
||||
use Module::Load;
|
||||
|
||||
use constant MAX_CONNECT_DELAY => 10;
|
||||
|
|
|
@ -715,7 +715,7 @@ int main( int argc, char *argv[] )
|
|||
if ( function > 1 )
|
||||
{
|
||||
Monitor *monitor = Monitor::Load( mon_id, false, Monitor::QUERY );
|
||||
if ( monitor )
|
||||
if ( monitor && monitor->connect() )
|
||||
{
|
||||
struct timeval tv = monitor->GetTimestamp();
|
||||
printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n",
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash -x
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
set -x
|
||||
|
||||
with_timestamps() {
|
||||
while read -r line; do
|
||||
echo -e "$(date +%T)\t$line";
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
bootstrap_zm() {
|
||||
|
||||
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize --force; fi
|
||||
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal; fi
|
||||
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi
|
||||
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then automake --force-missing --add-missing; fi
|
||||
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoconf; fi
|
||||
|
||||
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS zm"
|
||||
mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'";
|
||||
mysql -uroot -e "FLUSH PRIVILEGES"
|
||||
mysql -uzmuser -pzmpass < ${TRAVIS_BUILD_DIR}/db/zm_create.sql
|
||||
|
||||
}
|
||||
|
||||
bootstrap_zm | with_timestamps
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
with_timestamps() {
|
||||
while read -r line; do
|
||||
echo -e "$(date +%T)\t$line";
|
||||
done
|
||||
}
|
||||
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
|
||||
build_zm() {
|
||||
|
||||
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then
|
||||
./configure --prefix=/usr --with-libarch=lib/$DEB_HOST_GNU_TYPE --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-ffmpeg=/usr --with-webdir=/usr/share/zoneminder/www --with-cgidir=/usr/libexec/zoneminder/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=yes --disable-debug --enable-mmap=yes ZM_SSL_LIB=openssl
|
||||
fi
|
||||
|
||||
if [ "$ZM_BUILDMETHOD" = "cmake" ]; then
|
||||
cmake -DCMAKE_INSTALL_PREFIX="/usr"
|
||||
fi
|
||||
|
||||
make
|
||||
sudo make install
|
||||
|
||||
if [ "$ZM_BUILDMETHOD" = "cmake" ]; then
|
||||
sudo ./zmlinkcontent.sh
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
build_zm | with_timestamps
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
with_timestamps() {
|
||||
while read -r line; do
|
||||
echo -e "$(date +%T)\t$line";
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
install_deps() {
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev 2>&1 > /dev/null
|
||||
|
||||
}
|
||||
|
||||
install_deps | with_timestamps
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
git clone --depth=10 --branch=master git://source.ffmpeg.org/ffmpeg.git
|
||||
cd ffmpeg
|
||||
./configure --enable-shared --enable-swscale --enable-gpl --enable-libx264 --enable-libvpx --enable-libvorbis --enable-libtheora
|
||||
make -j `grep processor /proc/cpuinfo|wc -l`
|
||||
sudo make install
|
||||
sudo make install-libs
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
with_timestamps() {
|
||||
while read -r line; do
|
||||
echo -e "$(date +%T)\t$line";
|
||||
done
|
||||
}
|
||||
|
||||
run_tests() {
|
||||
mysql -uzmuser -pzmpass zm < ../../db/test.monitor.sql
|
||||
sudo zmu -l
|
||||
sudo zmc -m1 &
|
||||
sudo zma -m1 &
|
||||
sudo zmu -l
|
||||
sudo grep ERR /var/log/syslog
|
||||
sudo zmpkg.pl start
|
||||
sudo zmfilter.pl -f purgewhenfull
|
||||
}
|
||||
|
||||
run_tests | with_timestamps
|
|
@ -86,8 +86,6 @@ function checkSize() {
|
|||
}
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', checkSize);
|
||||
|
||||
// Deprecated
|
||||
function newWindow( url, name, width, height )
|
||||
{
|
||||
|
@ -308,3 +306,5 @@ if ( focusWindow )
|
|||
{
|
||||
windowToFront();
|
||||
}
|
||||
window.addEvent( 'domready', checkSize);
|
||||
|
||||
|
|
|
@ -86,8 +86,6 @@ function checkSize() {
|
|||
}
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', checkSize);
|
||||
|
||||
// Deprecated
|
||||
function newWindow( url, name, width, height )
|
||||
{
|
||||
|
@ -308,3 +306,8 @@ if ( focusWindow )
|
|||
{
|
||||
windowToFront();
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> release-1.28
|
||||
window.addEvent( 'domready', checkSize);
|
||||
|
|
Loading…
Reference in New Issue