Code Monkey home page Code Monkey logo

zoneminder / zoneminder Goto Github PK

View Code? Open in Web Editor NEW
4.8K 250.0 1.2K 137.9 MB

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.

Home Page: http://www.zoneminder.com/

License: GNU General Public License v2.0

CMake 0.58% Shell 0.39% Makefile 0.05% Perl 31.07% C 0.32% C++ 11.84% PHP 48.57% CSS 0.84% JavaScript 3.64% Batchfile 0.01% HTML 0.13% Assembly 0.02% Python 0.03% Objective-C 2.45% Mustache 0.03% Dockerfile 0.01%
zoneminder cctv video vms h264 h265 scalable distributed zmninja

zoneminder's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zoneminder's Issues

FFMPEG source showing passwords for remote source

When selecting FFMPEG as a source (such as for an h.264 source), the Web UI is showing the GET portion of the URL as the "Source", this could be seen as a security problem.

I suggest detecting HTTP, HTTPS, or RTSP sources in the code and displaying FFMPEG HTTP or FFMPEG RTSP depending on the source being detected.

zm_ffmpeg_snap

Remote Database and Purge

For larger systems (Or Multiple Systems) have a the ability for a separate database system that can run cleanup and purge scripts.

Request: Better API/Remote control

So I don't need to do silly things like http://www.zoneminder.com/wiki/index.php/Automatically_Adding_Monitors - would it be possible to create an api/service/listener that did various things like:

  • Add new monitor.
  • Delete monitor.
  • Set monitor status to XXX (None/Mocord/Monitor/Record etc) - I know there's an existing way to schedule status changes, but it's not the easiest to use or automate.
  • Get status of monitors
  • Otherstuff!

(Firmly in the happy land of dreams here... )

Text output from cash register

From http://www.zoneminder.com/forums/viewtopic.php?f=21&t=20975:

Forgive me if this has been answered; I've tried Gooling and found nothing.

We own a small coffee shop and would like to install a few IP cameras. In particular, one above our mid-line
 Casio cash register. It has a serial port that has the ability to output formatted text of transaction as they happen.

Is there anyway to integrate that data with Zoneminder using the IP camera? Ideally, i'd like to search the text
 for particular events, e.g, when the No Sale key is hit and watch the video at that time. Maybe set flags for
 when certain keys are pressed or other text is sent to the serial port.

The text does not necessarily have to be overlayed as long as it's synced with the video and is somewhat
 search-able.


Any suggestions or links to other open source software would greatly be appreciated.
Serial Data Streams: On the monitor configuration stage perhaps have an option to specify a serial port (/dev/ttys#) and the number of lines of text to display and an option of where to display the text (left right / top bottom) this could maybe use perl Tail or perl serial IO to read # of lines from the specified port. (I have seen one post about this earlier but know definite solution) this would enable integration of anything that outputs a serial text stream (with null modem cable) 

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Store video in a *video* format

At the moment, ZoneMinder stores all its video in jpegs. Not only is this a super old way of doing it, it's really inefficient and also causes a lot more I/O than is required.

There was a patch floating around a while ago for 1.24 or 1.25 which enabled the saving of events to MKV, which I believe would be a good format.

Ideas? Or am I late to the party? :-)

Minor errors when either OPT_MAIL, OPT_MESSAGE, or OPT_UPLOAD are not set

This is a non-critical issue:
If either/any OPT_MAIL, OPT_MESSAGE, or OPT_UPLOAD are not enabled under options, then one of the following errors will be generated in the event log when the Filters button is pressed:

TypeError: form.elements.autoEmail is undefined
/zm/skins/classic/views/js/filter.js
line 16

TypeError: form.elements.autoMessage is undefined
/zm/skins/classic/views/js/filter.js
line 18

TypeError: form.elements.autoUpload is undefined
/zm/skins/classic/views/js/filter.js
line 14

This was tested using a copy of zoneminder from the kfir-proper branch. The relevant code seems to be unchanged in the development branch so I would expect similar results.

Here is the relevant function from filter.js that is crashing:

function updateButtons( element )
{
    var form = element.form;

    if ( element.type == 'checkbox' && element.checked )
        form.elements['executeButton'].disabled = false;
    else
    {
        var canExecute = false;
        if ( form.elements['autoArchive'].checked )
            canExecute = true;
        if ( form.elements['autoVideo'].checked )
            canExecute = true;
        if ( form.elements['autoUpload'].checked )
            canExecute = true;
        if ( form.elements['autoEmail'].checked )
            canExecute = true;
        if ( form.elements['autoMessage'].checked )
            canExecute = true;
        if ( form.elements['autoExecute'].checked && form.elements['autoExecuteCmd'].value != '' )
            canExecute = true;
        if ( form.elements['autoDelete'].checked )
            canExecute = true;
        form.elements['executeButton'].disabled = !canExecute;
    }
}

autoEmail, autoMessage, and autoUpload appear to defined in web/skins/classic/views/filter.php, but only when its associated ZM_ variable is set.

if ( ZM_OPT_UPLOAD )
{
?>
<tr>
<td><?= $SLANG['FilterUploadEvents'] ?></td>
<td><input type="checkbox" name="autoUpload" value="1"<?php if ( !empty($dbFilter['AutoUpload']) ) { ?> checked="checked"<?php } ?> onclick="updateButtons( this )"/></td>
</tr>
<?php
}
if ( ZM_OPT_EMAIL )
{
?>
<tr>
<td><?= $SLANG['FilterEmailEvents'] ?></td>
<td><input type="checkbox" name="autoEmail" value="1"<?php if ( !empty($dbFilter['AutoEmail']) ) { ?> checked="checked"<?php } ?> onclick="updateButtons( this )"/></td>
</tr>
<?php
}
if ( ZM_OPT_MESSAGE )
{
?>
<tr>
<td><?= $SLANG['FilterMessageEvents'] ?></td>
<td><input type="checkbox" name="autoMessage" value="1"<?php if ( !empty($dbFilter['AutoMessage']) ) { ?> checked="checked"<?php } ?> onclick="updateButtons( this )"/></td>
</tr>
<?php
}

configure.ac checking for libavcore incorrectly

So I know for sure that libavcore was merged into libavutil so we don't need to check for this anymore: https://lists.ffmpeg.org/pipermail/ffmpeg-user
/2011-March/000102.html

checking for av_image_copy in -lavcore... no

configure.ac (so we should probably just remove it):

# Don't bother to warn about this one
AC_CHECK_LIB(avcore,av_image_copy,,)

Also, the check for libavformat might be incorrect as well. It isn't able to detect the avcodec_init function (my searching shows that this doesn't exist anymore either?)

checking for avcodec_init in -lavcodec... no
configure: WARNING: libavcodec.a is required for MPEG streaming

configure.ac:

AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))

Regardless I am unable to get Zoneminder to install with avcodec due to these errors and I'm not sure where to look to fix them

Monitors/index.ctp Undefined offset error

When searching for events per monitor, if there have been no events in the defined time period for a given monitor, null is returned. This causes the view to generate an 'Undefined offset' error.

<?php echo $eventsLastHour[$count][0]['count']; ?>
<?php echo $eventsLastDay[$count][0]['count']; ?>
<?php echo $eventsLastWeek[$count][0]['count']; ?>
<?php echo $eventsLastMonth[$count][0]['count']; ?>

undefinedoffset

zm_mpeg no longer uses correct ffmpeg API's

I have found this issue trying to get mkv storage to work and parallel to that, I tried to get eyeZM working. Running zmstreamer (which uses the VideoStream class in zm_mpeg), gives me the following backtrace:

#0  0x00007ffff76282e9 in ?? () from /usr/local/lib/libavformat.so.55
#1  0x00007ffff7628799 in avio_flush () from /usr/local/lib/libavformat.so.55
#2  0x00007ffff7686529 in ?? () from /usr/local/lib/libavformat.so.55
#3  0x00007ffff768aab8 in avformat_write_header () from /usr/local/lib/libavformat.so.55
#4  0x000000000044fa35 in VideoStream::SetParameters() ()
#5  0x00000000004500ba in VideoStream::VideoStream(char const*, char const*, int, double, int, int, int, int) ()
#6  0x000000000044b1f2 in MonitorStream::sendFrame(Image*, timeval*) ()
#7  0x000000000044c553 in MonitorStream::runStream() ()
#8  0x0000000000406bd3 in main ()

At point #4 is where it fails (the SetParameters call tries to write the file header when it should be dumping the file instead). This is the same issue I was having when getting mkv storage working. As such, these are related issues and we need to be updating zm_mpeg (which I am working on at the moment). Just thought I'd open an issue to show that this part of ZM is currently not functioning.

The Prev "<+" button does not work

When playing recorded video, clicking the Next "+>" button skips to the beginning of the next recorded video clip. Based on that, one might think that clicking the Prev "<+" button would skip backwards to the previous recorded video clip. Instead, the video clip rewinds to the beginning of the current video clip.

My assumption is that this is not by design.

Better ffmpeg Version Checking

One can go through the zoneminder forums and see that a very common problem centers around trying to use a version of ffmpeg that is just too new for the version of zoneminder in question.

I'm sure I'm not the only one who has been around long enough to see the pattern:

  • New version of Zoneminder is released
  • New guides are written/updated in the Wiki (many of which recommend compiling the latest ffmpeg from git)
  • ffmpeg developers change their latest code in a way that is incompatible with Zoneminder.
  • Many new forum threads are created asking for help from those who have followed the steps in the Wiki

Is there there anything we can pro-actively do to avoid or at least minimize this?

Having a place to submit trouble tickets is an excellent first step. Thanks Kyle for setting this up!

In addition here are a couple of ideas I would like to suggest:

  1. Clearly state the version of ffmpeg recommended/supported with each release of Zoneminder. This could be as simple as stating exactly what version the developer(s) used when they created the version of zoneminder in question.

  2. Integrate specific ffmpeg version checking within the configure script. If the version of ffmpeg is outside the acceptable range then alert the user there could be problems.

Ability to change status of multiple monitors (Wishlist)

The tickboxes on the right of the main console view have options for edit and delete only.

I propose an additional button for "Change" which once multiples are selected, would change the "Function" of selected monitors to the same dropdown list as in Function column.

Eg, "Non, Monitor, Record, Modect, Mocord" etc.

Use case: On slow links especially, amending states of multiple monitors is frustratingly slow. This would allow very rapid changes.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Ffmpeg not a choosable option as a Control type

Some IP cameras such as the Foscam family and VStarcam family need ffmpeg as the Monitor type even though they are a remote camera. These cameras do have a remote PTZ interface but when you select Ffmpeg as the Monitor type, there is no equivalent Control type so you cannot create a valid Control for it. I made the changes on my local copy to add the option to the classic skin controlcap.php. Additionally, I added the type to the Control table enum type in mysql

    mysql> alter table Controls modify column Type enum('Local', 'Remote', 'Ffmpeg') not null default 'Local'

This then allowed me to create a Control for the Ffmpeg Monitor type.

[CRITICAL] zms crashes with hashed authentication

Reproducible: always

Observed on CentOS 6.4 and Ubuntu 12.04 server w/ puppet module

Steps to reproduce:

  1. Build & install zoneminder in the normal manner
  2. Create an empty database and add a monitor. Open the monitor and observe all is well.
  3. Enable OPT_USE_AUTH and verify AUTH_RELAY is set to "hashed"
  4. save and restart zoneminder
  5. Open a monitor and observe there is no longer a live stream. Observe log entries such as:
    08/25/13 15:33:54.908546 zms[23317].INF-zm_signal.cpp/65 [Got signal 6 (Aborted), exiting and forcing backtrace]

NOTE: This issue occurs even though date.timezone in php.ini has a valid entry (if you happen to remember that previous issue).

Workaround:
For CentOS 6.4, setting ZM_SSL_LIB=gnutls at compile time resolves the issue. However, this workaround did not work on Ubuntu 12.04. Note that it has a newer version of gnutls than CentOS.

Further Discussion:
I have observed this issue as far back as svn3827. RPMs built on svn3639 with ZM_SSL_LIB=openssl worked fine. Until today, I had assumed it had something to do with the likely-outdated version of openssl on the CentOS platform, so I didn't initially report it.

Here is a sample of my http access log of the event that triggered the crash:
127.0.1.1:80 192.168.1.156 - - [25/Aug/2013:15:58:13 -0500] "GET /cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=100&maxfps=15&buffer=1000&auth=30f76e63e2849871d683eab5e0d7f073&connkey=64310&rand=1377464293 HTTP/1.1" 200 0 "http://192.168.1.180/index.php?view=watch&mid=1" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0"

It is definitely generating a hash, but how to tell what is wrong with it?

Please Add my code for 0-23Hour 0n/off Zone Operation

I did not need 24x7 Motion detection, So I added a new Feature where zones have a Timestart and timeend. I needed An Active zone for Midnight till 3am.

My modifications for putting on/off time on Zones:

Modify zm_create.sql file:

In CREATE TABLE ZonePresets ( Section add:
OverloadFrames smallint(5) unsigned NOT NULL default '0',

++TimeStart tinyint(2) unsigned NOT NULL default '0',
++TimeEnd tinyint(2) unsigned NOT NULL default '23' ,

In CREATE TABLE Zones ( Section add:
OverloadFrames smallint(5) unsigned NOT NULL default '0',

++TimeStart tinyint(2) unsigned NOT NULL default '0',
++TimeEnd tinyint(2) unsigned NOT NULL default '23' ,

ADD TWO COLUMNS: ,0,23
--INSERT INTO ZonePresets VALUES (1,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,);
--INSERT INTO ZonePresets VALUES (2,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);
--INSERT INTO ZonePresets VALUES (3,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,);
--INSERT INTO ZonePresets VALUES (4,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL,0);
--INSERT INTO ZonePresets VALUES (5,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL,0);
--INSERT INTO ZonePresets VALUES (6,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL,0);

++INSERT INTO ZonePresets VALUES (1,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,23);
++INSERT INTO ZonePresets VALUES (2,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,23);
++INSERT INTO ZonePresets VALUES (3,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,23);
++INSERT INTO ZonePresets VALUES (4,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,36,NULL,7,7,24,NULL,20,NULL,1,NULL,0,0,23);
++INSERT INTO ZonePresets VALUES (5,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,16,NULL,5,5,12,NULL,10,NULL,1,NULL,0,0,23);
++INSERT INTO ZonePresets VALUES (6,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,8,NULL,3,3,6,NULL,5,NULL,1,NULL,0,0,23);

Modify your favorite language file, default: en_gb.php:

'TimeStamp' => 'Time Stamp',
++ 'TimeStart' => 'TimeStart',
++ 'TimeEnd' => 'TimeEnd',

and also:

'ZoneOverloadFrames' => 'Overload Frame Ignore Count',
++ 'ZoneTimeStart' => 'Time Start',
++ 'ZoneTimeEnd' => 'Time End',

Modify big5_big5.php
add:

'ZoneOverloadFrames' => 'Overload Frame Ignore Count',
++ 'ZoneTimeStart' => 'Time Start',
++ 'ZoneTimeEnd' => 'Time End',

Modify zone.php:

'OverloadFrames' => '',
++ 'TimeStart' => '0',
++ 'TimeEnd' => '23',

and:

++
++
++ <input type="text" name="newZone[TimeStart]" value="" size="4"++
++ onchange="limitRange( this, 0,23 )"
++ />
++
++
++
++ <input type="text" name="newZone[TimeEnd]" value="" size="4"
++ onchange="limitRange( this, 0,23 )"
++ />
++

// The avove fixes Database structure, and new additions. Now to SRC Files::

In Src file zm_zone.h add:

int overload_frames;
++ int time_start;
++ int time_end;

--protected:

-- void Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames, int p_time_start, int p_time_end);

--public:
-- Zone( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0 , int p_time_start=0, int p_time_end=23)
-- {
-- Setup( p_monitor, p_id, p_label, p_type, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames, p_time_start, p_time_end );
-- }
-- Zone( Monitor *p_monitor, int p_id, const char *p_label, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0, int p_time_start=0, int p_time_end=23 )
-- {
-- Setup( p_monitor, p_id, p_label, Zone::ACTIVE, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames , p_time_start, p_time_end);
-- }

++protected:
++ void Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames, int p_time_start, int p_time_end);
++
++public:
++ Zone( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0 , int p_time_start=0, int p_time_end=23)
++ {
++ Setup( p_monitor, p_id, p_label, p_type, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames, p_time_start, p_time_end );
++ }
++ Zone( Monitor *p_monitor, int p_id, const char *p_label, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold=15, int p_max_pixel_threshold=0, int p_min_alarm_pixels=50, int p_max_alarm_pixels=75000, const Coord &p_filter_box=Coord( 3, 3 ), int p_min_filter_pixels=50, int p_max_filter_pixels=50000, int p_min_blob_pixels=10, int p_max_blob_pixels=0, int p_min_blobs=0, int p_max_blobs=0, int p_overload_frames=0, int p_time_start=0, int p_time_end=23 )
++ {
++ Setup( p_monitor, p_id, p_label, Zone::ACTIVE, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames , p_time_start, p_time_end);
++ }

--Setup( p_monitor, p_id, p_label, Zone::INACTIVE, p_polygon, RGB_BLACK, (Zone::CheckMethod)0, 0, 0, 0, 0, Coord( 0, 0 ), 0, 0, 0, 0, 0, 0, 0 );

++Setup( p_monitor, p_id, p_label, Zone::INACTIVE, p_polygon, RGB_BLACK, (Zone::CheckMethod)0, 0, 0, 0, 0, Coord( 0, 0 ), 0, 0, 0, 0, 0, 0, 0, 0, 0 );

Lastly:
inline unsigned int Score() const { return( score ); }
++ inline bool TimeFlag() const
++ {
++ int hr;
++ int zonetimestart=time_start;
++ int zonetimeend=time_end;
++ time_t rawtime;
++ struct tm *timeinfo;
++ time( &rawtime );
++ timeinfo=localtime (&rawtime);
++ hr=timeinfo->tm_hour;
++ if ((zonetimeend-zonetimestart) > 0)
++ {
++
++ if ( (hr >= zonetimestart) & (hr <= zonetimeend ) )
++ {
++ return (true);
++ }
++ }
++ if ((zonetimeend-zonetimestart) < 0)
++ {
++ if ( (hr >= zonetimestart) or (hr < zonetimeend ) )
++ {
++ return (true);
++ }
++ }
++ if ((zonetimeend-zonetimestart) == 0)
++ {
++ if ( (hr == zonetimestart) )
++ {
++ return (true);
++ }
++ }
++ return (false );
++ }

In SRC File zm_zone.cpp

--void Zone::Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames )

++void Zone::Setup( Monitor *p_monitor, int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon, const Rgb p_alarm_rgb, CheckMethod p_check_method, int p_min_pixel_threshold, int p_max_pixel_threshold, int p_min_alarm_pixels, int p_max_alarm_pixels, const Coord &p_filter_box, int p_min_filter_pixels, int p_max_filter_pixels, int p_min_blob_pixels, int p_max_blob_pixels, int p_min_blobs, int p_max_blobs, int p_overload_frames, int p_time_start, int p_time_end )

ADD:
overload_frames = p_overload_frames;
++ time_start=p_time_start;
++ time_end=p_time_end;

-- Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d", id, label, type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames ,time_start,time_end);

++ Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d, ZoneTimeStart: %d, ZoneTimeEnd: %d", id, label, type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames ,time_start,time_end);

-- snprintf( sql, sizeof(sql), "select Id,Name,Type+0,Units,NumCoords,Coords,AlarmRGB,CheckMethod+0,MinPixelThreshold,MaxPixelThreshold,MinAlarmPixels,MaxAlarmPixels,FilterX,FilterY,MinFilterPixels,MaxFilterPixels,MinBlobPixels,MaxBlobPixels,MinBlobs,MaxBlobs,OverloadFrames from Zones where MonitorId = %d order by Type, Id", monitor->Id() );

++snprintf( sql, sizeof(sql), "select Id,Name,Type+0,Units,NumCoords,Coords,AlarmRGB,CheckMethod+0,MinPixelThreshold,MaxPixelThreshold,MinAlarmPixels,MaxAlarmPixels,FilterX,FilterY,MinFilterPixels,MaxFilterPixels,MinBlobPixels,MaxBlobPixels,MinBlobs,MaxBlobs,OverloadFrames,TimeStart,TimeEnd from Zones where MonitorId = %d order by Type, Id", monitor->Id() );

ADD:

int OverloadFrames = dbrow[col]?atoi(dbrow[col]):0; col++;
++ int TimeStart = dbrow[col]?atoi(dbrow[col]):0; col++;
++ int TimeEnd = dbrow[col]?atoi(dbrow[col]):0; col++;

Add new IF:
-- if ( atoi(dbrow[2]) == Zone::INACTIVE )
-- {
-- zones[i] = new Zone( monitor, Id, Name, polygon );
-- }
-- else
-- {
-- zones[i] = new Zone( monitor, Id, Name, (Zone::ZoneType)Type, polygon, AlarmRGB, (Zone::CheckMethod)CheckMethod, MinPixelThreshold, MaxPixelThreshold, MinAlarmPixels, MaxAlarmPixels, Coord( FilterX, FilterY ), MinFilterPixels, MaxFilterPixels, MinBlobPixels, MaxBlobPixels, MinBlobs, MaxBlobs, OverloadFrames);
-- }

++if ( atoi(dbrow[2]) == Zone::INACTIVE )
++ {
++ zones[i] = new Zone( monitor, Id, Name, polygon );
++ }
++ else
++ {
++ zones[i] = new Zone( monitor, Id, Name, (Zone::ZoneType)Type, polygon, AlarmRGB, (Zone::CheckMethod)CheckMethod, MinPixelThreshold, MaxPixelThreshold, MinAlarmPixels, MaxAlarmPixels, Coord( FilterX, FilterY ), MinFilterPixels, MaxFilterPixels, MinBlobPixels, MaxBlobPixels, MinBlobs, MaxBlobs, OverloadFrames,TimeStart,TimeEnd);
++ }

Now the final code:

In file zm_monitor.cpp

unsigned int Monitor::DetectMotion( const Image &comp_image, Event::StringSet &zoneSet )
{
bool alarm = false;
unsigned int score = 0;
++ bool ZoneTimeFlag;

zone->ClearAlarm();
++ ZoneTimeFlag=zone->TimeFlag() ;

if ( !zone->IsInactive() )
    {
        continue;
    }

++ if ( !ZoneTimeFlag )
++ {
++ {
++ continue;
++ }

   Debug( 3, "Blanking inactive zone %s", zone->Label() );

AND:

Zone *zone = zones[n_zone];
++ ZoneTimeFlag=zone->TimeFlag() ;

if ( !zone->IsPreclusive() )
    {
        continue;
    }

++ if ( !ZoneTimeFlag )
++ {
++ continue;
++ }
Debug( 3, "Checking preclusive zone %s", zone->Label() );

AND:

Zone *zone = zones[n_zone];
++ ZoneTimeFlag=zone->TimeFlag() ;
if (!zone->IsActive() )
{
continue;
}
++ if ( !ZoneTimeFlag )
++ {
++
++ continue;
++ }
Debug( 3, "Checking active zone %s", zone->Label() );

AND:

Zone *zone = zones[n_zone];
++ ZoneTimeFlag=zone->TimeFlag() ;
if (!zone->IsInclusive() )
{
continue;
}
++ if ( !ZoneTimeFlag )
++ {
++
++ continue;
++ }
Debug( 3, "Checking inclusive zone %s", zone->Label() );

LASTLY:

Zone *zone = zones[n_zone];
++ ZoneTimeFlag=zone->TimeFlag() ;
if (!zone->IsExclusive() )
{
continue;
}
++ if ( !ZoneTimeFlag )
++ {
++
++ continue;
++ }
Debug( 3, "Checking exclusive zone %s", zone->Label() );

Run And Enjoy
Dennis A. Vitali
[email protected]

P.s.
Have not yet did or yet understand the sql upfdate files for older databases,
thats why i added my stuff to zm_create.sql!

1.26 Beta does not install SkyIPCam7xx.pm Control Script

The file SkyIPCam7xx.pm is contained in the source tree, and the database contains the correct reference to this PTZ control. However, the actual file is not copied over during install time. See below for a patch that resolves the issue.

UPDATE: I also found a typo in the skyip database record. The SkyIPCam7xx protocol was misspelled SKyIPCam7xx.pm. My eyes hurt after finding that one. :-) I updated the patch below to account for this.

PS: I apologize for not using the proper github method to submit this. Learning how to edit my own fork and then submit changes is something on my to-do list. I've read a lot about it, but I'm a slow learner.

--- scripts/Makefile.am 2013-08-13 11:40:03.000000000 -0500
+++ scripts/Makefile.am.skyip   2013-08-14 18:56:29.919038259 -0500
@@ -59,6 +59,7 @@
    ZoneMinder/lib/ZoneMinder/Control/Visca.pm \
    ZoneMinder/lib/ZoneMinder/Control/Ncs370.pm \
    ZoneMinder/lib/ZoneMinder/Control/mjpgStreamer.pm \
+   ZoneMinder/lib/ZoneMinder/Control/SkyIPCam7xx.pm \
    ZoneMinder/lib/ZoneMinder/Trigger/Channel.pm \
    ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm \
    ZoneMinder/lib/ZoneMinder/Trigger/Channel/Spawning.pm \
--- scripts/ZoneMinder/Makefile.PL  2013-08-13 11:40:03.000000000 -0500
+++ scripts/ZoneMinder/Makefile.PL.skyip    2013-08-14 19:18:33.839396021 -0500
@@ -25,6 +25,7 @@
        'lib/ZoneMinder/Control/Visca.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/Visca.pm',
        'lib/ZoneMinder/Control/Ncs370.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/Ncs370.pm',
        'lib/ZoneMinder/Control/mjpgStreamer.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/mjpgStreamer.pm',
+       'lib/ZoneMinder/Control/SkyIPCam7xx.pm' => '$(INST_LIBDIR)/ZoneMinder/Control/SkyIPCam7xx.pm',
        'lib/ZoneMinder/Trigger/Channel.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel.pm',
        'lib/ZoneMinder/Trigger/Channel/Handle.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Handle.pm',
        'lib/ZoneMinder/Trigger/Channel/Spawning.pm' => '$(INST_LIBDIR)/ZoneMinder/Trigger/Channel/Spawning.pm',
--- db/zm_create.sql.in 2013-08-13 11:40:03.000000000 -0500
+++ db/zm_create.sql.in.typo    2013-08-14 19:52:36.771715499 -0500
@@ -536,7 +536,7 @@
 INSERT INTO Controls VALUES (4,'Axis API v2','Remote','AxisV2',0,0,0,1,0,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,1,1,0,1,0,0,9999,10,2500,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,12,1,1,1,1,1,0,1,0,1,-360,360,1,90,0,NULL,NULL,0,NULL,1,-360,360,1,90,0,NULL,NULL,0,NULL,0,0);
 insert into Controls values (5,'Panasonic IP','Remote','PanasonicIP',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0);
 insert into Controls values (6,'Neu-Fusion NCS370','Remote','Ncs370',0,0,0,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,24,1,0,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); 
-insert into Controls values (7,'AirLink SkyIPCam 7xx','Remote','SKyIPCam7xx',0,0,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,1,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); 
+insert into Controls values (7,'AirLink SkyIPCam 7xx','Remote','SkyIPCam7xx',0,0,1,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,8,1,1,1,0,1,0,1,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,1,NULL,NULL,NULL,NULL,0,NULL,NULL,0,NULL,0,0); 
 insert into Controls values (8,'Pelco-D','Ffmpeg','PelcoD',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0);
 insert into Controls values (9,'Pelco-P','Ffmpeg','PelcoP',1,1,0,1,1,0,0,1,NULL,NULL,NULL,NULL,1,0,3,1,1,0,0,1,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,1,0,1,0,NULL,NULL,NULL,NULL,0,NULL,NULL,1,20,1,1,1,1,0,0,0,1,1,NULL,NULL,NULL,NULL,1,0,63,1,254,1,NULL,NULL,NULL,NULL,1,0,63,1,254,0,0);

Support http digest authentication for IP camera access

Currently zoneminder only supports http basic authentication for connecting to IP cameras. Some cameras, in particular the samsung SNO-5080R, only support http digest authentication and hence zoneminder is unable to work with them.

Support non-embedded password challenge

I'm not sure what the following method is called in software terms...
Zoneminder currently does not support cameras whose only method of authentication is via a separate password challenge response after making initial communication to the camera. When using a web browser, this manifests as a pop-up login after entering the camera's ip address.

Foscam H.264 cameras come to mind, and it is discussed here:
http://foscam.us/forum/post14111.html

One important note from the reference is that wget knows how to handle this kind of password challenge so perhaps there is some kind of common library that Zoenminder can link to?

I'm not entirely sure this is the same issue as the previously reported digest authentication issue. Feel free to mark this as a duplicate if this is the case.

Control Types always none using source Ffmpeg

Can not create control types under control panel, list says none, Monitor source type "Ffmpeg" Will show listing for 'Local' "remote'! Don't know if by design or bug.
Using 1.25.0.4
Thanks for Reading.
Dennis.

Exportable Camera Configs

Here is a feature suggestion for a future release.
It would be helpful if we could easily export camera configurations, including the ptz control file, and be able to exchange them with others, who could then import those configs as presets into their own zoneminder systems.

Store events in mp4 container [$1,280]

At the moment, ZoneMinder stores all its video in jpegs. Not only is this a super old way of doing it, it's really inefficient and also causes a lot more I/O than is required.

There was a patch floating around a while ago for 1.24 or 1.25 which enabled the saving of events to MKV, which I believe would be a good format.

Ideas? Or am I late to the party? :-)

There is a $1,280 open bounty on this issue. Add to the bounty at Bountysource.

Automatically set resolution

If the resolution field is empty or zero, let zmc auto-detect the resolution and store it in the shared memory.
This is possible by using epadding1 32bit padding variable by splitting it into two unsigned 16bit variables. This will keep the shared memory size and layout backwards compatible with older versions.
This is fairly easy to do for most cases. For remote streams such as http(mjpeg), ffmpeg or rtsp, we get the resolution after decompressing the first frame. For local cameras, we can simply attempt to use highest resolution supported by the device.

The only problem is that memory allocation happens first, so we have to allocate lots of memory to support the highest possible resolution defined in src/config.h. Hopefully we will find a way around this approach.

This is an important another step in the direction to make ZM quicker and simpler to configure. Adding a new monitor should not take more than a few minutes.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

'ZM Restart Required' notice

A little notice at the top of the webpage when a restart is required, such as when you change a configuration option and then forget to restart ZM.

Also, more explicitly stating which options require a restart.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Translation stuff done, please pull in and test...

OK, people, that's it from me for a while.

I've fixed a couple of things that bothered us for a long time, related to the web interface appearance and strings which could not be translated.

I've tested and developed all these modifications on two separate 1.25 production systems, with Firefox and Internet Explorer browsers. They work fine on both of them.

I really hope they work fine for all of you, and they will make their way into a final release once!

When filtering in the Events view, filter options are lost between pages

Filtering is done via named parameters in the URL. After filtering and click on "Search", the named params are set in the URL and the appropriate results are displayed. If you click on a page number, the 'page' named param is added to the url, and the page refreshes. This resets the filter elements in the sidebar, however since the filter named params are already set in the URL, your filtered results are not lost.

This bug was introduced in commit 46deb93

More, better, IP camera presets [$100]

Existing preset list is long without much content. Either add to that with a bunch of new cams (I can help with some common paths), or some two-stage "Manufacturer -> Model" selection to make it less of a scroll-beast?

There is a $100 open bounty on this issue. Add to the bounty at Bountysource.

Update wiki page (please?)

I have only just become aware that 1.26 existed. Happened to do a forum search and see it.

The posting there led me to here / github. Although I registered long ago, I know little of github.

Could the wiki page here (https://github.com/ZoneMinder/ZoneMinder/wiki) be updated with some info? e.g.

  • is this (github) developer only.
  • how to help.
  • where to go (next)?

I don't mean this to be a rehash of a github tutorial or anything, but the above were the first things that popped into my mind, without any obvious / intuitive zoneminder-github-specific answers.

Change in monitor setup requested.

Remove "Linked monitors" section from first page of monitor setup. This frequently confuses users and causes them to mis-select monitors breaking detection.

Could be moved to "Misc" tab or elsewhere

Also add a help button somewhere to explain just WTF it actually does :)

No PTZ control option when adding a new monitor

When adding a new monitor the Control Type combobox does not display options even with OPT_CONTROL enabled. It is only possible to enable Control when editing the device afterwards. Happens both with source/package on Ubuntu 12.04LTS server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.