Merge branch 'master' of https://github.com/ZoneMinder/ZoneMinder into plugin_support

Merging conflicts fixed in files:
	CMakeLists.txt
	configure.ac
	distros/debian_cmake/control
	src/zm_monitor.h
	web/lang/de_de.php
	web/skins/classic/views/monitor.php
This commit is contained in:
Emmanuel Papin 2015-07-20 16:49:04 +02:00
commit b294569147
251 changed files with 10010 additions and 542 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "web/api/app/Plugin/Crud"]
path = web/api/app/Plugin/Crud
url = https://github.com/FriendsOfCake/crud.git

View File

@ -4,8 +4,10 @@
#
cmake_minimum_required (VERSION 2.6)
project (zoneminder)
set(zoneminder_VERSION "1.28.1")
set(zoneminder_VERSION "1.28.100")
set(ZM_ENGINE_VERSION 29)
# make API version a minor of ZM version
set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
# CMake does not allow out-of-source build if CMakeCache.exists
# in the source folder. Abort and notify the user
@ -30,6 +32,27 @@ endif(NOT CMAKE_BUILD_TYPE)
#set(CMAKE_VERBOSE_MAKEFILE ON)
#set(CMAKE_INSTALL_ALWAYS ON)
# Host OS Check
set(HOST_OS "")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(HOST_OS "linux")
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*")
set(HOST_OS "solaris")
set(SOLARIS 1)
endif(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*")
if(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*")
set(HOST_OS "BSD")
set(BSD 1)
endif(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(HOST_OS "darwin")
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
if(NOT HOST_OS)
message(FATAL_ERROR
"ZoneMinder was unable to deterimine the host OS. Please report this. Value of CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
endif(NOT HOST_OS)
# Default CLFAGS and CXXFLAGS:
set(CMAKE_C_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2")
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2")
@ -185,27 +208,6 @@ include_directories("${CMAKE_BINARY_DIR}")
# This is required to enable searching in lib64 (if exists), do not change
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
# Host OS Check
set(HOST_OS "")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(HOST_OS "linux")
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*")
set(HOST_OS "solaris")
set(SOLARIS 1)
endif(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*")
if(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*")
set(HOST_OS "BSD")
set(BSD 1)
endif(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(HOST_OS "darwin")
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
if(NOT HOST_OS)
message(FATAL_ERROR
"ZoneMinder was unable to deterimine the host OS. Please report this. Value of CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
endif(NOT HOST_OS)
# System checks
check_include_file("libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H)
if(NOT HAVE_LIBV4L1_VIDEODEV_H)
@ -226,6 +228,16 @@ check_type_size("ucontext_t" HAVE_UCONTEXT_T)
# *** LIBRARY CHECKS ***
if (UNIX)
include (CheckLibraryExists)
CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
if(NOT HAVE_CLOCK_GETTIME)
message(FATAL_ERROR "clock_gettime not found")
else(NOT HAVE_CLOCK_GETTIME)
list(APPEND ZM_BIN_LIBS "-lrt")
endif(NOT HAVE_CLOCK_GETTIME)
endif(UNIX)
# zlib
find_package(ZLIB)
if(ZLIB_FOUND)
@ -404,7 +416,7 @@ if(NOT ZM_NO_FFMPEG)
set(HAVE_LIBAVFORMAT 1)
list(APPEND ZM_BIN_LIBS "${AVFORMAT_LIBRARIES}")
set(LIBS "${LIBS} -lavformat")
find_path(AVFORMAT_INCLUDE_DIR "libavformat/avformat.h")
find_path(AVFORMAT_INCLUDE_DIR "libavformat/avformat.h" /usr/include/ffmpeg)
if(AVFORMAT_INCLUDE_DIR)
include_directories("${AVFORMAT_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVFORMAT_INCLUDE_DIR}")
@ -422,7 +434,7 @@ if(NOT ZM_NO_FFMPEG)
set(HAVE_LIBAVCODEC 1)
list(APPEND ZM_BIN_LIBS "${AVCODEC_LIBRARIES}")
set(LIBS "${LIBS} -lavcodec")
find_path(AVCODEC_INCLUDE_DIR "libavcodec/avcodec.h")
find_path(AVCODEC_INCLUDE_DIR "libavcodec/avcodec.h" /usr/include/ffmpeg)
if(AVCODEC_INCLUDE_DIR)
include_directories("${AVCODEC_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVCODEC_INCLUDE_DIR}")
@ -440,7 +452,7 @@ if(NOT ZM_NO_FFMPEG)
set(HAVE_LIBAVDEVICE 1)
list(APPEND ZM_BIN_LIBS "${AVDEVICE_LIBRARIES}")
set(LIBS "${LIBS} -lavdevice")
find_path(AVDEVICE_INCLUDE_DIR "libavdevice/avdevice.h")
find_path(AVDEVICE_INCLUDE_DIR "libavdevice/avdevice.h" /usr/include/ffmpeg)
if(AVDEVICE_INCLUDE_DIR)
include_directories("${AVDEVICE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVDEVICE_INCLUDE_DIR}")
@ -458,7 +470,7 @@ if(NOT ZM_NO_FFMPEG)
set(HAVE_LIBAVUTIL 1)
list(APPEND ZM_BIN_LIBS "${AVUTIL_LIBRARIES}")
set(LIBS "${LIBS} -lavutil")
find_path(AVUTIL_INCLUDE_DIR "libavutil/avutil.h")
find_path(AVUTIL_INCLUDE_DIR "libavutil/avutil.h" /usr/include/ffmpeg)
if(AVUTIL_INCLUDE_DIR)
include_directories("${AVUTIL_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVUTIL_INCLUDE_DIR}")
@ -477,7 +489,7 @@ if(NOT ZM_NO_FFMPEG)
set(HAVE_LIBSWSCALE 1)
list(APPEND ZM_BIN_LIBS "${SWSCALE_LIBRARIES}")
set(LIBS "${LIBS} -lswscale")
find_path(SWSCALE_INCLUDE_DIR "libswscale/swscale.h")
find_path(SWSCALE_INCLUDE_DIR "libswscale/swscale.h" /usr/include/ffmpeg)
if(SWSCALE_INCLUDE_DIR)
include_directories("${SWSCALE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${SWSCALE_INCLUDE_DIR}")
@ -490,7 +502,9 @@ if(NOT ZM_NO_FFMPEG)
endif(SWSCALE_LIBRARIES)
# Find the path to the ffmpeg executable
find_program(FFMPEG_EXECUTABLE ffmpeg PATH_SUFFIXES ffmpeg)
find_program(FFMPEG_EXECUTABLE
NAMES ffmpeg avconv
PATH_SUFFIXES ffmpeg)
if(FFMPEG_EXECUTABLE)
set(PATH_FFMPEG "${FFMPEG_EXECUTABLE}")
set(OPT_FFMPEG "yes")
@ -666,6 +680,7 @@ endif(NOT POLKIT_FOUND)
set(ZM_PID "${ZM_RUNDIR}/zm.pid")
set(ZM_CONFIG "${ZM_CONFIG_DIR}/zm.conf")
set(VERSION "${zoneminder_VERSION}")
set(API_VERSION "${zoneminder_API_VERSION}")
set(PKGDATADIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/zoneminder")
set(BINDIR "${CMAKE_INSTALL_FULL_BINDIR}")
set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
@ -687,6 +702,10 @@ configure_file(zoneminder-config.cmake "${CMAKE_CURRENT_BINARY_DIR}/config.h" @O
configure_file(zmconfgen.pl.in "${CMAKE_CURRENT_BINARY_DIR}/zmconfgen.pl" @ONLY)
configure_file(zmlinkcontent.sh.in "${CMAKE_CURRENT_BINARY_DIR}/zmlinkcontent.sh" @ONLY)
# Create a target for man pages
include(Pod2Man)
ADD_MANPAGE_TARGET()
# Process subdirectories
add_subdirectory(src)
add_subdirectory(scripts)

View File

@ -11,9 +11,12 @@ RUN apt-get update && apt-get install -y \
libpolkit-gobject-1-dev build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev \
libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 \
libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf libjpeg-turbo8-dev \
libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev ffmpeg mysql-client \
libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev libav-tools mysql-client \
apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli openssh-server \
mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore5 vlc-data vlc libcurl4-openssl-dev
mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore5 vlc-data libcurl4-openssl-dev \
libavformat-dev libswscale-dev libavutil-dev libavcodec-dev libavfilter-dev \
libavresample-dev libavdevice-dev libpostproc-dev libv4l-dev libtool libnetpbm10-dev \
libmime-lite-perl dh-autoreconf dpatch
# Copy local code into our container
ADD . /ZoneMinder

View File

@ -19,7 +19,7 @@
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PC_POLKIT polkit-gobject-1)
pkg_search_module(PC_POLKIT polkit-gobject-1 polkit)
#pkg_check_modules(PC_POLKIT_AGENT polkit-agent-1)
set(POLKIT_DEFINITIONS ${PC_POLKIT_CFLAGS_OTHER})
endif (NOT WIN32)
@ -31,8 +31,8 @@
HINTS ${PC_POLKIT_INCLUDE_DIRS}
)
find_path( POLKIT_INCLUDE_DIR
NAMES polkit/polkit.h
PATH_SUFFIXES polkit-1
NAMES polkit/polkit.h libpolkit/libpolkit.h
PATH_SUFFIXES polkit-1 polkit
HINTS ${PC_POLKIT_INCLUDE_DIRS}
)
#find_path( POLKIT_AGENT_INCLUDE_DIR
@ -43,7 +43,7 @@
#set(POLKIT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_INCLUDE_DIR})
#set(POLKIT_AGENT_INCLUDE_DIRS ${GLIB2_INCLUDE_DIR} ${_POLKIT_AGENT_INCLUDE_DIR})
find_library( POLKIT_LIBRARIES
NAMES polkit-gobject-1
NAMES polkit-gobject-1 polkit
HINTS ${PC_POLKIT_LIBDIR}
)
#find_library( POLKIT_AGENT_LIBRARY

View File

@ -0,0 +1,71 @@
#
# Copyright (C) 2012 Emmanuel Roullit <emmanuel.roullit@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
#
# Generate man pages of the project by using the
# POD header written in the tool source code.
# To use it, include this file in CMakeLists.txt and
# invoke POD2MAN(<podfile> <manfile> <section>)
MACRO(POD2MAN PODFILE MANFILE SECTION)
FIND_PROGRAM(POD2MAN pod2man)
FIND_PROGRAM(GZIP gzip)
IF(NOT POD2MAN)
MESSAGE(FATAL ERROR "Need pod2man installed to generate man page")
ENDIF(NOT POD2MAN)
IF(NOT GZIP)
MESSAGE(FATAL ERROR "Need gzip installed to compress man page")
ENDIF(NOT GZIP)
IF(NOT EXISTS ${PODFILE})
MESSAGE(FATAL ERROR "Could not find pod file ${PODFILE} to generate man page")
ENDIF(NOT EXISTS ${PODFILE})
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}
DEPENDS ${PODFILE}
COMMAND ${POD2MAN}
ARGS --section ${SECTION} --center ${CMAKE_PROJECT_NAME} --release --stderr --name ${MANFILE}
${PODFILE} > ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}
)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}.gz
COMMAND ${GZIP} --best -c ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION} > ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}.gz
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}
)
SET(MANPAGE_TARGET "man-${MANFILE}")
ADD_CUSTOM_TARGET(${MANPAGE_TARGET} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}.gz)
ADD_DEPENDENCIES(man ${MANPAGE_TARGET})
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}.gz
DESTINATION share/man/man${SECTION}
)
ENDMACRO(POD2MAN PODFILE MANFILE SECTION)
MACRO(ADD_MANPAGE_TARGET)
# It is not possible add a dependency to target 'install'
# Run hard-coded 'make man' when 'make install' is invoked
INSTALL(CODE "EXECUTE_PROCESS(COMMAND make man)")
ADD_CUSTOM_TARGET(man)
ENDMACRO(ADD_MANPAGE_TARGET)

View File

@ -1,5 +1,9 @@
#
# Building ZoneMinder via Autotools will be depreciated soon
# For instructions on building with cmake, please see INSTALL
#
AC_PREREQ(2.59)
AC_INIT(zm,1.28.1,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
AC_INIT(zm,1.28.100,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE
LT_PREREQ([2.4.2])

View File

@ -315,6 +315,7 @@ DROP TABLE IF EXISTS `Monitors`;
CREATE TABLE `Monitors` (
`Id` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(64) NOT NULL default '',
`ServerId` int(10) unsigned,
`Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL') NOT NULL default 'Local',
`Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor',
`Enabled` tinyint(3) unsigned NOT NULL default '1',
@ -383,15 +384,29 @@ CREATE TABLE `Monitors` (
--
-- Table structure for table `States`
-- Added IsActive to track custom run states
--
DROP TABLE IF EXISTS `States`;
CREATE TABLE `States` (
`Id` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(64) NOT NULL default '',
`Definition` text NOT NULL,
PRIMARY KEY (`Name`)
`IsActive` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`Id`)
) ENGINE=@ZM_MYSQL_ENGINE@;
--
-- Table structure for table `Servers`
--
DROP TABLE IF EXISTS `Servers`;
CREATE TABLE `Servers` (
`Id` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(64) NOT NULL default '',
`State_Id` int(10) unsigned,
PRIMARY KEY (`Id`)
) ENGINE=@ZM_MYSQL_ENGINE@;
--
-- Table structure for table `Stats`
--
@ -579,6 +594,11 @@ INSERT INTO Controls VALUES (NULL,'Toshiba IK-WB11A','Remote','Toshiba_IK_WB11A'
INSERT INTO Controls VALUES (NULL,'WanscamPT','Remote','Wanscam',1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,16,0,0,0,0,0,1,16,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO Controls VALUES (NULL,'3S Domo N5071', 'Remote', '3S', 0, 0, 1, 1, 0, 1, 1, 0, 0, 9999, 0, 9999, 0, 0, 0, 1, 1, 1, 1, 0, 0, 9999, 20, 9999, 0, 0, 0, 1, 1, 1, 1, 0, 0, 9999, 1, 9999, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 1, 0, 1, 1, 0, 0, 0, 0, 1, -180, 180, 40, 100, 1, 40, 100, 0, 0, 1, -180, 180, 40, 100, 1, 40, 100, 0, 0, 0, 0);
INSERT INTO Controls VALUES (NULL,'ONVIF Camera','Ffmpeg','onvif',0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,255,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,6,1,1,0,0,0,1,10,0,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `Controls` VALUES (NULL,'Foscam 9831W','Ffmpeg','FI9831W',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,1,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,0,0,0,0,0,0,0);
INSERT INTO `Controls` VALUES (NULL,'Foscam FI8918W','Ffmpeg','FI8918W',0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,1,1,1,0,0,0,1,1,0,360,0,360,1,0,4,0,0,1,0,90,0,90,1,0,4,0,0,0,0);
--
-- Add some monitor preset values

22
db/zm_update-1.28.100.sql Normal file
View File

@ -0,0 +1,22 @@
--
-- This updates a 1.28.99 database to 1.28.100
--
--
-- Add ServerId column to Monitors
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Monitors'
AND table_schema = DATABASE()
AND column_name = 'ServerId'
) > 0,
"SELECT 'Column ServerId exists in Monitors'",
"ALTER TABLE Monitors ADD `ServerId` int(10) unsigned AFTER `Name`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

View File

@ -4,6 +4,8 @@
--
-- Add Controls definition for ONVIF
-- Add Controls definition for FI9831W
-- Add Controls definition for FI8918W
--
INSERT INTO Controls
SELECT * FROM (SELECT NULL as Id,
@ -108,9 +110,269 @@ SELECT * FROM (SELECT NULL as Id,
WHERE NOT EXISTS (
SELECT Name FROM Controls WHERE name = 'ONVIF Camera'
) LIMIT 1;
INSERT INTO Controls
SELECT * FROM (SELECT NULL as Id,
'Foscam 9831W' as Name,
'Ffmpeg' as Type,
'FI9831W' as Protocol,
0 as CanWake,
0 as CanSleep,
1 as CanReset,
0 as CanZoom,
0 as CanAutoZoom,
0 as CanZoomAbs,
0 as CanZoomRel,
0 as CanZoomCon,
0 as MinZoomRange,
0 as MaxZoomRange,
0 as MinZoomStep,
0 as MaxZoomStep,
0 as HasZoomSpeed,
0 as MinZoomSpeed,
0 as MaxZoomSpeed,
0 as CanFocus,
0 as CanAutoFocus,
0 as CanFocusAbs,
0 as CanFocusRel,
0 as CanFocusCon,
0 as MinFocusRange,
0 as MaxFocusRange,
0 as MinFocusStep,
0 as MaxFocusStep,
0 as HasFocusSpeed,
0 as MinFocusSpeed,
0 as MaxFocusSpeed,
0 as CanIris,
0 as CanAutoIris,
0 as CanIrisAbs,
0 as CanIrisRel,
0 as CanIrisCon,
0 as MinIrisRange,
0 as MaxIrisRange,
0 as MinIrisStep,
0 as MaxIrisStep,
0 as HasIrisSpeed,
0 as MinIrisSpeed,
0 as MaxIrisSpeed,
0 as CanGain,
0 as CanAutoGain,
0 as CanGainAbs,
0 as CanGainRel,
0 as CanGainCon,
0 as MinGainRange,
0 as MaxGainRange,
0 as MinGainStep,
0 as MaxGainStep,
0 as HasGainSpeed,
0 as MinGainSpeed,
0 as MaxGainSpeed,
0 as CanWhite,
0 as CanAutoWhite,
0 as CanWhiteAbs,
0 as CanWhiteRel,
0 as CanWhiteCon,
0 as MinWhiteRange,
0 as MaxWhiteRange,
0 as MinWhiteStep,
0 as MaxWhiteStep,
0 as HasWhiteSpeed,
0 as MinWhiteSpeed,
0 as MaxWhiteSpeed,
0 as HasPresets,
16 as NumPresets,
1 as HasHomePreset,
1 as CanSetPresets,
1 as CanMove,
1 as CanMoveDiag,
0 as CanMoveMap,
0 as CanMoveAbs,
0 as CanMoveRel,
1 as CanMoveCon,
1 as CanPan,
0 as MinPanRange,
360 as MaxPanRange,
0 as MinPanStep,
360 as MaxPanStep,
1 as HasPanSpeed,
0 as MinPanSpeed,
4 as MaxPanSpeed,
0 as HasTurboPan,
0 as TurboPanSpeed,
1 as CanTilt,
0 as MinTiltRange,
90 as MaxTiltRange,
0 as MinTiltStep,
90 as MaxTiltStep,
0 as HasTiltSpeed,
0 as MinTiltSpeed,
0 as MaxTiltSpeed,
0 as HasTurboTilt,
0 as TurboTiltSpeed,
0 as CanAutoScan,
0 as NumScanPaths) AS tmp
WHERE NOT EXISTS (
SELECT Name FROM Controls WHERE name = 'Foscam 9831W'
) LIMIT 1;
INSERT INTO Controls
SELECT * FROM (SELECT NULL as Id,
'Foscam FI8918W' as Name,
'Ffmpeg' as Type,
'FI8918W' as Protocol,
0 as CanWake,
0 as CanSleep,
1 as CanReset,
0 as CanZoom,
0 as CanAutoZoom,
0 as CanZoomAbs,
0 as CanZoomRel,
0 as CanZoomCon,
0 as MinZoomRange,
0 as MaxZoomRange,
0 as MinZoomStep,
0 as MaxZoomStep,
0 as HasZoomSpeed,
0 as MinZoomSpeed,
0 as MaxZoomSpeed,
0 as CanFocus,
0 as CanAutoFocus,
0 as CanFocusAbs,
0 as CanFocusRel,
0 as CanFocusCon,
0 as MinFocusRange,
0 as MaxFocusRange,
0 as MinFocusStep,
0 as MaxFocusStep,
0 as HasFocusSpeed,
0 as MinFocusSpeed,
0 as MaxFocusSpeed,
0 as CanIris,
0 as CanAutoIris,
0 as CanIrisAbs,
0 as CanIrisRel,
0 as CanIrisCon,
0 as MinIrisRange,
0 as MaxIrisRange,
0 as MinIrisStep,
0 as MaxIrisStep,
0 as HasIrisSpeed,
0 as MinIrisSpeed,
0 as MaxIrisSpeed,
0 as CanGain,
0 as CanAutoGain,
0 as CanGainAbs,
0 as CanGainRel,
0 as CanGainCon,
0 as MinGainRange,
0 as MaxGainRange,
0 as MinGainStep,
0 as MaxGainStep,
0 as HasGainSpeed,
0 as MinGainSpeed,
0 as MaxGainSpeed,
0 as CanWhite,
0 as CanAutoWhite,
0 as CanWhiteAbs,
0 as CanWhiteRel,
0 as CanWhiteCon,
0 as MinWhiteRange,
0 as MaxWhiteRange,
0 as MinWhiteStep,
0 as MaxWhiteStep,
0 as HasWhiteSpeed,
0 as MinWhiteSpeed,
0 as MaxWhiteSpeed,
0 as HasPresets,
8 as NumPresets,
0 as HasHomePreset,
1 as CanSetPresets,
1 as CanMove,
1 as CanMoveDiag,
0 as CanMoveMap,
0 as CanMoveAbs,
0 as CanMoveRel,
1 as CanMoveCon,
1 as CanPan,
0 as MinPanRange,
360 as MaxPanRange,
0 as MinPanStep,
360 as MaxPanStep,
1 as HasPanSpeed,
0 as MinPanSpeed,
4 as MaxPanSpeed,
0 as HasTurboPan,
0 as TurboPanSpeed,
1 as CanTilt,
0 as MinTiltRange,
90 as MaxTiltRange,
0 as MinTiltStep,
90 as MaxTiltStep,
0 as HasTiltSpeed,
0 as MinTiltSpeed,
0 as MaxTiltSpeed,
0 as HasTurboTilt,
0 as TurboTiltSpeed,
0 as CanAutoScan,
0 as NumScanPaths) AS tmp
WHERE NOT EXISTS (
SELECT Name FROM Controls WHERE name = 'Foscam FI8918W'
) LIMIT 1;
--
-- Hide USE_DEEP_STORAGE from user to prevent accidental event loss
--
UPDATE `zm`.`Config` SET `Category`='hidden' WHERE `Name`='ZM_USE_DEEP_STORAGE';
--
-- Add Id column to State
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'States'
AND table_schema = DATABASE()
AND column_name = 'Id'
) > 0,
"SELECT 'Column Id exists in States'",
"ALTER TABLE States DROP PRIMARY KEY, ADD `Id` int(10) unsigned auto_increment NOT NULL PRIMARY KEY FIRST"
));
PREPARE stmt FROM @s;
EXECUTE stmt;
-- The States table will be updated to have a new column called IsActive
-- used to keep track of which custom state is active (if any)
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'States'
AND table_schema = DATABASE()
AND column_name = 'IsActive'
) > 0,
"SELECT 'Column IsActive exists in States'",
"ALTER TABLE `States` ADD `IsActive` tinyint(3) unsigned not null default 0 AFTER `Definition`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name = 'Servers'
AND table_schema = DATABASE()
) > 0,
"SELECT 'Servers table exists'",
"CREATE TABLE `Servers` (
`Id` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(64) NOT NULL default '',
`State_Id` int(10) unsigned,
PRIMARY KEY (`Id`)
)"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.4
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 | 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
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, php5-gd
Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -95,7 +95,7 @@ Section: web
Architecture: any
Depends: zoneminder-core (= ${binary:Version}), ${shlibs:Depends},
${misc:Depends}, debconf, apache2, libapache2-mod-php5 | libapache2-mod-fcgid,
php5, php5-mysql | php5-mysqlnd
php5, php5-mysql | php5-mysqlnd, php5-gd
Description: Essential files for ZoneMinder's web user interface
ZoneMinder is a video camera security and surveillance solution.
.

View File

@ -7,7 +7,7 @@ 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 | libjpeg9 | libjpeg62-turbo, 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 | 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 | libjpeg9 | libjpeg62-turbo, 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, php5-gd
Recommends: mysql-server | mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -24,7 +24,7 @@ Source: ZoneMinder-%{version}.tar.gz
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
BuildRequires: community-mysql-devel pcre-devel libjpeg-turbo-devel
BuildRequires: perl(Archive::Tar) perl(Archive::Zip)
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
@ -38,7 +38,7 @@ BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
BuildRequires: httpd polkit-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
Requires: httpd php php-mysql cambozola polkit net-tools psmisc
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)

View File

@ -24,7 +24,7 @@ Source: ZoneMinder-%{version}.tar.gz
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
BuildRequires: community-mysql-devel pcre-devel libjpeg-turbo-devel
BuildRequires: perl(Archive::Tar) perl(Archive::Zip)
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
@ -38,7 +38,7 @@ BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
BuildRequires: httpd polkit-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
Requires: httpd php php-mysql cambozola polkit net-tools psmisc
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)

View File

@ -16,7 +16,7 @@ else(ZM_TARGET_DISTRO STREQUAL "el7")
endif(ZM_TARGET_DISTRO STREQUAL "el7")
# Download jscalendar & move files into position
file(DOWNLOAD http://softlayer-dal.dl.sourceforge.net/project/jscalendar/jscalendar/1.0/jscalendar-1.0.zip ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar-1.0.zip LOG jsc_log STATUS download_jsc)
file(DOWNLOAD http://nbtelecom.dl.sourceforge.net/project/jscalendar/jscalendar/1.0/jscalendar-1.0.zip ${CMAKE_CURRENT_SOURCE_DIR}/jscalendar-1.0.zip LOG jsc_log STATUS download_jsc)
#message(STATUS "Log of jscalender script was: ${jsc_log}")
if(download_jsc EQUAL 0)
message(STATUS "Jscalander successfully downloaded. Installing...")

View File

@ -30,7 +30,7 @@ BuildRequires: libcurl-devel vlc-devel ffmpeg-devel polkit-devel
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
BuildRequires: httpd ffmpeg
Requires: httpd php php-mysql mysql-server libjpeg-turbo polkit net-tools psmisc
Requires: httpd php php-gd php-mysql mysql-server libjpeg-turbo polkit net-tools psmisc
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)

View File

@ -20,7 +20,7 @@ Source: ZoneMinder-%{version}.tar.gz
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
BuildRequires: perl(Archive::Tar) perl(Archive::Zip)
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
@ -32,7 +32,7 @@ BuildRequires: ffmpeg ffmpeg-devel perl(X10::ActiveHome) perl(Astro::SunTime)
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
BuildRequires: httpd polkit-devel
Requires: httpd php php-mysql mariadb-server polkit net-tools psmisc
Requires: httpd php php-gd php-mysql mariadb-server polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)

View File

@ -1,3 +1,11 @@
zoneminder (1.28.1+1-trusty-SNAPSHOT2015071501) trusty; urgency=medium
* fix for issue #586 and #932
* fix for db not being upgraded
* version upgraded to .100
-- Isaac Connor <iconnor@connortechnology.com> Wed, 15 Jul 2015 11:56:28 -0400
zoneminder (1.28.1+1-trusty-SNAPSHOT2015030201) trusty; urgency=medium
* maybe fix for RTSP Basic Auth

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.4
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|mysql-client-5.6, 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, 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
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|mysql-client-5.6, 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, 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, php5-gd
Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -1,3 +1,11 @@
zoneminder (1.28.1+1-vivid-SNAPSHOT2015071501) vivid; urgency=medium
* fix for issue #586 and #932
* fix for db not being upgraded
* version upgraded to .100
-- Isaac Connor <iconnor@connortechnology.com> Wed, 15 Jul 2015 11:56:28 -0400
zoneminder (1.28.1+1-trusty-SNAPSHOT2015030201) trusty; urgency=medium
* maybe fix for RTSP Basic Auth

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.4
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|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, libavdevice-ffmpeg56, 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
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|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, libavdevice-ffmpeg56, 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, php5-gd
Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -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 <pjh@northern-ridge.com.au>, 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 <vagrant@debian.org> Sun, 27 Mar 2011 13:06:56 -0700

View File

@ -0,0 +1,9 @@
Alias /zm /usr/share/zoneminder
<Directory /usr/share/zoneminder>
php_flag register_globals off
Options Indexes FollowSymLinks
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
</Directory>

View File

@ -0,0 +1,95 @@
zoneminder (1.28.1+1-trusty-SNAPSHOT2015061201) vivid; urgency=medium
* translation fixes
* Merge angular api
* now build using cmake
* use split up packaging
-- Isaac Connor <iconnor@connortechnology.com> Fri, 12 Jun 2015 11:22:36 -0400
zoneminder (1.28.1+1-trusty-SNAPSHOT2015030201) trusty; urgency=medium
* maybe fix for RTSP Basic Auth
* Also remove dependency on netpbm
-- Isaac Connor <iconnor@connortechnology.com> Mon, 02 Mar 2015 11:25:59 -0500
zoneminder (1.28.1+1-utopic-SNAPSHOT2015022301) utopic; urgency=medium
* Big merge of onvif support and some fixes.
-- Isaac Connor <iconnor@connortechnology.com> Mon, 23 Feb 2015 19:45:45 -0500
zoneminder (1.28.0+1-trusty-SNAPSHOT2015021201) trusty; urgency=medium
* add mysql-client-5.6 as a dependency instaed of mysql-client.
-- Isaac Connor <iconnor@connortechnology.com> Fri, 13 Feb 2015 09:35:13 -0500
zoneminder (1.28.0+1-trusty-SNAPSHOT2015011101) trusty; urgency=medium
* small changes
-- Isaac Connor <iconnor@connortechnology.com> Fri, 12 Dec 2014 16:38:36 -0500
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 <iconnor@connortechnology.com> Thu, 20 Nov 2014 10:57:57 -0500
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
-- Isaac Connor <iconnor@connortechnology.com> Tue, 14 Oct 2014 09:28:29 -0400
zoneminder (1.27.99+1-trusty-SNAPSHOT2014092601) trusty; urgency=medium
* style updates and db fixes for database logging filters
-- Isaac Connor <iconnor@connortechnology.com> Fri, 26 Sep 2014 14:44:45 -0400
zoneminder (1.27.99+1-trusty-SNAPSHOT2014090801) trusty; urgency=medium
* several segfault fixes for local cameras
-- Isaac Connor <iconnor@connortechnology.com> Mon, 08 Sep 2014 16:56:57 -0400
zoneminder (1.27.99+1-trusty-SNAPSHOT2014090701) trusty; urgency=medium
* Fix segfaults for local cameras, also now includes the systemd support patch
-- Isaac Connor <iconnor@connortechnology.com> Sun, 07 Sep 2014 17:19:01 -0400
zoneminder (1.27.99+1-trusty-SNAPSHOT2014082102) trusty; urgency=medium
* Fix UI inputs for v4l multibuffer and captures per frame
-- Isaac Connor <iconnor@connortechnology.com> Thu, 21 Aug 2014 12:03:31 -0400
zoneminder (1.27.99+1-trusty-SNAPSHOT2014082101) trusty; urgency=medium
* fall back to Config table values for V4l MultiBUffer and Captures Per Frame
* add mention of monitor page settings for thse in the config table
-- Isaac Connor <iconnor@connortechnology.com> Thu, 21 Aug 2014 10:04:46 -0400
zoneminder (1.27.99+1-precise-SNAPSHOT2014080601) precise; 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 <iconnor@connortechnology.com> Wed, 06 Aug 2014 20:20:20 -0400
zoneminder (1.27.0+1-trusty-v4ltomonitor-1) trusty; urgency=high
* Snapshot release -
-- Isaac Connor <iconnor@connortechnology.com> Wed, 09 Jul 2014 21:35:29 -0400

View File

@ -0,0 +1 @@
9

View File

@ -0,0 +1,133 @@
Source: zoneminder
Section: net
Priority: optional
Maintainer: Isaac Connor <iconnor@connortechnology.com>
Build-Depends: debhelper (>= 9), po-debconf (>= 1.0), autoconf, automake, libphp-serialization-perl, libgnutls-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev | libjpeg9-dev | libjpeg62-turbo-dev, libpcre3-dev, libavcodec-ffmpeg-dev, libavformat-ffmpeg-dev, libswscale-ffmpeg-dev, libavutil-ffmpeg-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, libavdevice-ffmpeg-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, libdbi-perl, libnet-sftp-foreign-perl, libexpect-perl, libmime-tools-perl, libx264-dev, libmp4v2-dev, libpcre3-dev
Standards-Version: 3.9.6
Package: zoneminder
Section: metapackages
Architecture: all
Depends: ${misc:Depends},
libzoneminder-perl (>= ${source:Version}),
zoneminder-database (>= ${source:Version}),
zoneminder-core (>= ${binary:Version}),
zoneminder-ui-base (>= ${source:Version}),
zoneminder-ui-classic (>= ${source:Version}),
zoneminder-ui-mobile (>= ${source:Version}),
zoneminder-ui-xml (>= ${source:Version})
Description: Video camera security and surveillance solution (metapackage)
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: libzoneminder-perl
Section: perl
Architecture: all
Depends: ${misc:Depends}, ${perl:Depends}, libdbi-perl,
libdevice-serialport-perl, libimage-info-perl, libjson-any-perl,
libsys-mmap-perl, liburi-encode-perl, libwww-perl
Description: Perl libraries for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the libraries for the perl scripts, it can be used to
write custom interfaces as well.
Package: zoneminder-database
Section: database
Architecture: all
Depends: ${misc:Depends}, debconf, dbconfig-common,
mysql-client | mariadb-client
Recommends: mysql-server | mariadb-server
Description: Database management package for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the sql files and maintenance scripts to perform all the
database operations (installation, upgrade or removal) on a local or a remote
server.
Package: zoneminder-core
Section: video
Architecture: any
Depends: libzoneminder-perl (= ${source:Version}),
zoneminder-database (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends},
${perl:Depends}, libarchive-tar-perl, libarchive-zip-perl, libdate-manip-perl,
libdbi-perl, libmodule-load-conditional-perl, libmime-lite-perl,
libmime-tools-perl, libnet-sftp-foreign-perl, libphp-serialization-perl,
debconf, ffmpeg | libav-tools, rsyslog | system-log-daemon, zip,
policykit-1, apache2, libmp4v2-2, libpcre++0
Description: Core binaries and perl scripts for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the executable compiled binaries which do the main video
processing work and the perl scripts which perform helper and/or external
interface tasks.
Package: zoneminder-core-dbg
Priority: extra
Section: debug
Architecture: any
Depends: zoneminder-core (= ${binary:Version}), ${misc:Depends}
Description: Debugging symbols for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the debugging symbols for the executable compiled
binaries.
Package: zoneminder-ui-base
Section: web
Architecture: any
Depends: zoneminder-core (= ${binary:Version}), ${shlibs:Depends},
${misc:Depends}, debconf, apache2, libapache2-mod-php5 | libapache2-mod-fcgid,
php5, php5-mysql | php5-mysqlnd, php5-gd
Description: Essential files for ZoneMinder's web user interface
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the essential web files and maintenance scripts to set up
a basic web environment.
Package: zoneminder-ui-classic
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: Classic web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the classic web user interface.
Package: zoneminder-ui-mobile
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: Mobile web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the web user interface for mobile devices.
Package: zoneminder-ui-xml
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: XML interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides a XML interface mainly intended for use with the eyeZm
iPhone Application, but can be used with any other custom programs as well.
Package: zoneminder-ui-api
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: API interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides an API interface mainly intended for use with angular-ui
or mobile applications, but can be used with any other custom programs as well.

View File

@ -0,0 +1,22 @@
Copyright:
Copyright 2002 Philip Coombes <philip.coombes@zoneminder.com>
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.

View File

@ -0,0 +1 @@
README.md

View File

@ -0,0 +1,4 @@
usr/share/perl5/ZoneMinder
usr/share/perl5/ZoneMinder.pm
debian/tmp/usr/share/man/man3/ZoneMinder.3pm
debian/tmp/usr/share/man/man3/ZoneMinder::*

View File

@ -0,0 +1,3 @@
[type: gettext/rfc822deb] zoneminder-core.templates
[type: gettext/rfc822deb] zoneminder-database.templates
[type: gettext/rfc822deb] zoneminder-ui-base.templates

View File

@ -0,0 +1,252 @@
# debconf french translation file for ZoneMinder.
# Copyright (C) 2001-2008 Philip Coombes
# This file is distributed under the same license as the zoneminder package.
# First author: Emmanuel Papin <manupap01@gmail.com>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: zoneminder\n"
"Report-Msgid-Bugs-To: zoneminder@packages.debian.org\n"
"POT-Creation-Date: 2014-12-16 12:34+0100\n"
"PO-Revision-Date: 2014-12-07 00:40+0100\n"
"Last-Translator: Emmanuel Papin <manupap01@gmail.com>\n"
"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid "Delete this non empty directory?"
msgstr "Supprimer ce répertoire non vide ?"
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid ""
"A purge of the ZoneMinder package is performed but the directory '/var/cache/"
"zoneminder' is not empty so it will not be deleted."
msgstr ""
"Une purge du paquet ZoneMinder est en cours mais le répertoire '/var/cache/"
"zoneminder' n'est pas vide et sera donc conservé."
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid ""
"Please consider that this directory is designed to contain data resulting "
"from event detection. Therefore, \"proof of evidence\" could be lost!\""
msgstr ""
"Veuillez considérer que ce répertoire est conçu pour contenir des données "
"résultants de la détection d'événements. Par conséquent, des preuves "
"pourraient être perdues !"
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid ""
"If you are not sure of your decision, please do not delete this directory "
"but perform a manual checkup."
msgstr ""
"Si vous n'êtes pas sûr de votre décision, veuillez conserver ce répertoire "
"et effectuer une vérification manuelle."
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:2001
msgid "Deletion confirmed?"
msgstr "Supression confirmée ?"
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:2001
msgid ""
"You have allowed the deletion of directory '/var/cache/zoneminder' although "
"it may contain critical data."
msgstr ""
"Vous avez autorisé la suppression du répertoire '/var/cache/zoneminder' bien "
"qu'il puisse contenir des données critiques."
#. Type: select
#. Choices
#: ../zoneminder-database.templates:1001
msgid "local"
msgstr "local"
#. Type: select
#. Choices
#: ../zoneminder-database.templates:1001
msgid "remote"
msgstr "distant"
#. Type: select
#. Description
#: ../zoneminder-database.templates:1002
msgid "Database location:"
msgstr "Emplacement de la base de donnée :"
#. Type: select
#. Description
#: ../zoneminder-database.templates:1002
msgid ""
"A database server is required to run ZoneMinder. The database can be "
"installed either locally or remotely on a machine of your network."
msgstr ""
"Un serveur de base de données est requis pour ZoneMinder. La base de donnée "
"peut être installée localement ou à distance sur une machine de votre réseau."
#. Type: select
#. Description
#: ../zoneminder-database.templates:1002
msgid ""
"If you choose a remote location, you will have to select the 'tcp/ip' "
"connection method and enter the hostname or ip address of the remote machine "
"in the next configuration screens."
msgstr ""
"Si vous choisissez un emplacement distant, vous devrez sélectionner la "
"méthode de connexion 'tcp/ip' et entrer le nom réseau ou l'adresse ip de la "
"machine distante dans les écrans de configuration suivants."
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001
msgid "No local database server is available:"
msgstr "Aucun serveur local de base de données n'est disponible :"
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001
msgid ""
"Currently ZoneMinder supports mysql or mariadb database server but none of "
"them appears to be installed on this machine."
msgstr ""
"Actuellement ZoneMinder supporte les serveurs de base de données mysql et "
"mariadb mais aucun d'entre eux n'est installé sur cette machine."
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001
msgid ""
"In order to complete ZoneMinder's installation, after ending of this "
"assistant, please install a compatible database server and then restart the "
"assistant by invoking:"
msgstr ""
"Afin de compléter l'installation de ZoneMinder, après la fermeture de cet "
"assitant, veuillez installer un serveur de base de données compatible et "
"ensuite redémarrez l'assistant en invoquant :"
#. Type: error
#. Description
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001 ../zoneminder-database.templates:3001
msgid "$ sudo dpkg-reconfigure zoneminder"
msgstr "$ sudo dpkg-reconfigure zoneminder"
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid "Remote database servers are not allowed:"
msgstr "Les serveurs de base de données distants ne sont pas autorisés :"
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid ""
"The current configuration of dbconfig-common does not allow installation of "
"a database on remote servers."
msgstr ""
"La configuration actuelle de dbconfig-common ne permet pas l'installation de "
"bases de données sur des serveurs distants."
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid ""
"In order to reconfigure dbconfig-common, please invoke the following command "
"after ending of this assistant:"
msgstr ""
"Afin de reconfigurer dbconfig-common, veuillez invoquer la commande suivante "
"après la fermeture de cet assitant :"
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid "$ sudo dpkg-reconfigure dbconfig-common"
msgstr "$ sudo dpkg-reconfigure dbconfig-common"
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid ""
"Then, to complete ZoneMinder's installation, please restart this assistant "
"by invoking:"
msgstr ""
"Ensuite, pour compléter l'installation de ZoneMinder, veuillez redémarrer "
"cet assistant en invoquant :"
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid "New password for the ZoneMinder 'admin' user:"
msgstr "Nouveau mot de passe pour le compte 'admin' de ZoneMinder :"
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid "Please enter the password of the default administrative user."
msgstr "Veuillez entrer le mot de passe du compte administrateur par défaut."
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid ""
"While not mandatory, it is highly recommended that you set a custom password "
"for the administrative 'admin' user."
msgstr ""
"Bien que cela ne soit pas obligatoire, il est fortement recommandé de "
"fournir un mot de passe personnalisé pour le compte administrateur 'admin'."
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid "If this field is left blank, the password will not be changed."
msgstr "Si le champ est laissé vide, le mot de passe ne sera pas changé."
#. Type: password
#. Description
#: ../zoneminder-database.templates:5001
msgid "Repeat password for the ZoneMinder 'admin' user:"
msgstr "Répéter le mot de passe pour le compte 'admin' de ZoneMinder :"
#. Type: error
#. Description
#: ../zoneminder-database.templates:6001
msgid "Password input error"
msgstr "Erreur de mot de passe"
#. Type: error
#. Description
#: ../zoneminder-database.templates:6001
msgid "The two passwords you entered were not the same. Please try again."
msgstr ""
"Les deux mots de passe saisis ne sont pas les mêmes. Veuillez essayer à "
"nouveau."
#. Type: multiselect
#. Description
#: ../zoneminder-ui-base.templates:1001
msgid "Web server to reconfigure automatically:"
msgstr "Serveur web à reconfigurer automatiquement :"
#. Type: multiselect
#. Description
#: ../zoneminder-ui-base.templates:1001
msgid ""
"Please choose the web server that should be automatically configured for "
"ZoneMinder's web portal access."
msgstr ""
"Veuillez choisir le serveur web à reconfigurer automatiquement pour l'accès "
"au portail web de ZoneMinder."

View File

@ -0,0 +1,222 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: zoneminder\n"
"Report-Msgid-Bugs-To: zoneminder@packages.debian.org\n"
"POT-Creation-Date: 2014-12-16 12:34+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid "Delete this non empty directory?"
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid ""
"A purge of the ZoneMinder package is performed but the directory '/var/cache/"
"zoneminder' is not empty so it will not be deleted."
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid ""
"Please consider that this directory is designed to contain data resulting "
"from event detection. Therefore, \"proof of evidence\" could be lost!\""
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:1001
msgid ""
"If you are not sure of your decision, please do not delete this directory "
"but perform a manual checkup."
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:2001
msgid "Deletion confirmed?"
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder-core.templates:2001
msgid ""
"You have allowed the deletion of directory '/var/cache/zoneminder' although "
"it may contain critical data."
msgstr ""
#. Type: select
#. Choices
#: ../zoneminder-database.templates:1001
msgid "local"
msgstr ""
#. Type: select
#. Choices
#: ../zoneminder-database.templates:1001
msgid "remote"
msgstr ""
#. Type: select
#. Description
#: ../zoneminder-database.templates:1002
msgid "Database location:"
msgstr ""
#. Type: select
#. Description
#: ../zoneminder-database.templates:1002
msgid ""
"A database server is required to run ZoneMinder. The database can be "
"installed either locally or remotely on a machine of your network."
msgstr ""
#. Type: select
#. Description
#: ../zoneminder-database.templates:1002
msgid ""
"If you choose a remote location, you will have to select the 'tcp/ip' "
"connection method and enter the hostname or ip address of the remote machine "
"in the next configuration screens."
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001
msgid "No local database server is available:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001
msgid ""
"Currently ZoneMinder supports mysql or mariadb database server but none of "
"them appears to be installed on this machine."
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001
msgid ""
"In order to complete ZoneMinder's installation, after ending of this "
"assistant, please install a compatible database server and then restart the "
"assistant by invoking:"
msgstr ""
#. Type: error
#. Description
#. Type: error
#. Description
#: ../zoneminder-database.templates:2001 ../zoneminder-database.templates:3001
msgid "$ sudo dpkg-reconfigure zoneminder"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid "Remote database servers are not allowed:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid ""
"The current configuration of dbconfig-common does not allow installation of "
"a database on remote servers."
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid ""
"In order to reconfigure dbconfig-common, please invoke the following command "
"after ending of this assistant:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid "$ sudo dpkg-reconfigure dbconfig-common"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:3001
msgid ""
"Then, to complete ZoneMinder's installation, please restart this assistant "
"by invoking:"
msgstr ""
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid "New password for the ZoneMinder 'admin' user:"
msgstr ""
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid "Please enter the password of the default administrative user."
msgstr ""
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid ""
"While not mandatory, it is highly recommended that you set a custom password "
"for the administrative 'admin' user."
msgstr ""
#. Type: password
#. Description
#: ../zoneminder-database.templates:4001
msgid "If this field is left blank, the password will not be changed."
msgstr ""
#. Type: password
#. Description
#: ../zoneminder-database.templates:5001
msgid "Repeat password for the ZoneMinder 'admin' user:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:6001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder-database.templates:6001
msgid "The two passwords you entered were not the same. Please try again."
msgstr ""
#. Type: multiselect
#. Description
#: ../zoneminder-ui-base.templates:1001
msgid "Web server to reconfigure automatically:"
msgstr ""
#. Type: multiselect
#. Description
#: ../zoneminder-ui-base.templates:1001
msgid ""
"Please choose the web server that should be automatically configured for "
"ZoneMinder's web portal access."
msgstr ""

View File

@ -0,0 +1,164 @@
#!/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
INSTDIR = debian/tmp
# 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.*)(?:\-|\+nmu\d+.*)};')
DTYPE =
TARBALL = ../$(PKG)_$(VER)$(DTYPE).orig.tar.xz
%:
dh $@ --buildsystem=cmake --parallel
override_dh_auto_configure:
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" 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 \
-DCMAKE_INSTALL_SYSCONFDIR=etc/zm
override_dh_auto_test:
# do not run tests...
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:
dh_install --fail-missing
#
# 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
# The link stuff for these folders has been moved to
# zoneminder-core.links file
#
# 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.
# The link stuff for /usr/share/zoneminder/cgi-bin has been moved to
# zoneminder-ui-base.links file
override_dh_installinit:
dh_installinit --package=zoneminder-core --name=zoneminder
override_dh_systemd_start:
dh_systemd_start --package=zoneminder-core --name=zoneminder \
--restart-after-upgrade
override_dh_systemd_enable:
dh_systemd_enable --package=zoneminder-core --name=zoneminder
override_dh_fixperms:
dh_fixperms
#
# As requested by the Debian Webapps Policy Manual §3.2.1
chown root:www-data debian/zoneminder-core/etc/zm/zm.conf
chmod 640 debian/zoneminder-core/etc/zm/zm.conf
.PHONY: override_dh_strip
override_dh_strip:
dh_strip --dbg-package=zoneminder-core-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)"

View File

@ -0,0 +1 @@
3.0 (native)

View File

@ -0,0 +1 @@
extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile|aclocal.m4|compile|config.h.in|configure|depcomp|install-sh|missing)$"

View File

@ -0,0 +1,11 @@
#!/bin/sh
# config maintainer script for zoneminder-core package
set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
#DEBHELPER#
exit 0

View File

@ -0,0 +1,4 @@
var/log/zm
var/cache/zoneminder/events
var/cache/zoneminder/images
var/cache/zoneminder/temp

View File

@ -0,0 +1,5 @@
etc/zm
usr/bin
usr/share/polkit-1/actions
usr/share/polkit-1/rules.d
usr/share/man/man8

View File

@ -0,0 +1,3 @@
var/cache/zoneminder/events usr/share/zoneminder/events
var/cache/zoneminder/images usr/share/zoneminder/images
var/cache/zoneminder/temp usr/share/zoneminder/temp

View File

@ -0,0 +1,80 @@
#! /bin/sh
# postinst maintainer script for zoneminder-core package
set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
# Source the config file
CONFIGFILE=/etc/zm/zm.conf
. $CONFIGFILE
# Do this when the package is installed, upgraded or reconfigured
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
# Retrieve data from dbconfig (inputs from user)
. /etc/dbconfig-common/zoneminder.conf
# ZoneMinder config file handling
# Inspired by: http://manpages.debian.org/cgi-bin/man.cgi?query=debconf-devel&sektion=7
# Backup the config file
cp -a -f $CONFIGFILE ${CONFIGFILE}.postinst.bak
# Redeclare variables if missing in config file
test -z $dbc_dbserver || grep -Eq "^ *ZM_DB_HOST=" $CONFIGFILE \
|| echo "ZM_DB_HOST=" >> ${CONFIGFILE}.postinst.bak
test -z $dbc_dbname || grep -Eq "^ *ZM_DB_NAME=" $CONFIGFILE \
|| echo "ZM_DB_NAME=" >> ${CONFIGFILE}.postinst.bak
test -z $dbc_dbuser || grep -Eq "^ *ZM_DB_USER=" $CONFIGFILE \
|| echo "ZM_DB_USER=" >> ${CONFIGFILE}.postinst.bak
test -z $dbc_dbpass || grep -Eq "^ *ZM_DB_PASS=" $CONFIGFILE \
|| echo "ZM_DB_PASS=" >> ${CONFIGFILE}.postinst.bak
# Prevent ZM_DB_HOST to be empty if user selected the 'unix socket' method
if test -z $dbc_dbserver; then
dbc_dbserver_override="localhost"
else
dbc_dbserver_override=$dbc_dbserver
fi
# Update variables in config file
sed -i "s/^ *ZM_DB_HOST=.*/ZM_DB_HOST=$dbc_dbserver_override/" \
${CONFIGFILE}.postinst.bak
test -z $dbc_dbname || sed -i "s/^ *ZM_DB_NAME=.*/ZM_DB_NAME=$dbc_dbname/" \
${CONFIGFILE}.postinst.bak
test -z $dbc_dbuser || sed -i "s/^ *ZM_DB_USER=.*/ZM_DB_USER=$dbc_dbuser/" \
${CONFIGFILE}.postinst.bak
test -z $dbc_dbpass || sed -i "s/^ *ZM_DB_PASS=.*/ZM_DB_PASS=$dbc_dbpass/" \
${CONFIGFILE}.postinst.bak
# Clean-up backup file
mv -f ${CONFIGFILE}.postinst.bak $CONFIGFILE
# Set some file permissions
chown $ZM_WEB_USER:$ZM_WEB_GROUP /var/log/zm
if [ -z "$2" ]; then
chown $ZM_WEB_USER:$ZM_WEB_GROUP -R /var/cache/zoneminder
fi
# As requested by the Debian Webapps Policy Manual §3.2.1
chown root:${ZM_WEB_GROUP} $CONFIGFILE
chmod 640 $CONFIGFILE
fi
# Do this every time the package is installed or upgraded
# Test for database presence to avoid failure of zmupdate.pl
if [ "$dbc_install" = "true" ] && [ "$1" = "configure" ]; then
# Ensure zoneminder is stopped
deb-systemd-invoke stop zoneminder.service || exit $?
# Run the ZoneMinder update tool
zmupdate.pl --nointeractive
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,37 @@
#! /bin/sh
# postrm maintainer script for zoneminder-core package
set -e
# Source the debconf stuff
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
if [ "$1" = "purge" ]; then
# Ask the user if we have to remove the cache directory even if not empty
if [ -d /var/cache/zoneminder ] \
&& [ ! $(find /var/cache/zoneminder -maxdepth 0 -type d -empty 2>/dev/null) ]; then
RET=""
db_input high zoneminder/ask_delete || true
db_go || true
db_get zoneminder/ask_delete
if [ "$RET" = "true" ]; then
RET=""
db_input high zoneminder/ask_delete_again || true
db_go || true
db_get zoneminder/ask_delete_again
if [ "$RET" = "true" ]; then
rm -rf /var/cache/zoneminder
fi
fi
fi
fi
#DEBHELPER#
# postrm rm may freeze without that
db_stop
exit 0

View File

@ -0,0 +1,33 @@
#!/bin/sh
# preinst maintainer script for zoneminder-core package
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

View File

@ -0,0 +1,19 @@
Template: zoneminder/ask_delete
Type: boolean
Default: false
_Description: Delete this non empty directory?
A purge of the ZoneMinder package is performed but the directory
'/var/cache/zoneminder' is not empty so it will not be deleted.
.
Please consider that this directory is designed to contain data resulting from
event detection. Therefore, "proof of evidence" could be lost!"
.
If you are not sure of your decision, please do not delete this directory but
perform a manual checkup.
Template: zoneminder/ask_delete_again
Type: boolean
Default: false
_Description: Deletion confirmed?
You have allowed the deletion of directory '/var/cache/zoneminder' although
it may contain critical data.

View File

@ -0,0 +1,90 @@
#!/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 && chown www-data:www-data $RUNDIR
mkdir -p $TMPDIR && chown www-data:www-data $TMPDIR
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && 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
[ $RETVAL != 0 ] && 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

View File

@ -0,0 +1,19 @@
# 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=apache2.service
Wants=mysql.service
[Service]
User=www-data
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/usr/bin/zmpkg.pl stop
PIDFile=/var/run/zm/zm.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /var/run/zm 0755 www-data www-data

View File

@ -0,0 +1,142 @@
#!/bin/sh
# config maintainer script for zoneminder
set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
# Set the first version in which dbconfig-common was introduced in the package
dbc_first_version="1.28.0"
CONFIGFILE=/etc/zm/zm.conf
if [ -e $CONFIGFILE ]; then
# Source the config file if exists
. $CONFIGFILE
elif [ -e ${CONFIGFILE}.dpkg-new ]; then
# If no config file, source the config file which is going to be installed
# by the core package
. ${CONFIGFILE}.dpkg-new
else
# If no config file is going to be installed, set some default values
ZM_DB_HOST=
ZM_DB_NAME="zm"
ZM_DB_USER="zmuser"
fi
# Set some variables for the dbconfig-common stuff
dbc_dbserver="$ZM_DB_HOST"
dbc_dbname="$ZM_DB_NAME"
dbc_dbuser="$ZM_DB_USER"
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
# Default use dbconfig-common
dbc_install="true"
# Currently we only support mysql database
dbc_dbtypes="mysql"
# Set authentication method to password
dbc_authmethod_user="password"
# Source the dbconfig-common stuff
. /usr/share/dbconfig-common/dpkg/config
fi
# Do this when the package is installed, upgraded or reconfigured
# Most of answers are cached so the questions will not be asked again
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
# Ask the user if the database shall be installed locally or remotely
db_input high zoneminder/debconf_dblocation || true
db_go || true
db_get zoneminder/debconf_dblocation
if [ "$RET" = "local" ]; then
if [ ! -e "/usr/sbin/mysqld" ]; then
# Display a message and exit if the user want a local database but
# no database server is available
db_input high zoneminder/debconf_dblocalmissingerror || true
db_go || true
exit 0
else
# Set the database server to localhost
dbc_dbserver="localhost"
fi
else
# Source the dbconfig main configuration file
if [ -f /etc/dbconfig-common/config ]; then
. /etc/dbconfig-common/config
fi
if [ "$dbc_remote_questions_default" = "false" ]; then
# Display a message and exit if the dbconfig configuration does not
# allow installation of remote databases
# Note: To overcome this issue, we could think to override the
# default setting by using dbc_remote_questions_default='true' in
# maintainer scripts but unfortunately this does not work due to
# current dbconfig design
# More information here:
# https://bugs.launchpad.net/ubuntu/+source/dbconfig-common/+bug/1065331
db_input high zoneminder/debconf_dbconfigerror || true
db_go || true
exit 0
fi
fi
# Ask the user for all database settings
dbc_go zoneminder $@
# Ask the user for the password of the database administrator if the user
# has not yet answered to this question.
# This situation may occur if the user skipped the database creation step
# when reconfiguring the package.
RET=""
db_get zoneminder/mysql/admin-pass
if [ -z "$RET" ]; then
db_input high zoneminder/mysql/admin-pass || true
db_go || true
fi
# Do this only when not upgrading the package (no old version in argument)
if [ -z "$2" ]; then
# Ask for the password of 'admin' user
while :; do
RET=""
db_input high zoneminder/admin_password || true
db_go || true
db_get zoneminder/admin_password
# If password isn't empty we ask for password verification
if [ -z "$RET" ]; then
db_fset zoneminder/admin_password seen false
db_fset zoneminder/admin_password_again seen false
break
fi
ROOT_PW="$RET"
db_input high zoneminder/admin_password_again || true
db_go || true
db_get zoneminder/admin_password_again
if [ "$RET" = "$ROOT_PW" ]; then
ROOT_PW=""
break
fi
db_fset zoneminder/password_mismatch seen false
db_input critical zoneminder/password_mismatch || true
db_set zoneminder/admin_password ""
db_set zoneminder/admin_password_again ""
db_go || true
done
else
# If we are upgrading the package, set an empty password to disable
# password update in ZoneMinder database
db_set zoneminder/admin_password ""
fi
# Set the seen flag to not ask this question again if no password is
# provided
db_fset zoneminder/admin_password seen true
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,3 @@
usr/share/zoneminder/db
usr/share/dbconfig-common/data/zoneminder/install
usr/share/dbconfig-common/data/zoneminder/upgrade/mysql

View File

@ -0,0 +1 @@
usr/share/zoneminder/db

View File

@ -0,0 +1,79 @@
#! /bin/sh
# postinst maintainer script for zoneminder-db package
set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
mysql_update() {
# Source the dbconfig stuff
. /usr/share/dbconfig-common/internal/mysql
# Update the password of the hard-coded default 'admin' account
test -z $ADMIN_PASSWORD || dbc_mysql_exec_command "UPDATE Users SET Password = password('$ADMIN_PASSWORD') WHERE Username = 'admin';" || true
# Update the database version
dbc_mysql_exec_command "UPDATE Config SET Value = '$DB_VERSION' WHERE Name = 'ZM_DYN_DB_VERSION';" || true
}
if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then
# Set the first version in which dbconfig-common was introduced in the package
dbc_first_version="1.28.0"
# Set the database type
dbc_dbtypes="mysql"
# Source the dbconfig-common stuff
. /usr/share/dbconfig-common/dpkg/postinst
fi
# Do this when the package is installed, upgraded or reconfigured
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
# Install sql database create file for dbconfig
# (needed at first package installation)
if [ ! -f /usr/share/dbconfig-common/data/zoneminder/install/mysql ]; then
install -m 644 /usr/share/zoneminder/db/zm_create.sql \
/usr/share/dbconfig-common/data/zoneminder/install/mysql
# Remove unneeded sql requests
# dbconfig will create the underlying database
sed -i "/^ *CREATE DATABASE /d" \
/usr/share/dbconfig-common/data/zoneminder/install/mysql
sed -i "/^ *USE /d" \
/usr/share/dbconfig-common/data/zoneminder/install/mysql
fi
# Symlink sql update files for dbconfig (needed when upgrading the package)
for sqlfile in /usr/share/zoneminder/db/zm_update-*.sql; do
lnk=`echo $sqlfile | sed "s/^\/usr\/share\/zoneminder\/db\/zm_update-\(.*\)\.sql/\1/"`
if [ ! -L /usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk ]; then
ln -sf $sqlfile \
/usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk
fi
done || true
# Create the underlying database and populate it
# dbconfig will take care of applying any updates which are newer than the
# previously installed version
dbc_go zoneminder $@
# Get the password of ZoneMinder user 'admin' from debconf
db_get zoneminder/admin_password
ADMIN_PASSWORD=$RET
# Remove the password from debconf database
test -z $ADMIN_PASSWORD || db_reset zoneminder/admin_password || true
# Get the lastest database version from dbconfig upgrade folder
DB_VERSION=$(ls -rv /usr/share/dbconfig-common/data/zoneminder/upgrade/$dbc_dbtypes | head -1)
# Update the default admin account and database version
mysql_update
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,34 @@
#! /bin/sh
# postrm maintainer script for zoneminder-db package
set -e
# Source the debconf stuff
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
# Source the dbconfig stuff
if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
. /usr/share/dbconfig-common/dpkg/postrm
# Ask the user what do to with dbconfig when removing the package
dbc_go zoneminder $@
fi
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
# Remove dbconfig stuff added in postinst script
rm -rf /usr/share/dbconfig-common/data/zoneminder
# No need to manually remove the zm database, dbconfig take care of this
fi
if [ "$1" = "purge" ]; then
# Delete a potential remaining file used in postinst script
rm -f /etc/zm/zm.conf.postinst.bak
fi
#DEBHELPER#
# postrm rm may freeze without that
db_stop
exit 0

View File

@ -0,0 +1,22 @@
#!/bin/sh
# prerm script for zoneminder-db package
set -e
# Source the debconf stuff if file exists
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
# If dbconfig-common is installed and has been used by zoneminder
if [ -f /usr/share/dbconfig-common/dpkg/prerm ] \
&& [ -f /etc/dbconfig-common/zoneminder.conf ]; then
# Source the dbconfig stuff
. /usr/share/dbconfig-common/dpkg/prerm
# Ask the user what do to with dbconfig before removing the package
dbc_go zoneminder $@
fi
# #DEBHELPER#
exit 0

View File

@ -0,0 +1,58 @@
Template: zoneminder/debconf_dblocation
Type: select
__Choices: local, remote
Default: local
_Description: Database location:
A database server is required to run ZoneMinder. The database can be installed
either locally or remotely on a machine of your network.
.
If you choose a remote location, you will have to select the 'tcp/ip'
connection method and enter the hostname or ip address of the remote machine
in the next configuration screens.
Template: zoneminder/debconf_dblocalmissingerror
Type: error
_Description: No local database server is available:
Currently ZoneMinder supports mysql or mariadb database server but none of them
appears to be installed on this machine.
.
In order to complete ZoneMinder's installation, after ending of this assistant,
please install a compatible database server and then restart the assistant by
invoking:
.
$ sudo dpkg-reconfigure zoneminder
Template: zoneminder/debconf_dbconfigerror
Type: error
_Description: Remote database servers are not allowed:
The current configuration of dbconfig-common does not allow installation of
a database on remote servers.
.
In order to reconfigure dbconfig-common, please invoke the following command
after ending of this assistant:
.
$ sudo dpkg-reconfigure dbconfig-common
.
Then, to complete ZoneMinder's installation, please restart this assistant by
invoking:
.
$ sudo dpkg-reconfigure zoneminder
Template: zoneminder/admin_password
Type: password
_Description: New password for the ZoneMinder 'admin' user:
Please enter the password of the default administrative user.
.
While not mandatory, it is highly recommended that you set a custom password
for the administrative 'admin' user.
.
If this field is left blank, the password will not be changed.
Template: zoneminder/admin_password_again
Type: password
_Description: Repeat password for the ZoneMinder 'admin' user:
Template: zoneminder/password_mismatch
Type: error
_Description: Password input error
The two passwords you entered were not the same. Please try again.

View File

@ -0,0 +1 @@
usr/share/zoneminder/api

View File

@ -0,0 +1,20 @@
#!/bin/sh
# config maintainer script for zoneminder-ui-base package
set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
# Do this when the package is installed, upgraded or reconfigured
# Most of answers are cached so the questions will not be asked again
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
# Ask the user for the web server(s) to configure
db_input high zoneminder/webserver || true
db_go || true
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,11 @@
debian/apache.conf etc/zm
usr/lib/cgi-bin
usr/share/zoneminder/ajax
usr/share/zoneminder/css
usr/share/zoneminder/graphics
usr/share/zoneminder/includes
usr/share/zoneminder/index.php
usr/share/zoneminder/js
usr/share/zoneminder/lang
usr/share/zoneminder/tools
usr/share/zoneminder/views

View File

@ -0,0 +1 @@
usr/lib/cgi-bin usr/share/zoneminder/cgi-bin

View File

@ -0,0 +1,48 @@
#! /bin/sh
# postinst maintainer script for zoneminder-ui-base package
set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
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
# Enable CGI script module in apache (not enabled by default on jessie)
a2enmod cgi >/dev/null 2>&1
# Reload the web server
deb-systemd-invoke reload apache2.service || true
}
# Do this when the package is installed, upgraded or reconfigured
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
# Configure the web server
db_get zoneminder/webserver
webservers="$RET"
for webserver in $webservers; do
webserver=${webserver%,}
# Currently we only support apache2
if [ "$webserver" = "apache2" ] ; then
apache_install $1
fi
done
fi
#DEBHELPER#
exit 0

View File

@ -0,0 +1,41 @@
#! /bin/sh
# postrm maintainer script for zoneminder-ui-base package
set -e
# Source the debconf stuff
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
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
# Reload the web server
deb-systemd-invoke reload apache2.service || true
}
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
# Deconfigure the web server
db_get zoneminder/webserver
for webserver in $RET; do
webserver=${webserver%,}
# Currently we only support apache2
if [ "$webserver" = "apache2" ] ; then
apache_remove $1
fi
done
fi
#DEBHELPER#
# postrm rm may freeze without that
db_stop
exit 0

View File

@ -0,0 +1,7 @@
Template: zoneminder/webserver
Type: multiselect
Choices: apache2
Default: apache2
_Description: Web server to reconfigure automatically:
Please choose the web server that should be automatically configured for
ZoneMinder's web portal access.

View File

@ -0,0 +1 @@
usr/share/zoneminder/skins/classic

View File

@ -0,0 +1 @@
usr/share/zoneminder/skins/mobile

View File

@ -0,0 +1 @@
usr/share/zoneminder/skins/xml

View File

@ -1,10 +1,10 @@
API
===
^^^
This document will provide an overview of ZoneMinder's API.
This document will provide an overview of ZoneMinder's API. This is work in progress.
Overview
--------
^^^^^^^^
In an effort to further 'open up' ZoneMinder, an API was needed. This will
allow quick integration with and development of ZoneMinder.
@ -14,7 +14,7 @@ provides a RESTful service and supports CRUD (create, retrieve, update, delete)
functions for Monitors, Events, Frames, Zones and Config.
Examples
--------
^^^^^^^^
Here be a list of examples. Some results may be truncated.
@ -22,97 +22,244 @@ You will see each URL ending in either ``.xml`` or ``.json``. This is the
format of the request, and it determines the format that any data returned to
you will be in. I like json, however you can use xml if you'd like.
(In all examples, replace 'server' with IP or hostname & port where ZoneMinder is running)
API Version
^^^^^^^^^^^
To retrieve the API version:
::
http://server/zm/api/host/getVersion.json
Return a list of all monitors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``curl -XGET http://zmdevapi/monitors.json``
::
curl -XGET http://server/zm/api/monitors.json
Retrieve monitor 1
^^^^^^^^^^^^^^^^^^
``curl -XGET http://zmdevapi/monitors/1.json``
^^^^^^^^^^^^^^^^^^^
::
curl -XGET http://server/zm/api/monitors/1.json
Change State of Monitor 1
^^^^^^^^^^^^^^^^^^^^^^^^^^
This API changes monitor 1 to Modect and Enabled
::
curl -XPOST http://server/zm/api/monitors/1.json -d "Monitor[Function]=Modect&Monitor[Enabled]:true"
Add a monitor
^^^^^^^^^^^^^
^^^^^^^^^^^^^^
This command will add a new http monitor.
``curl -XPOST http://zmdevapi/monitors.js -d "Monitor[Name]=Cliff-Burton \
&Monitor[Function]=Modect \
&Monitor[Protocol]=http \
&Monitor[Method]=simple \
&Monitor[Host]=ussr:pass@192.168.11.20 \
&Monitor[Port]=80 \
&Monitor[Path]=/mjpg/video.mjpg \
&Monitor[Width]=704 \
&Monitor[Height]=480 \
&Monitor[Colours]=4"``
::
curl -XPOST http://server/zm/api/monitors.json -d "Monitor[Name]=Cliff-Burton \
&Monitor[Function]=Modect \
&Monitor[Protocol]=http \
&Monitor[Method]=simple \
&Monitor[Host]=usr:pass@192.168.11.20 \
&Monitor[Port]=80 \
&Monitor[Path]=/mjpg/video.mjpg \
&Monitor[Width]=704 \
&Monitor[Height]=480 \
&Monitor[Colours]=4"
Edit monitor 1
^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^
This command will change the 'Name' field of Monitor 1 to 'test1'
``curl -XPUT http://zmdevapi/monitors/1.json -d "Monitor[Name]=test1"``
::
curl -XPUT http://server/zm/api/monitors/1.json -d "Monitor[Name]=test1"
Delete monitor 1
^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^
This command will delete Monitor 1, but will _not_ delete any Events which
depend on it.
::
curl -XDELETE http://server/zm/api/monitors/1.json
``curl -XDELETE http://zmdevapi/monitors/1.json``
Return a list of all events
^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``curl -XGET http://zmdevapi/events.json``
::
curl -XGET http://server/zm/api/events.json
Note that events list can be quite large and this API (as with all other APIs in ZM)
uses pagination. Each page returns a specific set of entries. By default this is 25
and ties into WEB_EVENTS_PER_PAGE in the ZM options menu.
So the logic to iterate through all events should be something like this (pseudocode):
(unfortunately there is no way to get pageCount without getting the first page)
::
data = http://server/zm/api/events.json?page=1 # this returns the first page
# The json object returned now has a property called data.pagination.pageCount
count = data.pagination.pageCount;
for (i=1, i<count, i++)
{
data = http://server/zm/api/events.json?page=i;
doStuff(data);
}
Retrieve event Id 1000
^^^^^^^^^^^^^^^^^^^^^^
::
curl -XGET http://server/zm/api/events/1000.json
Retrieve event 1
^^^^^^^^^^^^^^^^
``curl -XGET http://zmdevapi/events/1.json``
Edit event 1
^^^^^^^^^^^^
^^^^^^^^^^^^^
This command will change the 'Name' field of Event 1 to 'Seek and Destroy'
``curl -XPUT http://zmdevapi/events/1.json -d "Event[Name]=Seek and Destroy"``
::
curl -XPUT http://server/zm/api/events/1.json -d "Event[Name]=Seek and Destroy"
Delete event 1
^^^^^^^^^^^^^^
This command will delete Event 1, and any Frames which depend on it.
``curl -XDELETE http://zmdevapi/events/1.json``
::
Edit config 121
curl -XDELETE http://server/zm/api/events/1.json
Return a list of events for a specific monitor Id =5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
curl -XGET http://server/zm/api/events/events/index/MonitorId:5.json``
Note that the same pagination logic applies if the list is too long
Return a list of events for a specific monitor within a specific date/time range
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
http://server/zm/api/events/events/index/MonitorId:5/StartTime >=:2015-05-15 18:43:56/EndTime <=:2015-05-16 18:43:56.json
To try this in CuRL, you need to URL escape the spaces like so:
::
curl -XGET "http://server/zm/api/events/index/MonitorId:5/StartTime%20>=:2015-05-15%2018:43:56/EndTime%20<=:2015-05-16%2018:43:56.json"
Return a list of events for all monitors within a specified date/time range
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
curl -XGET "http://server/zm/api/events/index/StartTime%20>=:2015-05-15%2018:43:56/EndTime%20<=:208:43:56.json"
Configuration Apis
^^^^^^^^^^^^^^^^^^^
The APIs allow you to access all the configuration parameters of ZM that you typically set inside the web console.
This returns the full list of configuration parameters:
::
curl -XGET http://server/zm/api/configs.json
Each configuration parameter has an Id, Name, Value and other fields. Chances are you are likely only going to focus on these 3.
(Example of changing config TBD)
Run State Apis
^^^^^^^^^^^^^^^
This command will change the 'Value' field of Config 121 to 901.
ZM API can be used to start/stop/restart/list states of ZM as well
Examples:
::
curl -XGET http://server/zm/api/states.json # returns list of run states
curl -XPOST http://server/zm/api/states/change/restart.json #restarts ZM
curl -XPOST http://server/zm/api/states/change/stop.json #Stops ZM
curl -XPOST http://server/zm/api/states/change/start.json #Starts ZM
``curl -XPUT http://zmdevapi/configs/121.json -d "Config[Value]=901"``
Create a Zone
^^^^^^^^^^^^^
^^^^^^^^^^^^^^
::
curl -XPOST http://server/zm/api/zones.json -d "Zone[Name]=Jason-Newsted \
&Zone[MonitorId]=3 \
&Zone[Type]=Active \
&Zone[Units]=Percent \
&Zone[NumCoords]=4 \
&Zone[Coords]=0,0 639,0 639,479 0,479 \
&Zone[AlarmRGB]=16711680 \
&Zone[CheckMethod]=Blobs \
&Zone[MinPixelThreshold]=25 \
&Zone[MaxPixelThreshold]= \
&Zone[MinAlarmPixels]=9216 \
&Zone[MaxAlarmPixels]= \
&Zone[FilterX]=3 \
&Zone[FilterY]=3 \
&Zone[MinFilterPixels]=9216 \
&Zone[MaxFilterPixels]=230400 \
&Zone[MinBlobPixels]=6144 \
&Zone[MaxBlobPixels]= \
&Zone[MinBlobs]=1 \
&Zone[MaxBlobs]= \
&Zone[OverloadFrames]=0"
PTZ Control APIs
^^^^^^^^^^^^^^^^
PTZ controls associated with a monitor are stored in the Controls table and not the Monitors table inside ZM. What that means is when you get the details of a Monitor, you will only know if it is controllable (isControllable:true) and the control ID.
To be able to retrieve PTZ information related to that Control ID, you need to use the controls API
This returns all the control definitions:
::
curl http://server/zm/api/controls.json
This returns control definitions for a specific control ID=5
::
curl http://server/zm/api/controls/5.json
Host APIs
^^^^^^^^^^
ZM APIs have various APIs that help you in determining host (aka ZM) daemon status, load etc. Some examples:
::
curl -XGET http://server/zm/api/host/daemonCheck.json # 1 = ZM running 0=not running
curl -XGET http://server/zm/api/host/getLoad.json # returns current load of ZM
curl -XGET http://server/zm/api/host/getDiskPercent.json # returns in GB (not percentage), disk usage per monitor (that is, space taken to store various event related information,images etc. per monitor) ``
``curl -XPOST http://zmdevapi/zones.json -d "Zone[Name]=Jason-Newsted \
&Zone[MonitorId]=3 \
&Zone[Type]=Active \
&Zone[Units]=Percent \
&Zone[NumCoords]=4 \
&Zone[Coords]=0,0 639,0 639,479 0,479 \
&Zone[AlarmRGB]=16711680 \
&Zone[CheckMethod]=Blobs \
&Zone[MinPixelThreshold]=25 \
&Zone[MaxPixelThreshold]= \
&Zone[MinAlarmPixels]=9216 \
&Zone[MaxAlarmPixels]= \
&Zone[FilterX]=3 \
&Zone[FilterY]=3 \
&Zone[MinFilterPixels]=9216 \
&Zone[MaxFilterPixels]=230400 \
&Zone[MinBlobPixels]=6144 \
&Zone[MaxBlobPixels]= \
&Zone[MinBlobs]=1 \
&Zone[MaxBlobs]= \
&Zone[OverloadFrames]=0"``

View File

@ -24,6 +24,12 @@ endif(NOT ZM_NO_X10)
configure_file(zm.in "${CMAKE_CURRENT_BINARY_DIR}/zm" @ONLY)
#configure_file(zmeventdump.in zmeventdump @ONLY)
# Generate man files for the perl scripts destined for the bin folder
file(GLOB perlscripts RELATIVE "${CMAKE_CURRENT_BINARY_DIR}" "*.pl")
FOREACH(PERLSCRIPT ${perlscripts})
POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/${PERLSCRIPT} zoneminder-${PERLSCRIPT} 8)
ENDFOREACH(PERLSCRIPT ${perlscripts})
# Install the perl scripts
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmaudit.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcontrol.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmdc.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmfilter.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmpkg.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrack.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrigger.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmupdate.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmvideo.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmwatch.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcamtool.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmsystemctl.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
if(NOT ZM_NO_X10)

View File

@ -0,0 +1,355 @@
# Modified on Jun 19 2016 by PP
# Changes made
# - modified command to work properly and pick up credentials from Control Device
# - the old script did not stop moving- added autostop
# (note that mjpeg cameras have onestep but that is too granular)
# - You need to set "user=xxx&pwd=yyy" in the ControlDevice field (NOT usr like in Foscam HD)
# ==========================================================================
#
# ZoneMinder Foscam FI8918W IP Control Protocol Module, $Date: 2009-11-25 09:20:00 +0000 (Wed, 04 Nov 2009) $, $Revision: 0001 $
# Copyright (C) 2001-2008 Philip Coombes
# Modified for use with Foscam FI8918W IP Camera by Dave Harris
# Modified Feb 2011 by Howard Durdle (http://durdl.es/x) to:
# fix horizontal panning, add presets and IR on/off
# use Control Device field to pass username and password
# Modified May 2014 by Arun Horne (http://arunhorne.co.uk) to:
# use HTTP basic auth as required by firmware 11.37.x.x upward
#
# 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 Foscam FI8918W IP camera control
# protocol
#
package MyAgent;
use base 'LWP::UserAgent';
package ZoneMinder::Control::FI8918W;
use 5.006;
use strict;
use warnings;
require ZoneMinder::Base;
require ZoneMinder::Control;
our @ISA = qw(ZoneMinder::Control);
our $VERSION = $ZoneMinder::Base::VERSION;
# ==========================================================================
#
# Foscam FI8918W IP 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 );
my $logindetails = "";
bless( $self, $class );
srand( time() );
return $self;
}
our $AUTOLOAD;
sub AUTOLOAD
{
my $self = shift;
my $class = ref($self) || croak( "$self not object" );
my $name = $AUTOLOAD;
$name =~ s/.*://;
if ( exists($self->{$name}) )
{
return( $self->{$name} );
}
Fatal( "Can't access $name member of object of class $class" );
}
our $stop_command;
sub open
{
my $self = shift;
$self->loadMonitor();
$self->{ua} = MyAgent->new;
$self->{ua}->agent( "ZoneMinder Control Agent/" );
$self->{state} = 'open';
}
sub close
{
my $self = shift;
$self->{state} = 'closed';
}
sub printMsg
{
my $self = shift;
my $msg = shift;
my $msg_len = length($msg);
Debug( $msg."[".$msg_len."]" );
}
sub sendCmd
{
my $self = shift;
my $cmd = shift;
my $result = undef;
printMsg( $cmd, "Tx" );
# PP Old cameras also support onstep=1 but it is too granular. Instead using moveCon and stop after interval
# PP - cleaned up URL to take it properly from Control device
# Control device needs to be of format user=xxx&pwd=yyy
my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd"."&".$self->{Monitor}->{ControlDevice});
print ("Sending $req\n");
my $res = $self->{ua}->request($req);
if ( $res->is_success )
{
$result = !undef;
}
else
{
Error( "Error REALLY check failed:'".$res->status_line()."'" );
Error ("Cmd:".$req);
}
return( $result );
}
sub reset
{
my $self = shift;
Debug( "Camera Reset" );
my $cmd = "reboot.cgi?";
$self->sendCmd( $cmd );
}
# PP - in all move operations, added auto stop after timeout
#Up Arrow
sub moveConUp
{
my $self = shift;
Debug( "Move Up" );
my $cmd = "decoder_control.cgi?command=0";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
#Down Arrow
sub moveConDown
{
my $self = shift;
Debug( "Move Down" );
my $cmd = "decoder_control.cgi?command=2";
$self->sendCmd( $cmd );
}
#Left Arrow
sub moveConLeft
{
my $self = shift;
Debug( "Move Left" );
my $cmd = "decoder_control.cgi?command=6";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
#Right Arrow
sub moveConRight
{
my $self = shift;
Debug( "Move Right" );
my $cmd = "decoder_control.cgi?command=4";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
#Diagonally Up Right Arrow
sub moveConUpRight
{
my $self = shift;
Debug( "Move Diagonally Up Right" );
my $cmd = "decoder_control.cgi?command=90";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
#Diagonally Down Right Arrow
sub moveConDownRight
{
my $self = shift;
Debug( "Move Diagonally Down Right" );
my $cmd = "decoder_control.cgi?command=92";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
#Diagonally Up Left Arrow
sub moveConUpLeft
{
my $self = shift;
Debug( "Move Diagonally Up Left" );
my $cmd = "decoder_control.cgi?command=91";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
#Diagonally Down Left Arrow
sub moveConDownLeft
{
my $self = shift;
Debug( "Move Diagonally Down Left" );
my $cmd = "decoder_control.cgi?command=93";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
#Stop
sub moveStop
{
my $self = shift;
Debug( "Move Stop" );
my $cmd = "decoder_control.cgi?command=1";
$self->sendCmd( $cmd );
}
# PP - imported from 9831 - autostop after usleep
sub autoStop
{
my $self = shift;
my $autostop = shift;
if( $autostop )
{
Debug( "Auto Stop" );
usleep( $autostop );
my $cmd = "decoder_control.cgi?command=1";
$self->sendCmd( $cmd );
}
}
#Move Camera to Home Position
sub presetHome
{
my $self = shift;
Debug( "Home Preset" );
my $cmd = "decoder_control.cgi?command=25";
$self->sendCmd( $cmd );
}
#Set preset
sub presetSet
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
my $presetCmd = 30 + ($preset*2);
Debug( "Set Preset $preset with cmd $presetCmd" );
my $cmd = "decoder_control.cgi?command=$presetCmd";
$self->sendCmd( $cmd );
}
#Goto preset
sub presetGoto
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
my $presetCmd = 31 + ($preset*2);
Debug( "Goto Preset $preset with cmd $presetCmd" );
my $cmd = "decoder_control.cgi?command=$presetCmd";
$self->sendCmd( $cmd );
}
#Turn IR on
sub wake
{
my $self = shift;
Debug( "Wake - IR on" );
my $cmd = "decoder_control.cgi?command=95";
$self->sendCmd( $cmd );
}
#Turn IR off
sub sleep
{
my $self = shift;
Debug( "Sleep - IR off" );
my $cmd = "decoder_control.cgi?command=94";
$self->sendCmd( $cmd );
}
1;
__END__
=head1 FI8918W
ZoneMinder::Database - Perl extension for FOSCAM FI8918W
=head1 SYNOPSIS
Control script for Foscam MJPEG 8918W cameras.
=head1 DESCRIPTION
You need to set "user=xxx&pwd=yyy" in the ControlDevice field
of the control tab for that monitor.
Auto TimeOut should be 1. Don't set it to less - processes
start crashing :)
NOTE: unlike HD foscam cameras, this one uses "user" not "usr"
in the control device
=head2 EXPORT
None by default.
=head1 SEE ALSO
=head1 AUTHOR
Philip Coombes, E<lt>philip.coombes@zoneminder.comE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2001-2008 Philip Coombes
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.
=cut

View File

@ -0,0 +1,763 @@
# Modified by PP to clean up user/auth dependencies inside the script
# Also, you can specify your auth credentials in the Control tab of the monitor
# In "ControlDevice" put in
# usr=xxxx&pwd=xxx
# where xxx is the auth credentials to your foscam camera
# The Foscam CGI manual referred to was v1.0.10
# All other notices below may be stale
#
# ==========================================================================
#
# ZoneMinder FOSCAM version 1.0 API Control Protocol Module, $Date$, $Revision$
# Copyright (C) 2001-2008 Philip Coombes
#
# 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 FI8620_Y2k.pm contains the implementation of API camera control
# For FOSCAM FI8620 Dome PTZ Camera (This cam support only H264 streaming)
# V1.0 Le 09 AOUT 2013 - production usable for the script but not for the camera "reboot itself"
# If you wan't to contact me i understand French and English, precise ZoneMinder in subject
# My name is Christophe DAPREMONT my email is christophe_y2k@yahoo.fr
#
# =========================================================================================
#
package ZoneMinder::Control::FI9831W;
use 5.006;
use strict;
use warnings;
require ZoneMinder::Base;
require ZoneMinder::Control;
our @ISA = qw(ZoneMinder::Control);
# ===================================================================================================================================
#
# FI9821 FOSCAM PT H264 Control Protocol
# with Firmware version V1.2.1.1 (latest at 09/08/2013)
# based with the latest buggy CGI doc from FOSCAM ( http://foscam.us/forum/cgi-sdk-for-hd-camera-t6045.html )
# This IPCAM work under ZoneMinder V1.25 from alternative source of code
# from this svn at https://svn.unixmedia.net/public/zum/trunk/zum/
# Many Thanks to "MASTERTHEKNIFE" for the excellent speed optimisation ( http://www.zoneminder.com/forums/viewtopic.php?f=9&t=17652 )
# And to "NEXTIME" for the recent source update and incredible plugins ( http://www.zoneminder.com/forums/viewtopic.php?f=9&t=20587 )
# And all people helping ZoneMinder dev.
#
# -FUNCTION: display on OSD
# speed is progressive in function of where you click on arrow ========>
# speed low=/ \=speed high
# ===================================================================================================================================
use ZoneMinder::Logger qw(:all);
use ZoneMinder::Config qw(:all);
use Time::HiRes qw( usleep );
# Set $osd to "off" if you wan't disabled OSD i need to place this variable in another script because
# this script is reload at every command ,if i want the button on/off (Focus MAN) for OSD works...
# PP - changed this to off - it achieves OSD by renaming the Device and what happens is at times
# it does not reset the name if a command fails. Net result: Your camera gets a name like "Move Left" which
# I bet you won't like
my $osd = "off";
my $cmd;
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;
#PP
#$self->{ua}->agent( "ZoneMinder Control Agent/".ZoneMinder::Base::ZM_VERSION );
$self->{ua}->agent( "ZoneMinder Control Agent/" );
$self->{state} = 'open';
}
sub close
{
my $self = shift;
$self->{state} = 'closed';
}
sub printMsg
{
my $self = shift;
my $msg = shift;
my $msg_len = length($msg);
Debug( $msg."[".$msg_len."]" );
}
sub sendCmd
{
my $self = shift;
my $cmd = shift;
my $result = undef;
printMsg( $cmd, "Tx" );
my $temps = time();
#PP - cleaned this up so it picks up the full auth from Control Devices
my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/cgi-bin/CGIProxy.fcgi?cmd=".$cmd."&".$self->{Monitor}->{ControlDevice} );
#my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/cgi-bin/CGIProxy.fcgi?usr%3Dadmin%26pwd%3D".$self->{Monitor}->{ControlDevice}."%26cmd%3D".$cmd."%26".$temps );
my $res = $self->{ua}->request($req);
if ( $res->is_success )
{
$result = !undef;
}
else
{
Error( "Error check failed: '".$res->status_line()."'" );
}
return( $result );
}
# PP - changed this to a system reboot. Its harmful to reset here. Settings may change
# with different firmware versions. Better to make this a reboot and use the camera
# interface to reset streams
sub reset
{ my $self = shift;
Debug ( "Reboot= setup camera FoscamHD" );
$cmd = "rebootSystem";
#my $cmd = "setOSDSetting%26isEnableTimeStamp%3D0%26isEnableDevName%3D1%26dispPos%3D0%26isEnabledOSDMask%3D0";
Info ("Sending reboot $cmd");
$self->sendCmd( $cmd );
# Setup For Stream=0 Resolution=720p Bandwith=4M FPS=30 KeyFrameInterval/GOP=100 VBR=ON
#$cmd = "setVideoStreamParam%26streamType%3D0%26resolution%3D0%26bitRate%3D4194304%26frameRate%3D30%26GOP%3D100%26isVBR%3D1";
#$self->sendCmd( $cmd );
# Setup For Infrared AUTO
#$cmd = "setInfraLedConfig%26Mode%3D1";
#$self->sendCmd( $cmd );
# Reset image settings
#$cmd = "resetImageSetting";
#$self->sendCmd( $cmd );
}
sub moveStop
{
my $self = shift;
Debug( "Move Stop" );
my $cmd = "ptzStopRun";
$self->sendCmd( $cmd );
if ($osd eq "on")
{
$cmd = "setDevName%26devName%3D.";
$self->sendCmd( $cmd );
$cmd = "setOSDSetting%26isEnableDevName%3D1";
$self->sendCmd( $cmd );
}
}
sub autoStop
{
my $self = shift;
my $autostop = shift;
if( $autostop )
{
Debug( "Auto Stop" );
usleep( $autostop );
my $cmd = "ptzStopRun";
$self->sendCmd( $cmd );
}
}
sub moveConUp
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Up" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Up $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveUp";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConDown
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalization
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Down" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Down $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveDown";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConLeft
{
my $self = shift;
my $params = shift;
my $panspeed = $self->getParam( $params, 'panspeed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $panspeed > 4 ) {
$panspeed = 4;
}
if ( $panspeed < 0 ) {
$panspeed = 0;
}
Debug( "Move Left" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Left $panspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$panspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConRight
{
my $self = shift;
my $params = shift;
my $panspeed = $self->getParam( $params, 'panspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$panspeed = abs($panspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $panspeed > 4 ) {
$panspeed = 4;
}
if ( $panspeed < 0 ) {
$panspeed = 0;
}
Debug( "Move Right" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Right $panspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$panspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConUpLeft
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Up Left" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Up Left $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveTopLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConUpRight
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Up Right" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Up Right $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveTopRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConDownLeft
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Down Left" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Down Left $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveBottomLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub moveConDownRight
{
my $self = shift;
my $params = shift;
my $tiltspeed = $self->getParam( $params, 'tiltspeed' );
# speed inverter 4-->0 , 3-->1 , 2-->2 , 1-->3 , 0-->4
$tiltspeed = abs($tiltspeed - 4);
# Normalisation en cas de valeur erronée dans la base de données
if ( $tiltspeed > 4 ) {
$tiltspeed = 4;
}
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Con Down Right" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Down Right $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
$cmd = "ptzMoveBottomRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub zoomConTele
{
my $self = shift;
Debug( "Zoom-Tele=MANU IR LED ON" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DManual IR LED Switch ON";
$self->sendCmd( $cmd );
}
my $cmd = "setInfraLedConfig%26mode%3D1";
$self->sendCmd( $cmd );
$cmd = "openInfraLed";
$self->sendCmd( $cmd );
}
sub zoomConWide
{
my $self = shift;
Debug( "Zoom-Wide=MANU IR LED OFF" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DManual IR LED Switch OFF";
$self->sendCmd( $cmd );
}
my $cmd = "setInfraLedConfig%26mode%3D1";
$self->sendCmd( $cmd );
$cmd = "closeInfraLed";
$self->sendCmd( $cmd );
}
sub wake
{
my $self = shift;
Debug( "Wake=AUTO IR LED" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DAuto IR LED Mode";
$self->sendCmd( $cmd );
}
my $cmd = "setInfraLedConfig%26mode%3D0";
$self->sendCmd( $cmd );
}
sub focusConNear
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Focus Near=Sharpness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSharpness $speed";
$self->sendCmd( $cmd );
$cmd = "setOSDSetting%26isEnableDevName%3D1";
$self->sendCmd( $cmd );
}
my $cmd = "setSharpness%26sharpness%3D$speed";
$self->sendCmd( $cmd );
# La variable speed ne fonctionne pas en paramètre du focus, alors je l'utilise pour définir la durée de la commande
# le résulat est identique
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub focusConFar
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Focus Far" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSharpness $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setSharpness%26sharpness%3D$speed";
$self->sendCmd( $cmd );
# La variable speed ne fonctionne pas en paramètre du focus alors je l'utilise pour définir la durée de la commande
# le résulat est identique
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub focusAuto
{
my $self = shift;
Debug( "Focus Auto=Reset Sharpness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DReset Sharpness";
$self->sendCmd( $cmd );
}
my $cmd = "setSharpness%26sharpness%3D10";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub focusMan
{
my $self = shift;
Debug( "Focus Manu=Reset Sharpness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DFOSCAM FI9821W Script V1.0 By Christophe_y2k";
$self->sendCmd( $cmd );
}
}
sub whiteConIn
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "White ConIn=brightness" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DBrightness $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setBrightness%26brightness%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub whiteConOut
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "White ConOut=Contrast" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DContrast $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setContrast%26constrast%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub whiteAuto
{
my $self = shift;
Debug( "White Auto=Brightness Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DBrightness Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setBrightness%26brightness%3D50";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub whiteMan
{
my $self = shift;
Debug( "White Manuel=Contrast Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DContrast Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setContrast%26constrast%3D44";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisConOpen
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Iris ConOpen=Saturation" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSaturation $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setSaturation%26saturation%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisConClose
{
my $self = shift;
my $params = shift;
my $speed = $self->getParam( $params, 'speed' );
# Normalisation en cas de valeur erronée dans la base de données
if ( $speed > 100 ) {
$speed = 100;
}
if ( $speed < 0 ) {
$speed = 0;
}
Debug( "Iris ConClose=Hue" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DHue $speed";
$self->sendCmd( $cmd );
}
my $cmd = "setHue%26hue%3D$speed";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisAuto
{
my $self = shift;
Debug( "Iris Auto=Saturation Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSaturation Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setSaturation%26saturation%3D30";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub irisMan
{
my $self = shift;
Debug( "Iris Manuel=Hue Reset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DHue Reset";
$self->sendCmd( $cmd );
}
my $cmd = "setHue%26hue%3D6";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
sub presetSet
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
if ( ( $preset >= 1 ) && ( $preset <= 16 ) ) {
Debug( "Clear Preset $preset" );
my $cmd = "ptzDeletePresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
Debug( "Set Preset $preset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DSet Preset $preset";
$self->sendCmd( $cmd );
}
$cmd = "ptzAddPresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
}
}
sub presetGoto
{
my $self = shift;
my $params = shift;
my $preset = $self->getParam( $params, 'preset' );
if ( ( $preset >= 1 ) && ( $preset <= 16 ) ) {
Debug( "Goto Preset $preset" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DGoto Preset $preset";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D0";
$self->sendCmd( $cmd );
$cmd = "ptzGotoPresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
}
}
1;
__END__
# Below is stub documentation for your module. You'd better edit it!
=head1 FI9831W
ZoneMinder::Database - Perl extension for FOSCAM FI9831W
=head1 SYNOPSIS
Control script for Foscam HD cameras. Tested on 9831W but
should work on others too.
=head1 DESCRIPTION
Control script for Foscam HD cameras. Tested on 9831W but
should work on others too.
You need to set "usr=xxx&pwd=yyy" in the ControlDevice field
of the control tab for that monitor.
Auto TimeOut should be 1. Don't set it to less - processes
start crashing :)
=head2 EXPORT
None by default.
=head1 SEE ALSO
=head1 AUTHOR
Philip Coombes, E<lt>philip.coombes@zoneminder.comE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2001-2008 Philip Coombes
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.
=cut

View File

@ -107,7 +107,14 @@ sub sendCmd
printMsg( $cmd, "Tx" );
my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."$cmd" );
my $url;
if ( $self->{Monitor}->{ControlAddress} =~ /^http/ ) {
$url = $self->{Monitor}->{ControlAddress}.$cmd;
} else {
$url = 'http://'.$self->{Monitor}->{ControlAddress}.$cmd;
} # en dif
my $req = HTTP::Request->new( GET=>$url );
my $res = $self->{ua}->request($req);
if ( $res->is_success )

View File

@ -58,6 +58,12 @@ sub open
{
my $self = shift;
my $device = new Device::SerialPort( $self->{path} );
if ( ! $device )
{
Error( "Unable to open $$self{path}: $!" );
$self->{state} = 'closed';
return;
}
$device->baudrate(9600);
$device->databits(8);
$device->parity('none');

View File

@ -156,7 +156,7 @@ if ( !$server_up )
while (!connect( CLIENT, $saddr ))
{
$attempts++;
Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY);
Fatal( "Can't connect: $! after $attempts attempts to $sock_file" ) if ($attempts > MAX_CONNECT_DELAY);
sleep(1);
}
}

View File

@ -414,8 +414,7 @@ sub start
my $daemon = shift;
my @args = @_;
my $command = $daemon;
$command .= ' '.join( ' ', ( @args ) ) if ( @args );
my $command = join(' ', $daemon, @args );
my $process = $cmd_hash{$command};
if ( !$process )
@ -506,22 +505,13 @@ sub start
}
}
sub _stop
{
my $final = shift;
my $daemon = shift;
my @args = @_;
# Sends the stop signal, without waiting around to see if the process died.
sub send_stop {
my ( $final, $process ) = @_;
my $command = $process->{command};
if ( $process->{pending} ) {
my $command = $daemon;
$command .= ' '.join( ' ', ( @args ) ) if ( @args );
my $process = $cmd_hash{$command};
if ( !$process )
{
dPrint( ZoneMinder::Logger::WARNING, "Can't find process with command of '$command'\n" );
return();
}
elsif ( $process->{pending} )
{
delete( $cmd_hash{$command} );
dPrint( ZoneMinder::Logger::INFO, "Command '$command' removed from pending list at "
.strftime( '%y/%m/%d %H:%M:%S', localtime() )
@ -530,37 +520,63 @@ sub _stop
return();
}
my $cpid = $process->{pid};
if ( !$pid_hash{$cpid} )
my $pid = $process->{pid};
if ( !$pid_hash{$pid} )
{
dPrint( ZoneMinder::Logger::ERROR, "No process with command of '$command' is running\n" );
dPrint( ZoneMinder::Logger::ERROR, "No process with command of '$command' pid $pid is running\n" );
return();
}
dPrint( ZoneMinder::Logger::INFO, "'$daemon ".join( ' ', @args )
."' stopping at "
dPrint( ZoneMinder::Logger::INFO, "'$command' sending stop to pid $pid at "
.strftime( '%y/%m/%d %H:%M:%S', localtime() )
."\n"
);
$process->{keepalive} = !$final;
kill( 'TERM', $cpid );
delete( $cmd_hash{$command} );
kill( 'TERM', $pid );
return $pid;
} # end sub send_stop
sub kill_until_dead {
my ( $process ) = @_;
# Now check it has actually gone away, if not kill -9 it
my $count = 0;
while( $cpid && kill( 0, $cpid ) )
while( $process and $$process{pid} and kill( 0, $$process{pid} ) )
{
if ( $count++ > 5 )
{
kill( 'KILL', $cpid );
dPrint( ZoneMinder::Logger::WARNING, "'$$process{command}' has not stopped at "
.strftime( '%y/%m/%d %H:%M:%S', localtime() )
.". Sending KILL to pid $$process{pid}\n"
);
kill( 'KILL', $$process{pid} );
}
sleep( 1 );
}
}
sub _stop {
my ($final, $process ) = @_;
my $pid = send_stop( $final, $process );
return if ! $pid;
delete( $cmd_hash{$$process{command}} );
kill_until_dead( $process );
}
sub stop
{
_stop( 1, @_ );
my ( $daemon, @args ) = @_;
my $command = join(' ', $daemon, @args );
my $process = $cmd_hash{$command};
if ( !$process )
{
dPrint( ZoneMinder::Logger::WARNING, "Can't find process with command of '$command'\n" );
return();
}
_stop( 1, $process );
}
sub restart
@ -578,7 +594,7 @@ sub restart
my $cpid = $process->{pid};
if ( defined($pid_hash{$cpid}) )
{
_stop( 0, $daemon, @args );
_stop( 0, $process );
return;
}
}
@ -639,7 +655,7 @@ sub reaper
my $exit_signal = $status&0xfe;
my $core_dumped = $status&0x01;
my $out_str = "'$process->{daemon} ".join( ' ', @{$process->{args}} )."' ";
my $out_str = "'$process->{command}' ";
if ( $exit_signal )
{
if ( $exit_signal == 15 || $exit_signal == 14 ) # TERM or ALRM
@ -678,17 +694,16 @@ sub reaper
if ( $process->{keepalive} )
{
# Schedule for immediate restart
$cmd_hash{$process->{command}} = $process;
if ( !$process->{delay} || ($process->{runtime} > $Config{ZM_MAX_RESTART_DELAY} ) )
{
#start( $process->{daemon}, @{$process->{args}} );
# Schedule for immediate restart
$cmd_hash{$process->{command}} = $process;
$process->{pending} = $process->{stopped};
$process->{delay} = 5;
}
else
{
$cmd_hash{$process->{command}} = $process;
$process->{pending} = $process->{stopped}+$process->{delay};
$process->{delay} *= 2;
# Limit the start delay to 15 minutes max
@ -718,9 +733,20 @@ sub restartPending
sub shutdownAll
{
foreach my $process ( values( %pid_hash ) )
{
stop( $process->{daemon}, @{$process->{args}} );
foreach my $pid ( keys %pid_hash ) {
# This is a quick fix because a SIGCHLD can happen and alter pid_hash while we are in here.
next if ! $pid_hash{$pid};
send_stop( 1, $pid_hash{$pid} );
}
foreach my $pid ( keys %pid_hash ) {
# This is a quick fix because a SIGCHLD can happen and alter pid_hash while we are in here.
next if ! $pid_hash{$pid};
my $process = $pid_hash{$pid};
kill_until_dead( $process );
delete( $cmd_hash{$$process{command}} );
delete( $pid_hash{$pid} );
}
killAll( 5 );
dPrint( ZoneMinder::Logger::INFO, "Server shutdown at "
@ -830,21 +856,20 @@ sub killAll
{
my $delay = shift;
sleep( $delay );
my $killall;
if ( '@HOST_OS@' eq 'BSD' )
{
$killall = 'killall -';
} elsif ( '@HOST_OS@' eq 'solaris' ) {
$killall = 'pkill -';
} else {
$killall = 'killall -q -s ';
}
my $killall;
if ( '@HOST_OS@' eq 'BSD' )
{
$killall = 'killall -';
} elsif ( '@HOST_OS@' eq 'solaris' ) {
$killall = 'pkill -';
} else {
$killall = 'killall -q -s ';
}
foreach my $daemon ( @daemons )
{
my $cmd = $killall ."TERM $daemon";
Debug( $cmd );
qx( $cmd );
my $cmd = $killall ."TERM $daemon";
Debug( $cmd );
qx( $cmd );
}
sleep( $delay );
foreach my $daemon ( @daemons )

View File

@ -55,6 +55,7 @@ use autouse 'Pod::Usage'=>qw(pod2usage);
$ENV{PATH} = '/bin:/usr/bin';
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
my $store_state=""; # PP - will remember state name passed
logInit();
@ -90,6 +91,7 @@ if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot|version)$/ )
{ Id=>$id, Function=>$function, Enabled=>$enabled }
);
}
$store_state=$command; # PP - Remember the name that was passed to search in DB
$command = 'state';
}
else
@ -149,6 +151,18 @@ if ( $command eq "state" )
}
}
$sth->finish();
#PP - lets go ahead and modify States DB
Debug ("Marking $store_state as Enabled");
# PP - Zero out other states being active
resetStates();
# PP - Now mark a specific state as active
$sql = "update States set IsActive = '1' where Name = ?";
$sth = $dbh->prepare_cached( $sql )
or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
$res = $sth->execute( $store_state )
or Fatal( "Can't execute: ".$sth->errstr() );
$command = "restart";
}
@ -159,6 +173,9 @@ if ( $command =~ /^(start|stop|restart)$/ )
# We have to detaint to keep perl from complaining
$command = $1;
# PP - if we are not switching to a custom state, zero out all isActive
resetStates() if (!$store_state);
if ( systemdRunning() && !calledBysystem() ) {
qx(@BINDIR@/zmsystemctl.pl $command);
$command = "";
@ -290,6 +307,19 @@ if ( $command eq "logrot" )
exit( $retval );
# PP - when the system is restarted/started/stopped, it will
# not be in a custom state, so lets keep the DB consistent
sub resetStates
{
$dbh = zmDbConnect() if ! $dbh;
my $sql = "update States set IsActive = '0'";
my $sth = $dbh->prepare_cached( $sql )
or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
my $res = $sth->execute()
or Fatal( "Can't execute: ".$sth->errstr() );
}
sub systemdRunning
{
my $result = 0;

View File

@ -31,10 +31,15 @@ zmsystemctl.pl - ZoneMinder systemctl wrapper
=head1 DESCRIPTION
This is a wrapper script that allows zoneminder to start and stop itself
in a manner that keeps it in-sync with systemd. This script is intended
to be called internally by zoneminder and may not give the desired results
if run from the command line.
This script allows an unpriveledged user to start, stop, or restart the
zoneminder service on a system running systemd. It does this by redirecting
commands through pkexec, which checks the available polkit policy files. The
default policy file grants the system web account user permission. This can be
changed or expanded by modifying the policy file. See man polkit for details.
=head1 SEE ALSO
polkit(8), pkexec(1)
=cut
use warnings;

View File

@ -28,7 +28,82 @@ zmtrigger.pl - ZoneMinder External Trigger Script
=head1 DESCRIPTION
This script is used to trigger and cancel alarms from external connections
using an arbitrary text based format
using an arbitrary text based format.
This script offers generic solution to external triggering of alarms. It
can handle external connections via either internet socket, unix socket or
file/device interfaces. You can either use it 'as is' if you can interface
with the existing format, or override connections and channels to customise
it to your needs.
If enabled by the OPT_TRIGGERS option, Zoneminder service start
zmtrigger.pl which listens for control messages on TCP port 6802.
=head1 TRIGGER MESSAGE FORMAT
B<id>|B<action>|B<score>|B<cause>|B<text>|B<showtext>
=over 4
=item B<id>
is the id number or name of the ZM monitor.
=item B<action>
Valid actions are 'on', 'off', 'cancel' or 'show' where
'on' forces an alarm condition on;
'off' forces an alarm condition off;
'cancel' negates the previous 'on' or 'off'.
The 'show' action merely updates some auxiliary text which can optionally
be displayed in the images captured by the monitor. Ordinarily you would
use 'on' and 'cancel', 'off' would tend to be used to suppress motion
based events. Additionally 'on' and 'off' can take an additional time
offset, e.g. on+20 which automatically 'cancel's the previous action
after that number of seconds.
=item B<score>
is the score given to the alarm, usually to indicate it's
importance. For 'on' triggers it should be non-zero, otherwise it should
be zero.
=item B<cause>
is a 32 char max string indicating the reason for, or source of
the alarm e.g. 'Relay 1 open'. This is saved in the 'Cause' field of the
event. Ignored for 'off' or 'cancel' messages.
=item B<text>
is a 256 char max additional info field, which is saved in the
'Description' field of an event. Ignored for 'off' or 'cancel' messages.
=item B<showtext>
is up to 32 characters of text that can be displayed in the
timestamp that is added to images. The 'show' action is designed to
update this text without affecting alarms but the text is updated, if
present, for any of the actions. This is designed to allow external input
to appear on the images captured, for instance temperature or personnel
identity etc.
=back
Note that multiple messages can be sent at once and should be LF or CRLF
delimited. This script is not necessarily intended to be a solution in
itself, but is intended to be used as 'glue' to help ZoneMinder interface
with other systems. It will almost certainly require some customisation
before you can make any use of it. If all you want to do is generate alarms
from external sources then using the ZoneMinder::SharedMem perl module is
likely to be easier.
=head1 EXAMPLES
3|on+10|1|motion|text|showtext
Triggers "alarm" on camera #3 for 10 seconds with score=1, cause="motion".
=cut
use strict;
@ -446,7 +521,7 @@ sub handleMessage
Debug( "Added timed event '$action_text', expires at $action_time (+$delay secs)\n" );
}
}
elsif ( $action =~ /^(on|off)(?:\+(\d+))?$/ )
elsif ( $action =~ /^(on|off)(?:[ \+](\d+))?$/ )
{
next if ( !$monitor->{Enabled} );

View File

@ -85,17 +85,67 @@ while( 1 )
or Fatal( "Can't execute: ".$sth->errstr() );
while( my $monitor = $sth->fetchrow_hashref() )
{
if ( $monitor->{Function} ne 'None' )
next if $monitor->{Function} eq 'None';
my $restart = 0;
if ( zmMemVerify( $monitor )
&& zmMemRead( $monitor, "shared_data:valid" )
)
{
my $restart = 0;
if ( zmMemVerify( $monitor )
&& zmMemRead( $monitor, "shared_data:valid" )
)
# Check we have got an image recently
my $image_time = zmGetLastWriteTime( $monitor );
next if ( !defined($image_time) ); # Can't read from shared data
next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died.
my $max_image_delay = ( $monitor->{MaxFPS}
&&($monitor->{MaxFPS}>0)
&&($monitor->{MaxFPS}<1)
) ? (3/$monitor->{MaxFPS})
: $Config{ZM_WATCH_MAX_DELAY}
;
my $image_delay = $now-$image_time;
Debug( "Monitor $monitor->{Id} last captured $image_delay seconds ago, max is $max_image_delay\n" );
if ( $image_delay > $max_image_delay )
{
# Check we have got an image recently
my $image_time = zmGetLastWriteTime( $monitor );
next if ( !defined($image_time) ); # Can't read from shared data
next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died.
Info( "Restarting capture daemon for "
.$monitor->{Name}.", time since last capture $image_delay seconds ($now-$image_time)\n"
);
$restart = 1;
}
}
else
{
Info( "Restarting capture daemon for ".$monitor->{Name}.", shared data not valid\n" );
$restart = 1;
}
if ( $restart )
{
my $command;
if ( $monitor->{Type} eq 'Local' )
{
$command = "zmdc.pl restart zmc -d $monitor->{Device}";
}
else
{
$command = "zmdc.pl restart zmc -m $monitor->{Id}";
}
runCommand( $command );
}
elsif ( $monitor->{Function} ne 'Monitor' )
{
# Now check analysis daemon
$restart = 0;
# Check we have got an image recently
my $image_time = zmGetLastReadTime( $monitor );
if ( !defined($image_time) ) {
# Can't read from shared data
$restart = 1;
Error( "Error reading shared data for $$monitor{id} $$monitor{Name}\n");
} elsif ( !$image_time ) {
# We can't get the last capture time so can't be sure it's died.
$restart = 1;
Error( "Error getting last capture time for $$monitor{id} $$monitor{Name}\n");
} else {
my $max_image_delay = ( $monitor->{MaxFPS}
&&($monitor->{MaxFPS}>0)
@ -104,68 +154,27 @@ while( 1 )
: $Config{ZM_WATCH_MAX_DELAY}
;
my $image_delay = $now-$image_time;
Debug( "Monitor $monitor->{Id} last captured $image_delay seconds ago, max is $max_image_delay\n" );
Debug( "Monitor $monitor->{Id} last analysed $image_delay seconds ago, max is $max_image_delay\n" );
if ( $image_delay > $max_image_delay )
{
Info( "Restarting capture daemon for "
.$monitor->{Name}.", time since last capture $image_delay seconds ($now-$image_time)\n"
Info( "Analysis daemon for $$monitor{id} $$monitor{Name} needs restarting,"
." time since last analysis $image_delay seconds ($now-$image_time)\n"
);
$restart = 1;
}
}
else
{
#Info( "Restarting capture daemon for ".$monitor->{Name}.", shared data not valid\n" );
#$restart = 1;
}
if ( $restart )
{
my $command;
if ( $monitor->{Type} eq 'Local' )
{
$command = "zmdc.pl restart zmc -d $monitor->{Device}";
}
else
{
$command = "zmdc.pl restart zmc -m $monitor->{Id}";
}
Info( "Restarting analysis daemon for $$monitor{id} $$monitor{Name}\n");
my $command = "zmdc.pl restart zma -m ".$monitor->{Id};
runCommand( $command );
}
elsif ( $monitor->{Function} ne 'Monitor' )
{
if ( zmMemVerify( $monitor )
&& zmMemRead( $monitor, "shared_data:valid" )
)
{
# Check we have got an image recently
my $image_time = zmGetLastReadTime( $monitor );
next if ( !defined($image_time) ); # Can't read from shared data
next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died.
my $max_image_delay = ( $monitor->{MaxFPS}
&&($monitor->{MaxFPS}>0)
&&($monitor->{MaxFPS}<1)
) ? (3/$monitor->{MaxFPS})
: $Config{ZM_WATCH_MAX_DELAY}
;
my $image_delay = $now-$image_time;
Debug( "Monitor $monitor->{Id} last analysed $image_delay seconds ago, max is $max_image_delay\n" );
if ( $image_delay > $max_image_delay )
{
Info( "Restarting analysis daemon for "
.$monitor->{Name}.", time since last analysis $image_delay seconds ($now-$image_time)\n"
);
my $command = "zmdc.pl restart zma -m ".$monitor->{Id};
runCommand( $command );
}
}
}
}
} # end if restart
} # end if check analysis daemon
# Prevent open handles building up if we have connect to shared memory
zmMemInvalidate( $monitor );
}
} # end foreach monitor
sleep( $Config{ZM_WATCH_CHECK_INTERVAL} );
}
} # end while (1)
Info( "Watchdog exiting\n" );
exit();

View File

@ -39,6 +39,11 @@ target_link_libraries(zmf -ldl zoneminder ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zms -ldl zoneminder ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zmstreamer -ldl zoneminder ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
# Generate man files for the binaries destined for the bin folder
FOREACH(CBINARY zma zmc zmf zmu zmstreamer)
POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/${CBINARY}.cpp zoneminder-${CBINARY} 8)
ENDFOREACH(CBINARY zma zmc zmf zmu zmstreamer)
install(TARGETS zmc zma zmu zmf zmstreamer RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(TARGETS zms RUNTIME DESTINATION "${ZM_CGIDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(CODE "execute_process(COMMAND ln -sf zms nph-zms WORKING_DIRECTORY \"\$ENV{DESTDIR}${ZM_CGIDIR}\")")

View File

@ -18,6 +18,7 @@
*/
#include <string.h>
#include <fcntl.h>
#include "zm.h"
#include "zm_buffer.h"
@ -67,3 +68,14 @@ unsigned int Buffer::expand( unsigned int count )
}
return( mSize );
}
int Buffer::read_into( int sd, unsigned int bytes ) {
// Make sure there is enough space
this->expand(bytes);
int bytes_read = read( sd, mTail, bytes );
if ( bytes_read > 0 ) {
mTail += bytes_read;
mSize += bytes_read;
}
return bytes_read;
}

View File

@ -203,6 +203,7 @@ public:
{
return( (int)mSize );
}
int read_into( int sd, unsigned int bytes );
};
#endif // ZM_BUFFER_H

View File

@ -75,3 +75,38 @@ void zmDbClose()
zmDbConnected = false;
}
}
MYSQL_RES * zmDbFetch( const char * query ) {
if ( ! zmDbConnected ) {
Error( "Not connected." );
return NULL;
}
if ( mysql_query( &dbconn, query ) ) {
Error( "Can't run query: %s", mysql_error( &dbconn ) );
return NULL;
}
Debug( 4, "Success running query: %s", query );
MYSQL_RES *result = mysql_store_result( &dbconn );
if ( !result ) {
Error( "Can't use query result: %s for query %s", mysql_error( &dbconn ), query );
return NULL;
}
return result;
} // end MYSQL_RES * zmDbFetch( const char * query );
MYSQL_ROW zmDBFetchOne( const char *query ) {
MYSQL_RES *result = zmDbFetch( query );
int n_rows = mysql_num_rows( result );
if ( n_rows != 1 ) {
Error( "Bogus number of lines return from query, %d returned for query %s.", n_rows, query );
return NULL;
}
MYSQL_ROW dbrow = mysql_fetch_row( result );
if ( ! dbrow ) {
Error("Error getting row from query %s. Error is %s", query, mysql_error( &dbconn ) );
return NULL;
}
return dbrow;
}

View File

@ -32,6 +32,9 @@ extern int zmDbConnected;
void zmDbConnect();
void zmDbClose();
MYSQL_RES * zmDbFetch( const char *query );
MYSQL_ROW zmDBFetchOne( const char *query );
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@ -2596,8 +2596,8 @@ void Image::Scale( unsigned int factor )
return;
}
unsigned int new_width = (width*factor)/ZM_SCALE_BASE;
unsigned int new_height = (height*factor)/ZM_SCALE_BASE;
unsigned int new_width = (width*factor)/ZM_SCALE_BASE+1;
unsigned int new_height = (height*factor)/ZM_SCALE_BASE+1;
size_t scale_buffer_size = new_width * new_height * colours;

View File

@ -601,8 +601,7 @@ void Logger::logPrint( bool hex, const char * const file, const int line, const
if ( mysql_query( &mDbConnection, sql ) )
{
databaseLevel( NOLOG );
Fatal( "Can't insert log entry: %s", mysql_error( &mDbConnection ) );
exit( mysql_errno( &mDbConnection ) );
Error( "Can't insert log entry: %s", mysql_error( &mDbConnection ) );
}
}
if ( level <= mSyslogLevel )

View File

@ -721,7 +721,7 @@ Monitor::State Monitor::GetState() const
return( (State)shared_data->state );
}
int Monitor::GetImage( int index, int scale ) const
int Monitor::GetImage( int index, int scale )
{
if ( index < 0 || index > image_buffer_count )
{
@ -730,21 +730,32 @@ int Monitor::GetImage( int index, int scale ) const
if ( index != image_buffer_count )
{
Snapshot *snap = &image_buffer[index];
Image snap_image( *(snap->image) );
Image *image;
// If we are going to be modifying the snapshot before writing, then we need to copy it
if ( ( scale != ZM_SCALE_BASE ) || ( !config.timestamp_on_capture ) ) {
Snapshot *snap = &image_buffer[index];
Image *snap_image = snap->image;
if ( scale != ZM_SCALE_BASE )
{
snap_image.Scale( scale );
alarm_image.Assign( *snap_image );
//write_image.Assign( *snap_image );
if ( scale != ZM_SCALE_BASE ) {
alarm_image.Scale( scale );
}
if ( !config.timestamp_on_capture ) {
TimestampImage( &alarm_image, snap->timestamp );
}
image = &alarm_image;
} else {
image = image_buffer[index].image;
}
static char filename[PATH_MAX];
snprintf( filename, sizeof(filename), "Monitor%d.jpg", id );
if ( !config.timestamp_on_capture )
{
TimestampImage( &snap_image, snap->timestamp );
}
snap_image.WriteJpeg( filename );
image->WriteJpeg( filename );
}
else
{
@ -1668,7 +1679,7 @@ bool Monitor::Analyse()
if ( config.create_analysis_images )
{
bool got_anal_image = false;
Image alarm_image( *snap_image );
alarm_image.Assign( *snap_image );
for( int i = 0; i < n_zones; i++ )
{
if ( zones[i]->Alarmed() )

View File

@ -251,6 +251,9 @@ protected:
double fps;
Image alarm_image; // Used in creating analysis images, will be initialized in Analysis
Image write_image; // Used when creating snapshot images
Purpose purpose; // What this monitor has been created to do
int event_count;
int image_count;
@ -357,7 +360,7 @@ public:
State GetState() const;
int GetImage( int index=-1, int scale=100 ) const;
int GetImage( int index=-1, int scale=100 );
struct timeval GetTimestamp( int index=-1 ) const;
int GetCaptureDelay() const { return( capture_delay ); }
int GetAlarmCaptureDelay() const { return( alarm_capture_delay ); }
@ -480,9 +483,9 @@ public:
{
ttl = p_ttl;
}
void setStreamStart( int monitor_id )
bool setStreamStart( int monitor_id )
{
loadMonitor( monitor_id );
return loadMonitor( monitor_id );
}
void runStream();
};

View File

@ -18,6 +18,7 @@
//
#include "zm_remote_camera_http.h"
#include "zm_rtsp_auth.h"
#include "zm_mem_utils.h"
@ -147,6 +148,12 @@ int RemoteCameraHttp::SendRequest()
return( 0 );
}
/* Return codes are as follows:
* -1 means there was an error
* 0 means no bytes were returned but there wasn't actually an error.
* > 0 is the # of bytes read.
*/
int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected )
{
fd_set rfds;
@ -158,8 +165,9 @@ int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected )
int n_found = select( sd+1, &rfds, NULL, NULL, &temp_timeout );
if( n_found == 0 )
{
Warning( "Select timed out" );
Disconnect();
Debug( 4, "Select timed out timeout was %d secs %d usecs", temp_timeout.tv_sec, temp_timeout.tv_usec );
// Why are we disconnecting? It's just a timeout, meaning that data wasn't available.
//Disconnect();
return( 0 );
}
else if ( n_found < 0)
@ -184,20 +192,27 @@ int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected )
if ( total_bytes_to_read == 0 )
{
Debug( 3, "Socket closed" );
Disconnect();
return( 0 );
// If socket is closed locally, then select will fail, but if it is closed remotely
// then we have an exception on our socket.. but no data.
Debug( 3, "Socket closed remotely" );
//Disconnect(); // Disconnect is done outside of ReadData now.
return( -1 );
}
}
Debug( 3, "Expecting %d bytes", total_bytes_to_read );
// There can be lots of bytes available. I've seen 4MB or more. This will vastly inflate our buffer size unneccessarily.
if ( total_bytes_to_read > ZM_NETWORK_BUFSIZ ) {
total_bytes_to_read = ZM_NETWORK_BUFSIZ;
Debug(3, "Just getting 32K" );
} else {
Debug(3, "Just getting %d", total_bytes_to_read );
}
}
Debug( 3, "Expecting %d bytes", total_bytes_to_read );
int total_bytes_read = 0;
do
{
static unsigned char temp_buffer[ZM_NETWORK_BUFSIZ];
int bytes_to_read = (unsigned int)total_bytes_to_read>(unsigned int)sizeof(temp_buffer)?sizeof(temp_buffer):total_bytes_to_read;
int bytes_read = read( sd, temp_buffer, bytes_to_read );
int bytes_read = buffer.read_into( sd, total_bytes_to_read );
if ( bytes_read < 0)
{
Error( "Read error: %s", strerror(errno) );
@ -205,17 +220,16 @@ int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected )
}
else if ( bytes_read == 0)
{
Debug( 3, "Socket closed" );
Disconnect();
return( 0 );
Debug( 2, "Socket closed" );
//Disconnect(); // Disconnect is done outside of ReadData now.
return( -1 );
}
else if ( bytes_read < bytes_to_read )
else if ( bytes_read < total_bytes_to_read )
{
Error( "Incomplete read, expected %d, got %d", bytes_to_read, bytes_read );
Error( "Incomplete read, expected %d, got %d", total_bytes_to_read, bytes_read );
return( -1 );
}
Debug( 3, "Read %d bytes", bytes_read );
buffer.append( temp_buffer, bytes_read );
total_bytes_read += bytes_read;
total_bytes_to_read -= bytes_read;
}
@ -228,6 +242,7 @@ int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected )
int RemoteCameraHttp::GetResponse()
{
int buffer_len;
#if HAVE_LIBPCRE
if ( method == REGEXP )
{
@ -257,17 +272,12 @@ int RemoteCameraHttp::GetResponse()
static RegExpr *content_length_expr = 0;
static RegExpr *content_type_expr = 0;
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
else if ( buffer_len < 0 )
{
Error( "Unable to read header data" );
return( -1 );
while ( ! ( buffer_len = ReadData( buffer ) ) ) {
}
if ( buffer_len < 0 ) {
Error( "Unable to read header data" );
return( -1 );
}
if ( !header_expr )
header_expr = new RegExpr( "^(.+?\r?\n\r?\n)", PCRE_DOTALL );
if ( header_expr->Match( (char*)buffer, buffer.size() ) == 2 )
@ -435,16 +445,12 @@ int RemoteCameraHttp::GetResponse()
else
{
Debug( 3, "Unable to extract subheader from stream, retrying" );
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
else if ( buffer_len < 0 )
{
return( -1 );
while ( ! ( buffer_len = ReadData( buffer ) ) ) {
}
if ( buffer_len < 0 ) {
Error( "Unable to extract subheader data" );
return( -1 );
}
}
break;
}
@ -479,14 +485,8 @@ int RemoteCameraHttp::GetResponse()
{
while ( (long)buffer.size() < content_length )
{
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
else if ( buffer_len < 0 )
{
Debug(3, "Need more data buffer %d < content length %d", buffer.size(), content_length );
if ( ReadData( buffer ) < 0 ) {
Error( "Unable to read content" );
return( -1 );
}
@ -497,54 +497,26 @@ int RemoteCameraHttp::GetResponse()
{
while ( !content_length )
{
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
if ( mode == MULTI_IMAGE )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
}
else if ( buffer_len < 0 )
{
Error( "Unable to read content" );
return( -1 );
while ( ! ( buffer_len = ReadData( buffer ) ) ) {
}
if ( buffer_len < 0 ) {
Error( "Unable to read content" );
return( -1 );
}
static RegExpr *content_expr = 0;
if ( buffer_len )
{
if ( mode == MULTI_IMAGE )
{
if ( !content_expr )
{
char content_pattern[256] = "";
snprintf( content_pattern, sizeof(content_pattern), "^(.+?)(?:\r?\n)*(?:--)?%s\r?\n", content_boundary );
content_expr = new RegExpr( content_pattern, PCRE_DOTALL );
}
if ( content_expr->Match( buffer, buffer.size() ) == 2 )
{
content_length = content_expr->MatchLength( 1 );
Debug( 3, "Got end of image by pattern, content-length = %d", content_length );
}
}
}
else
{
content_length = buffer.size();
Debug( 3, "Got end of image by closure, content-length = %d", content_length );
if ( mode == SINGLE_IMAGE )
{
if ( !content_expr )
{
content_expr = new RegExpr( "^(.+?)(?:\r?\n){1,2}?$", PCRE_DOTALL );
}
if ( content_expr->Match( buffer, buffer.size() ) == 2 )
{
content_length = content_expr->MatchLength( 1 );
Debug( 3, "Trimmed end of image, new content-length = %d", content_length );
}
}
if ( mode == MULTI_IMAGE )
{
if ( !content_expr )
{
char content_pattern[256] = "";
snprintf( content_pattern, sizeof(content_pattern), "^(.+?)(?:\r?\n)*(?:--)?%s\r?\n", content_boundary );
content_expr = new RegExpr( content_pattern, PCRE_DOTALL );
}
if ( content_expr->Match( buffer, buffer.size() ) == 2 )
{
content_length = content_expr->MatchLength( 1 );
Debug( 3, "Got end of image by pattern, content-length = %d", content_length );
}
}
}
}
@ -650,17 +622,12 @@ int RemoteCameraHttp::GetResponse()
}
case HEADERCONT :
{
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
else if ( buffer_len < 0 )
{
Error( "Unable to read header" );
return( -1 );
while ( ! ( buffer_len = ReadData( buffer ) ) ) {
}
if ( buffer_len < 0 ) {
Error( "Unable to read header" );
return( -1 );
}
char *crlf = 0;
char *header_ptr = (char *)buffer;
@ -1004,17 +971,12 @@ int RemoteCameraHttp::GetResponse()
else
{
Debug( 3, "Unable to extract subheader from stream, retrying" );
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
else if ( buffer_len < 0 )
{
Error( "Unable to read subheader" );
return( -1 );
while ( ! ( buffer_len = ReadData( buffer ) ) ) {
}
if ( buffer_len < 0 ) {
Error( "Unable to read subheader" );
return( -1 );
}
state = SUBHEADERCONT;
}
break;
@ -1060,14 +1022,7 @@ int RemoteCameraHttp::GetResponse()
while ( (long)buffer.size() < content_length )
{
//int buffer_len = ReadData( buffer, content_length-buffer.size() );
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
else if ( buffer_len < 0 )
{
if ( ReadData( buffer ) < 0 ) {
Error( "Unable to read content" );
return( -1 );
}
@ -1079,16 +1034,8 @@ int RemoteCameraHttp::GetResponse()
int content_pos = 0;
while ( !content_length )
{
int buffer_len = ReadData( buffer );
if ( buffer_len == 0 )
{
if ( mode == MULTI_IMAGE )
{
Error( "Connection dropped by remote end" );
return( 0 );
}
}
else if ( buffer_len < 0 )
buffer_len = ReadData( buffer );
if ( buffer_len < 0 )
{
Error( "Unable to read content" );
return( -1 );
@ -1147,7 +1094,7 @@ int RemoteCameraHttp::GetResponse()
}
}
Debug( 3, "Returning %d (%d) bytes of captured content", content_length, buffer.size() );
Debug( 3, "Returning %d bytes, buffer size: (%d) bytes of captured content", content_length, buffer.size() );
return( content_length );
}
}
@ -1191,7 +1138,7 @@ int RemoteCameraHttp::Capture( Image &image )
}
if ( content_length < 0 )
{
Error( "Unable to get response" );
Error( "Unable to get response, disconnecting" );
Disconnect();
return( -1 );
}

View File

@ -663,7 +663,7 @@ int RtspThread::run()
{
now = time(NULL);
// Send a keepalive message if the server supports this feature and we are close to the timeout expiration
Debug(5, "sendkeepalibe %d, timeout %d, now: %d last: %d since: %d", sendKeepalive, timeout, now, lastKeepalive, (now-lastKeepalive) );
Debug(5, "sendkeepalive %d, timeout %d, now: %d last: %d since: %d", sendKeepalive, timeout, now, lastKeepalive, (now-lastKeepalive) );
if ( sendKeepalive && (timeout > 0) && ((now-lastKeepalive) > (timeout-5)) )
{
if ( !sendCommand( message ) )
@ -808,7 +808,7 @@ Debug(5, "sendkeepalibe %d, timeout %d, now: %d last: %d since: %d", sendKeepali
// FIXME: Is this really necessary when using tcp ?
now = time(NULL);
// Send a keepalive message if the server supports this feature and we are close to the timeout expiration
Debug(5, "sendkeepalibe %d, timeout %d, now: %d last: %d since: %d", sendKeepalive, timeout, now, lastKeepalive, (now-lastKeepalive) );
Debug(5, "sendkeepalive %d, timeout %d, now: %d last: %d since: %d", sendKeepalive, timeout, now, lastKeepalive, (now-lastKeepalive) );
if ( sendKeepalive && (timeout > 0) && ((now-lastKeepalive) > (timeout-5)) )
{
if ( !sendCommand( message ) )

View File

@ -17,6 +17,38 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
/*
=head1 NAME
zma - The ZoneMinder Analysis daemon
=head1 SYNOPSIS
zma -m <monitor_id>
zma --monitor <monitor_id>
zma -h
zma --help
zma -v
zma --version
=head1 DESCRIPTION
This is the component that goes through the captured frames and checks them
for motion which might generate an alarm or event. It generally keeps up with
the Capture daemon but if very busy may skip some frames to prevent it falling
behind.
=head1 OPTIONS
-m, --monitor_id - ID of the monitor to analyse
-h, --help - Display usage information
-v, --version - Print the installed version of ZoneMinder
=cut
*/
#include <getopt.h>
#include <signal.h>

View File

@ -17,6 +17,44 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
/*
=head1 NAME
zmc - The ZoneMinder Capture daemon
=head1 SYNOPSIS
zmc -d <device_path>
zmc --device <device_path>
zmc -r <proto> -H <host> -P <port> -p <path>
zmc -f <file_path>
zmc --file <file_path>
zmc -m <monitor_id>
zmc --monitor <monitor_id>
zmc -h
zmc --help
zmc -v
zmc --version
=head1 DESCRIPTION
This binary's job is to sit on a video device and suck frames off it as fast as
possible, this should run at more or less constant speed.
=head1 OPTIONS
-d, --device <device_path> - For local cameras, device to access. e.g /dev/video0 etc
-r <proto> -H <host> -P <port> -p <path> - For remote cameras
-f, --file <file_path> - For local images, jpg file to access.
-m, --monitor_id - ID of the monitor to analyse
-h, --help - Display usage information
-v, --version - Print the installed version of ZoneMinder
=cut
*/
#include <getopt.h>
#include <signal.h>
#if defined(__FreeBSD__)
@ -211,7 +249,7 @@ int main( int argc, char *argv[] )
exit ( -1 );
}
Info( "Starting Capture" );
Info( "Starting Capture version %s", ZM_VERSION );
zmSetDefaultTermHandler();
zmSetDefaultDieHandler();

View File

@ -17,6 +17,39 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
/*
=head1 NAME
zmf - The ZoneMinder Frame daemon
=head1 SYNOPSIS
zmf -m <monitor_id>
zmf --monitor <monitor_id>
zmf -h
zmf --help
zmf -v
zmf --version
=head1 DESCRIPTION
This is an optional daemon that can run in concert with the Analysis daemon and
whose function it is to actually write captured frames to disk. This frees up
the Analysis daemon to do more analysis (!) and so keep up with the Capture
daemon better. If it isn't running or dies then the Analysis daemon just writes
them itself.
=head1 OPTIONS
-m, --monitor_id - ID of the monitor to use
-h, --help - Display usage information
-v, --version - Print the installed version of ZoneMinder
=cut
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -263,7 +263,13 @@ int main( int argc, const char *argv[] )
stream.setStreamTTL( ttl );
stream.setStreamQueue( connkey );
stream.setStreamBuffer( playback_buffer );
stream.setStreamStart( monitor_id );
if ( ! stream.setStreamStart( monitor_id ) ) {
Error( "Unable to connect to zmc process for monitor %d", monitor_id );
fprintf( stderr, "Unable to connect to zmc process. Please ensure that it is running." );
logTerm();
zmDbClose();
return( -1 );
}
if ( mode == ZMS_JPEG )
{

View File

@ -19,6 +19,52 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*
=head1 NAME
zmstreamer - eyeZM video streamer
=head1 SYNOPSIS
zmstreamer -e <mode>
zmstreamer -o <format>
zmstreamer -u <buffer size>
zmstreamer -f <maximum fps>
zmstreamer -s <scale>
zmstreamer -b <bitrate in bps>
zmstreamer -m <monitor id>
zmstreamer -d <debug mode>
zmstreamer -i
zmstreamer -?
zmstreamer -h
zmstreamer -v
=head1 DESCRIPTION
*DEPRECIATED* The xml skin and all files associated with the xml skin are now
depreciated. Please use the ZoneMinder API instead.
This binary works in conjunction with the XML skin to stream video to iPhones
running the eyeZm app.
=head1 OPTIONS
-e <mode> - Specify output mode: mpeg/jpg/zip/single/raw.
-o <format> - Specify output format.
-u <buffer size> - Specify buffer size in ms.
-f <maximum fps> - Specify maximum framerate.
-s <scale> - Specify scale.
-b <bitrate in bps> - Specify bitrate.
-m <monitor id> - Specify monitor id.
-d <debug mode> - 0 = off, 1 = no streaming, 2 = with streaming.
-i, -?, -h - Display usage information
-v - Print the installed version of ZoneMinder
=cut
*/
#include <stdio.h>
#include <stdlib.h>

View File

@ -17,6 +17,75 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
/*
=head1 NAME
zmc - The ZoneMinder Utility
=head1 SYNOPSIS
zmu -d device_path [-v] [function] [-U<username> -P<password>]
zmu --device device_path [-v] [function] [-U<username> -P<password>]
zmu -m monitor_id [-v] [function] [-U<username> -P<password>]
zmu --monitor monitor_id [-v] [function] [-U<username> -P<password>]
=head1 DESCRIPTION
This binary is a handy command line interface to several useful functions. It's
not really meant to be used by anyone except the web page (there's only limited
'help' in it so far) but can be if necessary, especially for debugging video
problems.
=head1 OPTIONS
General options:
-v, --verbose - Produce more verbose output
-l, --list - List the current status of active (or all with -v) monitors
-h, --help - Display usage information
-v, --version - Print the installed version of ZoneMinder
Options for use with devices:
-d, --device [device_path] - Get the current video device settings for [device_path] or all devices
-V, --version <V4L version> - Set the Video 4 Linux API version to use for the query, use 1 or 2
-q, --query - Query the current settings for the device
Options for use with monitors:
-m, --monitor <monitor_id> - Specify which monitor to address, default 1 if absent
-q, --query - Query the current settings for the monitor
-s, --state - Output the current monitor state, 0 = idle, 1 = prealarm, 2 = alarm,
3 = alert, 4 = tape
-B, --brightness [value] - Output the current brightness, set to value if given
-C, --contrast [value] - Output the current contrast, set to value if given
-H, --hue [value] - Output the current hue, set to value if given
-O, --colour [value] - Output the current colour, set to value if given
-i, --image [image_index] - Write captured image to disk as <monitor_name>.jpg, last image captured
or specified ring buffer index if given.
-S, --scale <scale_%%ge> - With --image specify any scaling (in %%) to be applied to the image
-t, --timestamp [image_index] - Output captured image timestamp, last image captured or specified
ring buffer index if given
-R, --read_index - Output ring buffer read index
-W, --write_index - Output ring buffer write index
-e, --event - Output last event index
-f, --fps - Output last Frames Per Second captured reading
-z, --zones - Write last captured image overlaid with zones to <monitor_name>-Zones.jpg
-a, --alarm - Force alarm in monitor, this will trigger recording until cancelled with -c
-n, --noalarm - Force no alarms in monitor, this will prevent alarms until cancelled with -c
-c, --cancel - Cancel a forced alarm/noalarm in monitor, required after being enabled with -a or -n
-L, --reload - Signal monitor to reload settings
-E, --enable - Enable detection, wake monitor up
-D, --disable - Disable detection, put monitor to sleep
-u, --suspend - Suspend detection, useful to prevent bogus alarms when panning etc
-r, --resume - Resume detection after a suspend
-U, --username <username> - When running in authenticated mode the username and
-P, --password <password> - password combination of the given user
-A, --auth <authentication> - Pass authentication hash string instead of user details
=cut
*/
#include <getopt.h>
#include "zm.h"

View File

@ -1 +1 @@
1.28.1
1.28.100

View File

@ -17,6 +17,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/includes/config.php" DESTINATION "${Z
if(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/api/app/Config/core.php" DESTINATION "${ZM_WEBDIR}/api/app/Config")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/api/app/Config/database.php" DESTINATION "${ZM_WEBDIR}/api/app/Config")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/api/app/Config/bootstrap.php" DESTINATION "${ZM_WEBDIR}/api/app/Config")
endif(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
# Install the mootools symlinks (if its not in the source directory)

View File

@ -48,7 +48,7 @@ switch ( $_REQUEST['command'] )
$remSockFile = ZM_PATH_SOCKS.'/zms-'.sprintf("%06d",$_REQUEST['connkey']).'s.sock';
$max_socket_tries = 10;
while ( !file_exists($remSockFile) && $max_socket_tries-- ) //sometimes we are too fast for our own good, if it hasn't been setup yet give it a second.
sleep(1);
usleep(200000);
if ( !@socket_sendto( $socket, $msg, strlen($msg), 0, $remSockFile ) )
{

View File

@ -2,4 +2,5 @@
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /zm/api
</IfModule>

View File

@ -10,3 +10,6 @@ configure_file(app/Config/database.php.default "${CMAKE_CURRENT_BINARY_DIR}/app/
# Configure core.php
configure_file(app/Config/core.php.default "${CMAKE_CURRENT_BINARY_DIR}/app/Config/core.php" @ONLY)
# Configure bootstrap.php
configure_file(app/Config/bootstrap.php.in "${CMAKE_CURRENT_BINARY_DIR}/app/Config/bootstrap.php" @ONLY)

View File

@ -2,4 +2,5 @@
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
RewriteBase /zm/api
</IfModule>

Some files were not shown because too many files have changed in this diff Show More