Merge branch 'master' of github.com:ZoneMinder/zoneminder

pull/2993/head
Isaac Connor 2020-07-16 15:42:56 -04:00
commit a8e46feb12
6 changed files with 176 additions and 23 deletions

View File

@ -21,8 +21,8 @@ override_dh_auto_configure:
-DCMAKE_BUILD_TYPE=Release \
-DZM_CONFIG_DIR="/etc/zm" \
-DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \
-DZM_RUNDIR="/var/run/zm" \
-DZM_SOCKDIR="/var/run/zm" \
-DZM_RUNDIR="/run/zm" \
-DZM_SOCKDIR="/run/zm" \
-DZM_TMPDIR="/tmp/zm" \
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \

View File

@ -21,8 +21,8 @@ override_dh_auto_configure:
-DCMAKE_BUILD_TYPE=Release \
-DZM_CONFIG_DIR="/etc/zm" \
-DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \
-DZM_RUNDIR="/var/run/zm" \
-DZM_SOCKDIR="/var/run/zm" \
-DZM_RUNDIR="/run/zm" \
-DZM_SOCKDIR="/run/zm" \
-DZM_TMPDIR="/tmp/zm" \
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \

View File

@ -3,10 +3,157 @@ Debian
.. contents::
Easy Way: Debian Buster
------------------------
This procedure will guide you through the installation of ZoneMinder on Debian 10 (Buster).
**Step 1:** Make sure your system is up to date
Open a console and use ``su`` command to become root.
::
apt update
apt upgrade
**Step 2:** Setup Sudo (optional but recommended)
By default Debian does not come with sudo, so you have to install it and configure it manually.
This step is optional but recommended and the following instructions assume that you have setup sudo.
If you prefer to setup ZoneMinder as root, do it at your own risk and adapt the following instructions accordingly.
::
apt install sudo
usermod -a -G sudo <username>
exit
Now your terminal session is back under your normal user. You can check that
you are now part of the sudo group with the command ``groups``, "sudo" should
appear in the list. If not, run ``newgrp sudo`` and check again with ``groups``.
**Step 3:** Install Apache and MySQL
These are not dependencies for the ZoneMinder package as they could be
installed elsewhere. If they are not installed yet in your system, you have to
trigger their installation manually.
::
sudo apt install apache2 mysql-server
**Step 4:** Add ZoneMinder's Package repository to your apt sources
ZoneMinder's Debian packages are not included in Debian's official package
repositories. To be able to install ZoneMinder with APT, you have to edit the
list of apt sources and add ZoneMinder's repository.
::
sudo nano /etc/apt/sources.list
Add the following to the bottom of the file
::
# ZoneMinder repository
deb https://zmrepo.zoneminder.com/debian/release-1.34 stretch/
CTRL+o and <Enter> to save
CTRL+x to exit
Because ZoneMinder's package repository provides a secure connection through HTTPS, apt must be enabled for HTTPS.
::
sudo apt install apt-transport-https
Finally, download the GPG key for ZoneMinder's repository:
::
wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | sudo apt-key add -
**Step 5:** Install ZoneMinder
::
sudo apt update
sudo apt install zoneminder
**Step 6:** Read the Readme
The rest of the install process is covered in the README.Debian, so feel free to have
a read.
::
zcat /usr/share/doc/zoneminder/README.Debian.gz
**Step 7:** Enable ZoneMinder service
::
sudo systemctl enable zoneminder.service
**Step 8:** Configure Apache
The following commands will setup the default /zm virtual directory and configure
required apache modules.
::
sudo a2enconf zoneminder
sudo a2enmod rewrite
sudo a2enmod cgi # this is done automatically when installing the package. Redo this command manually only for troubleshooting.
**Step 9:** Edit Timezone in PHP
Automated way:
::
sudo sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/7.0/apache2/php.ini
Manual way
::
sudo nano /etc/php/7.0/apache2/php.ini
Search for [Date] (Ctrl + w then type Date and press Enter) and change
date.timezone for your time zone. Don't forget to remove the ; from in front
of date.timezone.
::
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York
CTRL+o then [Enter] to save
CTRL+x to exit
**Step 10:** Start ZoneMinder
Reload Apache to enable your changes and then start ZoneMinder.
::
sudo systemctl reload apache2
sudo systemctl start zoneminder
You are now ready to go with ZoneMinder. Open a browser and type either ``localhost/zm`` one the local machine or ``{IP-OF-ZM-SERVER}/zm`` if you connect from a remote computer.
Easy Way: Debian Stretch
------------------------
This procedure will guide you through the installation of ZoneMinder on Debian 9 (Stretch). This section has been tested with ZoneMinder 1.32.3 on Debian 9.8.
This procedure will guide you through the installation of ZoneMinder on Debian 9 (Stretch). This section has been tested with ZoneMinder 1.34 on Debian 9.8.
**Step 1:** Make sure your system is up to date
@ -52,7 +199,7 @@ Add the following to the bottom of the file
::
# ZoneMinder repository
deb https://zmrepo.zoneminder.com/debian/release stretch/
deb https://zmrepo.zoneminder.com/debian/release-1.34 stretch/
CTRL+o and <Enter> to save
CTRL+x to exit
@ -275,7 +422,6 @@ CTRL+x to exit
**Step 12:** Please check the configuration
Zoneminder 1.32.x
1. Check path of ZM_PATH in '/etc/zm/conf.d/zmcustom.conf' is ZM_PATH_ZMS=/zm/cgi-bin/nph-zms
::
cat /etc/zm/conf.d/zmcustom.conf
@ -309,8 +455,8 @@ Reload Apache to enable your changes and then start ZoneMinder.
::
{
"version": "1.29.0",
"apiversion": "1.29.0.1"
"version": "1.34.0",
"apiversion": "1.34.0.1"
}
**Congratulations** Your installation is complete

View File

@ -572,8 +572,18 @@ uint8_t* Image::WriteBuffer(const unsigned int p_width, const unsigned int p_hei
return buffer;
}
/* Assign an existing buffer to the image instead of copying from a source buffer. The goal is to reduce the amount of memory copying and increase efficiency and buffer reusing. */
void Image::AssignDirect( const unsigned int p_width, const unsigned int p_height, const unsigned int p_colours, const unsigned int p_subpixelorder, uint8_t *new_buffer, const size_t buffer_size, const int p_buffertype) {
/* Assign an existing buffer to the image instead of copying from a source buffer.
The goal is to reduce the amount of memory copying and increase efficiency and buffer reusing.
*/
void Image::AssignDirect(
const unsigned int p_width,
const unsigned int p_height,
const unsigned int p_colours,
const unsigned int p_subpixelorder,
uint8_t *new_buffer,
const size_t buffer_size,
const int p_buffertype) {
if ( new_buffer == NULL ) {
Error("Attempt to directly assign buffer from a NULL pointer");
return;
@ -605,6 +615,7 @@ void Image::AssignDirect( const unsigned int p_width, const unsigned int p_heigh
width = p_width;
height = p_height;
colours = p_colours;
linesize = width*colours;
subpixelorder = p_subpixelorder;
pixels = height*width;
size = new_buffer_size; // was pixels*colours, but we already calculated it above as new_buffer_size
@ -623,6 +634,7 @@ void Image::AssignDirect( const unsigned int p_width, const unsigned int p_heigh
width = p_width;
height = p_height;
colours = p_colours;
linesize = width*colours;
subpixelorder = p_subpixelorder;
pixels = height*width;
size = new_buffer_size; // was pixels*colours, but we already calculated it above as new_buffer_size
@ -631,7 +643,6 @@ void Image::AssignDirect( const unsigned int p_width, const unsigned int p_heigh
buffertype = p_buffertype;
buffer = new_buffer;
}
Debug(1, "In assign direct");
}
void Image::Assign(const unsigned int p_width, const unsigned int p_height, const unsigned int p_colours, const unsigned int p_subpixelorder, const uint8_t* new_buffer, const size_t buffer_size) {
@ -2735,7 +2746,7 @@ void Image::Flip( bool leftright ) {
void Image::Scale( unsigned int factor ) {
if ( !factor ) {
Error( "Bogus scale factor %d found", factor );
Error("Bogus scale factor %d found", factor);
return;
}
if ( factor == ZM_SCALE_BASE ) {
@ -2745,6 +2756,7 @@ void Image::Scale( unsigned int factor ) {
unsigned int new_width = (width*factor)/ZM_SCALE_BASE;
unsigned int new_height = (height*factor)/ZM_SCALE_BASE;
// Why larger than we need?
size_t scale_buffer_size = (new_width+1) * (new_height+1) * colours;
uint8_t* scale_buffer = AllocBuffer(scale_buffer_size);
@ -2819,10 +2831,8 @@ void Image::Scale( unsigned int factor ) {
}
new_width = last_w_index;
new_height = last_h_index;
}
} // end foreach line
AssignDirect( new_width, new_height, colours, subpixelorder, scale_buffer, scale_buffer_size, ZM_BUFTYPE_ZM);
}
void Image::Deinterlace_Discard() {

View File

@ -1404,9 +1404,6 @@ bool Monitor::Analyse() {
score += trigger_data->trigger_score;
Debug(1, "Triggered on score += %d => %d", trigger_data->trigger_score, score);
if ( !event ) {
// How could it have a length already?
//if ( cause.length() )
//cause += ", ";
cause += trigger_data->trigger_cause;
}
Event::StringSet noteSet;
@ -1514,7 +1511,6 @@ bool Monitor::Analyse() {
} // end if event
if ( !event ) {
// Create event
event = new Event(this, *timestamp, "Continuous", noteSetMap, videoRecording);
shared_data->last_event = event->Id();
@ -1528,7 +1524,6 @@ bool Monitor::Analyse() {
if ( state == IDLE ) {
shared_data->state = state = TAPE;
}
} // end if ! event
} // end if function == RECORD || function == MOCORD)
} // end if !signal_change && signal
@ -1552,7 +1547,6 @@ bool Monitor::Analyse() {
);
}
if ( (!pre_event_count) || (Event::PreAlarmCount() >= alarm_frame_count-1) ) {
shared_data->state = state = ALARM;
// lets construct alarm cause. It will contain cause + names of zones alarmed
std::string alarm_cause = "";
for ( int i=0; i < n_zones; i++ ) {
@ -1610,6 +1604,7 @@ bool Monitor::Analyse() {
event = new Event(this, *(image_buffer[pre_index].timestamp), cause, noteSetMap);
} // end if analysis_fps && pre_event_count
shared_data->state = state = ALARM;
shared_data->last_event = event->Id();
//set up video store data
snprintf(video_store_data->event_file, sizeof(video_store_data->event_file), "%s", event->getEventFile());

View File

@ -106,7 +106,7 @@ xhtmlHeaders(__FILE__, translate('Events') );
<?php
if ( $pagination ) {
?>
<h2 class="pagination"><?php echo $pagination ?></h2>
<h2 class="pagination hidden-xs"><?php echo $pagination ?></h2>
<?php
}
?>
@ -138,6 +138,7 @@ if ( $pages > 1 ) {
<input type="hidden" name="sort_field" value="<?php echo validHtmlStr($_REQUEST['sort_field']) ?>"/>
<input type="hidden" name="sort_asc" value="<?php echo validHtmlStr($_REQUEST['sort_asc']) ?>"/>
<input type="hidden" name="limit" value="<?php echo $limit ?>"/>
<div class="table-responsive">
<table id="contentTable" class="major">
<tbody>
<?php
@ -299,6 +300,7 @@ while ( $event_row = dbFetchNext($results) ) {
}
?>
</table>
</div>
<?php
if ( $pagination ) {
?>