Bug 411 - Merged in DVR functionality.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2175 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
e730a3d9cf
commit
50cc4d980f
|
@ -331,6 +331,7 @@ CREATE TABLE `Monitors` (
|
|||
`WarmupCount` smallint(5) unsigned NOT NULL default '25',
|
||||
`PreEventCount` smallint(5) unsigned NOT NULL default '10',
|
||||
`PostEventCount` smallint(5) unsigned NOT NULL default '10',
|
||||
`StreamReplayBuffer` int(10) unsigned NOT NULL default '1000',
|
||||
`AlarmFrameCount` smallint(5) unsigned NOT NULL default '1',
|
||||
`SectionLength` int(10) unsigned NOT NULL default '600',
|
||||
`FrameSkip` smallint(5) unsigned NOT NULL default '0',
|
||||
|
@ -639,41 +640,42 @@ insert into Config set Id = 46, Name = 'ZM_EXTRA_DEBUG_LEVEL', Value = '0', Type
|
|||
insert into Config set Id = 47, Name = 'ZM_EXTRA_DEBUG_LOG', Value = '/tmp/zm_debug.log+', Type = 'string', DefaultValue = '/tmp/zm_debug.log+', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'Where extra debug is output to', Help = 'Depending on your system configuration you may find that only errors, warning and informational messages are logged to your system log. This option allows you to specify an additional target for these messages and debug. This also has the advantage of partitioning debug for the component you are tracing, from messages from other components. Be warned however that if this is a simple filename and you are debugging several components then they will all try and write to the same file with undesirable consequences. Appending a \'+\' to the filename will cause the file to be created with a \'.<pid>\' suffix containing your process id. In this way debug from each run of a component is kept separate. This is the recommended setting as it will also prevent subsequent runs from overwriting the same log.', Category = 'debug', Readonly = '0', Requires = 'ZM_EXTRA_DEBUG=1';
|
||||
insert into Config set Id = 48, Name = 'ZM_PATH_SOCKS', Value = '/tmp', Type = 'string', DefaultValue = '/tmp', Hint = '/absolute/path/to/somewhere', Pattern = '(?-xism:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to the various Unix domain socket files that ZoneMinder uses', Help = 'ZoneMinder generally uses Unix domain sockets where possible. This reduces the need for port assignments and prevents external applications from possibly compromising the daemons. However each Unix socket requires a .sock file to be created. This option where those socket files go.', Category = 'paths', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 49, Name = 'ZM_PATH_LOGS', Value = '/tmp', Type = 'string', DefaultValue = '/tmp', Hint = '/absolute/path/to/somewhere', Pattern = '(?-xism:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to the various logs that the ZoneMinder daemons generate', Help = 'There are various daemons that are used by ZoneMinder to perform various tasks. Most generate helpful log files and this is where they go. They can be deleted if not required for debugging.', Category = 'paths', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 50, Name = 'ZM_WEB_TITLE_PREFIX', Value = 'ZM', Type = 'string', DefaultValue = 'ZM', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The title prefix displayed on each window', Help = 'If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 51, Name = 'ZM_WEB_RESIZE_CONSOLE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the console window resize itself to fit', Help = 'Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusize but may not be to everyones tastes, especially if opened in a tab in browsers which support this kind if layout. Switch this option off to have the console window size left to the users preference', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 52, Name = 'ZM_WEB_POPUP_ON_ALARM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the monitor window jump to the top if an alarm occurs', Help = 'When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 53, Name = 'ZM_OPT_X10', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether we want to interface with X10 devices', Help = 'If you have an X10 Home Automation setup in your home you can use ZoneMinder to initiate or react to X10 signals if your computer has the appropriate interface controller. This option indicates whether X10 options will be available in the browser client.', Category = 'x10', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 54, Name = 'ZM_X10_DEVICE', Value = '/dev/ttyS0', Type = 'string', DefaultValue = '/dev/ttyS0', Hint = '/absolute/path/to/somewhere', Pattern = '(?-xism:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'What device is your X10 controller connected on', Help = 'If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1';
|
||||
insert into Config set Id = 55, Name = 'ZM_X10_HOUSE_CODE', Value = 'A', Type = 'string', DefaultValue = 'A', Hint = 'A-P', Pattern = '(?i-xsm:^([A-P]))', Format = ' uc($1) ', Prompt = 'What X10 house code should be used', Help = 'X10 devices are grouped together by identifying them as all belonging to one House Code. This option details what that is. It should be a single letter between A and P.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1';
|
||||
insert into Config set Id = 56, Name = 'ZM_X10_DB_RELOAD_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the X10 daemon reloads the monitors from the database', Help = 'The zmx10 daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently this check occurs, unless you change this area frequently this can be a fairly large value.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1';
|
||||
insert into Config set Id = 57, Name = 'ZM_WEB_SOUND_ON_ALARM', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the monitor window play a sound if an alarm occurs', Help = 'When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 58, Name = 'ZM_WEB_ALARM_SOUND', Value = '', Type = 'string', DefaultValue = '', Hint = 'filename', Pattern = '(?-xism:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'The sound to play on alarm, put this in the sounds directory', Help = 'You can specify a sound file to play if an alarm occurs whilst you are watching a live monitor stream. So long as your browser understands the format it does not need to be any particular type. This file should be placed in the sounds directory defined earlier.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_SOUND_ON_ALARM=1';
|
||||
insert into Config set Id = 59, Name = 'ZM_WEB_COMPACT_MONTAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to compact the montage view by removing extra detail', Help = 'The montage view shows the output of all of your active monitors in one window. This include a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 60, Name = 'ZM_WEB_MONTAGE_MAX_COLS', Value = '2', Type = 'integer', DefaultValue = '2', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'The maximum number of monitor columns in the montage view', Help = 'The \'montage\' view shows images from all your monitors at once. This parameter defines how many monitors to place across your screen before moving to the next row. If you have a very wide screen and/or small images from your cameras this can be a bigger value however if not, of if you prefer the images stacked vertically it should be small.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 61, Name = 'ZM_WEB_MONTAGE_WIDTH', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What width should each monitor in the montage view be', Help = 'In the montage view it is possible to view all of your monitors at once. If they are all different sizes this can be fairly untidy. Setting this option allows you to constrain the width of each of the monitor views to a fixed value to make the window tidier overall. Leaving it at the default of zero lets each monitor be displayed at it\'s normal native size.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 62, Name = 'ZM_WEB_MONTAGE_HEIGHT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What height should each monitor in the montage view be', Help = 'In the montage view it is possible to view all of your monitors at once. If they are all different sizes this can be fairly untidy. Setting this option allows you to constrain the height of each of the monitor views to a fixed value to make the window tidier overall. Leaving it at the default of zero lets each monitor be displayed at it\'s normal native size.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 63, Name = 'ZM_OPT_FAST_DELETE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Delete only event database records for speed', Help = 'Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 64, Name = 'ZM_STRICT_VIDEO_CONFIG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to allow errors in setting video config to be fatal', Help = 'With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 65, Name = 'ZM_SIGNAL_CHECK_POINTS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many points in a captured image to check for signal loss', Help = 'For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 66, Name = 'ZM_SIGNAL_CHECK_COLOUR', Value = '0100BE', Type = 'hexadecimal', DefaultValue = '0100BE', Hint = 'hexadecimal', Pattern = '(?-xism:^(?:0x)?([0-9a-f]{1,8})$)', Format = ' \"0x\".$1 ', Prompt = 'The colour to check when detecting signal loss', Help = 'For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. This option defines what that colour is, in hexadecimal RGB (red/green/blue) terms. The default, which is a shade of blue, is most common but other systems may differ.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 67, Name = 'ZM_CAPTURES_PER_FRAME', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many images are captured per returned frame, for shared local cameras', Help = 'If you are using cameras attached to a video capture card which forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed resulting in poor image quality and a distinctive comb edge appearance. Increasing this setting allows you to force additional image captures before one is selected as the captured frame. This allows the capture hardware to \'settle down\' and produce better quality images at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 68, Name = 'ZM_FILTER_RELOAD_DELAY', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) filters are reloaded in zmfilter', Help = 'ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are reloaded from the database to get the latest versions or new filters. If you don\'t change filters very often this value can be set to a large value.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 69, Name = 'ZM_FILTER_EXECUTE_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) to run automatic saved filters', Help = 'ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are executed on the saved event in the database. If you want a rapid response to new events this should be a smaller value, however this may increase the overall load on the system and affect performance of other elements.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 70, Name = 'ZM_OPT_UPLOAD', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder support uploading events from filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should be uploaded to a remote server for archiving. This option specifies whether this functionality should be available', Category = 'ftp', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 71, Name = 'ZM_UPLOAD_ARCH_FORMAT', Value = 'tar', Type = 'string', DefaultValue = 'tar', Hint = 'tar|zip', Pattern = '(?i-xsm:^([tz]))', Format = ' $1 =~ /^t/ ? \"tar\" : \"zip\" ', Prompt = 'What format the uploaded events should be created in.', Help = 'Uploaded events may be stored in either .tar or .zip format, this option specifies which. Note that to use this you will need to have the Archive::Tar and/or Archive::Zip perl modules installed.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 72, Name = 'ZM_UPLOAD_ARCH_COMPRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should archive files be compressed', Help = 'When the archive files are created they can be compressed. However in general since the images are compressed already this saves only a minimal amount of space versus utilising more CPU in their creation. Only enable if you have CPU to waste and are limited in disk space on your remote server or bandwidth.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 73, Name = 'ZM_UPLOAD_ARCH_ANALYSE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to include the analysis files in the archive', Help = 'When the archive files are created they can contain either just the captured frames or both the captured frames and, for frames that caused an alarm, the analysed image with the changed area highlighted. This option controls files are included. Only include analysed frames if you have a high bandwidth connection to the remote server or if you need help in figuring out what caused an alarm in the first place as archives with these files in can be considerably larger.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 74, Name = 'ZM_UPLOAD_FTP_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload to', Help = 'This is the remote machine that you wish to upload archived events to.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 75, Name = 'ZM_UPLOAD_FTP_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?-xism:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Your ftp username', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the username that ZoneMinder should use to log in for ftp transfer.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 76, Name = 'ZM_UPLOAD_FTP_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'Your ftp password', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the password that ZoneMinder should use to log in for ftp transfer.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 77, Name = 'ZM_UPLOAD_FTP_LOC_DIR', Value = '/tmp', Type = 'string', DefaultValue = '/tmp', Hint = '/absolute/path/to/somewhere', Pattern = '(?-xism:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 78, Name = 'ZM_UPLOAD_FTP_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?-xism:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the remote directory that ZoneMinder should use to upload event files to.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 79, Name = 'ZM_UPLOAD_FTP_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How long (in seconds) we allow the transfer to take for each file', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the maximum ftp inactivity timeout that should be tolerated before ZoneMinder determiesn that the transfer has failed and closes down the connection.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 80, Name = 'ZM_UPLOAD_FTP_PASSIVE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use passive ftp', Help = 'If your computer is behind a firewall or proxy you may need to set FTP to passive mode. In fact for simple transfers it makes little sense to do otherwise anyway but you can set this to \'No\' if you wish.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 81, Name = 'ZM_UPLOAD_FTP_DEBUG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to switch ftp debugging on', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. If you are having (or expecting) troubles with uploading events then setting this to \'yes\' permits additional information to be included in the zmfilter log file.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 82, Name = 'ZM_OPT_EMAIL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder email you details of events that match corresponding filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details emailed to you at a designated email address. This will allow you to be notified of events as soon as they occur and also to quickly view the events directly. This option specifies whether this functionality should be available. The email created with this option can be any size and is intended to be sent to a regular email reader rather than a mobile device.', Category = 'mail', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 83, Name = 'ZM_EMAIL_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = 'This option is used to define the email address that any events that match the appropriate filters will be sent to.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1';
|
||||
insert into Config set Id = 84, Name = 'ZM_EMAIL_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\"
|
||||
insert into Config set Id = 50, Name = 'ZM_PATH_SWAP', Value = '/tmp', Type = 'string', DefaultValue = '/tmp', Hint = '/absolute/path/to/somewhere', Pattern = '(?-xism:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'Path to location for temporary swap images used in streaming', Help = 'Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time.', Category = 'paths', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 51, Name = 'ZM_WEB_TITLE_PREFIX', Value = 'ZM', Type = 'string', DefaultValue = 'ZM', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The title prefix displayed on each window', Help = 'If you have more than one installation of ZoneMinder it can be helpful to display different titles for each one. Changing this option allows you to customise the window titles to include further information to aid identification.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 52, Name = 'ZM_WEB_RESIZE_CONSOLE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the console window resize itself to fit', Help = 'Traditionally the main ZoneMinder web console window has resized itself to shrink to a size small enough to list only the monitors that are actually present. This is intended to make the window more unobtrusize but may not be to everyones tastes, especially if opened in a tab in browsers which support this kind if layout. Switch this option off to have the console window size left to the users preference', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 53, Name = 'ZM_WEB_POPUP_ON_ALARM', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the monitor window jump to the top if an alarm occurs', Help = 'When viewing a live monitor stream you can specify whether you want the window to pop to the front if an alarm occurs when the window is minimised or behind another window. This is most useful if your monitors are over doors for example when they can pop up if someone comes to the doorway.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 54, Name = 'ZM_OPT_X10', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether we want to interface with X10 devices', Help = 'If you have an X10 Home Automation setup in your home you can use ZoneMinder to initiate or react to X10 signals if your computer has the appropriate interface controller. This option indicates whether X10 options will be available in the browser client.', Category = 'x10', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 55, Name = 'ZM_X10_DEVICE', Value = '/dev/ttyS0', Type = 'string', DefaultValue = '/dev/ttyS0', Hint = '/absolute/path/to/somewhere', Pattern = '(?-xism:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'What device is your X10 controller connected on', Help = 'If you have an X10 controller device (e.g. XM10U) connected to your computer this option details which port it is conected on, the default of /dev/ttyS0 maps to serial or com port 1.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1';
|
||||
insert into Config set Id = 56, Name = 'ZM_X10_HOUSE_CODE', Value = 'A', Type = 'string', DefaultValue = 'A', Hint = 'A-P', Pattern = '(?i-xsm:^([A-P]))', Format = ' uc($1) ', Prompt = 'What X10 house code should be used', Help = 'X10 devices are grouped together by identifying them as all belonging to one House Code. This option details what that is. It should be a single letter between A and P.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1';
|
||||
insert into Config set Id = 57, Name = 'ZM_X10_DB_RELOAD_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the X10 daemon reloads the monitors from the database', Help = 'The zmx10 daemon periodically checks the database to find out what X10 events trigger, or result from, alarms. This option determines how frequently this check occurs, unless you change this area frequently this can be a fairly large value.', Category = 'x10', Readonly = '0', Requires = 'ZM_OPT_X10=1';
|
||||
insert into Config set Id = 58, Name = 'ZM_WEB_SOUND_ON_ALARM', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should the monitor window play a sound if an alarm occurs', Help = 'When viewing a live monitor stream you can specify whether you want the window to play a sound to alert you if an alarm occurs.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 59, Name = 'ZM_WEB_ALARM_SOUND', Value = '', Type = 'string', DefaultValue = '', Hint = 'filename', Pattern = '(?-xism:^([a-zA-Z0-9-_.]+)$)', Format = ' $1 ', Prompt = 'The sound to play on alarm, put this in the sounds directory', Help = 'You can specify a sound file to play if an alarm occurs whilst you are watching a live monitor stream. So long as your browser understands the format it does not need to be any particular type. This file should be placed in the sounds directory defined earlier.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_SOUND_ON_ALARM=1';
|
||||
insert into Config set Id = 60, Name = 'ZM_WEB_COMPACT_MONTAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to compact the montage view by removing extra detail', Help = 'The montage view shows the output of all of your active monitors in one window. This include a small menu and status information for each one. This can increase the web traffic and make the window larger than may be desired. Setting this option on removes all this extraneous information and just displays the images.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 61, Name = 'ZM_WEB_MONTAGE_MAX_COLS', Value = '2', Type = 'integer', DefaultValue = '2', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'The maximum number of monitor columns in the montage view', Help = 'The \'montage\' view shows images from all your monitors at once. This parameter defines how many monitors to place across your screen before moving to the next row. If you have a very wide screen and/or small images from your cameras this can be a bigger value however if not, of if you prefer the images stacked vertically it should be small.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 62, Name = 'ZM_WEB_MONTAGE_WIDTH', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What width should each monitor in the montage view be', Help = 'In the montage view it is possible to view all of your monitors at once. If they are all different sizes this can be fairly untidy. Setting this option allows you to constrain the width of each of the monitor views to a fixed value to make the window tidier overall. Leaving it at the default of zero lets each monitor be displayed at it\'s normal native size.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 63, Name = 'ZM_WEB_MONTAGE_HEIGHT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What height should each monitor in the montage view be', Help = 'In the montage view it is possible to view all of your monitors at once. If they are all different sizes this can be fairly untidy. Setting this option allows you to constrain the height of each of the monitor views to a fixed value to make the window tidier overall. Leaving it at the default of zero lets each monitor be displayed at it\'s normal native size.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 64, Name = 'ZM_OPT_FAST_DELETE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Delete only event database records for speed', Help = 'Normally an event created as the result of an alarm consists of entries in one or more database tables plus the various files associated with it. When deleting events in the browser it can take a long time to remove all of this if your are trying to do a lot of events at once. It is recommended that you set this option which means that the browser client only deletes the key entries in the events table, which means the events will no longer appear in the listing, and leaves the zmaudit daemon to clear up the rest later.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 65, Name = 'ZM_STRICT_VIDEO_CONFIG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to allow errors in setting video config to be fatal', Help = 'With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 66, Name = 'ZM_SIGNAL_CHECK_POINTS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many points in a captured image to check for signal loss', Help = 'For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. When this happens any open events are closed and a short one frame signal loss event is generated, as is another when the signal returns. This option defines how many points on each image to check. Note that this is a maximum, any points found to not have the check colour will abort any further checks so in most cases on a couple of points will actually be checked. Network and file based cameras are never checked.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 67, Name = 'ZM_SIGNAL_CHECK_COLOUR', Value = '0100BE', Type = 'hexadecimal', DefaultValue = '0100BE', Hint = 'hexadecimal', Pattern = '(?-xism:^(?:0x)?([0-9a-f]{1,8})$)', Format = ' \"0x\".$1 ', Prompt = 'The colour to check when detecting signal loss', Help = 'For locally attached video cameras ZoneMinder can check for signal loss by looking at a number of random points on each captured image. If all of these points are set to the same fixed colour then the camera is assumed to have lost signal. This option defines what that colour is, in hexadecimal RGB (red/green/blue) terms. The default, which is a shade of blue, is most common but other systems may differ.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 68, Name = 'ZM_CAPTURES_PER_FRAME', Value = '1', Type = 'integer', DefaultValue = '1', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many images are captured per returned frame, for shared local cameras', Help = 'If you are using cameras attached to a video capture card which forces multiple inputs to share one capture chip, it can sometimes produce images with interlaced frames reversed resulting in poor image quality and a distinctive comb edge appearance. Increasing this setting allows you to force additional image captures before one is selected as the captured frame. This allows the capture hardware to \'settle down\' and produce better quality images at the price of lesser capture rates. This option has no effect on (a) network cameras, or (b) where multiple inputs do not share a capture chip', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 69, Name = 'ZM_FILTER_RELOAD_DELAY', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) filters are reloaded in zmfilter', Help = 'ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are reloaded from the database to get the latest versions or new filters. If you don\'t change filters very often this value can be set to a large value.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 70, Name = 'ZM_FILTER_EXECUTE_INTERVAL', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) to run automatic saved filters', Help = 'ZoneMinder allows you to save filters to the database which allow events that match certain criteria to be emailed, deleted or uploaded to a remote machine etc. The zmfilter daemon loads these and does the actual operation. This option determines how often the filters are executed on the saved event in the database. If you want a rapid response to new events this should be a smaller value, however this may increase the overall load on the system and affect performance of other elements.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 71, Name = 'ZM_OPT_UPLOAD', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder support uploading events from filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should be uploaded to a remote server for archiving. This option specifies whether this functionality should be available', Category = 'ftp', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 72, Name = 'ZM_UPLOAD_ARCH_FORMAT', Value = 'tar', Type = 'string', DefaultValue = 'tar', Hint = 'tar|zip', Pattern = '(?i-xsm:^([tz]))', Format = ' $1 =~ /^t/ ? \"tar\" : \"zip\" ', Prompt = 'What format the uploaded events should be created in.', Help = 'Uploaded events may be stored in either .tar or .zip format, this option specifies which. Note that to use this you will need to have the Archive::Tar and/or Archive::Zip perl modules installed.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 73, Name = 'ZM_UPLOAD_ARCH_COMPRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should archive files be compressed', Help = 'When the archive files are created they can be compressed. However in general since the images are compressed already this saves only a minimal amount of space versus utilising more CPU in their creation. Only enable if you have CPU to waste and are limited in disk space on your remote server or bandwidth.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 74, Name = 'ZM_UPLOAD_ARCH_ANALYSE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to include the analysis files in the archive', Help = 'When the archive files are created they can contain either just the captured frames or both the captured frames and, for frames that caused an alarm, the analysed image with the changed area highlighted. This option controls files are included. Only include analysed frames if you have a high bandwidth connection to the remote server or if you need help in figuring out what caused an alarm in the first place as archives with these files in can be considerably larger.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 75, Name = 'ZM_UPLOAD_FTP_HOST', Value = '', Type = 'string', DefaultValue = '', Hint = 'host.your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The remote server to upload to', Help = 'This is the remote machine that you wish to upload archived events to.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 76, Name = 'ZM_UPLOAD_FTP_USER', Value = '', Type = 'string', DefaultValue = '', Hint = 'alphanumeric', Pattern = '(?-xism:^([a-zA-Z0-9-_]+)$)', Format = ' $1 ', Prompt = 'Your ftp username', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the username that ZoneMinder should use to log in for ftp transfer.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 77, Name = 'ZM_UPLOAD_FTP_PASS', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'Your ftp password', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the password that ZoneMinder should use to log in for ftp transfer.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 78, Name = 'ZM_UPLOAD_FTP_LOC_DIR', Value = '/tmp', Type = 'string', DefaultValue = '/tmp', Hint = '/absolute/path/to/somewhere', Pattern = '(?-xism:^((?:/[^/]*)+?)/?$)', Format = ' $1 ', Prompt = 'The local directory in which to create upload files', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the local directory that ZoneMinder should use for temporary upload files. These are files that are created from events, uploaded and then deleted.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 79, Name = 'ZM_UPLOAD_FTP_REM_DIR', Value = '', Type = 'string', DefaultValue = '', Hint = 'relative/path/to/somewhere', Pattern = '(?-xism:^((?:[^/].*)?)/?$)', Format = ' $1 ', Prompt = 'The remote directory to upload to', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the remote directory that ZoneMinder should use to upload event files to.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 80, Name = 'ZM_UPLOAD_FTP_TIMEOUT', Value = '120', Type = 'integer', DefaultValue = '120', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How long (in seconds) we allow the transfer to take for each file', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. This option indicates the maximum ftp inactivity timeout that should be tolerated before ZoneMinder determiesn that the transfer has failed and closes down the connection.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 81, Name = 'ZM_UPLOAD_FTP_PASSIVE', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use passive ftp', Help = 'If your computer is behind a firewall or proxy you may need to set FTP to passive mode. In fact for simple transfers it makes little sense to do otherwise anyway but you can set this to \'No\' if you wish.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 82, Name = 'ZM_UPLOAD_FTP_DEBUG', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to switch ftp debugging on', Help = 'You can use filters to instruct ZoneMinder to upload events to a remote ftp server. If you are having (or expecting) troubles with uploading events then setting this to \'yes\' permits additional information to be included in the zmfilter log file.', Category = 'ftp', Readonly = '0', Requires = 'ZM_OPT_UPLOAD=1';
|
||||
insert into Config set Id = 83, Name = 'ZM_OPT_EMAIL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder email you details of events that match corresponding filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details emailed to you at a designated email address. This will allow you to be notified of events as soon as they occur and also to quickly view the events directly. This option specifies whether this functionality should be available. The email created with this option can be any size and is intended to be sent to a regular email reader rather than a mobile device.', Category = 'mail', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 84, Name = 'ZM_EMAIL_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = 'This option is used to define the email address that any events that match the appropriate filters will be sent to.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1';
|
||||
insert into Config set Id = 85, Name = 'ZM_EMAIL_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)\"
|
||||
body = \"
|
||||
Hello,
|
||||
|
||||
|
@ -706,8 +708,8 @@ The details are as follows :-
|
|||
This alarm was matched by the %FN% filter and can be viewed at %EPS%
|
||||
|
||||
ZoneMinder\"', Hint = 'free text', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the email used to send matching event details', Help = 'This option is used to define the content of the email that is sent for any events that match the appropriate filters.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1';
|
||||
insert into Config set Id = 85, Name = 'ZM_EMAIL_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the email used to send matching event details', Help = 'This option is used to define the subject of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1';
|
||||
insert into Config set Id = 86, Name = 'ZM_EMAIL_BODY', Value = '
|
||||
insert into Config set Id = 86, Name = 'ZM_EMAIL_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the email used to send matching event details', Help = 'This option is used to define the subject of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1';
|
||||
insert into Config set Id = 87, Name = 'ZM_EMAIL_BODY', Value = '
|
||||
Hello,
|
||||
|
||||
An alarm has been detected on your installation of the ZoneMinder.
|
||||
|
@ -738,92 +740,93 @@ The details are as follows :-
|
|||
This alarm was matched by the %FN% filter and can be viewed at %EPS%
|
||||
|
||||
ZoneMinder', Hint = 'free text', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the email used to send matching event details', Help = 'This option is used to define the content of the email that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1';
|
||||
insert into Config set Id = 87, Name = 'ZM_OPT_MESSAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder message you with details of events that match corresponding filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details sent to you at a designated short message email address. This will allow you to be notified of events as soon as they occur. This option specifies whether this functionality should be available. The email created by this option will be brief and is intended to be sent to an SMS gateway or a minimal mail reader such as a mobile device or phone rather than a regular email reader.', Category = 'mail', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 88, Name = 'ZM_MESSAGE_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = 'This option is used to define the short message email address that any events that match the appropriate filters will be sent to.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 89, Name = 'ZM_MESSAGE_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\"
|
||||
insert into Config set Id = 88, Name = 'ZM_OPT_MESSAGE', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should ZoneMinder message you with details of events that match corresponding filters', Help = 'In ZoneMinder you can create event filters that specify whether events that match certain criteria should have their details sent to you at a designated short message email address. This will allow you to be notified of events as soon as they occur. This option specifies whether this functionality should be available. The email created by this option will be brief and is intended to be sent to an SMS gateway or a minimal mail reader such as a mobile device or phone rather than a regular email reader.', Category = 'mail', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 89, Name = 'ZM_MESSAGE_ADDRESS', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address to send matching event details to', Help = 'This option is used to define the short message email address that any events that match the appropriate filters will be sent to.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 90, Name = 'ZM_MESSAGE_TEXT', Value = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\"
|
||||
body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Type = 'text', DefaultValue = 'subject = \"ZoneMinder: Alarm - %MN%-%EI%\"
|
||||
body = \"ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.\"', Hint = 'free text', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The text of the message used to send matching event details', Help = 'This option is used to define the content of the message that is sent for any events that match the appropriate filters.', Category = 'hidden', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 90, Name = 'ZM_MESSAGE_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI%', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI%', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the message used to send matching event details', Help = 'This option is used to define the subject of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 91, Name = 'ZM_MESSAGE_BODY', Value = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Type = 'text', DefaultValue = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Hint = 'free text', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the message used to send matching event details', Help = 'This option is used to define the content of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 92, Name = 'ZM_NEW_MAIL_MODULES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use a newer perl method to send emails', Help = 'Traditionally ZoneMinder has used the MIME::Entity perl module to construct and send notification emails and messages. Some people have reported problems with this module not being present at all or flexible enough for their needs. If you are one of those people this option allows you to select a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone but has not been extensively tested so currently is not selected by default.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 93, Name = 'ZM_EMAIL_HOST', Value = 'localhost', Type = 'string', DefaultValue = 'localhost', Hint = 'host.your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The host address of your SMTP mail server', Help = 'If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP\'s SMTP mail server here.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 94, Name = 'ZM_FROM_EMAIL', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address you wish your event notifications to originate from', Help = 'The emails or messages that will be sent to you informing you of events can appear to come from a designated email address to help you with mail filtering etc. An address of something like ZoneMinder@your.domain is recommended.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 95, Name = 'ZM_URL', Value = '', Type = 'string', DefaultValue = '', Hint = 'http://host.your.domain/', Pattern = '(?-xism:^(?:http://)?(.+)$)', Format = ' \"http://\".$1 ', Prompt = 'The URL of your ZoneMinder installation', Help = 'The emails or messages that will be sent to you informing you of events can include a link to the events themselves for easy viewing. If you intend to use this feature then set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm.php.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 96, Name = 'ZM_MAX_RESTART_DELAY', Value = '600', Type = 'integer', DefaultValue = '600', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum delay (in seconds) for daemon restart attempts.', Help = 'The zmdc (zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 97, Name = 'ZM_WATCH_CHECK_INTERVAL', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check the capture daemons have not locked up', Help = 'The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines how often the daemons are checked.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 98, Name = 'ZM_WATCH_MAX_DELAY', Value = '5', Type = 'decimal', DefaultValue = '5', Hint = 'decimal', Pattern = '(?-xism:^(\d+(?:\.\d+)?)$)', Format = ' $1 ', Prompt = 'The maximum delay allowed since the last captured image', Help = 'The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines the maximum delay we will allow since the last captured frame. The daemon will be restarted if it has not captured any images after this period though the actual restart may take slightly longer in conjunction with the check interval value above.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 99, Name = 'ZM_RUN_AUDIT', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to run zmaudit to check data consistency', Help = 'The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using \'fast deletes\' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 100, Name = 'ZM_AUDIT_CHECK_INTERVAL', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check database and filesystem consistency', Help = 'The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using \'fast deletes\' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 101, Name = 'ZM_FORCED_ALARM_SCORE', Value = '255', Type = 'integer', DefaultValue = '255', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'Score to give forced alarms', Help = 'The \'zmu\' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 102, Name = 'ZM_BULK_FRAME_INTERVAL', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often a bulk frame should be written to the database', Help = 'Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation (\'Record\' or \'Mocord\' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one \'bulk\' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 103, Name = 'ZM_FORCE_CLOSE_EVENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether events are closed at section ends.', Help = 'When a monitor is running in a continuous recording moe (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 104, Name = 'ZM_CREATE_ANALYSIS_IMAGES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to create analysed alarm images with motion outlined', Help = 'By default during an alarm ZoneMinder records both the raw captured image and one that has been analysed and had areas where motion was detected outlined. This can be very useful during zone configuration or in analysing why events occured. However it also incurs some overhead and in a stable system may no longer be necessary. This parameter allows you to switch the generation of these images off.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 105, Name = 'ZM_WEIGHTED_ALARM_CENTRES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use a weighted algorithm to calculate the centre of an alarm', Help = 'ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method this can instead be calculated using weighted pixel locations to give more accurate positioning for irregularly shaped blobs. This method, while more precise is also slower and so is turned off by default.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 106, Name = 'ZM_EVENT_IMAGE_DIGITS', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many significant digits are used in event image numbering', Help = 'As event images are captured they are stored to the filesystem with a numerical index. By default this index has three digits so the numbers start 001, 002 etc. This works works for most scenarios as events with more than 999 frames are rarely captured. However if you have extremely long events and use external applications then you may wish to increase this to ensure correct sorting of images in listings etc. Warning, increasing this value on a live system may render existing events unviewable as the event will have been saved with the previous scheme. Decreasing this value should have no ill effects.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 107, Name = 'ZM_OPT_FRAME_SERVER', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should analysis farm out the writing of images to disk', Help = 'In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 108, Name = 'ZM_FRAME_SOCKET_SIZE', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'Specify the frame server socket buffer size if non-standard', Help = 'For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_FRAME_SERVER=1';
|
||||
insert into Config set Id = 109, Name = 'ZM_OPT_CONTROL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to support controllable (e.g. PTZ) cameras', Help = 'ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. If you wish to control your cameras via ZoneMinder then select this option otherwise if you only have static cameras or use other control methods then leave this option off.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 110, Name = 'ZM_OPT_TRIGGERS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether we want to interface external event triggers via socket or device files', Help = 'ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via the zmtrigger.pl script. This option indicates whether you want to use these external triggers. Most people will say no here.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 111, Name = 'ZM_CHECK_FOR_UPDATES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to check with zoneminder.com for updated versions', Help = 'From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 112, Name = 'ZM_UPDATE_CHECK_PROXY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'Proxy url if required to access zoneminder.com', Help = 'If you use a proxy to access the internet then ZoneMinder needs to know so it can access zoneminder.com to check for updates. If you do use a proxy enter the full proxy url here in the form of http://<proxy host>:<proxy port>/', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 113, Name = 'ZM_SHM_KEY', Value = '0x7a6d2000', Type = 'hexadecimal', DefaultValue = '0x7a6d2000', Hint = 'hexadecimal', Pattern = '(?-xism:^(?:0x)?([0-9a-f]{1,8})$)', Format = ' \"0x\".$1 ', Prompt = 'Shared memory root key to use', Help = 'ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it\'s Id or\'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 114, Name = 'ZM_WEB_REFRESH_METHOD', Value = 'javascript', Type = 'string', DefaultValue = 'javascript', Hint = 'javascript|http', Pattern = '(?i-xsm:^([jh]))', Format = ' $1 =~ /^j/ ? \"javascript\" : \"http\" ', Prompt = 'What method windows should use to refresh themselves', Help = 'Many windows in Javascript need to refresh themselves to keep their information current. This option determines what method they should use to do this. Choosing \'javascript\' means that each window will have a short JavaScript statement in with a timer to prompt the refresh. This is the most compatible method. Choosing \'http\' means the refresh instruction is put in the HTTP header. This is a cleaner method but refreshes are interrupted or cancelled when a link in the window is clicked meaning that the window will no longer refresh and this would have to be done manually.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 115, Name = 'ZM_WEB_DOUBLE_BUFFER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether still images should be double buffered to avoid flickering', Help = 'From version 1.18.0 ZoneMinder can use a double buffering method to preload still image prior to displaying them on screen. This reduces flickering and makes viewing still images a more pleasant experience. However some devices may not support the JavaScript/frames combination needed to make this possible in which case this option should be switched off. As this option uses JavaScript it will only have an effect if the ZM_WEB_REFRESH_METHOD option is set to JavaScript also.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_REFRESH_METHOD=javascript';
|
||||
insert into Config set Id = 116, Name = 'ZM_WEB_EVENT_SORT_FIELD', Value = 'DateTime', Type = 'string', DefaultValue = 'DateTime', Hint = 'Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore', Pattern = '(?-xism:.)', Format = ' $1 ', Prompt = 'Default field the event lists are sorted by', Help = 'Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the \'Prev\' and \'Next\' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 117, Name = 'ZM_WEB_EVENT_SORT_ORDER', Value = 'asc', Type = 'string', DefaultValue = 'asc', Hint = 'asc|desc', Pattern = '(?i-xsm:^([ad]))', Format = ' $1 =~ /^a/i ? \"asc\" : \"desc\" ', Prompt = 'Default order the event lists are sorted by', Help = 'Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the \'Prev\' and \'Next\' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 118, Name = 'ZM_WEB_EVENTS_PER_PAGE', Value = '25', Type = 'integer', DefaultValue = '25', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many events to list per page in paged mode', Help = 'In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 119, Name = 'ZM_WEB_FRAMES_PER_LINE', Value = '4', Type = 'integer', DefaultValue = '4', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many frames to list per line in the frame view', Help = 'In the event frame view you can view the individual frames that comprise an event. This option allows you to specify how many frames go on each line. The product of this option and the frame lines option are the number of frames per page', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 120, Name = 'ZM_WEB_FRAME_LINES', Value = '4', Type = 'integer', DefaultValue = '4', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many lines of frames to list in the frame view', Help = 'In the event frame view you can view the individual frames that comprise an event. This option allows you to specify how many lines of frames are shown per page. The product of this option and the frames per line option are the number of frames per page.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 121, Name = 'ZM_WEB_LIST_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to display mini-thumbnails of event images in event lists', Help = 'Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 122, Name = 'ZM_WEB_LIST_THUMB_WIDTH', Value = '48', Type = 'integer', DefaultValue = '48', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'The width of the thumbnails that appear in the event lists', Help = 'This options controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1';
|
||||
insert into Config set Id = 123, Name = 'ZM_WEB_LIST_THUMB_HEIGHT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'The height of the thumbnails that appear in the event lists', Help = 'This options controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1';
|
||||
insert into Config set Id = 124, Name = 'ZM_WEB_USE_OBJECT_TAGS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to wrap embed in object tags for media content', Help = 'There are two methods of including media content in web pages. The most common way is use the EMBED tag which is able to give some indication of the type of content. However this is not a standard part of HTML. The official method is to use OBJECT tags which are able to give more information allowing the correct media viewers etc to be loaded. However these are less widely supported and content may be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only or whether, where appropriate, it is additionally wrapped in OBJECT tags. Currently OBJECT tags are only used in a limited number of circumstances but they may become more widespread in the future. It is suggested that you leave this option off unless you encounter problems playing some content.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 125, Name = 'ZM_WEB_H_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 126, Name = 'ZM_WEB_H_REFRESH_CYCLE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 127, Name = 'ZM_WEB_H_REFRESH_IMAGE', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 128, Name = 'ZM_WEB_H_REFRESH_STATUS', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 129, Name = 'ZM_WEB_H_REFRESH_EVENTS', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 130, Name = 'ZM_WEB_H_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'live\' or \'event\' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 131, Name = 'ZM_WEB_H_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 132, Name = 'ZM_WEB_H_VIDEO_BITRATE', Value = '150000', Type = 'integer', DefaultValue = '150000', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = 'When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a \'quality\' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 133, Name = 'ZM_WEB_H_VIDEO_MAXFPS', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = 'When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 134, Name = 'ZM_WEB_H_SCALE_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'highband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 135, Name = 'ZM_WEB_H_USE_STREAMS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use streaming or stills for live and events views', Help = 'Both the live and events views can use streaming to deliver a smoother feed. However over slow connections or in some other circumstances you can prefer to view stills instead. You can configure this globally with ZM_CAN_STREAM but this option allows you to modify your preference based on the bandwidth setting. Note that this option does not prevent you switching to streaming mode but just selects what the initial default setting is.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 136, Name = 'ZM_WEB_H_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?i-xsm:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 137, Name = 'ZM_WEB_H_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 138, Name = 'ZM_WEB_M_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 139, Name = 'ZM_WEB_M_REFRESH_CYCLE', Value = '20', Type = 'integer', DefaultValue = '20', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 140, Name = 'ZM_WEB_M_REFRESH_IMAGE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 141, Name = 'ZM_WEB_M_REFRESH_STATUS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 142, Name = 'ZM_WEB_M_REFRESH_EVENTS', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 143, Name = 'ZM_WEB_M_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'live\' or \'event\' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 144, Name = 'ZM_WEB_M_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 145, Name = 'ZM_WEB_M_VIDEO_BITRATE', Value = '75000', Type = 'integer', DefaultValue = '75000', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = 'When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a \'quality\' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 146, Name = 'ZM_WEB_M_VIDEO_MAXFPS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = 'When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 147, Name = 'ZM_WEB_M_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'medband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 148, Name = 'ZM_WEB_M_USE_STREAMS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use streaming or stills for live and events views', Help = 'Both the live and events views can use streaming to deliver a smoother feed. However over slow connections or in some other circumstances you can prefer to view stills instead. You can configure this globally with ZM_CAN_STREAM but this option allows you to modify your preference based on the bandwidth setting. Note that this option does not prevent you switching to streaming mode but just selects what the initial default setting is.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 149, Name = 'ZM_WEB_M_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?i-xsm:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 150, Name = 'ZM_WEB_M_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 151, Name = 'ZM_WEB_L_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 152, Name = 'ZM_WEB_L_REFRESH_CYCLE', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 153, Name = 'ZM_WEB_L_REFRESH_IMAGE', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 154, Name = 'ZM_WEB_L_REFRESH_STATUS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 155, Name = 'ZM_WEB_L_REFRESH_EVENTS', Value = '180', Type = 'integer', DefaultValue = '180', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 156, Name = 'ZM_WEB_L_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'live\' or \'event\' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 157, Name = 'ZM_WEB_L_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 158, Name = 'ZM_WEB_L_VIDEO_BITRATE', Value = '25000', Type = 'integer', DefaultValue = '25000', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = 'When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a \'quality\' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 159, Name = 'ZM_WEB_L_VIDEO_MAXFPS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = 'When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 160, Name = 'ZM_WEB_L_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'lowband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 161, Name = 'ZM_WEB_L_USE_STREAMS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use streaming or stills for live and events views', Help = 'Both the live and events views can use streaming to deliver a smoother feed. However over slow connections or in some other circumstances you can prefer to view stills instead. You can configure this globally with ZM_CAN_STREAM but this option allows you to modify your preference based on the bandwidth setting. Note that this option does not prevent you switching to streaming mode but just selects what the initial default setting is.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 162, Name = 'ZM_WEB_L_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?i-xsm:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 163, Name = 'ZM_WEB_L_SHOW_PROGRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 164, Name = 'ZM_WEB_P_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'phoneband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 165, Name = 'ZM_WEB_P_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'phoneband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 166, Name = 'ZM_DYN_LAST_VERSION', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'What the last version of ZoneMinder recorded from zoneminder.com is', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 167, Name = 'ZM_DYN_CURR_VERSION', Value = '1.22.3', Type = 'string', DefaultValue = '1.22.3', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'What the effective current version of ZoneMinder is, might be different from actual if versions ignored', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 168, Name = 'ZM_DYN_DB_VERSION', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'What the version of the database is, from zmupdate', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 169, Name = 'ZM_DYN_LAST_CHECK', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'When the last check for version from zoneminder.com was', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 170, Name = 'ZM_DYN_NEXT_REMINDER', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about versions will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 171, Name = 'ZM_DYN_DONATE_REMINDER_TIME', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about donations will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 172, Name = 'ZM_DYN_SHOW_DONATE_REMINDER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to remind about donations or not', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 91, Name = 'ZM_MESSAGE_SUBJECT', Value = 'ZoneMinder: Alarm - %MN%-%EI%', Type = 'string', DefaultValue = 'ZoneMinder: Alarm - %MN%-%EI%', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The subject of the message used to send matching event details', Help = 'This option is used to define the subject of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 92, Name = 'ZM_MESSAGE_BODY', Value = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Type = 'text', DefaultValue = 'ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.', Hint = 'free text', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'The body of the message used to send matching event details', Help = 'This option is used to define the content of the message that is sent for any events that match the appropriate filters.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 93, Name = 'ZM_NEW_MAIL_MODULES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use a newer perl method to send emails', Help = 'Traditionally ZoneMinder has used the MIME::Entity perl module to construct and send notification emails and messages. Some people have reported problems with this module not being present at all or flexible enough for their needs. If you are one of those people this option allows you to select a new mailing method using MIME::Lite and Net::SMTP instead. This method was contributed by Ross Melin and should work for everyone but has not been extensively tested so currently is not selected by default.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 94, Name = 'ZM_EMAIL_HOST', Value = 'localhost', Type = 'string', DefaultValue = 'localhost', Hint = 'host.your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)$)', Format = ' $1 ', Prompt = 'The host address of your SMTP mail server', Help = 'If you have chosen SMTP as the method by which to send notification emails or messages then this option allows you to choose which SMTP server to use to send them. The default of localhost may work if you have the sendmail, exim or a similar daemon running however you may wish to enter your ISP\'s SMTP mail server here.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 95, Name = 'ZM_FROM_EMAIL', Value = '', Type = 'string', DefaultValue = '', Hint = 'your.name@your.domain', Pattern = '(?-xism:^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9_.-]+)$)', Format = ' $1\@$2 ', Prompt = 'The email address you wish your event notifications to originate from', Help = 'The emails or messages that will be sent to you informing you of events can appear to come from a designated email address to help you with mail filtering etc. An address of something like ZoneMinder@your.domain is recommended.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 96, Name = 'ZM_URL', Value = '', Type = 'string', DefaultValue = '', Hint = 'http://host.your.domain/', Pattern = '(?-xism:^(?:http://)?(.+)$)', Format = ' \"http://\".$1 ', Prompt = 'The URL of your ZoneMinder installation', Help = 'The emails or messages that will be sent to you informing you of events can include a link to the events themselves for easy viewing. If you intend to use this feature then set this option to the url of your installation as it would appear from where you read your email, e.g. http://host.your.domain/zm.php.', Category = 'mail', Readonly = '0', Requires = 'ZM_OPT_EMAIL=1;ZM_OPT_MESSAGE=1';
|
||||
insert into Config set Id = 97, Name = 'ZM_MAX_RESTART_DELAY', Value = '600', Type = 'integer', DefaultValue = '600', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'Maximum delay (in seconds) for daemon restart attempts.', Help = 'The zmdc (zm daemon control) process controls when processeses are started or stopped and will attempt to restart any that fail. If a daemon fails frequently then a delay is introduced between each restart attempt. If the daemon stills fails then this delay is increased to prevent extra load being placed on the system by continual restarts. This option controls what this maximum delay is.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 98, Name = 'ZM_WATCH_CHECK_INTERVAL', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check the capture daemons have not locked up', Help = 'The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines how often the daemons are checked.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 99, Name = 'ZM_WATCH_MAX_DELAY', Value = '5', Type = 'decimal', DefaultValue = '5', Hint = 'decimal', Pattern = '(?-xism:^(\d+(?:\.\d+)?)$)', Format = ' $1 ', Prompt = 'The maximum delay allowed since the last captured image', Help = 'The zmwatch daemon checks the image capture performance of the capture daemons to ensure that they have not locked up (rarely a sync error may occur which blocks indefinately). This option determines the maximum delay we will allow since the last captured frame. The daemon will be restarted if it has not captured any images after this period though the actual restart may take slightly longer in conjunction with the check interval value above.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 100, Name = 'ZM_RUN_AUDIT', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to run zmaudit to check data consistency', Help = 'The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using \'fast deletes\' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. This option controls whether zmaudit is run in the background and performs these checks and fixes continuously. This is recommended for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to not have zmaudit running unconditionally and schedule occasional checks at other, more convenient, times.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 101, Name = 'ZM_AUDIT_CHECK_INTERVAL', Value = '900', Type = 'integer', DefaultValue = '900', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often to check database and filesystem consistency', Help = 'The zmaudit daemon exists to check that the saved information in the database and on the filesystem match and are consistent with each other. If an error occurs or if you are using \'fast deletes\' it may be that database records are deleted but files remain. In this case, and similar, zmaudit will remove redundant information to synchronise the two data stores. The default check interval of 900 seconds (15 minutes) is fine for most systems however if you have a very large number of events the process of scanning the database and filesystem may take a long time and impact performance. In this case you may prefer to make this interval much larger to reduce the impact on your system. This option determines how often these checks are performed.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 102, Name = 'ZM_FORCED_ALARM_SCORE', Value = '255', Type = 'integer', DefaultValue = '255', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'Score to give forced alarms', Help = 'The \'zmu\' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 103, Name = 'ZM_BULK_FRAME_INTERVAL', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often a bulk frame should be written to the database', Help = 'Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation (\'Record\' or \'Mocord\' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one \'bulk\' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 104, Name = 'ZM_FORCE_CLOSE_EVENTS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether events are closed at section ends.', Help = 'When a monitor is running in a continuous recording moe (Record or Mocord) events are usually closed after a fixed period of time (the section length). However in Mocord mode it is possible that motion detection may occur near the end of a section and ordinarily this will prevent the event being closed until the motion has ceased. Switching this option on will force the event closed at the specified time regardless of any motion activity.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 105, Name = 'ZM_CREATE_ANALYSIS_IMAGES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to create analysed alarm images with motion outlined', Help = 'By default during an alarm ZoneMinder records both the raw captured image and one that has been analysed and had areas where motion was detected outlined. This can be very useful during zone configuration or in analysing why events occured. However it also incurs some overhead and in a stable system may no longer be necessary. This parameter allows you to switch the generation of these images off.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 106, Name = 'ZM_WEIGHTED_ALARM_CENTRES', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use a weighted algorithm to calculate the centre of an alarm', Help = 'ZoneMinder will always calculate the centre point of an alarm in a zone to give some indication of where on the screen it is. This can be used by the experimental motion tracking feature or your own custom extensions. In the alarmed or filtered pixels mode this is a simple midpoint between the extents of the detected pxiesl. However in the blob method this can instead be calculated using weighted pixel locations to give more accurate positioning for irregularly shaped blobs. This method, while more precise is also slower and so is turned off by default.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 107, Name = 'ZM_EVENT_IMAGE_DIGITS', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many significant digits are used in event image numbering', Help = 'As event images are captured they are stored to the filesystem with a numerical index. By default this index has three digits so the numbers start 001, 002 etc. This works works for most scenarios as events with more than 999 frames are rarely captured. However if you have extremely long events and use external applications then you may wish to increase this to ensure correct sorting of images in listings etc. Warning, increasing this value on a live system may render existing events unviewable as the event will have been saved with the previous scheme. Decreasing this value should have no ill effects.', Category = 'config', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 108, Name = 'ZM_OPT_FRAME_SERVER', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Should analysis farm out the writing of images to disk', Help = 'In some circumstances it is possible for a slow disk to take so long writing images to disk that it causes the analysis daemon to fall behind especially during high frame rate events. Setting this option to yes enables a frame server daemon (zmf) which will be sent the images from the analysis daemon and will do the actual writing of images itself freeing up the analysis daemon to get on with other things. Should this transmission fail or other permanent or transient error occur, this function will fall back to the analysis daemon.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 109, Name = 'ZM_FRAME_SOCKET_SIZE', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'Specify the frame server socket buffer size if non-standard', Help = 'For large captured images it is possible for the writes from the analysis daemon to the frame server to fail as the amount to be written exceeds the default buffer size. While the images are then written by the analysis daemon so no data is lost, it defeats the object of the frame server daemon in the first place. You can use this option to indicate that a larger buffer size should be used. Note that you may have to change the existing maximum socket buffer size on your system via sysctl (or in /proc/sys/net/core/wmem_max) to allow this new size to be set. Alternatively you can change the default buffer size on your system in the same way in which case that will be used with no change necessary in this option', Category = 'system', Readonly = '0', Requires = 'ZM_OPT_FRAME_SERVER=1';
|
||||
insert into Config set Id = 110, Name = 'ZM_OPT_CONTROL', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to support controllable (e.g. PTZ) cameras', Help = 'ZoneMinder includes limited support for controllable cameras. A number of sample protocols are included and others can easily be added. If you wish to control your cameras via ZoneMinder then select this option otherwise if you only have static cameras or use other control methods then leave this option off.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 111, Name = 'ZM_OPT_TRIGGERS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether we want to interface external event triggers via socket or device files', Help = 'ZoneMinder can interact with external systems which prompt or cancel alarms. This is done via the zmtrigger.pl script. This option indicates whether you want to use these external triggers. Most people will say no here.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 112, Name = 'ZM_CHECK_FOR_UPDATES', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to check with zoneminder.com for updated versions', Help = 'From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 113, Name = 'ZM_UPDATE_CHECK_PROXY', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'Proxy url if required to access zoneminder.com', Help = 'If you use a proxy to access the internet then ZoneMinder needs to know so it can access zoneminder.com to check for updates. If you do use a proxy enter the full proxy url here in the form of http://<proxy host>:<proxy port>/', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 114, Name = 'ZM_SHM_KEY', Value = '0x7a6d0000', Type = 'hexadecimal', DefaultValue = '0x7a6d0000', Hint = 'hexadecimal', Pattern = '(?-xism:^(?:0x)?([0-9a-f]{1,8})$)', Format = ' \"0x\".$1 ', Prompt = 'Shared memory root key to use', Help = 'ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it\'s Id or\'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine. Only the first four hex digits are used, the lower four will be masked out and ignored.', Category = 'system', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 115, Name = 'ZM_WEB_REFRESH_METHOD', Value = 'javascript', Type = 'string', DefaultValue = 'javascript', Hint = 'javascript|http', Pattern = '(?i-xsm:^([jh]))', Format = ' $1 =~ /^j/ ? \"javascript\" : \"http\" ', Prompt = 'What method windows should use to refresh themselves', Help = 'Many windows in Javascript need to refresh themselves to keep their information current. This option determines what method they should use to do this. Choosing \'javascript\' means that each window will have a short JavaScript statement in with a timer to prompt the refresh. This is the most compatible method. Choosing \'http\' means the refresh instruction is put in the HTTP header. This is a cleaner method but refreshes are interrupted or cancelled when a link in the window is clicked meaning that the window will no longer refresh and this would have to be done manually.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 116, Name = 'ZM_WEB_DOUBLE_BUFFER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether still images should be double buffered to avoid flickering', Help = 'From version 1.18.0 ZoneMinder can use a double buffering method to preload still image prior to displaying them on screen. This reduces flickering and makes viewing still images a more pleasant experience. However some devices may not support the JavaScript/frames combination needed to make this possible in which case this option should be switched off. As this option uses JavaScript it will only have an effect if the ZM_WEB_REFRESH_METHOD option is set to JavaScript also.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_REFRESH_METHOD=javascript';
|
||||
insert into Config set Id = 117, Name = 'ZM_WEB_EVENT_SORT_FIELD', Value = 'DateTime', Type = 'string', DefaultValue = 'DateTime', Hint = 'Id|Name|Cause|MonitorName|DateTime|Length|Frames|AlarmFrames|TotScore|AvgScore|MaxScore', Pattern = '(?-xism:.)', Format = ' $1 ', Prompt = 'Default field the event lists are sorted by', Help = 'Events in lists can be initially ordered in any way you want. This option controls what field is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the \'Prev\' and \'Next\' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 118, Name = 'ZM_WEB_EVENT_SORT_ORDER', Value = 'asc', Type = 'string', DefaultValue = 'asc', Hint = 'asc|desc', Pattern = '(?i-xsm:^([ad]))', Format = ' $1 =~ /^a/i ? \"asc\" : \"desc\" ', Prompt = 'Default order the event lists are sorted by', Help = 'Events in lists can be initially ordered in any way you want. This option controls what order (ascending or descending) is used to sort them. You can modify this ordering from filters or by clicking on headings in the lists themselves. Bear in mind however that the \'Prev\' and \'Next\' links, when scrolling through events, relate to the ordering in the lists and so not always to time based ordering.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 119, Name = 'ZM_WEB_EVENTS_PER_PAGE', Value = '25', Type = 'integer', DefaultValue = '25', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many events to list per page in paged mode', Help = 'In the event list view you can either list all events or just a page at a time. This option controls how many events are listed per page in paged mode and how often to repeat the column headers in non-paged mode.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 120, Name = 'ZM_WEB_FRAMES_PER_LINE', Value = '4', Type = 'integer', DefaultValue = '4', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many frames to list per line in the frame view', Help = 'In the event frame view you can view the individual frames that comprise an event. This option allows you to specify how many frames go on each line. The product of this option and the frame lines option are the number of frames per page', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 121, Name = 'ZM_WEB_FRAME_LINES', Value = '4', Type = 'integer', DefaultValue = '4', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How many lines of frames to list in the frame view', Help = 'In the event frame view you can view the individual frames that comprise an event. This option allows you to specify how many lines of frames are shown per page. The product of this option and the frames per line option are the number of frames per page.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 122, Name = 'ZM_WEB_LIST_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to display mini-thumbnails of event images in event lists', Help = 'Ordinarily the event lists just display text details of the events to save space and time. By switching this option on you can also display small thumbnails to help you identify events of interest. The size of these thumbnails is controlled by the following two options.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 123, Name = 'ZM_WEB_LIST_THUMB_WIDTH', Value = '48', Type = 'integer', DefaultValue = '48', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'The width of the thumbnails that appear in the event lists', Help = 'This options controls the width of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a height instead in the next option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1';
|
||||
insert into Config set Id = 124, Name = 'ZM_WEB_LIST_THUMB_HEIGHT', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'The height of the thumbnails that appear in the event lists', Help = 'This options controls the height of the thumbnail images that appear in the event lists. It should be fairly small to fit in with the rest of the table. If you prefer you can specify a width instead in the previous option but you should only use one of the width or height and the other option should be set to zero. If both width and height are specified then width will be used and height ignored.', Category = 'web', Readonly = '0', Requires = 'ZM_WEB_LIST_THUMBS=1';
|
||||
insert into Config set Id = 125, Name = 'ZM_WEB_USE_OBJECT_TAGS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to wrap embed in object tags for media content', Help = 'There are two methods of including media content in web pages. The most common way is use the EMBED tag which is able to give some indication of the type of content. However this is not a standard part of HTML. The official method is to use OBJECT tags which are able to give more information allowing the correct media viewers etc to be loaded. However these are less widely supported and content may be specifically tailored to a particular platform or player. This option controls whether media content is enclosed in EMBED tags only or whether, where appropriate, it is additionally wrapped in OBJECT tags. Currently OBJECT tags are only used in a limited number of circumstances but they may become more widespread in the future. It is suggested that you leave this option off unless you encounter problems playing some content.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 126, Name = 'ZM_WEB_DVR_STREAMING', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use new DVR style streaming (beta)', Help = 'There are now two methods of viewing monitor and event streams. The default is to use the old framed style pages which allowed limited control over the streams but which have been thoroughly tested. The alternative is to use the newer pure CSS and Ajax views which are precursors to a number of changes that will be taking place in the web view over the next view versions. These views allow full DVR control including pause, rewind, pan and zoom etc, but which have not received so much testing and which may not work partly or at all on some browsers. It is recommended that you select the new views unless you find problems with them.', Category = 'web', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 127, Name = 'ZM_WEB_H_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 128, Name = 'ZM_WEB_H_REFRESH_CYCLE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 129, Name = 'ZM_WEB_H_REFRESH_IMAGE', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 130, Name = 'ZM_WEB_H_REFRESH_STATUS', Value = '3', Type = 'integer', DefaultValue = '3', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 131, Name = 'ZM_WEB_H_REFRESH_EVENTS', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 132, Name = 'ZM_WEB_H_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'live\' or \'event\' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 133, Name = 'ZM_WEB_H_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 134, Name = 'ZM_WEB_H_VIDEO_BITRATE', Value = '150000', Type = 'integer', DefaultValue = '150000', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = 'When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a \'quality\' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 135, Name = 'ZM_WEB_H_VIDEO_MAXFPS', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = 'When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 136, Name = 'ZM_WEB_H_SCALE_THUMBS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'highband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 137, Name = 'ZM_WEB_H_USE_STREAMS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use streaming or stills for live and events views', Help = 'Both the live and events views can use streaming to deliver a smoother feed. However over slow connections or in some other circumstances you can prefer to view stills instead. You can configure this globally with ZM_CAN_STREAM but this option allows you to modify your preference based on the bandwidth setting. Note that this option does not prevent you switching to streaming mode but just selects what the initial default setting is.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 138, Name = 'ZM_WEB_H_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?i-xsm:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 139, Name = 'ZM_WEB_H_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'highband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 140, Name = 'ZM_WEB_M_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 141, Name = 'ZM_WEB_M_REFRESH_CYCLE', Value = '20', Type = 'integer', DefaultValue = '20', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 142, Name = 'ZM_WEB_M_REFRESH_IMAGE', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 143, Name = 'ZM_WEB_M_REFRESH_STATUS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 144, Name = 'ZM_WEB_M_REFRESH_EVENTS', Value = '60', Type = 'integer', DefaultValue = '60', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 145, Name = 'ZM_WEB_M_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'live\' or \'event\' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 146, Name = 'ZM_WEB_M_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 147, Name = 'ZM_WEB_M_VIDEO_BITRATE', Value = '75000', Type = 'integer', DefaultValue = '75000', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = 'When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a \'quality\' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 148, Name = 'ZM_WEB_M_VIDEO_MAXFPS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = 'When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 149, Name = 'ZM_WEB_M_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'medband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 150, Name = 'ZM_WEB_M_USE_STREAMS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use streaming or stills for live and events views', Help = 'Both the live and events views can use streaming to deliver a smoother feed. However over slow connections or in some other circumstances you can prefer to view stills instead. You can configure this globally with ZM_CAN_STREAM but this option allows you to modify your preference based on the bandwidth setting. Note that this option does not prevent you switching to streaming mode but just selects what the initial default setting is.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 151, Name = 'ZM_WEB_M_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?i-xsm:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 152, Name = 'ZM_WEB_M_SHOW_PROGRESS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'medband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 153, Name = 'ZM_WEB_L_REFRESH_MAIN', Value = '300', Type = 'integer', DefaultValue = '300', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the main console window should refresh itself', Help = 'The main console window lists a general status and the event totals for all monitors. This is not a trivial task and should not be repeated too frequently or it may affect the performance of the rest of the system.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 154, Name = 'ZM_WEB_L_REFRESH_CYCLE', Value = '30', Type = 'integer', DefaultValue = '30', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the cycle watch window swaps to the next monitor', Help = 'The cycle watch window is a method of continuously cycling between images from all of your monitors. This option determines how often to refresh with a new image.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 155, Name = 'ZM_WEB_L_REFRESH_IMAGE', Value = '15', Type = 'integer', DefaultValue = '15', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the watched image is refreshed (if not streaming)', Help = 'The live images from a monitor can be viewed in either streamed or stills mode. This option determines how often a stills image is refreshed, it has no effect if streaming is selected.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 156, Name = 'ZM_WEB_L_REFRESH_STATUS', Value = '10', Type = 'integer', DefaultValue = '10', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the status refreshes itself in the watch window', Help = 'The monitor window is actually made from several frames. The one in the middle merely contains a monitor status which needs to refresh fairly frequently to give a true indication. This option determines that frequency.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 157, Name = 'ZM_WEB_L_REFRESH_EVENTS', Value = '180', Type = 'integer', DefaultValue = '180', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'How often (in seconds) the event listing is refreshed in the watch window', Help = 'The monitor window is actually made from several frames. The lower framme contains a listing of the last few events for easy access. This option determines how often this is refreshed.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 158, Name = 'ZM_WEB_L_DEFAULT_SCALE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|33|50|75|100|150|200|300|400', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default scaling factor applied to \'live\' or \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'live\' or \'event\' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 159, Name = 'ZM_WEB_L_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = '25|50|100|150|200|400|1000|2500|5000|10000', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 160, Name = 'ZM_WEB_L_VIDEO_BITRATE', Value = '25000', Type = 'integer', DefaultValue = '25000', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the bitrate of the video encoded stream should be set to', Help = 'When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a \'quality\' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 161, Name = 'ZM_WEB_L_VIDEO_MAXFPS', Value = '5', Type = 'integer', DefaultValue = '5', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the maximum frame rate for streamed video should be', Help = 'When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 162, Name = 'ZM_WEB_L_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'lowband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 163, Name = 'ZM_WEB_L_USE_STREAMS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to use streaming or stills for live and events views', Help = 'Both the live and events views can use streaming to deliver a smoother feed. However over slow connections or in some other circumstances you can prefer to view stills instead. You can configure this globally with ZM_CAN_STREAM but this option allows you to modify your preference based on the bandwidth setting. Note that this option does not prevent you switching to streaming mode but just selects what the initial default setting is.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 164, Name = 'ZM_WEB_L_EVENTS_VIEW', Value = 'events', Type = 'string', DefaultValue = 'events', Hint = 'events|timeline', Pattern = '(?i-xsm:^([lt]))', Format = ' $1 =~ /^e/ ? \"events\" : \"timeline\" ', Prompt = 'What the default view of multiple events should be.', Help = 'Stored events can be viewed in either an events list format or in a timeline based one. This option sets the default view that will be used. Choosing one view here does not prevent the other view being used as it will always be selectable from whichever view is currently being used.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 165, Name = 'ZM_WEB_L_SHOW_PROGRESS', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to show the progress of replay in event view.', Help = 'When viewing events an event navigation panel and progress bar is shown below the event itself. This allows you to jump to specific points in the event, but can can also dynamically update to display the current progress of the event replay itself. This progress is calculated from the actual event duration and is not directly linked to the replay itself, so on limited bandwidth connections may be out of step with the replay. This option allows you to turn off the progress display, whilst still keeping the navigation aspect, where bandwidth prevents it functioning effectively.', Category = 'lowband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 166, Name = 'ZM_WEB_P_DEFAULT_RATE', Value = '100', Type = 'integer', DefaultValue = '100', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'What the default replay rate factor applied to \'event\' views is (%)', Help = 'Normally ZoneMinder will display \'event\' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.', Category = 'phoneband', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 167, Name = 'ZM_WEB_P_SCALE_THUMBS', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to scale thumbnails in events, bandwidth versus cpu in rescaling', Help = 'If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server', Category = 'phoneband', Readonly = '0', Requires = 'ZM_PATH_NETPBM=/';
|
||||
insert into Config set Id = 168, Name = 'ZM_DYN_LAST_VERSION', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'What the last version of ZoneMinder recorded from zoneminder.com is', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 169, Name = 'ZM_DYN_CURR_VERSION', Value = '1.22.3', Type = 'string', DefaultValue = '1.22.3', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'What the effective current version of ZoneMinder is, might be different from actual if versions ignored', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 170, Name = 'ZM_DYN_DB_VERSION', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'What the version of the database is, from zmupdate', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 171, Name = 'ZM_DYN_LAST_CHECK', Value = '', Type = 'integer', DefaultValue = '', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'When the last check for version from zoneminder.com was', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 172, Name = 'ZM_DYN_NEXT_REMINDER', Value = '', Type = 'string', DefaultValue = '', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about versions will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 173, Name = 'ZM_DYN_DONATE_REMINDER_TIME', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about donations will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 174, Name = 'ZM_DYN_SHOW_DONATE_REMINDER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Whether to remind about donations or not', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
-- This updates a 1.22.3 database to 1.22.4
|
||||
--
|
||||
|
||||
--
|
||||
-- Add a column for buffer replay streams
|
||||
--
|
||||
alter table Monitors add column `StreamReplayBuffer` int(10) unsigned NOT NULL default '1000' after PostEventCount;
|
||||
|
||||
--
|
||||
-- Increase the size of the run state definition column
|
||||
--
|
||||
|
|
|
@ -515,6 +515,14 @@ our @options =
|
|||
type => $types{abs_path},
|
||||
category => "paths",
|
||||
},
|
||||
{
|
||||
name => "ZM_PATH_SWAP",
|
||||
default => "/tmp",
|
||||
description => "Path to location for temporary swap images used in streaming",
|
||||
help => "Buffered playback requires temporary swap images to be stored for each instance of the streaming daemons. This option determines where these images will be stored. The images will actually be stored in sub directories beneath this location and will be automatically cleaned up after a period of time.",
|
||||
type => $types{abs_path},
|
||||
category => "paths",
|
||||
},
|
||||
{
|
||||
name => "ZM_WEB_TITLE_PREFIX",
|
||||
default => "ZM",
|
||||
|
@ -1086,9 +1094,9 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
|
|||
},
|
||||
{
|
||||
name => "ZM_SHM_KEY",
|
||||
default => "0x7a6d2000",
|
||||
default => "0x7a6d0000",
|
||||
description => "Shared memory root key to use",
|
||||
help => "ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it's Id or'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine.",
|
||||
help => "ZoneMinder uses shared memory to speed up communication between modules. To identify the right area to use shared memory keys are used. This option controls what the base key is, each monitor will have it's Id or'ed with this to get the actual key used. You will not normally need to change this value unless it clashes with another instance of ZoneMinder on the same machine. Only the first four hex digits are used, the lower four will be masked out and ignored.",
|
||||
type => $types{hexadecimal},
|
||||
category => "system",
|
||||
},
|
||||
|
@ -1183,6 +1191,14 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
|
|||
type => $types{boolean},
|
||||
category => "web",
|
||||
},
|
||||
{
|
||||
name => "ZM_WEB_DVR_STREAMING",
|
||||
default => "no",
|
||||
description => "Whether to use new DVR style streaming (beta)",
|
||||
help => "There are now two methods of viewing monitor and event streams. The default is to use the old framed style pages which allowed limited control over the streams but which have been thoroughly tested. The alternative is to use the newer pure CSS and Ajax views which are precursors to a number of changes that will be taking place in the web view over the next view versions. These views allow full DVR control including pause, rewind, pan and zoom etc, but which have not received so much testing and which may not work partly or at all on some browsers. It is recommended that you select the new views unless you find problems with them.",
|
||||
type => $types{boolean},
|
||||
category => "web",
|
||||
},
|
||||
{
|
||||
name => "ZM_WEB_H_REFRESH_MAIN",
|
||||
default => "300",
|
||||
|
|
|
@ -222,7 +222,7 @@ sub zmShmGet( $ )
|
|||
my $monitor = shift;
|
||||
if ( !defined($monitor->{ShmId}) )
|
||||
{
|
||||
my $shm_key = hex(ZM_SHM_KEY)|$monitor->{Id};
|
||||
my $shm_key = (hex(ZM_SHM_KEY)&0xffff0000)|$monitor->{Id};
|
||||
my $shm_id = shmget( $shm_key, $shm_size, 0 );
|
||||
if ( !defined($shm_id) )
|
||||
{
|
||||
|
|
|
@ -55,6 +55,7 @@ use constant DBG_LEVEL => 1; # 0 is errors, warnings and info only, > 0 for debu
|
|||
use ZoneMinder;
|
||||
use DBI;
|
||||
use POSIX;
|
||||
use File::Find;
|
||||
use Time::HiRes qw/gettimeofday/;
|
||||
use Getopt::Long;
|
||||
|
||||
|
@ -155,7 +156,9 @@ my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM
|
|||
chdir( EVENT_PATH );
|
||||
|
||||
my $max_image_age = 6/24; # 6 hours
|
||||
my $max_swap_age = 24/24; # 24 hours
|
||||
my $image_path = IMAGE_PATH;
|
||||
my $swap_image_path = ZM_PATH_SWAP;
|
||||
do
|
||||
{
|
||||
my $db_monitors;
|
||||
|
@ -327,5 +330,30 @@ do
|
|||
unlink( split( ";", $untainted_old_files ) );
|
||||
}
|
||||
|
||||
# Now delete any old swap files
|
||||
sub deleteSwapImage
|
||||
{
|
||||
my $file = $_;
|
||||
|
||||
if ( $file !~ /^zmswap-/ )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
# Ignore directories
|
||||
if ( -d $file )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( -M $file > $max_swap_age )
|
||||
{
|
||||
Debug( "Deleting $file" );
|
||||
#unlink( $file );
|
||||
}
|
||||
}
|
||||
( my $swap_image_root ) = ( $swap_image_path =~ /^(.*)$/ ); # De-taint
|
||||
File::Find::find( { wanted=>\&deleteSwapImage, untaint=>1 }, $swap_image_root );
|
||||
|
||||
sleep( ZM_AUDIT_CHECK_INTERVAL ) if ( $continuous );
|
||||
} while( $continuous );
|
||||
|
|
|
@ -24,6 +24,7 @@ zm_SOURCES = \
|
|||
zm_box.cpp \
|
||||
zm_poly.cpp \
|
||||
zm_image.cpp \
|
||||
zm_stream.cpp \
|
||||
zm_event.cpp \
|
||||
zm_zone.cpp \
|
||||
zm_camera.cpp \
|
||||
|
@ -59,6 +60,7 @@ noinst_HEADERS = \
|
|||
zm_poly.h \
|
||||
zm_image.h \
|
||||
zm_event.h \
|
||||
zm_stream.h \
|
||||
zm_zone.h \
|
||||
zm_camera.h \
|
||||
zm_local_camera.h \
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#define ZM_MAX_IMAGE_DIM (ZM_MAX_IMAGE_WIDTH*ZM_MAX_IMAGE_HEIGHT)
|
||||
#define ZM_MAX_IMAGE_SIZE (ZM_MAX_IMAGE_DIM*ZM_MAX_IMAGE_COLOURS)
|
||||
|
||||
#define ZM_SCALE_SCALE 100 // The factor by which we bump up 'scale' to simulate FP
|
||||
#define ZM_RATE_SCALE 100 // The factor by which we bump up 'rate' to simulate FP
|
||||
#define ZM_SCALE_BASE 100 // The factor by which we bump up 'scale' to simulate FP
|
||||
#define ZM_RATE_BASE 100 // The factor by which we bump up 'rate' to simulate FP
|
||||
|
||||
#define ZM_MAX_FPS 30 // The maximum frame rate we expect to handle
|
||||
#define ZM_SAMPLE_RATE int(1000000/ZM_MAX_FPS) // A general nyquist sample frequency for delays etc
|
||||
|
|
958
src/zm_event.cpp
958
src/zm_event.cpp
File diff suppressed because it is too large
Load Diff
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "zm.h"
|
||||
#include "zm_image.h"
|
||||
#include "zm_stream.h"
|
||||
|
||||
class Monitor;
|
||||
|
||||
|
@ -43,6 +44,8 @@ class Monitor;
|
|||
//
|
||||
class Event
|
||||
{
|
||||
friend class EventStream;
|
||||
|
||||
protected:
|
||||
static bool initialised;
|
||||
static char capture_file_format[PATH_MAX];
|
||||
|
@ -85,11 +88,14 @@ protected:
|
|||
protected:
|
||||
static void Initialise()
|
||||
{
|
||||
initialised = true;
|
||||
if ( initialised )
|
||||
return;
|
||||
|
||||
snprintf( capture_file_format, sizeof(capture_file_format), "%%s/%%0%dd-capture.jpg", config.event_image_digits );
|
||||
snprintf( analyse_file_format, sizeof(analyse_file_format), "%%s/%%0%dd-analyse.jpg", config.event_image_digits );
|
||||
snprintf( general_file_format, sizeof(general_file_format), "%%s/%%0%dd-%%s", config.event_image_digits );
|
||||
|
||||
initialised = true;
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -116,11 +122,6 @@ public:
|
|||
void AddFrames( int n_frames, Image **images, struct timeval **timestamps );
|
||||
void AddFrame( Image *image, struct timeval timestamp, int score=0, Image *alarm_frame=NULL );
|
||||
|
||||
static void StreamEvent( int event_id, int frame_id, int scale=100, int rate=100, int maxfps=10 );
|
||||
#if HAVE_LIBAVCODEC
|
||||
static void StreamMpeg( int event_id, int frame_id, const char *format, int scale=100, int rate=100, int maxfps=10, int bitrate=100000 );
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
|
||||
public:
|
||||
static int PreAlarmCount()
|
||||
{
|
||||
|
@ -158,7 +159,82 @@ public:
|
|||
}
|
||||
EmptyPreAlarmFrames();
|
||||
}
|
||||
};
|
||||
|
||||
class EventStream : public StreamBase
|
||||
{
|
||||
public:
|
||||
typedef enum { MODE_SINGLE, MODE_ALL, MODE_ALL_GAPLESS } StreamMode;
|
||||
|
||||
protected:
|
||||
typedef struct FrameData {
|
||||
//unsigned long id;
|
||||
time_t timestamp;
|
||||
time_t offset;
|
||||
double delta;
|
||||
bool in_db;
|
||||
};
|
||||
|
||||
typedef struct EventData
|
||||
{
|
||||
unsigned long event_id;
|
||||
unsigned long monitor_id;
|
||||
unsigned long frame_count;
|
||||
time_t start_time;
|
||||
double duration;
|
||||
char path[PATH_MAX];
|
||||
int n_frames;
|
||||
FrameData *frames;
|
||||
};
|
||||
|
||||
protected:
|
||||
static const int STREAM_PAUSE_WAIT = 250000; // Microseconds
|
||||
|
||||
static const StreamMode DEFAULT_MODE = MODE_SINGLE;
|
||||
|
||||
protected:
|
||||
StreamMode mode;
|
||||
|
||||
protected:
|
||||
int curr_frame_id;
|
||||
double curr_stream_time;
|
||||
|
||||
EventData *event_data;
|
||||
|
||||
protected:
|
||||
bool loadEventData( int event_id );
|
||||
bool loadInitialEventData( int init_event_id, int init_frame_id );
|
||||
bool loadInitialEventData( int monitor_id, time_t event_time );
|
||||
|
||||
void checkEventLoaded();
|
||||
void processCommand( const CmdMsg *msg );
|
||||
void sendFrame( int delta_us );
|
||||
|
||||
public:
|
||||
EventStream()
|
||||
{
|
||||
mode = DEFAULT_MODE;
|
||||
|
||||
curr_frame_id = 0;
|
||||
curr_stream_time = 0.0;
|
||||
|
||||
event_data = 0;
|
||||
}
|
||||
void setStreamStart( int init_event_id, int init_frame_id=0 )
|
||||
{
|
||||
loadInitialEventData( init_event_id, init_frame_id );
|
||||
loadMonitor( event_data->monitor_id );
|
||||
}
|
||||
void setStreamStart( int monitor_id, time_t event_time )
|
||||
{
|
||||
loadInitialEventData( monitor_id, event_time );
|
||||
loadMonitor( monitor_id );
|
||||
}
|
||||
void setStreamMode( StreamMode p_mode )
|
||||
{
|
||||
mode = p_mode;
|
||||
}
|
||||
void runStream();
|
||||
};
|
||||
|
||||
#endif // ZM_EVENT_H
|
||||
|
|
273
src/zm_image.cpp
273
src/zm_image.cpp
|
@ -35,6 +35,85 @@ jpeg_compress_struct *Image::jpg_ccinfo[100] = { 0 };
|
|||
jpeg_decompress_struct *Image::jpg_dcinfo = 0;
|
||||
struct zm_error_mgr Image::jpg_err;
|
||||
|
||||
Image::Image()
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = 0;
|
||||
height = 0;
|
||||
pixels = 0;
|
||||
colours = 0;
|
||||
size = 0;
|
||||
allocation = 0;
|
||||
buffer = 0;
|
||||
blend_buffer = 0;
|
||||
text[0] = '\0';
|
||||
}
|
||||
|
||||
Image::Image( const char *filename )
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = 0;
|
||||
height = 0;
|
||||
pixels = 0;
|
||||
colours = 0;
|
||||
size = 0;
|
||||
allocation = 0;
|
||||
buffer = 0;
|
||||
ReadJpeg( filename );
|
||||
blend_buffer = 0;
|
||||
text[0] = '\0';
|
||||
}
|
||||
|
||||
Image::Image( int p_width, int p_height, int p_colours, JSAMPLE *p_buffer )
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = p_width;
|
||||
height = p_height;
|
||||
pixels = width*height;
|
||||
colours = p_colours;
|
||||
size = width*height*colours;
|
||||
if ( p_buffer )
|
||||
{
|
||||
allocation = 0;
|
||||
buffer = p_buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
allocation = size;
|
||||
buffer = new JSAMPLE[allocation];
|
||||
memset( buffer, 0, size );
|
||||
}
|
||||
blend_buffer = 0;
|
||||
text[0] = '\0';
|
||||
}
|
||||
|
||||
Image::Image( const Image &p_image )
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = p_image.width;
|
||||
height = p_image.height;
|
||||
pixels = p_image.pixels;
|
||||
colours = p_image.colours;
|
||||
size = allocation = p_image.size;
|
||||
buffer = new JSAMPLE[allocation];
|
||||
memcpy( buffer, p_image.buffer, size );
|
||||
blend_buffer = 0;
|
||||
strncpy( text, p_image.text, sizeof(text) );
|
||||
}
|
||||
|
||||
Image::~Image()
|
||||
{
|
||||
if ( allocation )
|
||||
{
|
||||
delete[] buffer;
|
||||
}
|
||||
delete[] blend_buffer;
|
||||
}
|
||||
|
||||
void Image::Initialise()
|
||||
{
|
||||
initialised = true;
|
||||
|
@ -86,6 +165,57 @@ Image::BlendTablePtr Image::GetBlendTable( int transparency )
|
|||
return( blend_ptr );
|
||||
}
|
||||
|
||||
void Image::Empty()
|
||||
{
|
||||
if ( allocation )
|
||||
{
|
||||
delete[] buffer;
|
||||
buffer = 0;
|
||||
allocation = 0;
|
||||
}
|
||||
width = height = colours = size = 0;
|
||||
}
|
||||
|
||||
void Image::Assign( int p_width, int p_height, int p_colours, unsigned char *new_buffer )
|
||||
{
|
||||
if ( !buffer || p_width != width || p_height != height || p_colours != colours )
|
||||
{
|
||||
width = p_width;
|
||||
height = p_height;
|
||||
pixels = width*height;
|
||||
colours = p_colours;
|
||||
size = width*height*colours;
|
||||
if ( allocation < size )
|
||||
{
|
||||
allocation = size;
|
||||
delete[] buffer;
|
||||
buffer = new JSAMPLE[allocation];
|
||||
memset( buffer, 0, size );
|
||||
}
|
||||
}
|
||||
memcpy( buffer, new_buffer, size );
|
||||
}
|
||||
|
||||
void Image::Assign( const Image &image )
|
||||
{
|
||||
if ( !buffer || image.width != width || image.height != height || image.colours != colours )
|
||||
{
|
||||
width = image.width;
|
||||
height = image.height;
|
||||
pixels = width*height;
|
||||
colours = image.colours;
|
||||
size = width*height*colours;
|
||||
if ( allocation < size )
|
||||
{
|
||||
allocation = size;
|
||||
delete[] buffer;
|
||||
buffer = new JSAMPLE[allocation];
|
||||
memset( buffer, 0, size );
|
||||
}
|
||||
}
|
||||
memcpy( buffer, image.buffer, size );
|
||||
}
|
||||
|
||||
Image *Image::HighlightEdges( Rgb colour, const Box *limits )
|
||||
{
|
||||
if ( colours != 1 )
|
||||
|
@ -138,7 +268,7 @@ bool Image::ReadRaw( const char *filename )
|
|||
return( false );
|
||||
}
|
||||
|
||||
if ( statbuf.st_size != size )
|
||||
if ( statbuf.st_size != size )
|
||||
{
|
||||
Error(( "Raw file size mismatch, expected %d bytes, found %d", size, statbuf.st_size ));
|
||||
return( false );
|
||||
|
@ -211,12 +341,12 @@ bool Image::ReadJpeg( const char *filename )
|
|||
fclose( infile );
|
||||
return( false );
|
||||
}
|
||||
int new_size = width*height*colours;
|
||||
if ( !buffer || size < new_size )
|
||||
size = width*height*colours;
|
||||
if ( !buffer || allocation < size )
|
||||
{
|
||||
size = new_size;
|
||||
allocation = size;
|
||||
delete[] buffer;
|
||||
buffer = new JSAMPLE[size];
|
||||
buffer = new JSAMPLE[allocation];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,12 +468,12 @@ bool Image::DecodeJpeg( const JOCTET *inbuffer, int inbuffer_size )
|
|||
jpeg_abort_decompress( cinfo );
|
||||
return( false );
|
||||
}
|
||||
int new_size = width*height*colours;
|
||||
if ( !buffer || size < new_size )
|
||||
size = width*height*colours;
|
||||
if ( !buffer || allocation < size )
|
||||
{
|
||||
size = new_size;
|
||||
allocation = size;
|
||||
delete[] buffer;
|
||||
buffer = new JSAMPLE[size];
|
||||
buffer = new JSAMPLE[allocation];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -446,8 +576,8 @@ bool Image::Zip( Bytef *outbuffer, unsigned long *outbuffer_size, int compressio
|
|||
|
||||
bool Image::Crop( int lo_x, int lo_y, int hi_x, int hi_y )
|
||||
{
|
||||
int new_width = (hi_x-lo_x)+1;;
|
||||
int new_height = (hi_y-lo_y)+1;;
|
||||
int new_width = (hi_x-lo_x)+1;
|
||||
int new_height = (hi_y-lo_y)+1;
|
||||
|
||||
if ( lo_x > hi_x || lo_y > hi_y )
|
||||
{
|
||||
|
@ -476,16 +606,15 @@ bool Image::Crop( int lo_x, int lo_y, int hi_x, int hi_y )
|
|||
memcpy( pnbuf, pbuf, new_stride );
|
||||
}
|
||||
|
||||
if ( our_buffer )
|
||||
if ( allocation )
|
||||
{
|
||||
delete[] buffer;
|
||||
}
|
||||
width = new_width;
|
||||
height = new_height;
|
||||
pixels = width*height;
|
||||
size = new_size;
|
||||
size = allocation = new_size;
|
||||
buffer = new_buffer;
|
||||
our_buffer = true;
|
||||
if ( blend_buffer )
|
||||
{
|
||||
delete[] blend_buffer;
|
||||
|
@ -495,6 +624,11 @@ bool Image::Crop( int lo_x, int lo_y, int hi_x, int hi_y )
|
|||
return( true );
|
||||
}
|
||||
|
||||
bool Image::Crop( const Box &limits )
|
||||
{
|
||||
return( Crop( limits.LoX(), limits.LoY(), limits.HiX(), limits.HiY() ) );
|
||||
}
|
||||
|
||||
void Image::Overlay( const Image &image )
|
||||
{
|
||||
if ( !(width == image.width && height == image.height) )
|
||||
|
@ -566,6 +700,55 @@ void Image::Overlay( const Image &image )
|
|||
}
|
||||
}
|
||||
|
||||
void Image::Overlay( const Image &image, int x, int y )
|
||||
{
|
||||
if ( !(width < image.width || height < image.height) )
|
||||
{
|
||||
Fatal(( "Attempt to overlay image too big for destination, %dx%d > %dx%d", image.width, image.height, width, height ));
|
||||
}
|
||||
|
||||
if ( !(width < (x+image.width) || height < (y+image.height)) )
|
||||
{
|
||||
Fatal(( "Attempt to overlay image outside of destination bounds, %dx%d @ %dx%d > %dx%d", image.width, image.height, x, y, width, height ));
|
||||
}
|
||||
|
||||
if ( !(colours == image.colours) )
|
||||
{
|
||||
Fatal(( "Attempt to partial overlay differently coloured images, expected %d, got %d", colours, image.colours ));
|
||||
}
|
||||
|
||||
int lo_x = x;
|
||||
int lo_y = y;
|
||||
int hi_x = (x+image.width)-1;
|
||||
int hi_y = (y+image.height-1);
|
||||
if ( colours == 1 )
|
||||
{
|
||||
unsigned char *psrc = image.buffer;
|
||||
for ( int y = lo_y; y <= hi_y; y++ )
|
||||
{
|
||||
unsigned char *pdest = &buffer[(y*width)+lo_x];
|
||||
for ( int x = lo_x; x <= hi_x; x++ )
|
||||
{
|
||||
*pdest++ = *psrc++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( colours == 3 )
|
||||
{
|
||||
unsigned char *psrc = image.buffer;
|
||||
for ( int y = lo_y; y <= hi_y; y++ )
|
||||
{
|
||||
unsigned char *pdest = &buffer[colours*((y*width)+lo_x)];
|
||||
for ( int x = lo_x; x <= hi_x; x++ )
|
||||
{
|
||||
*pdest++ = *psrc++;
|
||||
*pdest++ = *psrc++;
|
||||
*pdest++ = *psrc++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Image::Blend( const Image &image, int transparency ) const
|
||||
{
|
||||
if ( !(width == image.width && height == image.height && colours == image.colours) )
|
||||
|
@ -781,6 +964,33 @@ Image *Image::Delta( const Image &image ) const
|
|||
return( result );
|
||||
}
|
||||
|
||||
const Coord Image::centreCoord( const char *text )
|
||||
{
|
||||
int index = 0;
|
||||
int line_no = 0;
|
||||
int text_len = strlen( text );
|
||||
int line_len = 0;
|
||||
int max_line_len = 0;
|
||||
const char *line = text;
|
||||
|
||||
while ( (index < text_len) && (line_len = strcspn( line, "\n" )) )
|
||||
{
|
||||
if ( line_len > max_line_len )
|
||||
max_line_len = line_len;
|
||||
|
||||
index += line_len;
|
||||
while ( text[index] == '\n' )
|
||||
{
|
||||
index++;
|
||||
}
|
||||
line = text+index;
|
||||
line_no++;
|
||||
}
|
||||
int x = (width - (max_line_len * CHAR_WIDTH) ) / 2;
|
||||
int y = (height - (line_no * LINE_HEIGHT) ) / 2;
|
||||
return( Coord( x, y ) );
|
||||
}
|
||||
|
||||
void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colour, const Rgb bg_colour )
|
||||
{
|
||||
strncpy( text, p_text, sizeof(text) );
|
||||
|
@ -790,7 +1000,6 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
|
|||
int text_len = strlen( text );
|
||||
int line_len = 0;
|
||||
const char *line = text;
|
||||
int line_height = CHAR_HEIGHT;
|
||||
|
||||
char fg_r_col = RGB_RED_VAL(fg_colour);
|
||||
char fg_g_col = RGB_GREEN_VAL(fg_colour);
|
||||
|
@ -813,7 +1022,7 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
|
|||
int min_line_x = 0;
|
||||
int max_line_x = width - line_width;
|
||||
int min_line_y = 0;
|
||||
int max_line_y = height - line_height;
|
||||
int max_line_y = height - LINE_HEIGHT;
|
||||
|
||||
if ( lo_line_x > max_line_x )
|
||||
lo_line_x = max_line_x;
|
||||
|
@ -825,7 +1034,7 @@ void Image::Annotate( const char *p_text, const Coord &coord, const Rgb fg_colou
|
|||
lo_line_y = min_line_y;
|
||||
|
||||
int hi_line_x = lo_line_x + line_width;
|
||||
int hi_line_y = lo_line_y + line_height;
|
||||
int hi_line_y = lo_line_y + LINE_HEIGHT;
|
||||
|
||||
// Clip anything that runs off the right of the screen
|
||||
if ( hi_line_x > width )
|
||||
|
@ -1426,33 +1635,33 @@ void Image::Scale( unsigned int factor )
|
|||
Error(( "Bogus scale factor %d found", factor ));
|
||||
return;
|
||||
}
|
||||
if ( factor == ZM_SCALE_SCALE )
|
||||
if ( factor == ZM_SCALE_BASE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static unsigned char scale_buffer[ZM_MAX_IMAGE_SIZE];
|
||||
unsigned int new_width = (width*factor)/ZM_SCALE_SCALE;
|
||||
unsigned int new_height = (height*factor)/ZM_SCALE_SCALE;
|
||||
if ( factor > ZM_SCALE_SCALE )
|
||||
unsigned int new_width = (width*factor)/ZM_SCALE_BASE;
|
||||
unsigned int new_height = (height*factor)/ZM_SCALE_BASE;
|
||||
if ( factor > ZM_SCALE_BASE )
|
||||
{
|
||||
unsigned char *pd = scale_buffer;
|
||||
unsigned int wc = width*colours;
|
||||
unsigned int nwc = new_width*colours;
|
||||
unsigned int h_count = ZM_SCALE_SCALE/2;
|
||||
unsigned int h_count = ZM_SCALE_BASE/2;
|
||||
unsigned int last_h_index = 0;
|
||||
unsigned int last_w_index = 0;
|
||||
unsigned int h_index;
|
||||
for ( int y = 0; y < height; y++ )
|
||||
{
|
||||
unsigned char *ps = &buffer[y*wc];
|
||||
unsigned int w_count = ZM_SCALE_SCALE/2;
|
||||
unsigned int w_count = ZM_SCALE_BASE/2;
|
||||
unsigned int w_index;
|
||||
last_w_index = 0;
|
||||
for ( int x = 0; x < width; x++ )
|
||||
{
|
||||
w_count += factor;
|
||||
w_index = w_count/ZM_SCALE_SCALE;
|
||||
w_index = w_count/ZM_SCALE_BASE;
|
||||
for ( int f = last_w_index; f < w_index; f++ )
|
||||
{
|
||||
for ( int c = 0; c < colours; c++ )
|
||||
|
@ -1464,7 +1673,7 @@ void Image::Scale( unsigned int factor )
|
|||
last_w_index = w_index;
|
||||
}
|
||||
h_count += factor;
|
||||
h_index = h_count/ZM_SCALE_SCALE;
|
||||
h_index = h_count/ZM_SCALE_BASE;
|
||||
for ( int f = last_h_index+1; f < h_index; f++ )
|
||||
{
|
||||
memcpy( pd, pd-nwc, nwc );
|
||||
|
@ -1477,7 +1686,7 @@ void Image::Scale( unsigned int factor )
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned int inv_factor = (ZM_SCALE_SCALE*ZM_SCALE_SCALE)/factor;
|
||||
unsigned int inv_factor = (ZM_SCALE_BASE*ZM_SCALE_BASE)/factor;
|
||||
unsigned char *pd = scale_buffer;
|
||||
unsigned int wc = width*colours;
|
||||
unsigned int xstart = factor/2;
|
||||
|
@ -1489,7 +1698,7 @@ void Image::Scale( unsigned int factor )
|
|||
for ( unsigned int y = 0; y < height; y++ )
|
||||
{
|
||||
h_count += factor;
|
||||
h_index = h_count/ZM_SCALE_SCALE;
|
||||
h_index = h_count/ZM_SCALE_BASE;
|
||||
if ( h_index > last_h_index )
|
||||
{
|
||||
unsigned int w_count = xstart;
|
||||
|
@ -1500,7 +1709,7 @@ void Image::Scale( unsigned int factor )
|
|||
for ( unsigned int x = 0; x < width; x++ )
|
||||
{
|
||||
w_count += factor;
|
||||
w_index = w_count/ZM_SCALE_SCALE;
|
||||
w_index = w_count/ZM_SCALE_BASE;
|
||||
|
||||
if ( w_index > last_w_index )
|
||||
{
|
||||
|
@ -1521,11 +1730,5 @@ void Image::Scale( unsigned int factor )
|
|||
new_width = last_w_index;
|
||||
new_height = last_h_index;
|
||||
}
|
||||
width = new_width;
|
||||
height = new_height;
|
||||
pixels = width*height;
|
||||
size = width*height*colours;
|
||||
delete[] buffer;
|
||||
buffer = new JSAMPLE[size];
|
||||
memcpy( buffer, scale_buffer, size );
|
||||
Assign( new_width, new_height, colours, scale_buffer );
|
||||
}
|
||||
|
|
125
src/zm_image.h
125
src/zm_image.h
|
@ -89,6 +89,7 @@ protected:
|
|||
int pixels;
|
||||
int colours;
|
||||
int size;
|
||||
int allocation;
|
||||
JSAMPLE *buffer;
|
||||
bool our_buffer;
|
||||
char text[1024];
|
||||
|
@ -101,81 +102,11 @@ protected:
|
|||
static BlendTablePtr GetBlendTable( int );
|
||||
|
||||
public:
|
||||
Image()
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = 0;
|
||||
height = 0;
|
||||
pixels = 0;
|
||||
colours = 0;
|
||||
size = 0;
|
||||
our_buffer = true;
|
||||
buffer = 0;
|
||||
blend_buffer = 0;
|
||||
text[0] = '\0';
|
||||
}
|
||||
Image( const char *filename )
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = 0;
|
||||
height = 0;
|
||||
pixels = 0;
|
||||
colours = 0;
|
||||
size = 0;
|
||||
buffer = 0;
|
||||
ReadJpeg( filename );
|
||||
our_buffer = true;
|
||||
blend_buffer = 0;
|
||||
text[0] = '\0';
|
||||
}
|
||||
Image( int p_width, int p_height, int p_colours, JSAMPLE *p_buffer=0 )
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = p_width;
|
||||
height = p_height;
|
||||
pixels = width*height;
|
||||
colours = p_colours;
|
||||
size = width*height*colours;
|
||||
if ( p_buffer )
|
||||
{
|
||||
our_buffer = false;
|
||||
buffer = p_buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
our_buffer = true;
|
||||
buffer = new JSAMPLE[size];
|
||||
memset( buffer, 0, size );
|
||||
}
|
||||
blend_buffer = 0;
|
||||
text[0] = '\0';
|
||||
}
|
||||
Image( const Image &p_image )
|
||||
{
|
||||
if ( !initialised )
|
||||
Initialise();
|
||||
width = p_image.width;
|
||||
height = p_image.height;
|
||||
pixels = p_image.pixels;
|
||||
colours = p_image.colours;
|
||||
size = p_image.size;
|
||||
buffer = new JSAMPLE[size];
|
||||
memcpy( buffer, p_image.buffer, size );
|
||||
our_buffer = true;
|
||||
blend_buffer = 0;
|
||||
strncpy( text, p_image.text, sizeof(text) );
|
||||
}
|
||||
~Image()
|
||||
{
|
||||
if ( our_buffer )
|
||||
{
|
||||
delete[] buffer;
|
||||
}
|
||||
delete[] blend_buffer;
|
||||
}
|
||||
Image();
|
||||
Image( const char *filename );
|
||||
Image( int p_width, int p_height, int p_colours, JSAMPLE *p_buffer=0 );
|
||||
Image( const Image &p_image );
|
||||
~Image();
|
||||
|
||||
inline int Width() const { return( width ); }
|
||||
inline int Height() const { return( height ); }
|
||||
|
@ -185,44 +116,9 @@ public:
|
|||
inline JSAMPLE *Buffer() const { return( buffer ); }
|
||||
inline JSAMPLE *Buffer( unsigned int x, unsigned int y= 0 ) const { return( &buffer[colours*((y*width)+x)] ); }
|
||||
|
||||
inline void Assign( int p_width, int p_height, int p_colours, unsigned char *new_buffer )
|
||||
{
|
||||
if ( p_width != width || p_height != height || p_colours != colours )
|
||||
{
|
||||
width = p_width;
|
||||
height = p_height;
|
||||
pixels = width*height;
|
||||
colours = p_colours;
|
||||
int new_size = width*height*colours;
|
||||
if ( size < new_size )
|
||||
{
|
||||
size = new_size;
|
||||
delete[] buffer;
|
||||
buffer = new JSAMPLE[size];
|
||||
memset( buffer, 0, size );
|
||||
}
|
||||
}
|
||||
memcpy( buffer, new_buffer, size );
|
||||
}
|
||||
inline void Assign( const Image &image )
|
||||
{
|
||||
if ( image.width != width || image.height != height || image.colours != colours )
|
||||
{
|
||||
width = image.width;
|
||||
height = image.height;
|
||||
pixels = width*height;
|
||||
colours = image.colours;
|
||||
int new_size = width*height*colours;
|
||||
if ( size < new_size )
|
||||
{
|
||||
size = new_size;
|
||||
delete[] buffer;
|
||||
buffer = new JSAMPLE[size];
|
||||
memset( buffer, 0, size );
|
||||
}
|
||||
}
|
||||
memcpy( buffer, image.buffer, size );
|
||||
}
|
||||
void Empty();
|
||||
void Assign( int p_width, int p_height, int p_colours, unsigned char *new_buffer );
|
||||
void Assign( const Image &image );
|
||||
|
||||
inline void CopyBuffer( const Image &image )
|
||||
{
|
||||
|
@ -250,14 +146,17 @@ public:
|
|||
bool Zip( Bytef *outbuffer, unsigned long *outbuffer_size, int compression_level=Z_BEST_SPEED ) const;
|
||||
|
||||
bool Crop( int lo_x, int lo_y, int hi_y, int hi_y );
|
||||
bool Crop( const Box &limits );
|
||||
|
||||
void Overlay( const Image &image );
|
||||
void Overlay( const Image &image, int x, int y );
|
||||
void Blend( const Image &image, int transparency=10 ) const;
|
||||
static Image *Merge( int n_images, Image *images[] );
|
||||
static Image *Merge( int n_images, Image *images[], double weight );
|
||||
static Image *Highlight( int n_images, Image *images[], const Rgb threshold=RGB_BLACK, const Rgb ref_colour=RGB_RED );
|
||||
Image *Delta( const Image &image ) const;
|
||||
|
||||
const Coord centreCoord( const char *text );
|
||||
void Annotate( const char *p_text, const Coord &coord, const Rgb fg_colour=RGB_WHITE, const Rgb bg_colour=RGB_BLACK );
|
||||
Image *HighlightEdges( Rgb colour, const Box *limits=0 );
|
||||
//Image *HighlightEdges( Rgb colour, const Polygon &polygon );
|
||||
|
|
1225
src/zm_monitor.cpp
1225
src/zm_monitor.cpp
File diff suppressed because it is too large
Load Diff
116
src/zm_monitor.h
116
src/zm_monitor.h
|
@ -35,6 +35,8 @@ static struct timezone dummy_tz; // To avoid declaring pointless one each time w
|
|||
//
|
||||
class Monitor
|
||||
{
|
||||
friend class MonitorStream;
|
||||
|
||||
public:
|
||||
typedef enum
|
||||
{
|
||||
|
@ -166,36 +168,37 @@ protected:
|
|||
// These are read from the DB and thereafter remain unchanged
|
||||
int id;
|
||||
char name[64];
|
||||
Function function; // What the monitor is doing
|
||||
bool enabled; // Whether the monitor is enabled or asleep
|
||||
unsigned int width; // Normally the same as the camera, but not if partly rotated
|
||||
unsigned int height; // Normally the same as the camera, but not if partly rotated
|
||||
Orientation orientation; // Whether the image has to be rotated at all
|
||||
int brightness; // The statically saved brightness of the camera
|
||||
int contrast; // The statically saved contrast of the camera
|
||||
int hue; // The statically saved hue of the camera
|
||||
int colour; // The statically saved colour of the camera
|
||||
char event_prefix[64]; // The prefix applied to event names as they are created
|
||||
char label_format[64]; // The format of the timestamp on the images
|
||||
Coord label_coord; // The coordinates of the timestamp on the images
|
||||
int image_buffer_count; // Size of circular image buffer, at least twice the size of the pre_event_count
|
||||
int warmup_count; // How many images to process before looking for events
|
||||
int pre_event_count; // How many images to hold and prepend to an alarm event
|
||||
int post_event_count; // How many unalarmed images must occur before the alarm state is reset
|
||||
int section_length; // How long events should last in continuous modes
|
||||
int frame_skip; // How many frames to skip in continuous modes
|
||||
int capture_delay; // How long we wait between capture frames
|
||||
int alarm_capture_delay;// How long we wait between capture frames when in alarm state
|
||||
int alarm_frame_count; // How many alarm frames are required before an event is triggered
|
||||
int fps_report_interval;// How many images should be captured/processed between reporting the current FPS
|
||||
int ref_blend_perc; // Percentage of new image going into reference image.
|
||||
bool track_motion; // Whether this monitor tries to track detected motion
|
||||
Function function; // What the monitor is doing
|
||||
bool enabled; // Whether the monitor is enabled or asleep
|
||||
unsigned int width; // Normally the same as the camera, but not if partly rotated
|
||||
unsigned int height; // Normally the same as the camera, but not if partly rotated
|
||||
Orientation orientation; // Whether the image has to be rotated at all
|
||||
int brightness; // The statically saved brightness of the camera
|
||||
int contrast; // The statically saved contrast of the camera
|
||||
int hue; // The statically saved hue of the camera
|
||||
int colour; // The statically saved colour of the camera
|
||||
char event_prefix[64]; // The prefix applied to event names as they are created
|
||||
char label_format[64]; // The format of the timestamp on the images
|
||||
Coord label_coord; // The coordinates of the timestamp on the images
|
||||
int image_buffer_count; // Size of circular image buffer, at least twice the size of the pre_event_count
|
||||
int warmup_count; // How many images to process before looking for events
|
||||
int pre_event_count; // How many images to hold and prepend to an alarm event
|
||||
int post_event_count; // How many unalarmed images must occur before the alarm state is reset
|
||||
int stream_replay_buffer; // How many frames to store to support DVR functions
|
||||
int section_length; // How long events should last in continuous modes
|
||||
int frame_skip; // How many frames to skip in continuous modes
|
||||
int capture_delay; // How long we wait between capture frames
|
||||
int alarm_capture_delay; // How long we wait between capture frames when in alarm state
|
||||
int alarm_frame_count; // How many alarm frames are required before an event is triggered
|
||||
int fps_report_interval; // How many images should be captured/processed between reporting the current FPS
|
||||
int ref_blend_perc; // Percentage of new image going into reference image.
|
||||
bool track_motion; // Whether this monitor tries to track detected motion
|
||||
|
||||
double fps;
|
||||
Image image;
|
||||
Image ref_image;
|
||||
|
||||
Purpose purpose; // What this monitor has been created to do
|
||||
Purpose purpose; // What this monitor has been created to do
|
||||
int event_count;
|
||||
int image_count;
|
||||
int ready_count;
|
||||
|
@ -228,7 +231,7 @@ protected:
|
|||
MonitorLink **linked_monitors;
|
||||
|
||||
public:
|
||||
Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, bool p_track_motion, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 );
|
||||
Monitor( int p_id, const char *p_name, int p_function, bool p_enabled, const char *p_linked_monitors, Camera *p_camera, int p_orientation, const char *p_event_prefix, const char *p_label_format, const Coord &p_label_coord, int p_image_buffer_count, int p_warmup_count, int p_pre_event_count, int p_post_event_count, int p_stream_replay_buffer, int p_alarm_frame_count, int p_section_length, int p_frame_skip, int p_capture_delay, int p_alarm_capture_delay, int p_fps_report_interval, int p_ref_blend_perc, bool p_track_motion, Purpose p_purpose=QUERY, int p_n_zones=0, Zone *p_zones[]=0 );
|
||||
~Monitor();
|
||||
|
||||
void AddZones( int p_n_zones, Zone *p_zones[] );
|
||||
|
@ -275,6 +278,7 @@ public:
|
|||
|
||||
unsigned int Width() const { return( width ); }
|
||||
unsigned int Height() const { return( height ); }
|
||||
unsigned int Colours() const { return( camera->Colours() ); }
|
||||
|
||||
State GetState() const;
|
||||
int GetImage( int index=-1, int scale=100 ) const;
|
||||
|
@ -329,15 +333,67 @@ public:
|
|||
static int LoadRemoteMonitors( const char *host, const char*port, const char*path, Monitor **&monitors, Purpose purpose=QUERY );
|
||||
static int LoadFileMonitors( const char *file, Monitor **&monitors, Purpose purpose=QUERY );
|
||||
static Monitor *Load( int id, bool load_zones=false, Purpose purpose=QUERY );
|
||||
void StreamImages( int scale=100, int maxfps=10, time_t ttl=0 );
|
||||
void StreamImagesRaw( int scale=100, int maxfps=10, time_t ttl=0 );
|
||||
void StreamImagesZip( int scale=100, int maxfps=10, time_t ttl=0 );
|
||||
//void writeStreamImage( Image *image, struct timeval *timestamp, int scale, int mag, int x, int y );
|
||||
//void StreamImages( int scale=100, int maxfps=10, time_t ttl=0, int msq_id=0 );
|
||||
//void StreamImagesRaw( int scale=100, int maxfps=10, time_t ttl=0 );
|
||||
//void StreamImagesZip( int scale=100, int maxfps=10, time_t ttl=0 );
|
||||
void SingleImage( int scale=100 );
|
||||
void SingleImageRaw( int scale=100 );
|
||||
void SingleImageZip( int scale=100 );
|
||||
#if HAVE_LIBAVCODEC
|
||||
void StreamMpeg( const char *format, int scale=100, int maxfps=10, int bitrate=100000 );
|
||||
//void StreamMpeg( const char *format, int scale=100, int maxfps=10, int bitrate=100000 );
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
};
|
||||
|
||||
#define MOD_ADD( var, delta, limit ) (((var)+(limit)+(delta))%(limit))
|
||||
|
||||
class MonitorStream : public StreamBase
|
||||
{
|
||||
protected:
|
||||
typedef struct SwapImage {
|
||||
bool valid;
|
||||
struct timeval timestamp;
|
||||
char file_name[PATH_MAX];
|
||||
} SwapImage;
|
||||
|
||||
private:
|
||||
SwapImage *temp_image_buffer;
|
||||
int temp_image_buffer_count;
|
||||
int temp_read_index;
|
||||
int temp_write_index;
|
||||
|
||||
protected:
|
||||
time_t ttl;
|
||||
|
||||
protected:
|
||||
bool buffer_playback;
|
||||
bool delayed;
|
||||
|
||||
int frame_count;
|
||||
|
||||
protected:
|
||||
bool checkSwapPath( const char *path, bool create_path );
|
||||
|
||||
void sendFrame( const char *filepath, struct timeval *timestamp );
|
||||
void sendFrame( Image *image, struct timeval *timestamp );
|
||||
void processCommand( const CmdMsg *msg );
|
||||
|
||||
public:
|
||||
MonitorStream()
|
||||
{
|
||||
buffer_playback = false;
|
||||
delayed = false;
|
||||
frame_count = 0;
|
||||
}
|
||||
void setStreamTTL( time_t p_ttl )
|
||||
{
|
||||
ttl = p_ttl;
|
||||
}
|
||||
void setStreamStart( int monitor_id )
|
||||
{
|
||||
loadMonitor( monitor_id );
|
||||
}
|
||||
void runStream();
|
||||
};
|
||||
|
||||
#endif // ZM_MONITOR_H
|
||||
|
|
|
@ -0,0 +1,311 @@
|
|||
//
|
||||
// ZoneMinder Stream Class Implementation, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 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.
|
||||
//
|
||||
|
||||
#include <sys/un.h>
|
||||
|
||||
#include "zm.h"
|
||||
#include "zm_mpeg.h"
|
||||
#include "zm_monitor.h"
|
||||
|
||||
#include "zm_stream.h"
|
||||
|
||||
StreamBase::~StreamBase()
|
||||
{
|
||||
closeComms();
|
||||
}
|
||||
|
||||
bool StreamBase::loadMonitor( int monitor_id )
|
||||
{
|
||||
if ( !(monitor = Monitor::Load( monitor_id )) )
|
||||
{
|
||||
Fatal(( "Unable to load monitor id %d for streaming", monitor_id ));
|
||||
return( false );
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
|
||||
bool StreamBase::checkInitialised()
|
||||
{
|
||||
if ( !monitor )
|
||||
{
|
||||
Fatal(( "Cannot stream, not initialised" ));
|
||||
return( false );
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
|
||||
void StreamBase::updateFrameRate( double fps )
|
||||
{
|
||||
base_fps = (int)(fps);
|
||||
effective_fps = (base_fps*abs(replay_rate))/ZM_RATE_BASE;
|
||||
frame_mod = 1;
|
||||
Debug( 3, ( "FPS:%.2f, MXFPS:%d, BFPS:%d, EFPS:%d, FM:%d", fps, maxfps, base_fps, effective_fps, frame_mod ));
|
||||
// Min frame repeat?
|
||||
while( effective_fps > maxfps )
|
||||
{
|
||||
effective_fps /= 2;
|
||||
frame_mod *= 2;
|
||||
}
|
||||
Debug( 3, ( "aEFPS:%d, aFM:%d", effective_fps, frame_mod ));
|
||||
}
|
||||
|
||||
bool StreamBase::checkCommandQueue()
|
||||
{
|
||||
if ( sd >= 0 )
|
||||
{
|
||||
CmdMsg msg;
|
||||
memset( &msg, 0, sizeof(msg) );
|
||||
int nbytes = recvfrom( sd, &msg, sizeof(msg), MSG_DONTWAIT, 0, 0 );
|
||||
if ( nbytes < 0 )
|
||||
{
|
||||
if ( errno != EAGAIN )
|
||||
{
|
||||
Fatal(( "recvfrom(), errno = %d, error = %s", errno, strerror(errno) ));
|
||||
}
|
||||
}
|
||||
//else if ( (nbytes != sizeof(msg)) )
|
||||
//{
|
||||
//Error(( "Partial message received, expected %d bytes, got %d", sizeof(msg), nbytes ));
|
||||
//}
|
||||
else
|
||||
{
|
||||
processCommand( &msg );
|
||||
return( true );
|
||||
}
|
||||
}
|
||||
return( false );
|
||||
}
|
||||
|
||||
Image *StreamBase::prepareImage( Image *image )
|
||||
{
|
||||
int img_buffer_size = 0;
|
||||
static JOCTET img_buffer[ZM_MAX_IMAGE_SIZE];
|
||||
|
||||
static int last_scale = 0;
|
||||
static int last_zoom = 0;
|
||||
static int last_x = 0;
|
||||
static int last_y = 0;
|
||||
|
||||
if ( !last_scale )
|
||||
last_scale = scale;
|
||||
if ( !last_zoom )
|
||||
last_zoom = zoom;
|
||||
|
||||
bool image_copied = false;
|
||||
|
||||
int mag = (scale * zoom) / ZM_SCALE_BASE;
|
||||
int act_mag = mag > ZM_SCALE_BASE?ZM_SCALE_BASE:mag;
|
||||
Debug( 3, ( "Scaling by %d, zooming by %d = magnifying by %d(%d)", scale, zoom, mag, act_mag ));
|
||||
|
||||
int last_mag = (last_scale * last_zoom) / ZM_SCALE_BASE;
|
||||
int last_act_mag = last_mag > ZM_SCALE_BASE?ZM_SCALE_BASE:last_mag;
|
||||
Debug( 3, ( "Last scaling by %d, zooming by %d = magnifying by %d(%d)", last_scale, last_zoom, last_mag, last_act_mag ));
|
||||
|
||||
int base_image_width = image->Width(), base_image_height = image->Height();
|
||||
Debug( 3, ( "Base image width = %d, height = %d", base_image_width, base_image_height ));
|
||||
|
||||
int virt_image_width = (base_image_width * mag) / ZM_SCALE_BASE, virt_image_height = (base_image_height * mag) / ZM_SCALE_BASE;
|
||||
Debug( 3, ( "Virtual image width = %d, height = %d", virt_image_width, virt_image_height ));
|
||||
|
||||
int last_virt_image_width = (base_image_width * last_mag) / ZM_SCALE_BASE, last_virt_image_height = (base_image_height * last_mag) / ZM_SCALE_BASE;
|
||||
Debug( 3, ( "Last virtual image width = %d, height = %d", last_virt_image_width, last_virt_image_height ));
|
||||
|
||||
int act_image_width = (base_image_width * act_mag ) / ZM_SCALE_BASE, act_image_height = (base_image_height * act_mag ) / ZM_SCALE_BASE;
|
||||
Debug( 3, ( "Actual image width = %d, height = %d", act_image_width, act_image_height ));
|
||||
|
||||
int last_act_image_width = (base_image_width * last_act_mag ) / ZM_SCALE_BASE, last_act_image_height = (base_image_height * last_act_mag ) / ZM_SCALE_BASE;
|
||||
Debug( 3, ( "Last actual image width = %d, height = %d", last_act_image_width, last_act_image_height ));
|
||||
|
||||
int disp_image_width = (image->Width() * scale) / ZM_SCALE_BASE, disp_image_height = (image->Height() * scale) / ZM_SCALE_BASE;
|
||||
Debug( 3, ( "Display image width = %d, height = %d", disp_image_width, disp_image_height ));
|
||||
|
||||
int last_disp_image_width = (image->Width() * last_scale) / ZM_SCALE_BASE, last_disp_image_height = (image->Height() * last_scale) / ZM_SCALE_BASE;
|
||||
Debug( 3, ( "Last display image width = %d, height = %d", last_disp_image_width, last_disp_image_height ));
|
||||
|
||||
int send_image_width = (disp_image_width * act_mag ) / mag, send_image_height = (disp_image_height * act_mag ) / mag;
|
||||
Debug( 3, ( "Send image width = %d, height = %d", send_image_width, send_image_height ));
|
||||
|
||||
int last_send_image_width = (last_disp_image_width * last_act_mag ) / last_mag, last_send_image_height = (last_disp_image_height * last_act_mag ) / last_mag;
|
||||
Debug( 3, ( "Last send image width = %d, height = %d", last_send_image_width, last_send_image_height ));
|
||||
|
||||
if ( mag != ZM_SCALE_BASE )
|
||||
{
|
||||
Debug( 3, ( "Magnifying by %d", mag ));
|
||||
if ( act_mag < ZM_SCALE_BASE )
|
||||
{
|
||||
if ( !image_copied )
|
||||
{
|
||||
static Image copy_image;
|
||||
copy_image.Assign( *image );
|
||||
image = ©_image;
|
||||
image_copied = true;
|
||||
}
|
||||
image->Scale( mag );
|
||||
}
|
||||
}
|
||||
|
||||
Debug( 3, ( "Real image width = %d, height = %d", image->Width(), image->Height() ));
|
||||
|
||||
if ( disp_image_width < virt_image_width || disp_image_height < virt_image_height )
|
||||
{
|
||||
Debug( 3, ( "Got click at %d,%d", x, y ));
|
||||
static Box last_crop;
|
||||
|
||||
if ( mag != last_mag || x != last_x || y != last_y )
|
||||
{
|
||||
//if ( !last_mag )
|
||||
//last_mag = mag;
|
||||
|
||||
if ( !(last_disp_image_width < last_virt_image_width || last_disp_image_height < last_virt_image_height) )
|
||||
last_crop = Box();
|
||||
|
||||
Debug( 3, ( "Recalculating crop" ));
|
||||
// Recalculate crop parameters, as %ges
|
||||
int click_x = (last_crop.LoX() * 100 ) / last_act_image_width; // Initial crop offset from last image
|
||||
click_x += ( x * 100 ) / last_virt_image_width;
|
||||
int click_y = (last_crop.LoY() * 100 ) / last_act_image_height; // Initial crop offset from last image
|
||||
click_y += ( y * 100 ) / last_virt_image_height;
|
||||
Debug( 3, ( "Got adjusted click at %d%%,%d%%", click_x, click_y ));
|
||||
|
||||
// Convert the click locations to the current image pixels
|
||||
click_x = ( click_x * act_image_width ) / 100;
|
||||
click_y = ( click_y * act_image_height ) / 100;
|
||||
Debug( 3, ( "Got readjusted click at %d,%d", click_x, click_y ));
|
||||
|
||||
int lo_x = click_x - (send_image_width/2);
|
||||
if ( lo_x < 0 )
|
||||
lo_x = 0;
|
||||
int hi_x = lo_x + (send_image_width-1);
|
||||
if ( hi_x >= act_image_width )
|
||||
{
|
||||
hi_x = act_image_width - 1;
|
||||
lo_x = hi_x - (send_image_width - 1);
|
||||
}
|
||||
|
||||
int lo_y = click_y - (send_image_height/2);
|
||||
if ( lo_y < 0 )
|
||||
lo_y = 0;
|
||||
int hi_y = lo_y + (send_image_height-1);
|
||||
if ( hi_y >= act_image_height )
|
||||
{
|
||||
hi_y = act_image_height - 1;
|
||||
lo_y = hi_y - (send_image_height - 1);
|
||||
}
|
||||
last_crop = Box( lo_x, lo_y, hi_x, hi_y );
|
||||
}
|
||||
Debug( 3, ( "Cropping to %d,%d -> %d,%d", last_crop.LoX(), last_crop.LoY(), last_crop.HiX(), last_crop.HiY() ));
|
||||
if ( !image_copied )
|
||||
{
|
||||
static Image copy_image;
|
||||
copy_image.Assign( *image );
|
||||
image = ©_image;
|
||||
image_copied = true;
|
||||
}
|
||||
image->Crop( last_crop );
|
||||
}
|
||||
last_scale = scale;
|
||||
last_zoom = zoom;
|
||||
last_x = x;
|
||||
last_y = y;
|
||||
|
||||
return( image );
|
||||
}
|
||||
|
||||
void StreamBase::sendTextFrame( const char *frame_text )
|
||||
{
|
||||
Debug( 2, ( "Sending text frame '%s'", frame_text ));
|
||||
|
||||
Image image( monitor->Width(), monitor->Height(), monitor->Colours() );
|
||||
image.Annotate( frame_text, image.centreCoord( frame_text ) );
|
||||
|
||||
if ( scale != 100 )
|
||||
{
|
||||
image.Scale( scale );
|
||||
}
|
||||
#if HAVE_LIBAVCODEC
|
||||
if ( type == STREAM_MPEG )
|
||||
{
|
||||
if ( !vid_stream )
|
||||
{
|
||||
vid_stream = new VideoStream( "pipe:", format, bitrate, effective_fps, image.Colours(), image.Width(), image.Height() );
|
||||
fprintf( stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType() );
|
||||
vid_stream->OpenStream();
|
||||
}
|
||||
double pts = vid_stream->EncodeFrame( image.Buffer(), image.Size() );
|
||||
}
|
||||
else
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
{
|
||||
static unsigned char buffer[ZM_MAX_IMAGE_SIZE];
|
||||
int n_bytes = 0;
|
||||
|
||||
image.EncodeJpeg( buffer, &n_bytes );
|
||||
|
||||
fprintf( stdout, "--ZoneMinderFrame\r\n" );
|
||||
fprintf( stdout, "Content-Length: %d\r\n", n_bytes );
|
||||
fprintf( stdout, "Content-Type: image/jpeg\r\n\r\n" );
|
||||
fwrite( buffer, n_bytes, 1, stdout );
|
||||
fprintf( stdout, "\r\n\r\n" );
|
||||
fflush( stdout );
|
||||
}
|
||||
last_frame_sent = TV_2_FLOAT( now );
|
||||
}
|
||||
|
||||
void StreamBase::openComms()
|
||||
{
|
||||
if ( connkey > 0 )
|
||||
{
|
||||
sd = socket( AF_UNIX, SOCK_DGRAM, 0 );
|
||||
if ( sd < 0 )
|
||||
{
|
||||
Fatal(( "Can't create socket: %s", strerror(errno) ));
|
||||
}
|
||||
|
||||
snprintf( loc_sock_path, sizeof(loc_sock_path), "%s/zms-%06ds.sock", config.path_socks, connkey );
|
||||
unlink( loc_sock_path );
|
||||
|
||||
strncpy( loc_addr.sun_path, loc_sock_path, sizeof(loc_addr.sun_path) );
|
||||
loc_addr.sun_family = AF_UNIX;
|
||||
if ( bind( sd, (struct sockaddr *)&loc_addr, strlen(loc_addr.sun_path)+sizeof(loc_addr.sun_family)) < 0 )
|
||||
{
|
||||
Fatal(( "Can't bind: %s", strerror(errno) ));
|
||||
}
|
||||
|
||||
snprintf( rem_sock_path, sizeof(rem_sock_path), "%s/zms-%06dw.sock", config.path_socks, connkey );
|
||||
strncpy( rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path) );
|
||||
rem_addr.sun_family = AF_UNIX;
|
||||
}
|
||||
}
|
||||
|
||||
void StreamBase::closeComms()
|
||||
{
|
||||
if ( connkey > 0 )
|
||||
{
|
||||
if ( sd >= 0 )
|
||||
{
|
||||
close( sd );
|
||||
sd = -1;
|
||||
}
|
||||
if ( loc_sock_path[0] )
|
||||
{
|
||||
unlink( loc_sock_path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
//
|
||||
// ZoneMinder Stream Interfaces, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 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.
|
||||
//
|
||||
|
||||
#ifndef ZM_STREAM_H
|
||||
#define ZM_STREAM_H
|
||||
|
||||
#include <sys/un.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "zm.h"
|
||||
#include "zm_mpeg.h"
|
||||
|
||||
class Monitor;
|
||||
|
||||
#define TV_2_FLOAT( tv ) ( double((tv).tv_sec) + (double((tv).tv_usec) / 1000000.0) )
|
||||
|
||||
class StreamBase
|
||||
{
|
||||
public:
|
||||
typedef enum { STREAM_JPEG, STREAM_RAW, STREAM_ZIP, STREAM_SINGLE, STREAM_MPEG } StreamType;
|
||||
|
||||
protected:
|
||||
static const int MAX_STREAM_DELAY = 5; // Seconds
|
||||
|
||||
static const StreamType DEFAULT_TYPE = STREAM_JPEG;
|
||||
enum { DEFAULT_RATE=ZM_RATE_BASE };
|
||||
enum { DEFAULT_SCALE=ZM_SCALE_BASE };
|
||||
enum { DEFAULT_ZOOM=ZM_SCALE_BASE };
|
||||
enum { DEFAULT_MAXFPS=10 };
|
||||
enum { DEFAULT_BITRATE=100000 };
|
||||
|
||||
protected:
|
||||
typedef struct {
|
||||
long msg_type;
|
||||
char msg_data[16];
|
||||
} CmdMsg;
|
||||
|
||||
typedef struct {
|
||||
long msg_type;
|
||||
char msg_data[256];
|
||||
} DataMsg;
|
||||
|
||||
typedef enum { MSG_CMD=1, MSG_DATA_WATCH, MSG_DATA_EVENT } MsgType;
|
||||
typedef enum { CMD_NONE=0, CMD_PAUSE, CMD_PLAY, CMD_STOP, CMD_FASTFWD, CMD_SLOWFWD, CMD_SLOWREV, CMD_FASTREV, CMD_ZOOMIN, CMD_ZOOMOUT, CMD_PAN, CMD_SCALE, CMD_PREV, CMD_NEXT, CMD_SEEK, CMD_QUERY=99 } MsgCommand;
|
||||
|
||||
protected:
|
||||
Monitor *monitor;
|
||||
|
||||
StreamType type;
|
||||
const char *format;
|
||||
int replay_rate;
|
||||
int scale;
|
||||
int zoom;
|
||||
int maxfps;
|
||||
int bitrate;
|
||||
unsigned short x, y;
|
||||
|
||||
protected:
|
||||
int connkey;
|
||||
int sd;
|
||||
char loc_sock_path[PATH_MAX];
|
||||
struct sockaddr_un loc_addr;
|
||||
char rem_sock_path[PATH_MAX];
|
||||
struct sockaddr_un rem_addr;
|
||||
|
||||
protected:
|
||||
bool paused;
|
||||
int step;
|
||||
|
||||
struct timeval now;
|
||||
|
||||
int base_fps;
|
||||
int effective_fps;
|
||||
int frame_mod;
|
||||
|
||||
double last_frame_sent;
|
||||
struct timeval last_frame_timestamp;
|
||||
|
||||
#if HAVE_LIBAVCODEC
|
||||
VideoStream *vid_stream;
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
|
||||
CmdMsg msg;
|
||||
|
||||
protected:
|
||||
bool loadMonitor( int monitor_id );
|
||||
bool checkInitialised();
|
||||
void updateFrameRate( double fps );
|
||||
Image *prepareImage( Image *image );
|
||||
void sendFrame( int delta_us );
|
||||
void sendTextFrame( const char *text );
|
||||
bool checkCommandQueue();
|
||||
virtual void processCommand( const CmdMsg *msg )=0;
|
||||
|
||||
public:
|
||||
StreamBase()
|
||||
{
|
||||
monitor = 0;
|
||||
|
||||
type = DEFAULT_TYPE;
|
||||
format = "";
|
||||
replay_rate = DEFAULT_RATE;
|
||||
scale = DEFAULT_SCALE;
|
||||
zoom = DEFAULT_ZOOM;
|
||||
maxfps = DEFAULT_MAXFPS;
|
||||
bitrate = DEFAULT_BITRATE;
|
||||
|
||||
paused = false;
|
||||
step = 0;
|
||||
x = 0;
|
||||
y = 0;
|
||||
|
||||
connkey = 0;
|
||||
sd = -1;
|
||||
memset( &loc_sock_path, 0, sizeof(loc_sock_path) );
|
||||
memset( &loc_addr, 0, sizeof(loc_addr) );
|
||||
memset( &rem_sock_path, 0, sizeof(rem_sock_path) );
|
||||
memset( &rem_addr, 0, sizeof(rem_addr) );
|
||||
|
||||
base_fps = 0;
|
||||
effective_fps = 0;
|
||||
frame_mod = 1;
|
||||
|
||||
#if HAVE_LIBAVCODEC
|
||||
vid_stream = 0;
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
}
|
||||
virtual ~StreamBase();
|
||||
|
||||
void setStreamType( StreamType p_type )
|
||||
{
|
||||
type = p_type;
|
||||
}
|
||||
void setStreamFormat( const char *p_format )
|
||||
{
|
||||
format = p_format;
|
||||
}
|
||||
void setStreamScale( int p_scale )
|
||||
{
|
||||
scale = p_scale;
|
||||
}
|
||||
void setStreamReplayRate( int p_rate )
|
||||
{
|
||||
replay_rate = p_rate;
|
||||
}
|
||||
void setStreamMaxFPS( int p_maxfps )
|
||||
{
|
||||
maxfps = p_maxfps;
|
||||
}
|
||||
void setStreamBitrate( int p_bitrate )
|
||||
{
|
||||
bitrate = p_bitrate;
|
||||
}
|
||||
void setStreamQueue( int p_connkey )
|
||||
{
|
||||
connkey = p_connkey;
|
||||
}
|
||||
virtual void openComms();
|
||||
virtual void closeComms();
|
||||
virtual void runStream()=0;
|
||||
};
|
||||
|
||||
#endif // ZM_STREAM_H
|
153
src/zms.cpp
153
src/zms.cpp
|
@ -17,6 +17,9 @@
|
|||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
|
||||
#include "zm.h"
|
||||
#include "zm_db.h"
|
||||
#include "zm_user.h"
|
||||
|
@ -49,11 +52,13 @@ bool ValidateAccess( User *user, int mon_id )
|
|||
|
||||
int main( int argc, const char *argv[] )
|
||||
{
|
||||
enum { ZMS_JPEG, ZMS_MPEG, ZMS_RAW, ZMS_ZIP, ZMS_SINGLE } mode = ZMS_JPEG;
|
||||
enum { ZMS_MONITOR, ZMS_EVENT } source = ZMS_MONITOR;
|
||||
enum { ZMS_JPEG, ZMS_MPEG, ZMS_RAW, ZMS_ZIP, ZMS_SINGLE } type = ZMS_JPEG;
|
||||
char format[32] = "";
|
||||
int id = 0;
|
||||
int event = 0;
|
||||
int frame = 1;
|
||||
int monitor_id = 0;
|
||||
time_t event_time = 0;
|
||||
int event_id = 0;
|
||||
int frame_id = 1;
|
||||
unsigned int scale = 100;
|
||||
unsigned int rate = 100;
|
||||
unsigned int maxfps = 10;
|
||||
|
@ -62,6 +67,7 @@ int main( int argc, const char *argv[] )
|
|||
char username[64] = "";
|
||||
char password[64] = "";
|
||||
char auth[64] = "";
|
||||
unsigned int connkey = 0;
|
||||
|
||||
bool nph = false;
|
||||
const char *basename = strrchr( argv[0], '/' );
|
||||
|
@ -71,7 +77,7 @@ int main( int argc, const char *argv[] )
|
|||
nph = true;
|
||||
}
|
||||
|
||||
zmDbgInit( "zms", "", -1 );
|
||||
zmDbgInit( "zms", "", 0 );
|
||||
|
||||
zmLoadConfig();
|
||||
|
||||
|
@ -98,21 +104,27 @@ int main( int argc, const char *argv[] )
|
|||
{
|
||||
char *name = strtok( parms[p], "=" );
|
||||
char *value = strtok( NULL, "=" );
|
||||
if ( !strcmp( name, "mode" ) )
|
||||
if ( !strcmp( name, "source" ) )
|
||||
{
|
||||
mode = !strcmp( value, "jpeg" )?ZMS_JPEG:ZMS_MPEG;
|
||||
mode = !strcmp( value, "raw" )?ZMS_RAW:mode;
|
||||
mode = !strcmp( value, "zip" )?ZMS_ZIP:mode;
|
||||
mode = !strcmp( value, "single" )?ZMS_SINGLE:mode;
|
||||
source = !strcmp( value, "event" )?ZMS_EVENT:ZMS_MONITOR;
|
||||
}
|
||||
else if ( !strcmp( name, "type" ) )
|
||||
{
|
||||
type = !strcmp( value, "jpeg" )?ZMS_JPEG:ZMS_MPEG;
|
||||
type = !strcmp( value, "raw" )?ZMS_RAW:type;
|
||||
type = !strcmp( value, "zip" )?ZMS_ZIP:type;
|
||||
type = !strcmp( value, "single" )?ZMS_SINGLE:type;
|
||||
}
|
||||
else if ( !strcmp( name, "monitor" ) )
|
||||
id = atoi( value );
|
||||
else if ( !strcmp( name, "event" ) )
|
||||
event = strtoull( value, (char **)NULL, 10 );
|
||||
else if ( !strcmp( name, "frame" ) )
|
||||
frame = strtoull( value, (char **)NULL, 10 );
|
||||
else if ( !strcmp( name, "format" ) )
|
||||
strncpy( format, value, sizeof(format) );
|
||||
else if ( !strcmp( name, "monitor" ) )
|
||||
monitor_id = atoi( value );
|
||||
else if ( !strcmp( name, "time" ) )
|
||||
event_time = atoi( value );
|
||||
else if ( !strcmp( name, "event" ) )
|
||||
event_id = strtoull( value, (char **)NULL, 10 );
|
||||
else if ( !strcmp( name, "frame" ) )
|
||||
frame_id = strtoull( value, (char **)NULL, 10 );
|
||||
else if ( !strcmp( name, "scale" ) )
|
||||
scale = atoi( value );
|
||||
else if ( !strcmp( name, "rate" ) )
|
||||
|
@ -154,6 +166,8 @@ int main( int argc, const char *argv[] )
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ( !strcmp( name, "connkey" ) )
|
||||
connkey = atoi(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,7 +204,7 @@ int main( int argc, const char *argv[] )
|
|||
Error(( "Unable to authenticate user" ));
|
||||
return( -1 );
|
||||
}
|
||||
ValidateAccess( user, id );
|
||||
ValidateAccess( user, monitor_id );
|
||||
}
|
||||
|
||||
setbuf( stdout, 0 );
|
||||
|
@ -215,56 +229,79 @@ int main( int argc, const char *argv[] )
|
|||
//fprintf( stdout, "Content-Length: 0\r\n");
|
||||
//}
|
||||
|
||||
if ( !event )
|
||||
if ( source == ZMS_MONITOR )
|
||||
{
|
||||
Monitor *monitor = Monitor::Load( id );
|
||||
MonitorStream stream;
|
||||
stream.setStreamScale( scale );
|
||||
stream.setStreamReplayRate( rate );
|
||||
stream.setStreamMaxFPS( maxfps );
|
||||
stream.setStreamTTL( ttl );
|
||||
stream.setStreamQueue( connkey );
|
||||
stream.setStreamStart( monitor_id );
|
||||
|
||||
if ( monitor )
|
||||
if ( type == ZMS_JPEG )
|
||||
{
|
||||
stream.setStreamType( MonitorStream::STREAM_JPEG );
|
||||
}
|
||||
else if ( type == ZMS_RAW )
|
||||
{
|
||||
if ( mode == ZMS_JPEG )
|
||||
{
|
||||
monitor->StreamImages( scale, maxfps, ttl );
|
||||
}
|
||||
else if ( mode == ZMS_RAW )
|
||||
{
|
||||
monitor->StreamImagesRaw( scale, maxfps, ttl );
|
||||
}
|
||||
else if ( mode == ZMS_ZIP )
|
||||
{
|
||||
monitor->StreamImagesZip( scale, maxfps, ttl );
|
||||
}
|
||||
else if ( mode == ZMS_SINGLE )
|
||||
{
|
||||
monitor->SingleImage( scale );
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.setStreamType( MonitorStream::STREAM_RAW );
|
||||
}
|
||||
else if ( type == ZMS_ZIP )
|
||||
{
|
||||
stream.setStreamType( MonitorStream::STREAM_ZIP );
|
||||
}
|
||||
else if ( type == ZMS_SINGLE )
|
||||
{
|
||||
stream.setStreamType( MonitorStream::STREAM_SINGLE );
|
||||
}
|
||||
else
|
||||
{
|
||||
#if HAVE_LIBAVCODEC
|
||||
monitor->StreamMpeg( format, scale, maxfps, bitrate );
|
||||
stream.setStreamFormat( format );
|
||||
stream.setStreamBitrate( bitrate );
|
||||
stream.setStreamType( MonitorStream::STREAM_MPEG );
|
||||
#else // HAVE_LIBAVCODEC
|
||||
Error(( "MPEG streaming of '%s' attempted while disabled", query ));
|
||||
fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
|
||||
return( -1 );
|
||||
Error(( "MPEG streaming of '%s' attempted while disabled", query ));
|
||||
fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
|
||||
return( -1 );
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
}
|
||||
}
|
||||
}
|
||||
stream.runStream();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mode == ZMS_JPEG )
|
||||
{
|
||||
Event::StreamEvent( event, frame, scale, rate, maxfps );
|
||||
}
|
||||
else
|
||||
{
|
||||
else if ( source == ZMS_EVENT )
|
||||
{
|
||||
EventStream stream;
|
||||
stream.setStreamScale( scale );
|
||||
stream.setStreamReplayRate( rate );
|
||||
stream.setStreamMaxFPS( maxfps );
|
||||
stream.setStreamMode( EventStream::MODE_ALL_GAPLESS );
|
||||
stream.setStreamQueue( connkey );
|
||||
if ( monitor_id && event_time )
|
||||
{
|
||||
stream.setStreamStart( monitor_id, event_time );
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.setStreamStart( event_id, frame_id );
|
||||
}
|
||||
if ( type == ZMS_JPEG )
|
||||
{
|
||||
stream.setStreamType( EventStream::STREAM_JPEG );
|
||||
}
|
||||
else
|
||||
{
|
||||
#if HAVE_LIBAVCODEC
|
||||
Event::StreamMpeg( event, frame, format, scale, rate, maxfps, bitrate );
|
||||
stream.setStreamFormat( format );
|
||||
stream.setStreamBitrate( bitrate );
|
||||
stream.setStreamType( EventStream::STREAM_MPEG );
|
||||
#else // HAVE_LIBAVCODEC
|
||||
Error(( "MPEG streaming of '%s' attempted while disabled", query ));
|
||||
fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
|
||||
return( -1 );
|
||||
Error(( "MPEG streaming of '%s' attempted while disabled", query ));
|
||||
fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" );
|
||||
return( -1 );
|
||||
#endif // HAVE_LIBAVCODEC
|
||||
}
|
||||
}
|
||||
}
|
||||
stream.runStream();
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
|
|
|
@ -15,10 +15,19 @@ web_DATA = \
|
|||
zm_actions.php \
|
||||
zm_config.php \
|
||||
zm_control_funcs.php \
|
||||
zm_control_funcsX.php \
|
||||
zm_db.php \
|
||||
zm_export_funcs.php \
|
||||
zm_funcs.php \
|
||||
zm_request_status.php \
|
||||
zm_request_command.php \
|
||||
zm_request_control.php \
|
||||
zm_request_event.php \
|
||||
zm_html.php \
|
||||
zm_html.js \
|
||||
zm_html_js.php \
|
||||
zm_html_reset.css \
|
||||
zm_html_base.css \
|
||||
zm_html_styles.css \
|
||||
zm_html_config.php \
|
||||
zm_html_view_bandwidth.php \
|
||||
|
@ -37,6 +46,8 @@ web_DATA = \
|
|||
zm_html_view_donate.php \
|
||||
zm_html_view_error.php \
|
||||
zm_html_view_event.php \
|
||||
zm_html_view_eventX.php \
|
||||
zm_html_view_eventX.css \
|
||||
zm_html_view_eventdetail.php \
|
||||
zm_html_view_events.php \
|
||||
zm_html_view_export.php \
|
||||
|
@ -75,6 +86,8 @@ web_DATA = \
|
|||
zm_html_view_watchmenu.php \
|
||||
zm_html_view_watch.php \
|
||||
zm_html_view_watchstatus.php \
|
||||
zm_html_view_watchX.php \
|
||||
zm_html_view_watchX.css \
|
||||
zm_html_view_zone.php \
|
||||
zm_html_view_zones.php \
|
||||
zm_xhtml.php \
|
||||
|
@ -119,10 +132,19 @@ EXTRA_DIST = \
|
|||
zm_actions.php \
|
||||
zm_config.php.in \
|
||||
zm_control_funcs.php \
|
||||
zm_control_funcsX.php \
|
||||
zm_db.php \
|
||||
zm_export_funcs.php \
|
||||
zm_funcs.php \
|
||||
zm_request_status.php \
|
||||
zm_request_control.php \
|
||||
zm_request_command.php \
|
||||
zm_request_event.php \
|
||||
zm_html.php \
|
||||
zm_html.js \
|
||||
zm_html_js.php \
|
||||
zm_html_reset.css \
|
||||
zm_html_base.css \
|
||||
zm_html_styles.css \
|
||||
zm_html_config.php \
|
||||
zm_html_view_bandwidth.php \
|
||||
|
@ -140,6 +162,8 @@ EXTRA_DIST = \
|
|||
zm_html_view_donate.php \
|
||||
zm_html_view_error.php \
|
||||
zm_html_view_event.php \
|
||||
zm_html_view_eventX.php \
|
||||
zm_html_view_eventX.css \
|
||||
zm_html_view_eventdetail.php \
|
||||
zm_html_view_events.php \
|
||||
zm_html_view_export.php \
|
||||
|
@ -177,6 +201,8 @@ EXTRA_DIST = \
|
|||
zm_html_view_watchfeed.php \
|
||||
zm_html_view_watchmenu.php \
|
||||
zm_html_view_watch.php \
|
||||
zm_html_view_watchX.php \
|
||||
zm_html_view_watchX.css \
|
||||
zm_html_view_watchstatus.php \
|
||||
zm_html_view_zone.php \
|
||||
zm_html_view_zones.php \
|
||||
|
|
|
@ -51,6 +51,31 @@ define( "STATE_ALARM", 2 );
|
|||
define( "STATE_ALERT", 3 );
|
||||
define( "STATE_TAPE", 4 );
|
||||
|
||||
//
|
||||
// DVR Control Commands
|
||||
//
|
||||
|
||||
define( "MSG_CMD", 1 );
|
||||
define( "MSG_DATA_WATCH", 2 );
|
||||
define( "MSG_DATA_EVENT", 3 );
|
||||
|
||||
define( "CMD_NONE", 0 );
|
||||
define( "CMD_PAUSE", 1 );
|
||||
define( "CMD_PLAY", 2 );
|
||||
define( "CMD_STOP", 3 );
|
||||
define( "CMD_FASTFWD", 4 );
|
||||
define( "CMD_SLOWFWD", 5 );
|
||||
define( "CMD_SLOWREV", 6 );
|
||||
define( "CMD_FASTREV", 7 );
|
||||
define( "CMD_ZOOMIN", 8 );
|
||||
define( "CMD_ZOOMOUT", 9 );
|
||||
define( "CMD_PAN", 10 );
|
||||
define( "CMD_SCALE", 11 );
|
||||
define( "CMD_PREV", 12 );
|
||||
define( "CMD_NEXT", 13 );
|
||||
define( "CMD_SEEK", 14 );
|
||||
define( "CMD_QUERY", 99 );
|
||||
|
||||
//
|
||||
// These are miscellaneous options you won't normally need to change
|
||||
//
|
||||
|
|
|
@ -0,0 +1,392 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder web control function library, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 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.
|
||||
//
|
||||
|
||||
function getControlCommands( $monitor )
|
||||
{
|
||||
$cmds = array();
|
||||
|
||||
$cmds['Wake'] = "wake";
|
||||
$cmds['Sleep'] = "sleep";
|
||||
$cmds['Reset'] = "reset";
|
||||
|
||||
$cmds['PresetSet'] = "preset_set";
|
||||
$cmds['PresetGoto'] = "preset_goto_";
|
||||
$cmds['PresetHome'] = "preset_home";
|
||||
|
||||
if ( $monitor['CanZoomCon'] )
|
||||
$cmds['ZoomRoot'] = "zoom_con_";
|
||||
elseif ( $monitor['CanZoomRel'] )
|
||||
$cmds['ZoomRoot'] = "zoom_rel_";
|
||||
elseif ( $monitor['CanZoomAbs'] )
|
||||
$cmds['ZoomRoot'] = "zoom_abs_";
|
||||
$cmds['ZoomTele'] = $cmds['ZoomRoot']."tele";
|
||||
$cmds['ZoomWide'] = $cmds['ZoomRoot']."wide";
|
||||
$cmds['ZoomStop'] = "zoom_stop";
|
||||
$cmds['ZoomAuto'] = "zoom_auto";
|
||||
$cmds['ZoomMan'] = "zoom_man";
|
||||
|
||||
if ( $monitor['CanFocusCon'] )
|
||||
$cmds['FocusRoot'] = "focus_con_";
|
||||
elseif ( $monitor['CanFocusRel'] )
|
||||
$cmds['FocusRoot'] = "focus_rel_";
|
||||
elseif ( $monitor['CanFocusAbs'] )
|
||||
$cmds['FocusRoot'] = "focus_abs_";
|
||||
$cmds['FocusFar'] = $cmds['FocusRoot']."far";
|
||||
$cmds['FocusNear'] = $cmds['FocusRoot']."near";
|
||||
$cmds['FocusStop'] = "focus_stop";
|
||||
$cmds['FocusAuto'] = "focus_auto";
|
||||
$cmds['FocusMan'] = "focus_man";
|
||||
|
||||
if ( $monitor['CanIrisCon'] )
|
||||
$cmds['IrisRoot'] = "iris_con_";
|
||||
elseif ( $monitor['CanIrisRel'] )
|
||||
$cmds['IrisRoot'] = "iris_rel_";
|
||||
elseif ( $monitor['CanIrisAbs'] )
|
||||
$cmds['IrisRoot'] = "iris_abs_";
|
||||
$cmds['IrisOpen'] = $cmds['IrisRoot']."open";
|
||||
$cmds['IrisClose'] = $cmds['IrisRoot']."close";
|
||||
$cmds['IrisStop'] = "iris_stop";
|
||||
$cmds['IrisAuto'] = "iris_auto";
|
||||
$cmds['IrisMan'] = "iris_man";
|
||||
|
||||
if ( $monitor['CanWhiteCon'] )
|
||||
$cmds['WhiteRoot'] = "white_con_";
|
||||
elseif ( $monitor['CanWhiteRel'] )
|
||||
$cmds['WhiteRoot'] = "white_rel_";
|
||||
elseif ( $monitor['CanWhiteAbs'] )
|
||||
$cmds['WhiteRoot'] = "white_abs_";
|
||||
$cmds['WhiteIn'] = $cmds['WhiteRoot']."in";
|
||||
$cmds['WhiteOut'] = $cmds['WhiteRoot']."out";
|
||||
$cmds['WhiteAuto'] = "white_auto";
|
||||
$cmds['WhiteMan'] = "white_man";
|
||||
|
||||
if ( $monitor['CanGainCon'] )
|
||||
$cmds['GainRoot'] = "gain_con_";
|
||||
elseif ( $monitor['CanGainRel'] )
|
||||
$cmds['GainRoot'] = "gain_rel_";
|
||||
elseif ( $monitor['CanGainAbs'] )
|
||||
$cmds['GainRoot'] = "gain_abs_";
|
||||
$cmds['GainUp'] = $cmds['GainRoot']."up";
|
||||
$cmds['GainDown'] = $cmds['GainRoot']."down";
|
||||
$cmds['GainAuto'] = "gain_auto";
|
||||
$cmds['GainMan'] = "gain_man";
|
||||
|
||||
if ( $monitor['CanMoveCon'] )
|
||||
{
|
||||
$cmds['MoveRoot'] = "move_con_";
|
||||
$cmds['Center'] = "move_stop";
|
||||
}
|
||||
elseif ( $monitor['CanMoveRel'] )
|
||||
{
|
||||
$cmds['MoveRoot'] = "move_rel_";
|
||||
$cmds['Center'] = $cmds['PresetHome'];
|
||||
}
|
||||
elseif ( $monitor['CanMoveAbs'] )
|
||||
{
|
||||
$cmds['MoveRoot'] = "move_abs_";
|
||||
$cmds['Center'] = $cmds['PresetHome'];
|
||||
}
|
||||
|
||||
$cmds['MoveUp'] = $cmds['MoveRoot']."up";
|
||||
$cmds['MoveDown'] = $cmds['MoveRoot']."down";
|
||||
$cmds['MoveLeft'] = $cmds['MoveRoot']."left";
|
||||
$cmds['MoveRight'] = $cmds['MoveRoot']."right";
|
||||
$cmds['MoveUpLeft'] = $cmds['MoveRoot']."upleft";
|
||||
$cmds['MoveUpRight'] = $cmds['MoveRoot']."upright";
|
||||
$cmds['MoveDownLeft'] = $cmds['MoveRoot']."downleft";
|
||||
$cmds['MoveDownRight'] = $cmds['MoveRoot']."downright";
|
||||
|
||||
return( $cmds );
|
||||
}
|
||||
|
||||
function controlFocus( $monitor )
|
||||
{
|
||||
global $cmds, $zmSlangFocus, $zmSlangNear, $zmSlangFar, $zmSlangAuto, $zmSlangMan;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div id="focusControls">
|
||||
<div><?= $zmSlangNear ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd( '<?= $cmds['FocusNear'] ?>')"></div>
|
||||
<div<?php if ( $monitor['CanFocusCon'] ) { ?> onclick="controlCmd( '<?= $cmds['FocusStop'] ?>')"<?php } ?>><?= $zmSlangFocus ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd( '<?= $cmds['FocusFar'] ?>')"></div>
|
||||
<div><?= $zmSlangFar ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoFocus'] )
|
||||
{
|
||||
?>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangAuto ?>" onclick="controlCmd( '<?= $cmds['FocusAuto'] ?>')"/></div>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangMan ?>" onclick="controlCmd( '<?= $cmds['FocusMan'] ?>')"/></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlZoom( $monitor )
|
||||
{
|
||||
global $cmds, $zmSlangZoom, $zmSlangTele, $zmSlangWide, $zmSlangAuto, $zmSlangMan;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div id="zoomControls">
|
||||
<div><?= $zmSlangTele ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd( '<?= $cmds['ZoomTele'] ?>')"></div>
|
||||
<div<?php if ( $monitor['CanZoomCon'] ) { ?> onclick="controlCmd( '<?= $cmds['ZoomStop'] ?>')"<?php } ?>><?= $zmSlangZoom ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd( '<?= $cmds['ZoomWide'] ?>')"></div>
|
||||
<div><?= $zmSlangWide ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoZoom'] )
|
||||
{
|
||||
?>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangAuto ?>" onclick="controlCmd( '<?= $cmds['ZoomAuto'] ?>')"/></div>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangMan ?>" onclick="controlCmd( '<?= $cmds['ZoomMan'] ?>')"/></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div><?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlIris( $monitor )
|
||||
{
|
||||
global $cmds, $zmSlangIris, $zmSlangOpen, $zmSlangClose, $zmSlangAuto, $zmSlangMan;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div id="irisControls">
|
||||
<div><?= $zmSlangOpen ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd( '<?= $cmds['IrisOpen'] ?>')"></div>
|
||||
<div<?php if ( $monitor['CanIrisCon'] ) { ?> onclick="controlCmd( '<?= $cmds['IrisStop'] ?>')"<?php } ?>><?= $zmSlangIris ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd( '<?= $cmds['IrisClose'] ?>')"></div>
|
||||
<div><?= $zmSlangClose ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoIris'] )
|
||||
{
|
||||
?>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangAuto ?>" onclick="controlCmd( '<?= $cmds['IrisAuto'] ?>')"/></div>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangMan ?>" onclick="controlCmd( '<?= $cmds['IrisMan'] ?>')"/></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlWhite( $monitor )
|
||||
{
|
||||
global $cmds, $zmSlangWhite, $zmSlangIn, $zmSlangOut, $zmSlangAuto, $zmSlangMan;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div id="whiteControls">
|
||||
<div><?= $zmSlangIn ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd( '<?= $cmds['WhiteIn'] ?>')"></div>
|
||||
<div<?php if ( $monitor['CanWhiteCon'] ) { ?> onclick="controlCmd( '<?= $cmds['WhiteStop'] ?>')"<?php } ?>><?= $zmSlangWhite ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd( '<?= $cmds['WhiteOut'] ?>')"></div>
|
||||
<div><?= $zmSlangOut ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoWhite'] )
|
||||
{
|
||||
?>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangAuto ?>" onclick="controlCmd( '<?= $cmds['WhiteAuto'] ?>')"/></div>
|
||||
<div><input type="button" class="textbutton" value="<?= $zmSlangMan ?>" onclick="controlCmd( '<?= $cmds['WhiteMan'] ?>')"/></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlPanTilt( $monitor )
|
||||
{
|
||||
global $cmds, $zmSlangPanTilt;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div id="pantiltControls">
|
||||
<div><?= $zmSlangPanTilt ?></div>
|
||||
<div id="pantiltButtons">
|
||||
<?php
|
||||
if ( $monitor['CanTilt'] )
|
||||
{
|
||||
if ( $monitor['CanPan'] )
|
||||
{
|
||||
if ( $monitor['CanMoveDiag'] )
|
||||
{
|
||||
?>
|
||||
<div id="upLeftBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveUpLeft'] ?>')"></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="upBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveUp'] ?>')"></div>
|
||||
<?php
|
||||
if ( $monitor['CanPan'] )
|
||||
{
|
||||
if ( $monitor['CanMoveDiag'] )
|
||||
{
|
||||
?>
|
||||
<div id="upRightBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveUpRight'] ?>')"></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( $monitor['CanPan'] )
|
||||
{
|
||||
?>
|
||||
<div id="leftBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveLeft'] ?>')"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id="centerBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['Center'] ?>')"></div>
|
||||
<?php
|
||||
if ( $monitor['CanPan'] )
|
||||
{
|
||||
?>
|
||||
<div id="rightBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveRight'] ?>')"></div>
|
||||
<?php
|
||||
}
|
||||
if ( $monitor['CanTilt'] )
|
||||
{
|
||||
if ( $monitor['CanPan'] )
|
||||
{
|
||||
if ( $monitor['CanMoveDiag'] )
|
||||
{
|
||||
?>
|
||||
<div id="downLeftBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveDownLeft'] ?>')"></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="downBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveDown'] ?>')"></div>
|
||||
<?php
|
||||
if ( $monitor['CanPan'] )
|
||||
{
|
||||
if ( $monitor['CanMoveDiag'] )
|
||||
{
|
||||
?>
|
||||
<div id="downRightBtn" class="arrowBtn" onclick="controlCmd( '<?= $cmds['MoveDownRight'] ?>')"></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlPresets( $monitor )
|
||||
{
|
||||
global $cmds, $jws, $zmSlangPresets, $zmSlangHome, $zmSlangSet;
|
||||
|
||||
define( "MAX_PRESETS", "12" );
|
||||
|
||||
$sql = "select * from ControlPresets where MonitorId = '".$monitor['Id']."'";
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$labels = array();
|
||||
while( $row = mysql_fetch_assoc( $result ) )
|
||||
{
|
||||
$labels[$row['Preset']] = $row['Label'];
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
|
||||
$preset_break = (int)(($monitor['NumPresets']+1)/((int)(($monitor['NumPresets']-1)/MAX_PRESETS)+1));
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div id="presetControls">
|
||||
<div><?= $zmSlangPresets ?></div>
|
||||
<div>
|
||||
<?php
|
||||
for ( $i = 1; $i <= $monitor['NumPresets']; $i++ )
|
||||
{
|
||||
?><input type="button" class="numbutton" title="<?= $labels[$i]?$labels[$i]:"" ?>" value="<?= $i ?>" onclick="controlCmd( '<?= $cmds['PresetGoto'] ?><?=$i?>' );"/><?php (($i%$preset_break)==0)?"<br/>":" " ?><?php
|
||||
if ( $i && (($i%$preset_break) == 0) )
|
||||
{
|
||||
?><br/><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div>
|
||||
<?php
|
||||
if ( $monitor['HasHomePreset'] )
|
||||
{
|
||||
?>
|
||||
<span><input type="button" class="textbutton" value="<?= $zmSlangHome ?>" onclick="controlCmd( '<?= $cmds['PresetHome'] ?>' );"/></span>
|
||||
<?php
|
||||
}
|
||||
if ( canEdit( 'Monitors' ) && $monitor['CanSetPresets'] )
|
||||
{
|
||||
?>
|
||||
<span><input type="button" class="textbutton" value="<?= $zmSlangSet ?>" onclick="newWindow( '<?= $PHP_SELF ?>?view=controlpreset&mid=<?= $monitor['Id'] ?>', 'zmPreset', <?= $jws['preset']['w'] ?>, <?= $jws['preset']['h'] ?> );"/></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlPower( $monitor )
|
||||
{
|
||||
global $cmds, $zmSlangControl, $zmSlangWake, $zmSlangSleep, $zmSlangReset;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div id="powerControls">
|
||||
<div><?= $zmSlangControl ?></div>
|
||||
<div>
|
||||
<?php
|
||||
if ( $monitor['CanWake'] )
|
||||
{
|
||||
?>
|
||||
<span><input type="button" class="textbutton" value="<?= $zmSlangWake ?>" onclick="controlCmd( '<?= $cmds['Wake'] ?>')"/></span>
|
||||
<?php
|
||||
}
|
||||
if ( $monitor['CanSleep'] )
|
||||
{
|
||||
?>
|
||||
<span><input type="button" class="textbutton" value="<?= $zmSlangSleep ?>" onclick="controlCmd( '<?= $cmds['Sleep'] ?>')"/></span>
|
||||
<?php
|
||||
}
|
||||
if ( $monitor['CanReset'] )
|
||||
{
|
||||
?>
|
||||
<span><input type="button" class="textbutton" value="<?= $zmSlangReset ?>" onclick="controlCmd( '<?= $cmds['Reset'] ?>')"/></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
|
@ -18,21 +18,61 @@
|
|||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
$db_debug = false;
|
||||
|
||||
$conn = mysql_pconnect( ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS ) or die("Could not connect to database: ".mysql_error());
|
||||
mysql_select_db( ZM_DB_NAME, $conn) or die("Could not select database: ".mysql_error());
|
||||
|
||||
function dbDebug( $sql )
|
||||
{
|
||||
global $db_debug;
|
||||
|
||||
if ( $db_debug )
|
||||
error_log( "SQL: $sql" );
|
||||
return( $db_debug );
|
||||
}
|
||||
|
||||
function dbQuery( $sql )
|
||||
{
|
||||
if ( dbDebug( $sql ) )
|
||||
return;
|
||||
if (!($result = mysql_query( $sql )))
|
||||
die( mysql_error() );
|
||||
return( $result );
|
||||
}
|
||||
|
||||
function dbFetchOne( $sql, $col=false )
|
||||
{
|
||||
dbDebug( $sql );
|
||||
|
||||
if (!($result = mysql_query( $sql )))
|
||||
die( mysql_error() );
|
||||
|
||||
$db_row = mysql_fetch_assoc( $result );
|
||||
return( $col?$db_row[$col]:$db_row );
|
||||
}
|
||||
|
||||
function dbFetchAll( $sql, $col=false )
|
||||
{
|
||||
dbDebug( $sql );
|
||||
|
||||
if (!($result = mysql_query( $sql )))
|
||||
die( mysql_error() );
|
||||
|
||||
$db_rows = array();
|
||||
while( $db_row = mysql_fetch_assoc( $result ) )
|
||||
$db_rows[] = $col?$db_row[$col]:$db_row;
|
||||
return( $db_rows );
|
||||
}
|
||||
|
||||
function dbFetch( $sql, $col=false )
|
||||
{
|
||||
return( dbFetchAll( $sql, $col ) );
|
||||
}
|
||||
|
||||
function simpleQuery( $sql )
|
||||
{
|
||||
global $debug;
|
||||
|
||||
if ( $debug )
|
||||
{
|
||||
echo "SQL:$sql<br>\n";
|
||||
}
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
return( $result );
|
||||
return( dbQuery( $sql ) );
|
||||
}
|
||||
|
||||
function getEnumValues( $table, $column )
|
||||
|
|
|
@ -157,6 +157,10 @@ function getStreamSrc( $args )
|
|||
$args[] = "user=".$_SESSION['username'];
|
||||
}
|
||||
}
|
||||
if ( $GLOBALS['connkey'] )
|
||||
{
|
||||
$args[] = "connkey=".$GLOBALS['connkey'];
|
||||
}
|
||||
if ( ZM_RAND_STREAM )
|
||||
{
|
||||
$args[] = "rand=".time();
|
||||
|
@ -514,11 +518,11 @@ function buildSelect( $name, $contents, $behaviours=false )
|
|||
}
|
||||
else
|
||||
{
|
||||
$behaviour_text = ' onChange="'.$behaviours.'"';
|
||||
$behaviour_text = ' onchange="'.$behaviours.'"';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<select name="<?= $name ?>" class="form"<?= $behaviour_text ?>>
|
||||
<select name="<?= $name ?>" id="<?= $name ?>" class="form"<?= $behaviour_text ?>>
|
||||
<?php
|
||||
foreach ( $contents as $content_value => $content_text )
|
||||
{
|
||||
|
@ -1897,4 +1901,55 @@ function setDeviceStatusX10( $key, $status )
|
|||
return( $status );
|
||||
}
|
||||
|
||||
function isVector ( &$array )
|
||||
{
|
||||
$next_key = 0;
|
||||
foreach ( array_keys($array) as $key )
|
||||
{
|
||||
if ( !is_int( $key ) )
|
||||
return( false );
|
||||
if ( $key != $next_key++ )
|
||||
return( false );
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
|
||||
function jsValue( &$value )
|
||||
{
|
||||
switch ( gettype($value) )
|
||||
{
|
||||
case 'double':
|
||||
case 'integer':
|
||||
return( $value );
|
||||
case 'boolean':
|
||||
return( $value?'true':'false' );
|
||||
case 'string':
|
||||
return( "'".addslashes($value)."'" );
|
||||
case 'NULL':
|
||||
return( 'null' );
|
||||
case 'object':
|
||||
return( "'Object ".addslashes(get_class($value))."'" );
|
||||
case 'array':
|
||||
if ( isVector( $value ) )
|
||||
return( '['.join( ',', array_map( 'jsValue', $value) ).']' );
|
||||
else
|
||||
{
|
||||
$result = '{';
|
||||
foreach ($value as $subkey => $subvalue )
|
||||
{
|
||||
if ( $result != '{' )
|
||||
$result .= ',';
|
||||
$result .= jsValue( $subkey ).':'.jsValue( $subvalue );
|
||||
}
|
||||
return( $result.'}' );
|
||||
}
|
||||
default:
|
||||
return( "'".addslashes(gettype($value))."'" );
|
||||
}
|
||||
}
|
||||
|
||||
function generateConnKey()
|
||||
{
|
||||
return( rand( 1, 999999 ) );
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// ZoneMinder base static javascript file, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 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 file should only contain static JavaScript and no php.
|
||||
// Use zm_html_js.php for JavaScript that need pre-processing
|
||||
//
|
||||
|
||||
function newWindow( Url, Name, Width, Height )
|
||||
{
|
||||
var Win = window.open(Url,Name,"resizable,scrollbars,status=no,width="+Width+",height="+Height);
|
||||
}
|
||||
|
||||
function closeWindow()
|
||||
{
|
||||
top.window.close();
|
||||
}
|
||||
|
||||
function refreshWindow()
|
||||
{
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
|
@ -85,6 +85,17 @@ if ( !isset($view) )
|
|||
$view = "console";
|
||||
}
|
||||
|
||||
if ( ZM_WEB_DVR_STREAMING )
|
||||
{
|
||||
switch( $view )
|
||||
{
|
||||
case "event" :
|
||||
case "watch" :
|
||||
$view = $view."X";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch( $view )
|
||||
{
|
||||
case "bandwidth" :
|
||||
|
@ -100,6 +111,7 @@ switch( $view )
|
|||
case "devices" :
|
||||
case "donate" :
|
||||
case "event" :
|
||||
case "eventX" :
|
||||
case "eventdetail" :
|
||||
case "events" :
|
||||
case "export" :
|
||||
|
@ -138,6 +150,7 @@ switch( $view )
|
|||
case "watchfeed" :
|
||||
case "watchmenu" :
|
||||
case "watchstatus" :
|
||||
case "watchX" :
|
||||
case "zone" :
|
||||
case "zones" :
|
||||
case "blank" :
|
||||
|
@ -146,6 +159,25 @@ switch( $view )
|
|||
require_once( "zm_".$format."_view_".$view.".php" );
|
||||
break;
|
||||
}
|
||||
case "request" :
|
||||
{
|
||||
switch( $request )
|
||||
{
|
||||
case "status" :
|
||||
case "command" :
|
||||
case "control" :
|
||||
case "event" :
|
||||
{
|
||||
require_once( "zm_request_".$request.".php" );
|
||||
break;
|
||||
}
|
||||
default :
|
||||
{
|
||||
$view = "error";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default :
|
||||
{
|
||||
$view = "error";
|
||||
|
|
|
@ -0,0 +1,217 @@
|
|||
/*
|
||||
* ZoneMinder Base Stylesheet, $Date$, $Revision$
|
||||
* Copyright (C) 2003, 2004, 2005, 2006 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.
|
||||
*/
|
||||
|
||||
@import url(zm_html_reset.css);
|
||||
|
||||
body {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #333333;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: inherit;
|
||||
font-size: 12px;
|
||||
color: #000066;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: inherit;
|
||||
font-size: 11px;
|
||||
color: #000066;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-family: inherit;
|
||||
font-size: 10px;
|
||||
color: #016A9D;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-family: inherit;
|
||||
font-size: 9px;
|
||||
color: #333333;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.error {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #DC143C;
|
||||
font-weight: bold;
|
||||
}
|
||||
.warn {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #FF8C00;
|
||||
font-weight: bold;
|
||||
}
|
||||
.info {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #688E23;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.italics {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: #7F7FB2;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #7F7FB2;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #666699;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
input,textarea,select {
|
||||
border: 1px #7F7FB2 solid;
|
||||
font-family: inherit;
|
||||
font-size: 10px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
input.noborder {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
input[disabled] {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
input[set] {
|
||||
border: 1px #7F7FB2 dashed;
|
||||
}
|
||||
|
||||
img.normal {
|
||||
border: white solid 1px;
|
||||
}
|
||||
img.alarm {
|
||||
border: red solid 1px;
|
||||
}
|
||||
|
||||
td.activetab {
|
||||
font-family: inherit;
|
||||
font-size: 10px;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
border-left: #7F7FB2 solid 2px;
|
||||
border-top: #7F7FB2 solid 2px;
|
||||
border-right: #7F7FB2 solid 2px;
|
||||
border-bottom: #7F7FB2 dotted 1px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
td.passivetab {
|
||||
font-family: inherit;
|
||||
font-size: 10px;
|
||||
color: #333333;
|
||||
font-weight: normal;
|
||||
border: #7F7FB2 solid 1px;
|
||||
background: #DDDDDD;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
td.nontab {
|
||||
font-family: inherit;
|
||||
font-size: 10px;
|
||||
color: #333333;
|
||||
font-weight: normal;
|
||||
border-bottom: #7F7FB2 solid 1px;
|
||||
}
|
||||
|
||||
td.ruled {
|
||||
font-family: inherit;
|
||||
font-size: 10px;
|
||||
color: #333333;
|
||||
font-weight: normal;
|
||||
border-top: #7F7FB2 solid 1px;
|
||||
}
|
||||
|
||||
tr.over {
|
||||
background: #EEEEEE;
|
||||
}
|
||||
|
||||
tr.out {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.button {
|
||||
border: 1px #000000 solid;
|
||||
padding: 2px 5px;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
background-color: #016A9D;
|
||||
}
|
||||
|
||||
.smallbutton {
|
||||
padding: 1px 2px;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
background-color: #016A9D;
|
||||
}
|
||||
|
||||
.numbutton {
|
||||
padding: 1px 2px;
|
||||
width: 24px;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
background-color: #016A9D;
|
||||
}
|
||||
|
||||
.flatbutton {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #333333;
|
||||
font-weight: normal;
|
||||
padding: 1px 2px;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.invisible {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
div.clear {
|
||||
clear: both;
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder base javascript file, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 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 file should only contain JavaScript that needs preprocessing by php.
|
||||
// Static JavaScript should go in zm_html.js
|
||||
//
|
||||
|
||||
?>
|
||||
<script type="text/javascript" src="mootools.v1.11.js"></script>
|
||||
<script type="text/javascript" src="zm_html.js"></script>
|
||||
<script type="text/javascript">
|
||||
function eventWindow( eventId, eventFilter )
|
||||
{
|
||||
var windowUrl = '<?= $PHP_SELF ?>?view=event&eid='+eventId;
|
||||
if ( eventFilter )
|
||||
windowUrl += eventFilter;
|
||||
var windowName = 'zmEvent';
|
||||
var windowOptions = 'resizable,status=no,width=<?= $monitor['Width']+$jws['event']['w'] ?>,height=<?= $monitor['Height']+$jws['event']['h'] ?>';
|
||||
var windowId = window.open( windowUrl, windowName, windowOptions );
|
||||
}
|
||||
|
||||
function framesWindow( eventId, eventFilter )
|
||||
{
|
||||
var windowUrl = '<?= $PHP_SELF ?>?view=frames&eid='+eventId;
|
||||
if ( eventFilter )
|
||||
windowUrl += eventFilter;
|
||||
var windowName = 'zmFrames';
|
||||
var windowOptions = 'resizable,status=no,width=<?= $monitor['Width']+$jws['frames']['w'] ?>,height=<?= $monitor['Height']+$jws['frames']['h'] ?>';
|
||||
var windowId = window.open( windowUrl, windowName, windowOptions );
|
||||
}
|
||||
|
||||
function frameWindow( eventId, frameId, eventFilter )
|
||||
{
|
||||
var windowUrl = '<?= $PHP_SELF ?>?view=frame&eid='+eventId+'&fid='+frameId;
|
||||
if ( eventFilter )
|
||||
windowUrl += eventFilter;
|
||||
var windowName = 'zmFrame';
|
||||
var windowOptions = 'resizable,status=no,width=<?= $monitor['Width']+$jws['image']['w'] ?>,height=<?= $monitor['Height']+$jws['image']['h'] ?>';
|
||||
var windowId = window.open( windowUrl, windowName, windowOptions );
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* ZoneMinder Reset Stylesheet, $Date$, $Revision$
|
||||
* Copyright (C) 2003, 2004, 2005, 2006 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Based on Reset Reloaded by Eric Meyer at http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
|
||||
*/
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
input, textarea, select,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
font-weight: inherit;
|
||||
font-style: inherit;
|
||||
font-size: 100%;
|
||||
font-family: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* remember to define focus styles! */
|
||||
:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
line-height: 1;
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
/* tables still need 'cellspacing="0"' in the markup */
|
||||
table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
caption, th, td {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
blockquote, q {
|
||||
quotes: "" "";
|
||||
}
|
|
@ -144,15 +144,15 @@ window.resizeTo( <?= $jws['console']['w'] ?>, <?= $jws['console']['h']+(25*(coun
|
|||
?>
|
||||
function newWindow(Url,Name,Width,Height)
|
||||
{
|
||||
var Win = window.open(Url,Name,"resizable,width="+Width+",height="+Height);
|
||||
var Win = window.open(Url,Name,"resizable,status=no,width="+Width+",height="+Height);
|
||||
}
|
||||
function scrollWindow(Url,Name,Width,Height)
|
||||
{
|
||||
var Win = window.open(Url,Name,"resizable,scrollbars,width="+Width+",height="+Height);
|
||||
var Win = window.open(Url,Name,"resizable,scrollbars,status=no,width="+Width+",height="+Height);
|
||||
}
|
||||
function filterWindow(Url,Name)
|
||||
{
|
||||
var Win = window.open(Url,Name,"resizable,scrollbars,width=<?= $jws['filter']['w'] ?>,height=<?= $jws['filter']['h'] ?>");
|
||||
var Win = window.open(Url,Name,"resizable,scrollbars,status=no,width=<?= $jws['filter']['w'] ?>,height=<?= $jws['filter']['h'] ?>");
|
||||
}
|
||||
function configureButton(form,name)
|
||||
{
|
||||
|
|
|
@ -386,12 +386,12 @@ if ( $mode == "stream" )
|
|||
<?php
|
||||
if ( ZM_STREAM_METHOD == 'mpeg' && ZM_MPEG_REPLAY_FORMAT )
|
||||
{
|
||||
$stream_src = getStreamSrc( array( "mode=mpeg", "event=".$eid, "frame=".(!empty($fid)?$fid:1), "scale=".$scale, "rate=".$rate, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_REPLAY_FORMAT ) );
|
||||
$stream_src = getStreamSrc( array( "source=event", "mode=mpeg", "event=".$eid, "frame=".(!empty($fid)?$fid:1), "scale=".$scale, "rate=".$rate, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_REPLAY_FORMAT ) );
|
||||
outputVideoStream( $stream_src, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ), $event['Name'], ZM_MPEG_REPLAY_FORMAT );
|
||||
}
|
||||
else
|
||||
{
|
||||
$stream_src = getStreamSrc( array( "mode=jpeg", "event=".$eid, "frame=".(!empty($fid)?$fid:1), "scale=".$scale, "rate=".$rate, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) );
|
||||
$stream_src = getStreamSrc( array( "source=event", "mode=jpeg", "event=".$eid, "frame=".(!empty($fid)?$fid:1), "scale=".$scale, "rate=".$rate, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) );
|
||||
if ( canStreamNative() )
|
||||
{
|
||||
outputImageStream( $stream_src, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ), $event['Name'] );
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
@import url(zm_html_base.css);
|
||||
|
||||
body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#dataBar {
|
||||
width: 96%;
|
||||
margin: 2px auto 2px auto;
|
||||
padding: 2px 0px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#dataBar #dataTable {
|
||||
width: 100%;
|
||||
background-color: #006699;
|
||||
border-spacing: 1px;
|
||||
}
|
||||
|
||||
#dataBar #dataTable tr {
|
||||
}
|
||||
|
||||
#dataBar #dataTable td {
|
||||
background-color: #ffffff;
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#menuBar1 {
|
||||
width: 100%;
|
||||
padding: 3px 0 3px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#menuBar1 span {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
|
||||
#menuBar2 {
|
||||
width: 100%;
|
||||
padding: 3px 0 3px 0;
|
||||
margin-bottom: 4px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#menuBar2 span {
|
||||
padding: 0px 20px;
|
||||
}
|
||||
|
||||
#menuBar2 #closeWindow {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
}
|
||||
|
||||
#imageFeed{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorStatus {
|
||||
width: 100%;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorStatus #enableAlarms {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
#monitorStatus #forceAlarm {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
}
|
||||
|
||||
#monitorStatus #monitorState {
|
||||
}
|
||||
|
||||
#dvrControls {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#dvrControls input {
|
||||
height: 20px;
|
||||
width: 28px;
|
||||
padding-bottom: 3px;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
#dvrControls input[disabled] {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
#dvrControls input.active {
|
||||
border: 1px solid blue;
|
||||
}
|
||||
|
||||
#dvrControls input.inactive {
|
||||
border: 1px solid green;
|
||||
}
|
||||
|
||||
#dvrControls input.unavail {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
#replayStatus {
|
||||
width: 100%;
|
||||
padding: 4px 0;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#progressBar {
|
||||
position: relative;
|
||||
border: 1px solid #666666;
|
||||
height: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#progressBar .progressBox {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height: 15px;
|
||||
background: #eeeeee;
|
||||
border-left: 1px solid #999999;
|
||||
}
|
||||
|
||||
#progressBar .complete {
|
||||
background: #aaaaaa;
|
||||
}
|
||||
|
||||
li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
|
@ -0,0 +1,600 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder web event view file, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 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.
|
||||
//
|
||||
|
||||
if ( !canView( 'Events' ) )
|
||||
{
|
||||
$view = "error";
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $user['MonitorIds'] )
|
||||
{
|
||||
$mid_sql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mid_sql = '';
|
||||
}
|
||||
|
||||
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultRate,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
|
||||
$event = dbFetchOne( $sql );
|
||||
|
||||
if ( !isset( $rate ) )
|
||||
$rate = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
|
||||
if ( !isset( $scale ) )
|
||||
$scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
||||
$panel_sections = 40;
|
||||
$panel_section_width = (int)ceil(reScale($event['Width'],$scale)/$panel_sections);
|
||||
$panel_width = ($panel_sections*$panel_section_width-1);
|
||||
|
||||
$connkey = generateConnKey();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangEvent ?></title>
|
||||
<link rel="stylesheet" href="<?= basename(__FILE__,".php") ?>.css" type="text/css" media="screen"/>
|
||||
<?php require_once( 'zm_html_js.php' ) ?>
|
||||
<script type="text/javascript">
|
||||
|
||||
var url = "<?= ZM_BASE_URL.$PHP_SELF ?>";
|
||||
|
||||
function setButtonState( element, class )
|
||||
{
|
||||
element.className = class;
|
||||
element.disabled = (class != 'inactive');
|
||||
}
|
||||
|
||||
function secsToTime( secs )
|
||||
{
|
||||
var timeString;
|
||||
if ( secs < 60 )
|
||||
timeString = secs;
|
||||
else if ( secs < 60*60 )
|
||||
{
|
||||
var mins = parseInt(secs/60);
|
||||
var secs = secs%60;
|
||||
if ( secs < 10 )
|
||||
secs = '0'+secs.toString().substr( 0, 4 );
|
||||
else
|
||||
secs = secs.toString().substr( 0, 5 );
|
||||
timeString = mins+":"+secs;
|
||||
}
|
||||
else
|
||||
{
|
||||
var hours = parseInt(secs/3600);
|
||||
var mins = (secs%3600)/60;
|
||||
var secs = secs%60;
|
||||
if ( mins < 10 )
|
||||
mins = '0'+mins.toString().substr( 0, 4 );
|
||||
else
|
||||
mins = mins.toString().substr( 0, 5 );
|
||||
if ( secs < 10 )
|
||||
secs = '0'+secs.toString().substr( 0, 4 );
|
||||
else
|
||||
secs = secs.toString().substr( 0, 5 );
|
||||
timeString = hours+":"+mins+":"+secs;
|
||||
}
|
||||
return( timeString );
|
||||
}
|
||||
|
||||
function changeScale()
|
||||
{
|
||||
var scale = $('scale').getValue();
|
||||
var baseWidth = event.Width;
|
||||
var baseHeight = event.Height;
|
||||
console.log( "Got new scale: "+scale );
|
||||
var newWidth = ( baseWidth * scale ) / <?= SCALE_BASE ?>;
|
||||
var newHeight = ( baseHeight * scale ) / <?= SCALE_BASE ?>;
|
||||
|
||||
cmdScale( scale );
|
||||
|
||||
var streamImg = $('imageFeed').getElement('img');
|
||||
$(streamImg).setStyles( { width: newWidth, height: newHeight } );
|
||||
}
|
||||
|
||||
var cmdParms = "view=request&request=command&connkey=<?= $connkey ?>";
|
||||
var cmdTimeoutId = 0;
|
||||
|
||||
var status;
|
||||
var event;
|
||||
var eventId;
|
||||
var lastEventId = 0;
|
||||
|
||||
function getCmdResponse( resp_text, resp_xml )
|
||||
{
|
||||
if ( cmdTimeoutId )
|
||||
{
|
||||
window.clearTimeout( cmdTimeoutId );
|
||||
cmdTimeoutId = 0;
|
||||
}
|
||||
if ( !resp_text )
|
||||
return;
|
||||
var resp_func = new Function( "return "+resp_text );
|
||||
var resp_obj = resp_func();
|
||||
status = resp_obj.status;
|
||||
|
||||
eventId = status.event;
|
||||
if ( eventId != lastEventId )
|
||||
{
|
||||
evtQuery();
|
||||
lastEventId = eventId;
|
||||
}
|
||||
if ( status.paused == true )
|
||||
{
|
||||
$('modeValue').setHTML( "Paused" );
|
||||
$('rate').addClass( 'hidden' );
|
||||
cmdPause( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('modeValue').setHTML( "Replay" );
|
||||
$('rateValue').setHTML( status.rate );
|
||||
$('rate').removeClass( 'hidden' );
|
||||
cmdPlay( false );
|
||||
}
|
||||
$('progressValue').setHTML( secsToTime( parseInt(status.progress) ) );
|
||||
$('zoomValue').setHTML( status.zoom );
|
||||
if ( status.zoom == "1.0" )
|
||||
setButtonState( $('zoomOutBtn'), 'unavail' );
|
||||
else
|
||||
setButtonState( $('zoomOutBtn'), 'inactive' );
|
||||
|
||||
updateProgressBar();
|
||||
|
||||
var cmdTimeout = <?= ZM_WEB_REFRESH_STATUS ?>;
|
||||
cmdTimeoutId = window.setTimeout( 'cmdQuery()', 1000 * cmdTimeout );
|
||||
}
|
||||
|
||||
function cmdPause( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'unavail' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_PAUSE ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdPlay( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), status.rate==1?'active':'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowRevBtn'), 'unavail' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_PLAY ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdFastFwd( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowRevBtn'), 'unavail' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_FASTFWD ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdSlowFwd( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowFwdBtn'), 'active' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'unavail' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_SLOWFWD ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
}
|
||||
|
||||
function cmdSlowRev( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'active' );
|
||||
setButtonState( $('fastRevBtn'), 'unavail' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_SLOWREV ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
}
|
||||
|
||||
function cmdFastRev( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowRevBtn'), 'unavail' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_FASTREV ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdPrev( action )
|
||||
{
|
||||
cmdPlay( false );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_PREV ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdNext( action )
|
||||
{
|
||||
cmdPlay( false );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_NEXT ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdZoomIn( x, y )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_ZOOMIN ?>&x="+x+"&y="+y, onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdZoomOut()
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_ZOOMOUT ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdScale( scale )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_SCALE ?>&scale="+scale, onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdPan( x, y )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_PAN ?>&x="+x+"&y="+y, onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdSeek( offset )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_SEEK ?>&offset="+offset, onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdQuery()
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_QUERY ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function getEvtResponse( resp_text, resp_xml )
|
||||
{
|
||||
if ( resp_text == 'Ok' )
|
||||
return;
|
||||
var resp_func = new Function( "return "+resp_text );
|
||||
var resp_obj = resp_func();
|
||||
console.log( resp_obj );
|
||||
|
||||
event = resp_obj.event;
|
||||
|
||||
$('dataId').setHTML( event.Id );
|
||||
if ( event.Notes )
|
||||
{
|
||||
$('dataCause').setProperty( 'title', event.Notes );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('dataCause').setProperty( 'title', '<?= $zmSlangAttrCause ?>' );
|
||||
}
|
||||
$('dataCause').setHTML( event.Cause );
|
||||
$('dataTime').setHTML( event.StartTime );
|
||||
$('dataDuration').setHTML( event.Length );
|
||||
$('dataFrames').setHTML( event.Frames+"/"+event.AlarmFrames );
|
||||
$('dataScore').setHTML( event.TotScore+"/"+event.AvgScore+"/"+event.MaxScore );
|
||||
$('eventName').setProperty( 'value', event.Name );
|
||||
|
||||
var link = $('archiveEvent').getElement( 'a' );
|
||||
if ( parseInt(event.Archived) )
|
||||
{
|
||||
$(link).setHTML( '<?= $zmSlangUnarchive ?>' );
|
||||
$(link).setProperty( 'href', 'javascript: unarchiveEvent()' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$(link).setHTML( '<?= $zmSlangArchive ?>' );
|
||||
$(link).setProperty( 'href', 'javascript: archiveEvent()' );
|
||||
}
|
||||
drawProgressBar();
|
||||
}
|
||||
|
||||
function evtQuery()
|
||||
{
|
||||
var evtParms = "view=request&request=status&entity=event&id="+eventId;
|
||||
var evtReq = new Ajax( url, { method: 'post', postBody: evtParms, onComplete: getEvtResponse } );
|
||||
evtReq.request();
|
||||
}
|
||||
|
||||
function getActResponse( resp_text, resp_xml )
|
||||
{
|
||||
if ( resp_text == 'Ok' )
|
||||
return;
|
||||
var resp_func = new Function( "return "+resp_text );
|
||||
var resp_obj = resp_func();
|
||||
console.log( resp_obj );
|
||||
|
||||
if ( resp_obj.refreshParent )
|
||||
{
|
||||
window.opener.location.reload();
|
||||
}
|
||||
evtQuery();
|
||||
}
|
||||
|
||||
function actQuery( action, parms )
|
||||
{
|
||||
var actParms = "view=request&request=event&id="+event.Id+"&action="+action;
|
||||
console.log( parms );
|
||||
if ( parms != null )
|
||||
{
|
||||
actParms += "&"+Object.toQueryString( parms );
|
||||
}
|
||||
console.log( actParms );
|
||||
var actReq = new Ajax( url, { method: 'post', postBody: actParms, onComplete: getActResponse } );
|
||||
actReq.request();
|
||||
}
|
||||
|
||||
function startRequests()
|
||||
{
|
||||
cmdTimeoutId = window.setTimeout( 'cmdQuery()', 1000 );
|
||||
}
|
||||
|
||||
function deleteEvent()
|
||||
{
|
||||
actQuery( 'delete' );
|
||||
cmdNext();
|
||||
opener.location.reload(true);
|
||||
}
|
||||
|
||||
function renameEvent()
|
||||
{
|
||||
var newName = $('eventName').getValue();
|
||||
actQuery( 'rename', { eventName: newName } );
|
||||
}
|
||||
|
||||
function editEvent()
|
||||
{
|
||||
newWindow( '<?= $PHP_SELF ?>?view=eventdetail&eid='+event.Id, 'zmEventDetail', <?= $jws['eventdetail']['w'] ?>, <?= $jws['eventdetail']['h'] ?> );
|
||||
}
|
||||
|
||||
function exportEvent()
|
||||
{
|
||||
newWindow( '<?= $PHP_SELF ?>?view=export&eid='+event.Id, 'zmExport', <?= $jws['export']['w'] ?>, <?= $jws['export']['h'] ?> );
|
||||
}
|
||||
|
||||
function archiveEvent()
|
||||
{
|
||||
actQuery( 'archive' );
|
||||
}
|
||||
|
||||
function unarchiveEvent()
|
||||
{
|
||||
actQuery( 'unarchive' );
|
||||
}
|
||||
|
||||
function drawProgressBar()
|
||||
{
|
||||
var barWidth = 0;
|
||||
$('progressBar').addClass( 'invisible' );
|
||||
var cells = $('progressBar').getElements( 'div' );
|
||||
var cellWidth = parseInt( event.Width/$$(cells).length );
|
||||
$$(cells).forEach(
|
||||
function( cell, index )
|
||||
{
|
||||
$(cell).setStyle( 'left', barWidth );
|
||||
$(cell).setStyle( 'width', cellWidth );
|
||||
//console.log( "Cell at "+barWidth );
|
||||
if ( index == 0 )
|
||||
$(cell).setStyle( 'border-left', 0 );
|
||||
var offset = parseInt((index*event.Length)/$$(cells).length);
|
||||
$(cell).setProperty( 'title', '+'+secsToTime(offset)+'s' );
|
||||
$(cell).removeEvent( 'click' );
|
||||
$(cell).addEvent( 'click', function(){ cmdSeek( offset ); } );
|
||||
$(cell).setProperty( 'title', '+'+secsToTime(offset)+'s' );
|
||||
barWidth += $(cell).getCoordinates().width;
|
||||
}
|
||||
);
|
||||
//console.log( "Bar width "+barWidth );
|
||||
$('progressBar').setStyle( 'width', barWidth );
|
||||
$('progressBar').removeClass( 'invisible' );
|
||||
}
|
||||
|
||||
function updateProgressBar()
|
||||
{
|
||||
if ( event && status )
|
||||
{
|
||||
var cells = $('progressBar').getElements( 'div' );
|
||||
var completeIndex = parseInt((($$(cells).length+1)*status.progress)/event.Length);
|
||||
$$(cells).forEach(
|
||||
function( cell, index )
|
||||
{
|
||||
if ( index < completeIndex )
|
||||
{
|
||||
if ( !$(cell).hasClass( 'complete' ) )
|
||||
{
|
||||
$(cell).addClass( 'complete' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $(cell).hasClass( 'complete' ) )
|
||||
{
|
||||
$(cell).removeClass( 'complete' );
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="dataBar">
|
||||
<table id="dataTable" cellspacing="0">
|
||||
<tr>
|
||||
<td><span id="dataId" title="<?= $zmSlangId ?>"><?= $event['Id'] ?></span></td>
|
||||
<td><span id="dataCause" title="<?= $event['Notes']?htmlentities($event['Notes']):$zmSlangAttrCause ?>"><?= htmlentities($event['Cause']) ?></span></td>
|
||||
<td><span id="dataTime" title="<?= $zmSlangTime ?>"><?= strftime( STRF_FMT_DATETIME_SHORT, strtotime($event['StartTime'] ) ) ?></span></td>
|
||||
<td><span id="dataDuration" title="<?= $zmSlangDuration ?>"><?= $event['Length'] ?></span>s</td>
|
||||
<td><span id="dataFrames" title="<?= $zmSlangAttrFrames."/".$zmSlangAttrAlarmFrames ?>"><?= $event['Frames'] ?>/<?= $event['AlarmFrames'] ?></span></td>
|
||||
<td><span id="dataScore" title="<?= $zmSlangAttrTotalScore."/".$zmSlangAttrAvgScore."/".$zmSlangAttrMaxScore ?>"><?= $event['TotScore'] ?>/<?= $event['AvgScore'] ?>/<?= $event['MaxScore'] ?></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="menuBar1">
|
||||
<span><input size="16" id="eventName" name="eventName" value="<?= $event['Name'] ?>"/> <input type="button" value="<?= $zmSlangRename ?>" onclick="renameEvent()"<?php if ( !canEdit( 'Events' ) ) { ?> disabled<?php } ?>/></span>
|
||||
<span id="menuControls">
|
||||
<span><?= $zmSlangScale ?>: <?= buildSelect( "scale", $scales, "changeScale();" ); ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<div id="menuBar2">
|
||||
<?php
|
||||
if ( canEdit( 'Events' ) )
|
||||
{
|
||||
?>
|
||||
<span id="deleteEvent"><a href="javascript: deleteEvent()"><?= $zmSlangDelete ?></a></span>
|
||||
<span id="editEvent"><a href="javascript: editEvent()"><?= $zmSlangEdit ?></a></span>
|
||||
<span id="exportEvent"><a href="javascript: exportEvent()"><?= $zmSlangExport ?></a></span>
|
||||
<span id="archiveEvent"><a href="javascript: void(0)"> </a></span>
|
||||
<?php
|
||||
}
|
||||
if ( ZM_OPT_MPEG != "no" )
|
||||
{
|
||||
?>
|
||||
<span><a href="javascript: videoEvent()"><?= $zmSlangVideo ?></a></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span id="closeWindow"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></span>
|
||||
</div>
|
||||
<div id="imageFeed">
|
||||
<?php
|
||||
if ( ZM_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
|
||||
{
|
||||
$stream_src = getStreamSrc( array( "source=event", "mode=mpeg", "event=".$eid, "frame=".(!empty($fid)?$fid:1), "scale=".$scale, "rate=".$rate, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_REPLAY_FORMAT ) );
|
||||
outputVideoStream( $stream_src, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ), $event['Name'], ZM_MPEG_LIVE_FORMAT );
|
||||
}
|
||||
else
|
||||
{
|
||||
$stream_src = getStreamSrc( array( "source=event", "mode=jpeg", "event=".$eid, "frame=".(!empty($fid)?$fid:1), "scale=".$scale, "rate=".$rate, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) );
|
||||
if ( canStreamNative() )
|
||||
{
|
||||
outputImageStream( $stream_src, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ), $event['Name'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
outputHelperStream( $stream_src, reScale( $event['Width'], $scale ), reScale( $event['Height'], $scale ) );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<p id="dvrControls">
|
||||
<input type="button" value="<+" id="prevBtn" class="inactive" onclick="cmdPrev( true )"/>
|
||||
<input type="button" value="<<" id="fastRevBtn" class="inactive" disabled="disabled" onclick="cmdFastRev( true )"/>
|
||||
<input type="button" value="<" id="slowRevBtn" class="unavail" disabled="disabled" onclick="cmdSlowRev( true )"/>
|
||||
<input type="button" value="||" id="pauseBtn" class="inactive" onclick="cmdPause( true )"/>
|
||||
<input type="button" value="|>" id="playBtn" class="active" disabled="disabled" onclick="cmdPlay( true )"/>
|
||||
<input type="button" value=">" id="slowFwdBtn" class="unavail" disabled="disabled" onclick="cmdSlowFwd( true )"/>
|
||||
<input type="button" value=">>" id="fastFwdBtn" class="inactive" disabled="disabled" onclick="cmdFastFwd( true )"/>
|
||||
<input type="button" value="–" id="zoomOutBtn" class="avail" onclick="cmdZoomOut()"/>
|
||||
<input type="button" value="+>" id="nextBtn" class="inactive" onclick="cmdNext( true )"/>
|
||||
</p>
|
||||
<div id="replayStatus"><span id="mode">Mode: <span id="modeValue"> </span></span><span id="rate"> – Rate: <span id="rateValue"></span>x</span><span id="progress"> – Progress: <span id="progressValue"></span>s</span><span id="zoom"> – Zoom: <span id="zoomValue"></span>x</span>
|
||||
</div>
|
||||
<div id="progressBar" class="invisible">
|
||||
<?php
|
||||
for ( $i = 0; $i < $panel_sections; $i++ )
|
||||
{
|
||||
?>
|
||||
<div class="progressBox" id="progressBox<?= $i ?>" title=""></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
startRequests();
|
||||
<?php
|
||||
if ( canStreamNative() )
|
||||
{
|
||||
?>
|
||||
function handleClick( event )
|
||||
{
|
||||
var target = event.target;
|
||||
//console.log( "Target = "+event.target );
|
||||
//console.log( "Left = "+$(target).getLeft() );
|
||||
var x = event.page.x - $(target).getLeft();
|
||||
var y = event.page.y - $(target).getTop();
|
||||
|
||||
if ( event.shift )
|
||||
cmdPan( x, y );
|
||||
else
|
||||
cmdZoomIn( x, y );
|
||||
//console.log(x+","+y)
|
||||
}
|
||||
|
||||
var streamImg = $('imageFeed').getElement('img');
|
||||
$(streamImg).addEvent( 'click', handleClick.bindWithEvent( $(streamImg) ) );
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -82,6 +82,7 @@ else
|
|||
$monitor['WarmupCount'] = 25;
|
||||
$monitor['PreEventCount'] = 10;
|
||||
$monitor['PostEventCount'] = 10;
|
||||
$monitor['StreamReplayBuffer'] = 1000;
|
||||
$monitor['AlarmFrameCount'] = 1;
|
||||
$monitor['Controllable'] = 0;
|
||||
$monitor['ControlType'] = 0;
|
||||
|
@ -240,6 +241,10 @@ function validateForm(form)
|
|||
{
|
||||
errors[errors.length] = "<?= $zmSlangBadPostEventCount ?>";
|
||||
}
|
||||
if ( !form.elements['new_monitor[StreamReplayBuffer]'].value || !(parseInt(form.elements['new_monitor[StreamReplayBuffer]'].value) >= 0 ) )
|
||||
{
|
||||
errors[errors.length] = "<?= $zmSlangBadStreamReplayBuffer ?>";
|
||||
}
|
||||
if ( !form.elements['new_monitor[AlarmFrameCount]'].value || !(parseInt(form.elements['new_monitor[AlarmFrameCount]'].value) > 0 ) )
|
||||
{
|
||||
errors[errors.length] = "<?= $zmSlangBadAlarmFrameCount ?>";
|
||||
|
@ -455,6 +460,7 @@ if ( $tab != 'buffers' )
|
|||
<input type="hidden" name="new_monitor[WarmupCount]" value="<?= $new_monitor['WarmupCount'] ?>">
|
||||
<input type="hidden" name="new_monitor[PreEventCount]" value="<?= $new_monitor['PreEventCount'] ?>">
|
||||
<input type="hidden" name="new_monitor[PostEventCount]" value="<?= $new_monitor['PostEventCount'] ?>">
|
||||
<input type="hidden" name="new_monitor[StreamReplayBuffer]" value="<?= $new_monitor['StreamReplayBuffer'] ?>">
|
||||
<input type="hidden" name="new_monitor[AlarmFrameCount]" value="<?= $new_monitor['AlarmFrameCount'] ?>">
|
||||
<?php
|
||||
}
|
||||
|
@ -606,6 +612,7 @@ switch ( $tab )
|
|||
<tr><td align="left" class="text"><?= $zmSlangWarmupFrames ?></td><td align="left" class="text"><input type="text" name="new_monitor[WarmupCount]" value="<?= $new_monitor['WarmupCount'] ?>" size="4" class="form"></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangPreEventImageBuffer ?></td><td align="left" class="text"><input type="text" name="new_monitor[PreEventCount]" value="<?= $new_monitor['PreEventCount'] ?>" size="4" class="form"></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangPostEventImageBuffer ?></td><td align="left" class="text"><input type="text" name="new_monitor[PostEventCount]" value="<?= $new_monitor['PostEventCount'] ?>" size="4" class="form"></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangStreamReplayBuffer ?></td><td align="left" class="text"><input type="text" name="new_monitor[StreamReplayBuffer]" value="<?= $new_monitor['StreamReplayBuffer'] ?>" size="6" class="form"></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangAlarmFrameCount ?></td><td align="left" class="text"><input type="text" name="new_monitor[AlarmFrameCount]" value="<?= $new_monitor['AlarmFrameCount'] ?>" size="4" class="form"></td></tr>
|
||||
<?php
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,336 @@
|
|||
@import url(zm_html_base.css);
|
||||
|
||||
body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#menuBar {
|
||||
width: 100%;
|
||||
margin-top: 2px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#menuBar #monitorName {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
#menuBar #closeWindow {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
}
|
||||
|
||||
#menuBar #menuControls > span {
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
#imageFeed{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorStatus {
|
||||
width: 100%;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorStatus #enableAlarms {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
#monitorStatus #forceAlarm {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
}
|
||||
|
||||
#monitorStatus #monitorState {
|
||||
}
|
||||
|
||||
#dvrControls {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#dvrControls input {
|
||||
height: 20px;
|
||||
width: 28px;
|
||||
padding-bottom: 3px;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
#dvrControls input[disabled] {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
#dvrControls input.active {
|
||||
border: 1px solid blue;
|
||||
}
|
||||
|
||||
#dvrControls input.inactive {
|
||||
border: 1px solid green;
|
||||
}
|
||||
|
||||
#dvrControls input.unavail {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
#replayStatus {
|
||||
width: 100%;
|
||||
margin-top: 3px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#events {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#eventList {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#eventList thead td {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#eventList td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
span.alarm {
|
||||
color: #DC143C;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.alert {
|
||||
color: #FF8C00;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#eventList tr.highlight {
|
||||
background-color: #B0E0E6;
|
||||
}
|
||||
|
||||
#ptzControls {
|
||||
vertical-align: top;
|
||||
margin-top: 10px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 340px;
|
||||
border: 1px dashed #006699;
|
||||
}
|
||||
|
||||
#ptzControls input.textbutton {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel {
|
||||
position: relative;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
height: 184px;
|
||||
}
|
||||
|
||||
#ptzControls input[type=image] {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel .longArrowBtn {
|
||||
background-repeat: no-repeat;
|
||||
width: 32px;
|
||||
height: 48px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a bit of a hack as these lines should be in the above
|
||||
* section but that messes up layout on IE6
|
||||
*/
|
||||
#ptzControls #controlsPanel > div > div.longArrowBtn {
|
||||
left: 50%;
|
||||
margin-left: -16px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel .upBtn {
|
||||
background-image: url("graphics/arrow-l-u.gif");
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel .downBtn {
|
||||
background-image: url("graphics/arrow-l-d.gif");
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #focusControls {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #focusControls > div {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #zoomControls {
|
||||
position: absolute;
|
||||
left: 54px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #zoomControls > div {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 8px;
|
||||
width: 120px;
|
||||
margin-left: -60px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel > div {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #pantiltButtons {
|
||||
position: relative;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border: 1px solid #006699;
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls .arrowBtn {
|
||||
background-repeat: no-repeat;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #upLeftBtn {
|
||||
background-image: url("graphics/arrow-ul.gif");
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #upBtn {
|
||||
background-image: url("graphics/arrow-u.gif");
|
||||
top: 0px;
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #upRightBtn {
|
||||
background-image: url("graphics/arrow-ur.gif");
|
||||
top: 0px;
|
||||
left: 64px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #leftBtn {
|
||||
background-image: url("graphics/arrow-l.gif");
|
||||
top: 32px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #centerBtn {
|
||||
background-image: url("graphics/center.gif");
|
||||
top: 32px;
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #rightBtn {
|
||||
background-image: url("graphics/arrow-r.gif");
|
||||
top: 32px;
|
||||
left: 64px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #downLeftBtn {
|
||||
background-image: url("graphics/arrow-dl.gif");
|
||||
top: 64px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #downBtn {
|
||||
background-image: url("graphics/arrow-d.gif");
|
||||
top: 64px;
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #pantiltControls #downRightBtn {
|
||||
background-image: url("graphics/arrow-dr.gif");
|
||||
top: 64px;
|
||||
left: 64px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #powerControls {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #pantiltPanel #powerControls div {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #irisControls {
|
||||
position: absolute;
|
||||
right: 54px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #irisControls > div {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #whiteControls {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#ptzControls #controlsPanel #whiteControls > div {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#ptzControls #presetControls {
|
||||
position: relative;
|
||||
margin-top: -20px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#ptzControls #presetControls input {
|
||||
margin: 1px 1px 1px 1px;
|
||||
}
|
||||
|
||||
#ptzControls #presetControls > div {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#ptzControls #presetControls > div > span {
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
|
@ -0,0 +1,851 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder web watch feed view file, $Date$, $Revision$
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 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.
|
||||
//
|
||||
|
||||
if ( !canView( 'Stream' ) )
|
||||
{
|
||||
$view = "error";
|
||||
return;
|
||||
}
|
||||
|
||||
$sql = "select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id = '$mid'";
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
mysql_free_result( $result );
|
||||
|
||||
$showControls = ( ZM_OPT_CONTROL && $monitor['Controllable'] && canView( 'Control' ) );
|
||||
|
||||
if ( !isset( $scale ) )
|
||||
$scale = reScale( SCALE_BASE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
||||
$connkey = generateConnKey();
|
||||
|
||||
noCacheHeaders();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= $monitor['Name'] ?> - <?= $zmSlangFeed ?></title>
|
||||
<link rel="stylesheet" href="<?= basename(__FILE__,".php") ?>.css" type="text/css" media="screen"/>
|
||||
<?php require_once( 'zm_html_js.php' ) ?>
|
||||
<script type="text/javascript">
|
||||
var STATE_IDLE = <?= STATE_IDLE ?>;
|
||||
var STATE_PREALARM = <?= STATE_PREALARM ?>;
|
||||
var STATE_ALARM = <?= STATE_ALARM ?>;
|
||||
var STATE_ALERT = <?= STATE_ALERT ?>;
|
||||
var STATE_TAPE = <?= STATE_TAPE ?>;
|
||||
|
||||
var url = "<?= ZM_BASE_URL.$PHP_SELF ?>";
|
||||
|
||||
function setButtonState( element, class )
|
||||
{
|
||||
element.className = class;
|
||||
element.disabled = (class != 'inactive');
|
||||
}
|
||||
|
||||
var showMode = "<?= ($showControls && $control)?"control":"events" ?>";
|
||||
function showEvents()
|
||||
{
|
||||
$('ptzControls').addClass( 'hidden' );
|
||||
$('events').removeClass( 'hidden' );
|
||||
$('controlToggle').setHTML( '<?= $zmSlangControl ?>' );
|
||||
$('controlToggle').setProperty( 'onclick', 'showControls()' );
|
||||
showMode = "events";
|
||||
}
|
||||
|
||||
function showControls()
|
||||
{
|
||||
$('events').addClass( 'hidden' );
|
||||
$('ptzControls').removeClass( 'hidden' );
|
||||
$('controlToggle').setHTML( '<?= $zmSlangEvents ?>' );
|
||||
$('controlToggle').setProperty( 'onclick', 'showEvents()' );
|
||||
showMode = "control";
|
||||
}
|
||||
|
||||
function changeScale()
|
||||
{
|
||||
var scale = $('scale').getValue();
|
||||
var baseWidth = <?= $monitor['Width'] ?>;
|
||||
var baseHeight = <?= $monitor['Height'] ?>;
|
||||
console.log( "Got new scale: "+scale );
|
||||
var newWidth = ( baseWidth * scale ) / <?= SCALE_BASE ?>;
|
||||
var newHeight = ( baseHeight * scale ) / <?= SCALE_BASE ?>;
|
||||
|
||||
cmdScale( scale );
|
||||
|
||||
var streamImg = $('imageFeed').getElement('img');
|
||||
$(streamImg).setStyles( { width: newWidth, height: newHeight } );
|
||||
}
|
||||
|
||||
var cmdParms = "view=request&request=command&connkey=<?= $connkey ?>";
|
||||
var cmdTimeoutId = 0;
|
||||
|
||||
var lastState = STATE_IDLE;
|
||||
var status;
|
||||
|
||||
function getCmdResponse( resp_text, resp_xml )
|
||||
{
|
||||
if ( cmdTimeoutId )
|
||||
{
|
||||
window.clearTimeout( cmdTimeoutId );
|
||||
cmdTimeoutId = 0;
|
||||
}
|
||||
if ( !resp_text )
|
||||
return;
|
||||
var resp_func = new Function( "return "+resp_text );
|
||||
var resp_obj = resp_func();
|
||||
status = resp_obj.status;
|
||||
$('fpsValue').setHTML( status.fps );
|
||||
var state = status.state;
|
||||
var stateString = "Unknown";
|
||||
var stateClass = "";
|
||||
if ( state <= STATE_PREALARM )
|
||||
{
|
||||
stateString = "<?= $zmSlangIdle ?>";
|
||||
}
|
||||
else if ( state == STATE_ALARM )
|
||||
{
|
||||
stateString = "<?= $zmSlangAlarm ?>";
|
||||
stateClass = "alarm";
|
||||
}
|
||||
else if ( state == STATE_ALERT )
|
||||
{
|
||||
stateString = "<?= $zmSlangAlert ?>";
|
||||
stateClass = "alert";
|
||||
}
|
||||
else if ( state == STATE_TAPE )
|
||||
{
|
||||
stateString = "<?= $zmSlangRecord ?>";
|
||||
}
|
||||
$('stateValue').setHTML( stateString );
|
||||
if ( stateClass )
|
||||
$('stateValue').setProperty( 'class', stateClass );
|
||||
else
|
||||
$('stateValue').removeProperty( 'class' );
|
||||
$('levelValue').setHTML( status.level );
|
||||
if ( status.level > 95)
|
||||
{
|
||||
$('levelValue').className = "alarm";
|
||||
}
|
||||
else if ( status.level > 80 )
|
||||
{
|
||||
$('levelValue').className = "alert";
|
||||
}
|
||||
else
|
||||
{
|
||||
$('levelValue').className = "ok";
|
||||
}
|
||||
|
||||
var delayString;
|
||||
if ( status.delay < 60 )
|
||||
delayString = status.delay;
|
||||
else if ( status.delay < 60*60 )
|
||||
{
|
||||
var mins = parseInt(status.delay/60);
|
||||
var secs = status.delay%60;
|
||||
if ( secs < 10 )
|
||||
secs = '0'+secs.toString().substr( 0, 4 );
|
||||
else
|
||||
secs = secs.toString().substr( 0, 5 );
|
||||
delayString = mins+":"+secs;
|
||||
}
|
||||
else
|
||||
{
|
||||
var hours = parseInt(status.delay/3600);
|
||||
var mins = (status.delay%3600)/60;
|
||||
var secs = status.delay%60;
|
||||
if ( mins < 10 )
|
||||
mins = '0'+mins.toString().substr( 0, 4 );
|
||||
else
|
||||
mins = mins.toString().substr( 0, 5 );
|
||||
if ( secs < 10 )
|
||||
secs = '0'+secs.toString().substr( 0, 4 );
|
||||
else
|
||||
secs = secs.toString().substr( 0, 5 );
|
||||
delayString = hours+":"+mins+":"+secs;
|
||||
}
|
||||
if ( status.paused == true )
|
||||
{
|
||||
$('modeValue').setHTML( "Paused" );
|
||||
$('rate').addClass( 'hidden' );
|
||||
$('delayValue').setHTML( delayString );
|
||||
$('delay').removeClass( 'hidden' );
|
||||
$('level').removeClass( 'hidden' );
|
||||
cmdPause( false );
|
||||
}
|
||||
else if ( status.delayed == true )
|
||||
{
|
||||
$('modeValue').setHTML( "Replay" );
|
||||
$('rateValue').setHTML( status.rate );
|
||||
$('rate').removeClass( 'hidden' );
|
||||
$('delayValue').setHTML( delayString );
|
||||
$('delay').removeClass( 'hidden' );
|
||||
$('level').removeClass( 'hidden' );
|
||||
if ( status.rate == 1 )
|
||||
{
|
||||
cmdPlay( false );
|
||||
}
|
||||
else if ( status.rate > 0 )
|
||||
{
|
||||
if ( status.rate < 1 )
|
||||
cmdSlowFwd( false );
|
||||
else
|
||||
cmdFastFwd( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( status.rate > -1 )
|
||||
cmdSlowRev( false );
|
||||
else
|
||||
cmdFastRev( false );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('modeValue').setHTML( "Live" );
|
||||
$('rate').addClass( 'hidden' );
|
||||
$('delay').addClass( 'hidden' );
|
||||
$('level').addClass( 'hidden' );
|
||||
cmdPlay( false );
|
||||
}
|
||||
$('zoomValue').setHTML( status.zoom );
|
||||
if ( status.zoom == "1.0" )
|
||||
setButtonState( $('zoomOutBtn'), 'unavail' );
|
||||
else
|
||||
setButtonState( $('zoomOutBtn'), 'inactive' );
|
||||
|
||||
var isAlarmed = ( state == STATE_ALARM || state == STATE_ALERT );
|
||||
var wasAlarmed = ( lastState == STATE_ALARM || lastState == STATE_ALERT );
|
||||
|
||||
var newAlarm = ( isAlarmed && !wasAlarmed );
|
||||
var oldAlarm = ( !isAlarmed && wasAlarmed );
|
||||
|
||||
if ( newAlarm )
|
||||
{
|
||||
<?php
|
||||
if ( ZM_WEB_SOUND_ON_ALARM )
|
||||
{
|
||||
?>
|
||||
// Enable the alarm sound
|
||||
$('alarmSound').removeClass( 'hidden' );
|
||||
<?php
|
||||
}
|
||||
if ( ZM_WEB_POPUP_ON_ALARM )
|
||||
{
|
||||
?>
|
||||
window.focus();
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
<?php
|
||||
if ( ZM_WEB_SOUND_ON_ALARM )
|
||||
{
|
||||
?>
|
||||
if ( oldAlarm )
|
||||
{
|
||||
// Disable alarm sound
|
||||
$('alarmSound').addClass( 'hidden' );
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
var cmdTimeout = <?= ZM_WEB_REFRESH_STATUS ?>;
|
||||
if ( state == STATE_ALARM || state == STATE_ALERT )
|
||||
{
|
||||
cmdTimeout = 1;
|
||||
}
|
||||
cmdTimeoutId = window.setTimeout( 'cmdQuery()', 1000 * cmdTimeout );
|
||||
lastState = state;
|
||||
}
|
||||
|
||||
function cmdPause( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_PAUSE ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdPlay( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'active' );
|
||||
if ( status.delayed == true )
|
||||
{
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
}
|
||||
else
|
||||
{
|
||||
setButtonState( $('stopBtn'), 'unavail' );
|
||||
setButtonState( $('fastFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowRevBtn'), 'unavail' );
|
||||
setButtonState( $('fastRevBtn'), 'unavail' );
|
||||
}
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_PLAY ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdStop( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'unavail' );
|
||||
setButtonState( $('stopBtn'), 'active' );
|
||||
setButtonState( $('fastFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowRevBtn'), 'unavail' );
|
||||
setButtonState( $('fastRevBtn'), 'unavail' );
|
||||
|
||||
//window.setTimeout('setButtonState( $('stopBtn'), 'unavail' ); setButtonState( $('playBtn'), 'active' );", 500 );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_STOP ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
setButtonState( $('stopBtn'), 'unavail' );
|
||||
setButtonState( $('playBtn'), 'active' );
|
||||
}
|
||||
|
||||
function cmdFastFwd( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_FASTFWD ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdSlowFwd( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'active' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_SLOWFWD ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
}
|
||||
|
||||
function cmdSlowRev( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'active' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_SLOWREV ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
}
|
||||
|
||||
function cmdFastRev( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_FASTREV ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
}
|
||||
|
||||
function cmdZoomIn( x, y )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_ZOOMIN ?>&x="+x+"&y="+y, onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdZoomOut()
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_ZOOMOUT ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdScale( scale )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_SCALE ?>&scale="+scale, onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdPan( x, y )
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_PAN ?>&x="+x+"&y="+y, onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
function cmdQuery()
|
||||
{
|
||||
var cmdReq = new Ajax( url, { method: 'post', postBody: cmdParms+"&command=<?= CMD_QUERY ?>", onComplete: getCmdResponse } );
|
||||
cmdReq.request();
|
||||
}
|
||||
|
||||
var evtParms = "view=request&request=status&entity=events&id=<?= $mid ?>&count=<?= MAX_EVENTS ?>&sort=Id%20desc";
|
||||
var evtTimeoutId = 0;
|
||||
var evtFirst = true;
|
||||
|
||||
function getEvtResponse( resp_text, resp_xml )
|
||||
{
|
||||
if ( evtTimeoutId )
|
||||
{
|
||||
window.clearTimeout( evtTimeoutId );
|
||||
evtTimeoutId = 0;
|
||||
}
|
||||
if ( resp_text == 'Ok' )
|
||||
return;
|
||||
var resp_func = new Function( "return "+resp_text );
|
||||
var resp_obj = resp_func();
|
||||
|
||||
var db_events = resp_obj.events.reverse();
|
||||
var eventList = $('eventList');
|
||||
var eventListBody = $(eventList).getElement( 'tbody' );
|
||||
var eventListRows = $(eventListBody).getElements( 'tr' );
|
||||
for ( var i = 0; i < db_events.length; i++ )
|
||||
{
|
||||
var row = $('event'+db_events[i].Id);
|
||||
if ( !$(row) )
|
||||
{
|
||||
row = new Element( 'tr', { 'id': 'event'+db_events[i].Id } );
|
||||
if ( !evtFirst )
|
||||
$(row).addClass( 'highlight' );
|
||||
var cell = new Element( 'td' );
|
||||
$(cell).injectInside( $(row) );
|
||||
$(cell).clone().injectInside( $(row) );
|
||||
$(cell).clone().injectInside( $(row) );
|
||||
$(cell).clone().injectInside( $(row) );
|
||||
$(cell).clone().injectInside( $(row) );
|
||||
$(cell).clone().injectInside( $(row) );
|
||||
$(row).injectTop( $(eventListBody) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$(row).removeClass( 'highlight' );
|
||||
}
|
||||
var cells = $(row).getElements( 'td' );
|
||||
var id = cells[0];
|
||||
var idLink = $(id).getElement( 'a' );
|
||||
if ( !$(idLink) )
|
||||
{
|
||||
idLink = new Element( 'a', { 'href': '#', 'events': { 'click': eventWindow.pass( db_events[i].Id, '&trms=1&attr1=MonitorId&op1=%3d&val1=<?= $mid ?>&page=1' ) } });
|
||||
$(idLink).injectInside( $(id) );
|
||||
}
|
||||
$(idLink).setHTML( db_events[i].Id );
|
||||
var name = cells[1];
|
||||
var nameLink = $(name).getElement( 'a' );
|
||||
if ( !$(nameLink) )
|
||||
{
|
||||
nameLink = new Element( 'a', { 'href': '#', 'events': { 'click': eventWindow.pass( db_events[i].Id, '&trms=1&attr1=MonitorId&op1=%3d&val1=<?= $mid ?>&page=1' ) } });
|
||||
$(nameLink).injectInside( $(name) );
|
||||
}
|
||||
$(nameLink).setHTML( db_events[i].Name );
|
||||
var time = cells[2];
|
||||
$(time).setHTML( db_events[i].StartTime );
|
||||
var secs = cells[3];
|
||||
$(secs).setHTML( db_events[i].Length );
|
||||
var frames = cells[4];
|
||||
var framesLink = $(frames).getElement( 'a' );
|
||||
if ( !$(framesLink) )
|
||||
{
|
||||
framesLink = new Element( 'a', { 'href': '#', 'events': { 'click': framesWindow.pass( db_events[i].Id ) } });
|
||||
$(framesLink).injectInside( $(frames) );
|
||||
}
|
||||
$(framesLink).setHTML( db_events[i].Frames+'/'+db_events[i].AlarmFrames );
|
||||
var score = cells[5];
|
||||
var scoreLink = $(score).getElement( 'a' );
|
||||
if ( !$(scoreLink) )
|
||||
{
|
||||
scoreLink = new Element( 'a', { 'href': '#', 'events': { 'click': frameWindow.pass( [ db_events[i].Id, '0' ] ) } });
|
||||
$(scoreLink).injectInside( $(score) );
|
||||
}
|
||||
$(scoreLink).setHTML( db_events[i].AvgScore+'/'+db_events[i].MaxScore );
|
||||
}
|
||||
var rows = $(eventListBody).getElements( 'tr' );
|
||||
while ( $$(rows).length > <?= MAX_EVENTS ?> )
|
||||
{
|
||||
$$(rows)[$$(rows).length-1].remove();
|
||||
rows = $(eventListBody).getElements( 'tr' );
|
||||
}
|
||||
var evtTimeout = <?= ZM_WEB_REFRESH_STATUS ?>;
|
||||
//if ( state == STATE_ALARM || state == STATE_ALERT )
|
||||
//{
|
||||
//cmdTimeout = 1;
|
||||
//}
|
||||
evtTimeoutId = window.setTimeout( 'evtQuery()', 1000 * evtTimeout );
|
||||
evtFirst = false;
|
||||
}
|
||||
|
||||
function evtQuery()
|
||||
{
|
||||
var evtReq = new Ajax( url, { method: 'post', postBody: evtParms, onComplete: getEvtResponse } );
|
||||
evtReq.request();
|
||||
}
|
||||
|
||||
var controlParms = "view=request&request=control&id=<?= $mid ?>";
|
||||
|
||||
function getControlResponse( resp_text, resp_xml )
|
||||
{
|
||||
if ( !resp_text )
|
||||
return;
|
||||
console.log( resp_text );
|
||||
var resp_func = new Function( "return "+resp_text );
|
||||
var resp_obj = resp_func();
|
||||
result = resp_obj.result;
|
||||
if ( result != 'Ok' )
|
||||
{
|
||||
alert( "Control response was status = "+resp_obj.status+"\nmessage = "+resp_obj.message );
|
||||
}
|
||||
}
|
||||
|
||||
function controlCmd( control )
|
||||
{
|
||||
var controlReq = new Ajax( url, { method: 'post', postBody: controlParms+"&control="+control, onComplete: getControlResponse } );
|
||||
controlReq.request();
|
||||
}
|
||||
|
||||
function controlCmdImage( x, y )
|
||||
{
|
||||
var imageControlParms = controlParms;
|
||||
imageControlParms += "&scale=<?= $scale ?>";
|
||||
<?php
|
||||
if ( $monitor['CanMoveMap'] )
|
||||
{
|
||||
?>
|
||||
imageControlParms += "&control=move_map";
|
||||
<?php
|
||||
}
|
||||
elseif ( $monitor['CanMoveRel'] )
|
||||
{
|
||||
?>
|
||||
imageControlParms += "&control=move_psuedo_map";
|
||||
<?php
|
||||
}
|
||||
elseif ( $monitor['CanMoveCon'] )
|
||||
{
|
||||
?>
|
||||
imageControlParms += "&control=move_con_map";
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
var controlReq = new Ajax( url, { method: 'post', postBody: imageControlParms+"&x="+x+"&y="+y, onComplete: getControlResponse } );
|
||||
controlReq.request();
|
||||
}
|
||||
function startRequests()
|
||||
{
|
||||
cmdTimeoutId = window.setTimeout( 'cmdQuery()', 1000 );
|
||||
evtTimeoutId = window.setTimeout( 'evtQuery()', 1500 );
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="menuBar">
|
||||
<span id="monitorName"><strong><?= $monitor['Name'] ?></strong></span>
|
||||
<span id="menuControls">
|
||||
<?php
|
||||
if ( $showControls )
|
||||
{
|
||||
if ( !$control )
|
||||
{
|
||||
if ( canView( 'Control' ) )
|
||||
{
|
||||
?>
|
||||
<span><a id="controlToggle" href="javascript: void(0)" onclick="showControls()"><?= $zmSlangControl ?></a></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( canView( 'Events' ) )
|
||||
{
|
||||
?>
|
||||
<span><a id="controlToggle" href="javascript: void(0)" onclick="showEvents()"><?= $zmSlangEvents ?></a></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<span><?= $zmSlangScale ?>: <?= buildSelect( "scale", $scales, "changeScale( this );" ); ?></span>
|
||||
<?php
|
||||
if ( canView( 'Control' ) && $monitor['Type'] == "Local" )
|
||||
{
|
||||
?>
|
||||
<span><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=settings&mid=<?= $monitor['Id'] ?>', 'zmSettings<?= $monitor['Id'] ?>', <?= $jws['settings']['w'] ?>, <?= $jws['settings']['h'] ?> );"><?= $zmSlangSettings ?></a></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span id="closeWindow"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></span>
|
||||
</div>
|
||||
<div id="imageFeed">
|
||||
<?php
|
||||
if ( ZM_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
|
||||
{
|
||||
$stream_src = getStreamSrc( array( "mode=mpeg", "monitor=".$mid, "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) );
|
||||
outputVideoStream( $stream_src, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'], ZM_MPEG_LIVE_FORMAT );
|
||||
}
|
||||
else
|
||||
{
|
||||
$stream_src = getStreamSrc( array( "mode=jpeg", "monitor=".$mid, "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) );
|
||||
if ( canStreamNative() )
|
||||
{
|
||||
//if ( $control && ($monitor['CanMoveMap'] || $monitor['CanMoveRel'] || $monitor['CanMoveCon']) )
|
||||
{
|
||||
outputImageStream( $stream_src, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outputHelperStream( $stream_src, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ) );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div id="monitorStatus">
|
||||
<?php
|
||||
$refresh = (isset($force)||$forced||isset($disable)||$disabled||(($status>=STATE_PREALARM)&&($status<=STATE_ALERT)))?1:ZM_WEB_REFRESH_STATUS;
|
||||
$url = "$PHP_SELF?view=watchstatus&mid=$mid&last_status=$status".(($force||$forced)?"&forced=1":"").(($disable||$disabled)?"&disabled=1":"");
|
||||
|
||||
?>
|
||||
<span id="enableAlarms"><a href="<?= $PHP_SELF ?>?view=watchstatus&mid=<?= $mid ?>&last_status=<?= $status ?>&disable=0"><?= $zmSlangEnableAlarms ?></a></span>
|
||||
<span id="monitorState"><?= $zmSlangState ?>: <span id="stateValue"></span> - <span id="fpsValue"></span> fps</span>
|
||||
<?php
|
||||
if ( !($disable || $disabled) )
|
||||
{
|
||||
if ( canEdit( 'Monitors' ) && ($force || $forced) )
|
||||
{
|
||||
?>
|
||||
<span id="forceAlarm"><a href="<?= $PHP_SELF ?>?view=watchstatus&mid=<?= $mid ?>&last_status=<?= $status ?>&force=0"><?= $zmSlangCancelForcedAlarm ?></a></span>
|
||||
<?php
|
||||
}
|
||||
elseif ( canEdit( 'Monitors' ) && zmaCheck( $mid ) )
|
||||
{
|
||||
?>
|
||||
<span id="forceAlarm"><a href="<?= $PHP_SELF ?>?view=watchstatus&mid=<?= $mid ?>&last_status=<?= $status ?>&force=1"><?= $zmSlangForceAlarm ?></a></span>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<p id="dvrControls">
|
||||
<input type="button" value="<<" id="fastRevBtn" class="unavail" disabled="disabled" onclick="cmdFastRev( true )"/>
|
||||
<input type="button" value="<" id="slowRevBtn" class="unavail" disabled="disabled" onclick="cmdSlowRev( true )"/>
|
||||
<input type="button" value="||" id="pauseBtn" class="inactive" onclick="cmdPause( true )"/>
|
||||
<input type="button" value="[]" id="stopBtn" class="unavail" disabled="disabled" onclick="cmdStop( true )"/>
|
||||
<input type="button" value="|>" id="playBtn" class="active" disabled="disabled" onclick="cmdPlay( true )"/>
|
||||
<input type="button" value=">" id="slowFwdBtn" class="unavail" disabled="disabled" onclick="cmdSlowFwd( true )"/>
|
||||
<input type="button" value=">>" id="fastFwdBtn" class="unavail" disabled="disabled" onclick="cmdFastFwd( true )"/>
|
||||
<input type="button" value="–" id="zoomOutBtn" class="avail" onclick="cmdZoomOut()"/>
|
||||
</p>
|
||||
<div id="replayStatus"><span id="mode">Mode: <span id="modeValue"> </span></span><span id="rate"> – Rate: <span id="rateValue"></span>x</span><span id="delay"> – Delay: <span id="delayValue"></span>s</span><span id="level"> – Buffer: <span id="levelValue"></span>%</span><span id="zoom"> – Zoom: <span id="zoomValue"></span>x</span>
|
||||
</div>
|
||||
<?php
|
||||
if ( $showControls )
|
||||
{
|
||||
require_once( 'zm_control_funcsX.php' );
|
||||
$cmds = getControlCommands( $monitor );
|
||||
?>
|
||||
<div id="ptzControls"<?= $control?'':' class="hidden"' ?>>
|
||||
<div id="controlsPanel">
|
||||
<?php
|
||||
if ( $monitor['CanFocus'] )
|
||||
{
|
||||
echo controlFocus( $monitor );
|
||||
}
|
||||
if ( $monitor['CanZoom'] )
|
||||
{
|
||||
echo controlZoom( $monitor );
|
||||
}
|
||||
if ( $monitor['CanMove'] || ( $monitor['CanWake'] || $monitor['CanSleep'] || $monitor['CanReset'] ) )
|
||||
{
|
||||
?>
|
||||
<div id="pantiltPanel">
|
||||
<?php
|
||||
if ( $monitor['CanMove'] )
|
||||
{
|
||||
echo controlPanTilt( $monitor );
|
||||
}
|
||||
if ( $monitor['CanWake'] || $monitor['CanSleep'] || $monitor['CanReset'] )
|
||||
{
|
||||
echo controlPower( $monitor );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ( $monitor['CanIris'] )
|
||||
{
|
||||
echo controlIris( $monitor );
|
||||
}
|
||||
if ( $monitor['CanWhite'] )
|
||||
{
|
||||
echo controlWhite( $monitor );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ( $monitor['HasPresets'] )
|
||||
{
|
||||
echo controlPresets( $monitor );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ( canView( 'Events' ) )
|
||||
{
|
||||
?>
|
||||
<div id="events"<?= $control?' class="hidden"':'' ?>>
|
||||
<table id="eventList" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $zmSlangId ?></td>
|
||||
<td><?= $zmSlangName ?></td>
|
||||
<td><?= $zmSlangTime ?></td>
|
||||
<td><?= $zmSlangSecs ?></td>
|
||||
<td><?= $zmSlangFrames ?></td>
|
||||
<td><?= $zmSlangScore ?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ( ZM_WEB_SOUND_ON_ALARM )
|
||||
{
|
||||
$sound_src = ZM_DIR_SOUNDS.'/'.ZM_WEB_ALARM_SOUND;
|
||||
?>
|
||||
<div id="alarmSound" class="hidden">
|
||||
<?php
|
||||
if ( ZM_WEB_USE_OBJECT_TAGS && isWindows() )
|
||||
{
|
||||
?>
|
||||
<object id="MediaPlayer" width="0" height="0"
|
||||
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
|
||||
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902">
|
||||
<param name="FileName" value="<?= $sound_src ?>"/>
|
||||
<param name="autoStart" value="1"/>
|
||||
<param name="loop" value="1"/>
|
||||
<param name=hidden value="1"/>
|
||||
<param name="showControls" value="0"/>
|
||||
<embed src="<?= $sound_src ?>"
|
||||
autostart="true"
|
||||
loop="true"
|
||||
hidden="true">
|
||||
</embed>
|
||||
</object>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<embed src="<?= $sound_src ?>"
|
||||
autostart="true"
|
||||
loop="true"
|
||||
hidden="true">
|
||||
</embed>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
startRequests();
|
||||
<?php
|
||||
if ( canStreamNative() )
|
||||
{
|
||||
?>
|
||||
function handleClick( event )
|
||||
{
|
||||
var target = event.target;
|
||||
//console.log( "Target = "+event.target );
|
||||
//console.log( "Left = "+$(target).getLeft() );
|
||||
var x = event.page.x - $(target).getLeft();
|
||||
var y = event.page.y - $(target).getTop();
|
||||
var canMove = <?= ($monitor['CanMoveMap'] || $monitor['CanMoveRel'] || $monitor['CanMoveCon'])?'true':'false' ?>;
|
||||
|
||||
if ( showMode == "events" || !canMove )
|
||||
{
|
||||
if ( event.shift )
|
||||
cmdPan( x, y );
|
||||
else
|
||||
cmdZoomIn( x, y );
|
||||
}
|
||||
else
|
||||
{
|
||||
controlCmdImage( x, y );
|
||||
}
|
||||
//console.log(x+","+y)
|
||||
}
|
||||
|
||||
var streamImg = $('imageFeed').getElement('img');
|
||||
$(streamImg).addEvent( 'click', handleClick.bindWithEvent( $(streamImg) ) );
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -136,10 +136,11 @@ $zmSlangBadMaxFPS = 'Maximum FPS must be a positive integer or floati
|
|||
$zmSlangBadNameChars = 'Names may only contain alphanumeric characters plus hyphen and underscore';
|
||||
$zmSlangBadPath = 'Path must be set to a valid value';
|
||||
$zmSlangBadPort = 'Port must be set to a valid number';
|
||||
$zmSlangBadPostEventCount = 'Post event image buffer must be an integer of zero or more';
|
||||
$zmSlangBadPreEventCount = 'Pre event image buffer must be at least zero, and less than image buffer size';
|
||||
$zmSlangBadRefBlendPerc = 'Reference blendpercentage must be a positive integer';
|
||||
$zmSlangBadPostEventCount = 'Post event image count must be an integer of zero or more';
|
||||
$zmSlangBadPreEventCount = 'Pre event image count must be at least zero, and less than image buffer size';
|
||||
$zmSlangBadRefBlendPerc = 'Reference blend percentage must be a positive integer';
|
||||
$zmSlangBadSectionLength = 'Section length must be an integer of 30 or more';
|
||||
$zmSlangBadStreamReplayBuffer= 'Stream replay buffer must be an integer of zero or more';
|
||||
$zmSlangBadWarmupCount = 'Warmup frames must be an integer of zero or more';
|
||||
$zmSlangBadWebColour = 'Web colour must be a valid web colour string';
|
||||
$zmSlangBadWidth = 'Width must be set to a valid value';
|
||||
|
@ -492,8 +493,8 @@ $zmSlangPixels = 'pixels';
|
|||
$zmSlangPlayAll = 'Play All';
|
||||
$zmSlangPleaseWait = 'Please Wait';
|
||||
$zmSlangPoint = 'Point';
|
||||
$zmSlangPostEventImageBuffer = 'Post Event Image Buffer';
|
||||
$zmSlangPreEventImageBuffer = 'Pre Event Image Buffer';
|
||||
$zmSlangPostEventImageBuffer = 'Post Event Image Count';
|
||||
$zmSlangPreEventImageBuffer = 'Pre Event Image Count';
|
||||
$zmSlangPreset = 'Preset';
|
||||
$zmSlangPresets = 'Presets';
|
||||
$zmSlangPrev = 'Prev';
|
||||
|
@ -564,6 +565,7 @@ $zmSlangStills = 'Stills';
|
|||
$zmSlangStopped = 'Stopped';
|
||||
$zmSlangStop = 'Stop';
|
||||
$zmSlangStream = 'Stream';
|
||||
$zmSlangStreamReplayBuffer = 'Stream Replay Image Buffer';
|
||||
$zmSlangSubmit = 'Submit';
|
||||
$zmSlangSystem = 'System';
|
||||
$zmSlangTele = 'Tele';
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
if ( !canView( 'Stream' ) )
|
||||
{
|
||||
$view = "error";
|
||||
return;
|
||||
}
|
||||
|
||||
error_reporting( E_ALL );
|
||||
|
||||
define( "MSG_TIMEOUT", 2.0 );
|
||||
define( "MSG_DATA_SIZE", 4+256 );
|
||||
|
||||
header("Content-type: text/plain" );
|
||||
if ( !($_REQUEST['connkey'] && $_REQUEST['command']) )
|
||||
{
|
||||
error_log( "No connection key or command supplied" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !($socket = socket_create( AF_UNIX, SOCK_DGRAM, 0 )) )
|
||||
{
|
||||
error_log( "socket_create() failed: ".socket_strerror(socket_last_error()) );
|
||||
return;
|
||||
}
|
||||
$loc_sock_file = ZM_PATH_SOCKS.'/zms-'.sprintf("%06d",$_REQUEST['connkey']).'w.sock';
|
||||
if ( !socket_bind( $socket, $loc_sock_file ) )
|
||||
{
|
||||
error_log( "socket_bind() failed: ".socket_strerror(socket_last_error()) );
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( $_REQUEST['command'] )
|
||||
{
|
||||
case CMD_ZOOMIN :
|
||||
error_log( "Zooming to ".$_REQUEST['x'].",".$_REQUEST['y'] );
|
||||
$msg = pack( "lcnn", MSG_CMD, $_REQUEST['command'], $_REQUEST['x'], $_REQUEST['y'] );
|
||||
break;
|
||||
case CMD_PAN :
|
||||
error_log( "Panning to ".$_REQUEST['x'].",".$_REQUEST['y'] );
|
||||
$msg = pack( "lcnn", MSG_CMD, $_REQUEST['command'], $_REQUEST['x'], $_REQUEST['y'] );
|
||||
break;
|
||||
case CMD_SCALE :
|
||||
error_log( "Scaling to ".$_REQUEST['scale'] );
|
||||
$msg = pack( "lcn", MSG_CMD, $_REQUEST['command'], $_REQUEST['scale'] );
|
||||
break;
|
||||
case CMD_SEEK :
|
||||
error_log( "Seeking to ".$_REQUEST['offset'] );
|
||||
$msg = pack( "lcN", MSG_CMD, $_REQUEST['command'], $_REQUEST['offset'] );
|
||||
break;
|
||||
default :
|
||||
$msg = pack( "lc", MSG_CMD, $_REQUEST['command'] );
|
||||
break;
|
||||
}
|
||||
|
||||
$rem_sock_file = ZM_PATH_SOCKS.'/zms-'.sprintf("%06d",$_REQUEST['connkey']).'s.sock';
|
||||
if ( !socket_sendto( $socket, $msg, strlen($msg), 0, $rem_sock_file ) )
|
||||
{
|
||||
error_log( "socket_sendto() failed: ".socket_strerror(socket_last_error()) );
|
||||
return;
|
||||
}
|
||||
|
||||
$r_sockets = array( $socket );
|
||||
$w_sockets = NULL;
|
||||
$e_sockets = NULL;
|
||||
$num_sockets = socket_select( $r_sockets, $w_sockets, $e_sockets, MSG_TIMEOUT );
|
||||
|
||||
if ( $num_sockets === false)
|
||||
{
|
||||
error_log( "Timed out waiting for msg" );
|
||||
return;
|
||||
}
|
||||
else if ( $num_sockets > 0 )
|
||||
{
|
||||
if ( count($r_sockets) != 1 )
|
||||
{
|
||||
error_log( "Bogus return from select" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch( $nbytes = socket_recvfrom( $socket, $msg, MSG_DATA_SIZE, 0, $rem_addr ) )
|
||||
{
|
||||
case -1 :
|
||||
{
|
||||
error_log( "socket_recvfrom() failed: ".socket_strerror(socket_last_error()) );
|
||||
return;
|
||||
}
|
||||
case 0 :
|
||||
{
|
||||
error_log( "No data to read from socket" );
|
||||
return;
|
||||
}
|
||||
default :
|
||||
{
|
||||
if ( $nbytes != MSG_DATA_SIZE )
|
||||
{
|
||||
error_log( "Got unexpected message size, got $nbytes, expected ".MSG_DATA_SIZE );
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$data = unpack( "ltype", $msg );
|
||||
switch ( $data['type'] )
|
||||
{
|
||||
case MSG_DATA_WATCH :
|
||||
{
|
||||
$data = unpack( "ltype/dfps/istate/ilevel/Cdelayed/Cpaused/C/C/irate/ddelay/izoom", $msg );
|
||||
$data['fps'] = sprintf( "%.2f", $data['fps'] );
|
||||
$data['rate'] /= 100;
|
||||
$data['delay'] = sprintf( "%.2f", $data['delay'] );
|
||||
$data['zoom'] = sprintf( "%.1f", $data['zoom']/100 );
|
||||
break;
|
||||
}
|
||||
case MSG_DATA_EVENT :
|
||||
{
|
||||
$data = unpack( "ltype/ievent/Cpaused/C/C/C/iprogress/irate/izoom", $msg );
|
||||
//$data['progress'] = sprintf( "%.2f", $data['progress'] );
|
||||
$data['rate'] /= 100;
|
||||
$data['zoom'] = sprintf( "%.1f", $data['zoom']/100 );
|
||||
break;
|
||||
}
|
||||
default :
|
||||
{
|
||||
error_log( "Unexpected received message type $type" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$response = array( 'status' => $data );
|
||||
echo jsValue( $response );
|
||||
|
||||
socket_close( $socket );
|
||||
unlink( $loc_sock_file );
|
||||
|
||||
?>
|
|
@ -0,0 +1,728 @@
|
|||
<?php
|
||||
// Monitor control actions, require a monitor id and control view permissions for that monitor
|
||||
if ( empty($_REQUEST['id']) || !canView( 'Control', $_REQUEST['id'] ) )
|
||||
{
|
||||
$view = "error";
|
||||
return;
|
||||
}
|
||||
|
||||
error_reporting( E_ALL );
|
||||
|
||||
if ( !$_REQUEST['id'] )
|
||||
{
|
||||
error_log( "No monitor id supplied" );
|
||||
return;
|
||||
}
|
||||
|
||||
$monitor = dbFetchOne( "select C.*,M.* from Monitors as M inner join Controls as C on (M.ControlId = C.Id ) where M.Id = '".$_REQUEST['id']."'" );
|
||||
|
||||
$ctrl_command = $monitor['Command'];
|
||||
if ( !preg_match( '/^\//', $ctrl_command ) )
|
||||
$ctrl_command = ZM_PATH_BIN.'/'.$ctrl_command;
|
||||
if ( $monitor['ControlDevice'] )
|
||||
$ctrl_command .= " --device=".$monitor['ControlDevice'];
|
||||
if ( $monitor['ControlAddress'] )
|
||||
$ctrl_command .= " --address=".$monitor['ControlAddress'];
|
||||
|
||||
$control = $_REQUEST['control'];
|
||||
if ( isset($_REQUEST['x']) && isset($_REQUEST['y']) )
|
||||
{
|
||||
$x = $_REQUEST['x'];
|
||||
$y = $_REQUEST['y'];
|
||||
$scale = $_REQUEST['scale'];
|
||||
if ( $control == "move_map" )
|
||||
{
|
||||
$x = deScale( $x, $scale );
|
||||
$y = deScale( $y, $scale );
|
||||
switch ( $monitor['Orientation'] )
|
||||
{
|
||||
case '0' :
|
||||
case '180' :
|
||||
case 'hori' :
|
||||
case 'vert' :
|
||||
$width = $monitor['Width'];
|
||||
$height = $monitor['Height'];
|
||||
break;
|
||||
case '90' :
|
||||
case '270' :
|
||||
$width = $monitor['Height'];
|
||||
$height = $monitor['Width'];
|
||||
break;
|
||||
}
|
||||
switch ( $monitor['Orientation'] )
|
||||
{
|
||||
case '90' :
|
||||
$temp_y = $y;
|
||||
$y = $height - $x;
|
||||
$x = $temp_y;
|
||||
break;
|
||||
case '180' :
|
||||
$x = $width - $x;
|
||||
$y = $height - $y;
|
||||
break;
|
||||
case '270' :
|
||||
$temp_x = $x;
|
||||
$x = $width - $y;
|
||||
$y = $temp_x;
|
||||
break;
|
||||
case 'hori' :
|
||||
$x = $width - $x;
|
||||
break;
|
||||
case 'vert' :
|
||||
$y = $height - $y;
|
||||
break;
|
||||
}
|
||||
$ctrl_command .= " -xcoord $x -ycoord $y -width $width -height $height";
|
||||
}
|
||||
elseif ( $control == "move_pseudo_map" )
|
||||
{
|
||||
$x = deScale( $x, $scale );
|
||||
$y = deScale( $y, $scale );
|
||||
|
||||
$half_width = $monitor['Width'] / 2;
|
||||
$half_height = $monitor['Height'] / 2;
|
||||
$x_factor = ($x - $half_width)/$half_width;
|
||||
$y_factor = ($y - $half_height)/$half_height;
|
||||
|
||||
switch ( $monitor['Orientation'] )
|
||||
{
|
||||
case '90' :
|
||||
$temp_y_factor = $y;
|
||||
$y_factor = -$x_factor;
|
||||
$x_factor = $temp_y_factor;
|
||||
break;
|
||||
case '180' :
|
||||
$x_factor = -$x_factor;
|
||||
$y_factor = -$y_factor;
|
||||
break;
|
||||
case '270' :
|
||||
$temp_x_factor = $x;
|
||||
$x_factor = -$y_factor;
|
||||
$y_factor = $tenp_x_factor;
|
||||
break;
|
||||
case 'hori' :
|
||||
$x_factor = -$x_factor;
|
||||
break;
|
||||
case 'vert' :
|
||||
$y_factor = -$y_factor;
|
||||
break;
|
||||
}
|
||||
|
||||
$turbo = 0.9; // Threshold for turbo speed
|
||||
$blind = 0.1; // Threshold for blind spot
|
||||
|
||||
$pan_control = '';
|
||||
$tilt_control = '';
|
||||
if ( $x_factor > $blind )
|
||||
{
|
||||
$pan_control = 'right';
|
||||
}
|
||||
elseif ( $x_factor < -$blind )
|
||||
{
|
||||
$pan_control = 'left';
|
||||
}
|
||||
if ( $y_factor > $blind )
|
||||
{
|
||||
$tilt_control = 'down';
|
||||
}
|
||||
elseif ( $y_factor < -$blind )
|
||||
{
|
||||
$tilt_control = 'up';
|
||||
}
|
||||
|
||||
$dirn = $tilt_control.$pan_control;
|
||||
if ( !$dirn )
|
||||
{
|
||||
// No command, probably in blind spot in middle
|
||||
$control = 'null';
|
||||
}
|
||||
else
|
||||
{
|
||||
$control = 'move_rel_'.$dirn;
|
||||
$x_factor = abs($x_factor);
|
||||
$y_factor = abs($y_factor);
|
||||
|
||||
if ( $monitor['HasPanSpeed'] && $x_factor )
|
||||
{
|
||||
if ( $monitor['HasTurboPan'] )
|
||||
{
|
||||
if ( $x_factor >= $turbo )
|
||||
{
|
||||
$pan_speed = $monitor['TurboPanSpeed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$x_factor = $x_factor/$turbo;
|
||||
$pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$x_factor)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$x_factor)));
|
||||
}
|
||||
}
|
||||
if ( $monitor['HasTiltSpeed'] && $y_factor )
|
||||
{
|
||||
if ( $monitor['HasTurboTilt'] )
|
||||
{
|
||||
if ( $y_factor >= $turbo )
|
||||
{
|
||||
$tilt_speed = $monitor['TurboTiltSpeed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$y_factor = $y_factor/$turbo;
|
||||
$tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$y_factor)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$y_factor)));
|
||||
}
|
||||
}
|
||||
if ( preg_match( '/(left|right)$/', $dirn ) )
|
||||
{
|
||||
$pan_step = intval(round($monitor['MinPanStep']+(($monitor['MaxPanStep']-$monitor['MinPanStep'])*$x_factor)));
|
||||
$ctrl_command .= " --panstep=".$pan_step." --panspeed=".$pan_speed;
|
||||
}
|
||||
if ( preg_match( '/^(up|down)/', $dirn ) )
|
||||
{
|
||||
$tilt_step = intval(round($monitor['MinTiltStep']+(($monitor['MaxTiltStep']-$monitor['MinTiltStep'])*$y_factor)));
|
||||
$ctrl_command .= " --tiltstep=".$tilt_step." --tiltspeed=".$tilt_speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ( $control == "move_con_map" )
|
||||
{
|
||||
$x = deScale( $x, $scale );
|
||||
$y = deScale( $y, $scale );
|
||||
|
||||
$half_width = $monitor['Width'] / 2;
|
||||
$half_height = $monitor['Height'] / 2;
|
||||
$x_factor = ($x - $half_width)/$half_width;
|
||||
$y_factor = ($y - $half_height)/$half_height;
|
||||
|
||||
switch ( $monitor['Orientation'] )
|
||||
{
|
||||
case '90' :
|
||||
$temp_y_factor = $y;
|
||||
$y_factor = -$x_factor;
|
||||
$x_factor = $temp_y_factor;
|
||||
break;
|
||||
case '180' :
|
||||
$x_factor = -$x_factor;
|
||||
$y_factor = -$y_factor;
|
||||
break;
|
||||
case '270' :
|
||||
$temp_x_factor = $x;
|
||||
$x_factor = -$y_factor;
|
||||
$y_factor = $tenp_x_factor;
|
||||
break;
|
||||
case 'hori' :
|
||||
$x_factor = -$x_factor;
|
||||
break;
|
||||
case 'vert' :
|
||||
$y_factor = -$y_factor;
|
||||
break;
|
||||
}
|
||||
|
||||
$slow = 0.9; // Threshold for slow speed/timeouts
|
||||
$turbo = 0.9; // Threshold for turbo speed
|
||||
$blind = 0.1; // Threshold for blind spot
|
||||
|
||||
$pan_control = '';
|
||||
$tilt_control = '';
|
||||
if ( $x_factor > $blind )
|
||||
{
|
||||
$pan_control = 'right';
|
||||
}
|
||||
elseif ( $x_factor < -$blind )
|
||||
{
|
||||
$pan_control = 'left';
|
||||
}
|
||||
if ( $y_factor > $blind )
|
||||
{
|
||||
$tilt_control = 'down';
|
||||
}
|
||||
elseif ( $y_factor < -$blind )
|
||||
{
|
||||
$tilt_control = 'up';
|
||||
}
|
||||
|
||||
$dirn = $tilt_control.$pan_control;
|
||||
if ( !$dirn )
|
||||
{
|
||||
// No command, probably in blind spot in middle
|
||||
$control = 'move_stop';
|
||||
}
|
||||
else
|
||||
{
|
||||
$control = 'move_con_'.$dirn;
|
||||
$x_factor = abs($x_factor);
|
||||
$y_factor = abs($y_factor);
|
||||
|
||||
if ( $monitor['HasPanSpeed'] && $x_factor )
|
||||
{
|
||||
if ( $monitor['HasTurboPan'] )
|
||||
{
|
||||
if ( $x_factor >= $turbo )
|
||||
{
|
||||
$pan_speed = $monitor['TurboPanSpeed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$x_factor = $x_factor/$turbo;
|
||||
$pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$x_factor)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$x_factor)));
|
||||
}
|
||||
}
|
||||
if ( $monitor['HasTiltSpeed'] && $y_factor )
|
||||
{
|
||||
if ( $monitor['HasTurboTilt'] )
|
||||
{
|
||||
if ( $y_factor >= $turbo )
|
||||
{
|
||||
$tilt_speed = $monitor['TurboTiltSpeed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$y_factor = $y_factor/$turbo;
|
||||
$tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$y_factor)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$y_factor)));
|
||||
}
|
||||
}
|
||||
if ( preg_match( '/(left|right)$/', $dirn ) )
|
||||
{
|
||||
$ctrl_command .= " --panspeed=".$pan_speed;
|
||||
}
|
||||
if ( preg_match( '/^(up|down)/', $dirn ) )
|
||||
{
|
||||
$ctrl_command .= " --tiltspeed=".$tilt_speed;
|
||||
}
|
||||
if ( $monitor['AutoStopTimeout'] )
|
||||
{
|
||||
$slow_pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$slow)));
|
||||
$slow_tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$slow)));
|
||||
if ( (!isset($pan_speed) || ($pan_speed < $slow_pan_speed)) && (!isset($tilt_speed) || ($tilt_speed < $slow_tilt_speed)) )
|
||||
{
|
||||
$ctrl_command .= " --autostop=".$monitor['AutoStopTimeout'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$slow = 0.9; // Threshold for slow speed/timeouts
|
||||
$turbo = 0.9; // Threshold for turbo speed
|
||||
$long_y = 48;
|
||||
$short_x = 32;
|
||||
$short_y = 32;
|
||||
|
||||
if ( preg_match( '/^([^_]+)_([^_]+)_([^_]+)$/', $control, $matches ) )
|
||||
{
|
||||
$command = $matches[1];
|
||||
$mode = $matches[2];
|
||||
$dirn = $matches[3];
|
||||
|
||||
switch( $command )
|
||||
{
|
||||
case 'focus' :
|
||||
{
|
||||
switch( $dirn )
|
||||
{
|
||||
case 'near' :
|
||||
{
|
||||
$factor = ($long_y-($y+1))/$long_y;
|
||||
break;
|
||||
}
|
||||
case 'far' :
|
||||
{
|
||||
$factor = ($y+1)/$long_y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( $monitor['HasFocusSpeed'] )
|
||||
{
|
||||
$speed = intval(round($monitor['MinFocusSpeed']+(($monitor['MaxFocusSpeed']-$monitor['MinFocusSpeed'])*$factor)));
|
||||
$ctrl_command .= " --speed=".$speed;
|
||||
}
|
||||
switch( $mode )
|
||||
{
|
||||
case 'abs' :
|
||||
case 'rel' :
|
||||
{
|
||||
$step = intval(round($monitor['MinFocusStep']+(($monitor['MaxFocusStep']-$monitor['MinFocusStep'])*$factor)));
|
||||
$ctrl_command .= " --step=".$step;
|
||||
break;
|
||||
}
|
||||
case 'con' :
|
||||
{
|
||||
if ( $monitor['AutoStopTimeout'] )
|
||||
{
|
||||
$slow_speed = intval(round($monitor['MinFocusSpeed']+(($monitor['MaxFocusSpeed']-$monitor['MinFocusSpeed'])*$slow)));
|
||||
if ( $speed < $slow_speed )
|
||||
{
|
||||
$ctrl_command .= " --autostop=".$monitor['AutoStopTimeout'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'zoom' :
|
||||
{
|
||||
switch( $dirn )
|
||||
{
|
||||
case 'tele' :
|
||||
{
|
||||
$factor = ($long_y-($y+1))/$long_y;
|
||||
break;
|
||||
}
|
||||
case 'wide' :
|
||||
{
|
||||
$factor = ($y+1)/$long_y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( $monitor['HasZoomSpeed'] )
|
||||
{
|
||||
$speed = intval(round($monitor['MinZoomSpeed']+(($monitor['MaxZoomSpeed']-$monitor['MinZoomSpeed'])*$factor)));
|
||||
$ctrl_command .= " --speed=".$speed;
|
||||
}
|
||||
switch( $mode )
|
||||
{
|
||||
case 'abs' :
|
||||
case 'rel' :
|
||||
{
|
||||
$step = intval(round($monitor['MinZoomStep']+(($monitor['MaxZoomStep']-$monitor['MinZoomStep'])*$factor)));
|
||||
$ctrl_command .= " --step=".$step;
|
||||
break;
|
||||
}
|
||||
case 'con' :
|
||||
{
|
||||
if ( $monitor['AutoStopTimeout'] )
|
||||
{
|
||||
$slow_speed = intval(round($monitor['MinZoomSpeed']+(($monitor['MaxZoomSpeed']-$monitor['MinZoomSpeed'])*$slow)));
|
||||
if ( $speed < $slow_speed )
|
||||
{
|
||||
$ctrl_command .= " --autostop=".$monitor['AutoStopTimeout'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'iris' :
|
||||
{
|
||||
switch( $dirn )
|
||||
{
|
||||
case 'open' :
|
||||
{
|
||||
$factor = ($long_y-($y+1))/$long_y;
|
||||
break;
|
||||
}
|
||||
case 'close' :
|
||||
{
|
||||
$factor = ($y+1)/$long_y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( $monitor['HasIrisSpeed'] )
|
||||
{
|
||||
$speed = intval(round($monitor['MinIrisSpeed']+(($monitor['MaxIrisSpeed']-$monitor['MinIrisSpeed'])*$factor)));
|
||||
$ctrl_command .= " --speed=".$speed;
|
||||
}
|
||||
switch( $mode )
|
||||
{
|
||||
case 'abs' :
|
||||
case 'rel' :
|
||||
{
|
||||
$step = intval(round($monitor['MinIrisStep']+(($monitor['MaxIrisStep']-$monitor['MinIrisStep'])*$factor)));
|
||||
$ctrl_command .= " --step=".$step;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'white' :
|
||||
{
|
||||
switch( $dirn )
|
||||
{
|
||||
case 'in' :
|
||||
{
|
||||
$factor = ($long_y-($y+1))/$long_y;
|
||||
break;
|
||||
}
|
||||
case 'out' :
|
||||
{
|
||||
$factor = ($y+1)/$long_y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( $monitor['HasWhiteSpeed'] )
|
||||
{
|
||||
$speed = intval(round($monitor['MinWhiteSpeed']+(($monitor['MaxWhiteSpeed']-$monitor['MinWhiteSpeed'])*$factor)));
|
||||
$ctrl_command .= " --speed=".$speed;
|
||||
}
|
||||
switch( $mode )
|
||||
{
|
||||
case 'abs' :
|
||||
case 'rel' :
|
||||
{
|
||||
$step = intval(round($monitor['MinWhiteStep']+(($monitor['MaxWhiteStep']-$monitor['MinWhiteStep'])*$factor)));
|
||||
$ctrl_command .= " --step=".$step;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'gain' :
|
||||
{
|
||||
switch( $dirn )
|
||||
{
|
||||
case 'up' :
|
||||
{
|
||||
$factor = ($long_y-($y+1))/$long_y;
|
||||
break;
|
||||
}
|
||||
case 'down' :
|
||||
{
|
||||
$factor = ($y+1)/$long_y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( $monitor['HasGainSpeed'] )
|
||||
{
|
||||
$speed = intval(round($monitor['MinGainSpeed']+(($monitor['MaxGainSpeed']-$monitor['MinGainSpeed'])*$factor)));
|
||||
$ctrl_command .= " --speed=".$speed;
|
||||
}
|
||||
switch( $mode )
|
||||
{
|
||||
case 'abs' :
|
||||
case 'rel' :
|
||||
{
|
||||
$step = intval(round($monitor['MinGainStep']+(($monitor['MaxGainStep']-$monitor['MinGainStep'])*$factor)));
|
||||
$ctrl_command .= " --step=".$step;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'move' :
|
||||
{
|
||||
$x_factor = 0;
|
||||
$y_factor = 0;
|
||||
|
||||
if ( preg_match( '/^up/', $dirn ) )
|
||||
{
|
||||
$y_factor = ($short_y-($y+1))/$short_y;
|
||||
}
|
||||
elseif ( preg_match( '/^down/', $dirn ) )
|
||||
{
|
||||
$y_factor = ($y+1)/$short_y;
|
||||
}
|
||||
if ( preg_match( '/left$/', $dirn ) )
|
||||
{
|
||||
$x_factor = ($short_x-($x+1))/$short_x;
|
||||
}
|
||||
elseif ( preg_match( '/right$/', $dirn ) )
|
||||
{
|
||||
$x_factor = ($x+1)/$short_x;
|
||||
}
|
||||
|
||||
if ( $monitor['Orientation'] != '0' )
|
||||
{
|
||||
$conversions = array(
|
||||
'90' => array(
|
||||
'up' => 'left',
|
||||
'down' => 'right',
|
||||
'left' => 'down',
|
||||
'right' => 'up',
|
||||
'upleft' => 'downleft',
|
||||
'upright' => 'upleft',
|
||||
'downleft' => 'downright',
|
||||
'downright' => 'upright',
|
||||
),
|
||||
'180' => array(
|
||||
'up' => 'down',
|
||||
'down' => 'up',
|
||||
'left' => 'right',
|
||||
'right' => 'left',
|
||||
'upleft' => 'downright',
|
||||
'upright' => 'downleft',
|
||||
'downleft' => 'upright',
|
||||
'downright' => 'upleft',
|
||||
),
|
||||
'270' => array(
|
||||
'up' => 'right',
|
||||
'down' => 'left',
|
||||
'left' => 'up',
|
||||
'right' => 'down',
|
||||
'upleft' => 'upright',
|
||||
'upright' => 'downright',
|
||||
'downleft' => 'upleft',
|
||||
'downright' => 'downleft',
|
||||
),
|
||||
'hori' => array(
|
||||
'up' => 'up',
|
||||
'down' => 'down',
|
||||
'left' => 'right',
|
||||
'right' => 'left',
|
||||
'upleft' => 'upright',
|
||||
'upright' => 'upleft',
|
||||
'downleft' => 'downright',
|
||||
'downright' => 'downleft',
|
||||
),
|
||||
'vert' => array(
|
||||
'up' => 'down',
|
||||
'down' => 'up',
|
||||
'left' => 'left',
|
||||
'right' => 'right',
|
||||
'upleft' => 'downleft',
|
||||
'upright' => 'downright',
|
||||
'downleft' => 'upleft',
|
||||
'downright' => 'upright',
|
||||
),
|
||||
);
|
||||
$new_dirn = $conversions[$monitor['Orientation']][$dirn];
|
||||
$control = preg_replace( "/_$dirn\$/", "_$new_dirn", $control );
|
||||
$dirn = $new_dirn;
|
||||
}
|
||||
|
||||
if ( $monitor['HasPanSpeed'] && $x_factor )
|
||||
{
|
||||
if ( $monitor['HasTurboPan'] )
|
||||
{
|
||||
if ( $x_factor >= $turbo )
|
||||
{
|
||||
$pan_speed = $monitor['TurboPanSpeed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$x_factor = $x_factor/$turbo;
|
||||
$pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$x_factor)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$x_factor)));
|
||||
}
|
||||
$ctrl_command .= " --panspeed=".$pan_speed;
|
||||
}
|
||||
if ( $monitor['HasTiltSpeed'] && $y_factor )
|
||||
{
|
||||
if ( $monitor['HasTurboTilt'] )
|
||||
{
|
||||
if ( $y_factor >= $turbo )
|
||||
{
|
||||
$tilt_speed = $monitor['TurboTiltSpeed'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$y_factor = $y_factor/$turbo;
|
||||
$tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$y_factor)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$y_factor)));
|
||||
}
|
||||
$ctrl_command .= " --tiltspeed=".$tilt_speed;
|
||||
}
|
||||
switch( $mode )
|
||||
{
|
||||
case 'rel' :
|
||||
case 'abs' :
|
||||
{
|
||||
if ( preg_match( '/(left|right)$/', $dirn ) )
|
||||
{
|
||||
$pan_step = intval(round($monitor['MinPanStep']+(($monitor['MaxPanStep']-$monitor['MinPanStep'])*$x_factor)));
|
||||
$ctrl_command .= " --panstep=".$pan_step;
|
||||
}
|
||||
if ( preg_match( '/^(up|down)/', $dirn ) )
|
||||
{
|
||||
$tilt_step = intval(round($monitor['MinTiltStep']+(($monitor['MaxTiltStep']-$monitor['MinTiltStep'])*$y_factor)));
|
||||
$ctrl_command .= " --tiltstep=".$tilt_step;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'con' :
|
||||
{
|
||||
if ( $monitor['AutoStopTimeout'] )
|
||||
{
|
||||
$slow_pan_speed = intval(round($monitor['MinPanSpeed']+(($monitor['MaxPanSpeed']-$monitor['MinPanSpeed'])*$slow)));
|
||||
$slow_tilt_speed = intval(round($monitor['MinTiltSpeed']+(($monitor['MaxTiltSpeed']-$monitor['MinTiltSpeed'])*$slow)));
|
||||
if ( (!isset($pan_speed) || ($pan_speed < $slow_pan_speed)) && (!isset($tilt_speed) || ($tilt_speed < $slow_tilt_speed)) )
|
||||
{
|
||||
$ctrl_command .= " --autostop=".$monitor['AutoStopTimeout'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( preg_match( '/^preset_goto_(\d+)$/', $control, $matches ) )
|
||||
{
|
||||
$control = 'preset_goto';
|
||||
$ctrl_command .= " --preset ".$matches[1];
|
||||
}
|
||||
elseif ( $control == "preset_set" )
|
||||
{
|
||||
$preset = $_REQUEST['preset'];
|
||||
if ( canEdit( 'Control' ) )
|
||||
{
|
||||
$new_label = $_REQUEST['new_label'];
|
||||
$row = dbFetchOne( "select * from ControlPresets where MonitorId = '".$monitor['Id']."' and Preset = '".$preset."'" );
|
||||
if ( $new_label != $row['Label'] )
|
||||
{
|
||||
if ( $new_label )
|
||||
$sql = "replace into ControlPresets ( MonitorId, Preset, Label ) values ( '".$monitor['Id']."', '".$preset."', '".addslashes($new_label)."' )";
|
||||
else
|
||||
$sql = "delete from ControlPresets where MonitorId = '".$monitor['Id']."' and Preset = '".$preset."'";
|
||||
dbQuery( $sql );
|
||||
$refresh_parent = true;
|
||||
}
|
||||
}
|
||||
$ctrl_command .= " --preset ".$preset;
|
||||
$view = 'none';
|
||||
}
|
||||
}
|
||||
if ( $control != 'null' )
|
||||
{
|
||||
$ctrl_command .= " --command=".$control;
|
||||
error_log( "Command: $ctrl_command" );
|
||||
$ctrl_status = '';
|
||||
$ctrl_output = array();
|
||||
exec( escapeshellcmd( $ctrl_command, $ctrl_output, $ctrl_status ) );
|
||||
error_log( "Status: $ctrl_status" );
|
||||
error_log( "Output: ".join( "\n", $ctrl_output ) );
|
||||
if ( !$ctrl_status )
|
||||
$response = array( 'result' => "Ok" );
|
||||
else
|
||||
$response = array( 'result' => "Error", 'status' => $ctrl_status, 'message' => join( "\n", $ctrl_output ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$response = array( 'result' => "Error", 'status' => 0, 'message' => "No command given" );
|
||||
}
|
||||
|
||||
header("Content-type: text/plain" );
|
||||
echo jsValue( $response );
|
||||
|
||||
?>
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
// Monitor control actions, require a monitor id and control view permissions for that monitor
|
||||
if ( empty($_REQUEST['id']) || !canEdit( 'Events', $_REQUEST['id'] ) )
|
||||
{
|
||||
$view = "error";
|
||||
return;
|
||||
}
|
||||
|
||||
error_reporting( E_ALL );
|
||||
|
||||
if ( !$_REQUEST['id'] )
|
||||
{
|
||||
error_log( "No event id supplied" );
|
||||
return;
|
||||
}
|
||||
|
||||
$refresh_parent = false;
|
||||
|
||||
// Event scope actions, edit permissions required
|
||||
if ( $_REQUEST['action'] == "rename" && $_REQUEST['id'] && $_REQUEST['eventName'] )
|
||||
{
|
||||
dbQuery( "update Events set Name = '".mysql_real_escape_string($_REQUEST['eventName'])."' where Id = '".mysql_real_escape_string($_REQUEST['id'])."'" );
|
||||
}
|
||||
else if ( $_REQUEST['action'] == "eventdetail" )
|
||||
{
|
||||
if ( $_REQUEST['id'] )
|
||||
{
|
||||
dbQuery( "update Events set Cause = '".mysql_real_escape_string($_REQUEST['new_event']['Cause'])."', Notes = '".mysql_real_escape_string($_REQUEST['new_event']['Notes'])."' where Id = '".mysql_real_escape_string($_REQUEST['id'])."'" );
|
||||
$refresh_parent = true;
|
||||
}
|
||||
}
|
||||
elseif ( $_REQUEST['action'] == "archive" || $_REQUEST['action'] == "unarchive" )
|
||||
{
|
||||
$archive_val = ($_REQUEST['action'] == "archive")?1:0;
|
||||
|
||||
if ( $_REQUEST['id'] )
|
||||
{
|
||||
dbQuery( "update Events set Archived = ".$archive_val." where Id = '".mysql_real_escape_string($_REQUEST['id'])."'" );
|
||||
}
|
||||
elseif ( $mark_eids || $mark_eid )
|
||||
{
|
||||
if ( !$mark_eids && $mark_eid )
|
||||
{
|
||||
$mark_eids[] = $mark_eid;
|
||||
}
|
||||
if ( $mark_eids )
|
||||
{
|
||||
foreach( $mark_eids as $mark_eid )
|
||||
{
|
||||
dbQuery( "update Events set Archived = $archive_val where Id = '$mark_eid'" );
|
||||
}
|
||||
$refresh_parent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ( $_REQUEST['action'] == "delete" )
|
||||
{
|
||||
if ( !$mark_eids && $mark_eid )
|
||||
{
|
||||
$mark_eids[] = $mark_eid;
|
||||
}
|
||||
if ( $mark_eids )
|
||||
{
|
||||
foreach( $mark_eids as $mark_eid )
|
||||
{
|
||||
deleteEvent( $mark_eid );
|
||||
}
|
||||
$refresh_parent = true;
|
||||
}
|
||||
}
|
||||
|
||||
$response['status'] = 'Ok';
|
||||
$response['refreshParent'] = $refresh_parent;
|
||||
|
||||
header("Content-type: text/plain" );
|
||||
echo jsValue( $response );
|
||||
|
||||
?>
|
|
@ -0,0 +1,269 @@
|
|||
<?php
|
||||
$spec = array(
|
||||
"system" => array(
|
||||
"permission" => "System",
|
||||
"table" => "Monitors",
|
||||
"limit" => 1,
|
||||
"elements" => array(
|
||||
"MonitorCount" => array( "sql" => "count(*)" ),
|
||||
"ActiveMonitorCount" => array( "sql" => "count(if(Function != 'None',1,NULL))" ),
|
||||
"State" => array( code => "daemonCheck()?'$zmSlangRunning':'$zmSlangStopped'" ),
|
||||
"Load" => array( code => "getLoad()" ),
|
||||
"Disk" => array( code => "getDiskPercent()" ),
|
||||
),
|
||||
),
|
||||
"monitor" => array(
|
||||
"permission" => "Monitors",
|
||||
"table" => "Monitors",
|
||||
"limit" => 1,
|
||||
"selector" => "Monitors.Id",
|
||||
"elements" => array(
|
||||
"Id" => array( "sql" => "Monitors.Id" ),
|
||||
"Name" => array( "sql" => "Monitors.Name" ),
|
||||
"Type" => true,
|
||||
"Function" => true,
|
||||
"Enabled" => true,
|
||||
"LinkedMonitors" => true,
|
||||
"Triggers" => true,
|
||||
"Device" => true,
|
||||
"Channel" => true,
|
||||
"Format" => true,
|
||||
"Host" => true,
|
||||
"Port" => true,
|
||||
"Path" => true,
|
||||
"Width" => array( "sql" => "Monitors.Width" ),
|
||||
"Height" => array( "sql" => "Monitors.Height" ),
|
||||
"Palette" => true,
|
||||
"Orientation" => true,
|
||||
"Brightness" => true,
|
||||
"Contrast" => true,
|
||||
"Hue" => true,
|
||||
"Colour" => true,
|
||||
"EventPrefix" => true,
|
||||
"LabelFormat" => true,
|
||||
"LabelX" => true,
|
||||
"LabelY" => true,
|
||||
"ImageBufferCount" => true,
|
||||
"WarmupCount" => true,
|
||||
"PreEventCount" => true,
|
||||
"PostEventCount" => true,
|
||||
"AlarmFrameCount" => true,
|
||||
"SectionLength" => true,
|
||||
"FrameSkip" => true,
|
||||
"MaxFPS" => true,
|
||||
"AlarmMaxFPS" => true,
|
||||
"FPSReportInterval" => true,
|
||||
"RefBlendPerc" => true,
|
||||
"Controllable" => true,
|
||||
"ControlId" => true,
|
||||
"ControlDevice" => true,
|
||||
"ControlAddress" => true,
|
||||
"AutoStopTimeout" => true,
|
||||
"TrackMotion" => true,
|
||||
"TrackDelay" => true,
|
||||
"ReturnLocation" => true,
|
||||
"ReturnDelay" => true,
|
||||
"DefaultView" => true,
|
||||
"DefaultRate" => true,
|
||||
"DefaultScale" => true,
|
||||
"WebColour" => true,
|
||||
"Sequence" => true,
|
||||
"MinEventId" => array( "sql" => "min(Events.Id)", "table" => "Events", join => "Events.MonitorId = Monitors.Id", "group" => "Events.MonitorId" ),
|
||||
"MaxEventId" => array( "sql" => "max(Events.Id)", "table" => "Events", join => "Events.MonitorId = Monitors.Id", "group" => "Events.MonitorId" ),
|
||||
"TotalEvents" => array( "sql" => "count(Events.Id)", "table" => "Events", join => "Events.MonitorId = Monitors.Id", "group" => "Events.MonitorId" ),
|
||||
"Status" => array( "zmu" => "-m ".$_REQUEST['id']." -s" ),
|
||||
"FrameRate" => array( "zmu" => "-m ".$_REQUEST['id']." -f" ),
|
||||
),
|
||||
),
|
||||
"events" => array(
|
||||
"permission" => "Events",
|
||||
"table" => "Events",
|
||||
"selector" => "Events.MonitorId",
|
||||
"elements" => array(
|
||||
"Id" => true,
|
||||
"Name" => true,
|
||||
"Cause" => true,
|
||||
"StartTime" => true,
|
||||
"EndTime" => true,
|
||||
"Width" => true,
|
||||
"Height" => true,
|
||||
"Length" => true,
|
||||
"Frames" => true,
|
||||
"AlarmFrames" => true,
|
||||
"TotScore" => true,
|
||||
"AvgScore" => true,
|
||||
"MaxScore" => true,
|
||||
),
|
||||
),
|
||||
"event" => array(
|
||||
"permission" => "Events",
|
||||
"table" => "Events",
|
||||
"limit" => 1,
|
||||
"selector" => "Events.Id",
|
||||
"elements" => array(
|
||||
"Id" => array( "sql" => "Events.Id" ),
|
||||
"MonitorId" => true,
|
||||
"Name" => true,
|
||||
"Cause" => true,
|
||||
"StartTime" => true,
|
||||
"StartTimeShort" => array( "sql" => "date_format( StartTime, '".STRF_FMT_DATETIME_SHORT."' )" ),
|
||||
"EndTime" => true,
|
||||
"Width" => true,
|
||||
"Height" => true,
|
||||
"Length" => true,
|
||||
"Frames" => true,
|
||||
"AlarmFrames" => true,
|
||||
"TotScore" => true,
|
||||
"AvgScore" => true,
|
||||
"MaxScore" => true,
|
||||
"Archived" => true,
|
||||
"Videoed" => true,
|
||||
"Uploaded" => true,
|
||||
"Emailed" => true,
|
||||
"Messaged" => true,
|
||||
"Executed" => true,
|
||||
"LearnState" => true,
|
||||
"Notes" => true,
|
||||
"MinFrameId" => array( "sql" => "min(Frames.FrameId)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ),
|
||||
"MaxFrameId" => array( "sql" => "max(Frames.FrameId)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ),
|
||||
"MinFrameDelta" => array( "sql" => "min(Frames.Delta)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ),
|
||||
"MaxFrameDelta" => array( "sql" => "max(Frames.Delta)", "table" => "Frames", "join" => "Events.Id = Frames.EventId", "group" => "Frames.EventId" ),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
function throwError( $message, $code=400 )
|
||||
{
|
||||
error_log( $message );
|
||||
header( "HTTP/1.0 $code $message" );
|
||||
exit();
|
||||
}
|
||||
|
||||
function collectData( $spec )
|
||||
{
|
||||
$element_spec = &$spec[strtolower($_REQUEST['entity'])];
|
||||
#print_r( $element_spec );
|
||||
if ( !canView( $element_spec['permission'] ) )
|
||||
{
|
||||
error_log( "Invalid permissions" );
|
||||
return;
|
||||
}
|
||||
|
||||
$data = array();
|
||||
|
||||
$field_sql = array();
|
||||
$join_sql = array();
|
||||
$group_sql = array();
|
||||
|
||||
$elements = &$element_spec['elements'];
|
||||
$lc_elements = array_change_key_case( $elements );
|
||||
if ( !isset($_REQUEST['element']) )
|
||||
$_REQUEST['element'] = array_keys( $elements );
|
||||
else if ( !is_array($_REQUEST['element']) )
|
||||
$_REQUEST['element'] = array( $_REQUEST['element'] );
|
||||
|
||||
foreach ( $_REQUEST['element'] as $element )
|
||||
{
|
||||
if ( !($element_data = $lc_elements[strtolower($element)]) )
|
||||
throwError( "Bad ".$_REQUEST['entity']." element ".$element );
|
||||
if ( $element_data['code'] )
|
||||
$data[$element] = eval( "return( ".$element_data['code']." );" );
|
||||
else if ( $element_data['zmu'] )
|
||||
$data[$element] = exec( escapeshellcmd( getZmuCommand( " ".$element_data['zmu'] ) ) );
|
||||
else
|
||||
{
|
||||
if ( $element_data['sql'] )
|
||||
$field_sql[] = $element_data['sql']." as ".$element;
|
||||
else
|
||||
$field_sql[] = $element;
|
||||
if ( $element_data['table'] && $element_data['join'] )
|
||||
{
|
||||
$join_sql[] = "left join ".$element_data['table']." on ".$element_data['join'];
|
||||
}
|
||||
if ( $element_data['group'] )
|
||||
{
|
||||
$group_sql[] = $element_data['group'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( count($field_sql) )
|
||||
{
|
||||
$sql = "select ".join( ", ", $field_sql )." from ".$element_spec['table'];
|
||||
if ( $join_sql )
|
||||
$sql .= " ".join( " ", array_unique( $join_sql ) );
|
||||
if ( $element_spec['selector'] )
|
||||
$sql .= " where ".$element_spec['selector']." = ".$_REQUEST['id'];
|
||||
if ( $group_sql )
|
||||
$sql .= " group by ".join( ",", array_unique( $group_sql ) );
|
||||
if ( $_REQUEST['sort'] )
|
||||
$sql .= " order by ".$_REQUEST['sort'];
|
||||
if ( $element_spec['limit'] )
|
||||
$limit = $element_spec['limit'];
|
||||
elseif ( $_REQUEST['count'] )
|
||||
$limit = $_REQUEST['count'];
|
||||
if ( !empty( $limit ) )
|
||||
$sql .= " limit ".$limit;
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
{
|
||||
error_log( $sql );
|
||||
error_log( mysql_error() );
|
||||
}
|
||||
if ( isset($limit) && $limit == 1 )
|
||||
{
|
||||
$sql_data = mysql_fetch_assoc( $result );
|
||||
$data = array_merge( $data, $sql_data );
|
||||
}
|
||||
else
|
||||
{
|
||||
$count = 0;
|
||||
while ( $sql_data = mysql_fetch_assoc( $result ) )
|
||||
{
|
||||
$data[] = $sql_data;
|
||||
if ( ++$count >= $limit )
|
||||
break;
|
||||
}
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
}
|
||||
#print_r( $data );
|
||||
return( $data );
|
||||
}
|
||||
|
||||
$data = collectData( $spec );
|
||||
|
||||
if ( !isset($_REQUEST['layout']) )
|
||||
{
|
||||
$_REQUEST['layout'] = "json";
|
||||
}
|
||||
switch( $_REQUEST['layout'] )
|
||||
{
|
||||
case 'xml NOT CURRENTLY SUPPORTED' :
|
||||
{
|
||||
header("Content-type: application/xml" );
|
||||
echo( '<?xml version="1.0" encoding="iso-8859-1"?>'."\n" );
|
||||
echo "<".strtolower($_REQUEST['entity']).">\n";
|
||||
foreach ( $data as $key=>$value )
|
||||
{
|
||||
$key = strtolower( $key );
|
||||
echo "<$key>".htmlentities($value)."</$key>\n";
|
||||
}
|
||||
echo "</".strtolower($_REQUEST['entity']).">\n";
|
||||
break;
|
||||
}
|
||||
case 'json' :
|
||||
{
|
||||
header("Content-type: text/plain" );
|
||||
$result = array( $_REQUEST['entity'] => $data );
|
||||
echo jsValue( $result );
|
||||
break;
|
||||
}
|
||||
case 'text' :
|
||||
{
|
||||
header("Content-type: text/plain" );
|
||||
echo join( " ", array_values( $data ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue