mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 04:04:03 -05:00
* feat: name what an ONVIF camera detected in the event note refs #7688 The ONVIF event note was the raw topic plus the value of the first Data SimpleItem, e.g. "tns1:RuleEngine/MyRuleDetector/PeopleDetect/true". parse_event_message() dropped every other item, the item names and the Source Rule, so cameras that name the detection in an item (Tapo IsPeople=true under a generic TPSmartEvent topic) or in a value (Ajax ClassTypes="Human Vehicle") produced notes that did not say what was detected. parse_event_message() now also returns every Data SimpleItem and the Source Rule, and ONVIFEventNote() builds the note from them with rules that hold across vendors rather than a per-camera list: - strip the namespace prefix of every topic segment (tns1:, tnsajax:) - drop a leading RuleEngine/, the root of every analytics topic - leave out items that are empty or inactive, by the same words interpret_alarm_value() uses for the alarm state, and per-object ids, which would otherwise add a note per object as notes only accumulate - leave out the value of items that say active, and State/LogicalState items that say active - add the Rule in parentheses when the camera names one Reolink MyRuleDetector/PeopleDetect Tapo TPSmartEventDetector/TPSmartEvent IsPeople (MyTPSmartEventDetectorRule) Ajax ObjectDetection/Object ClassTypes=Human Vehicle (AjaxObjectRule) The word lists that drive this sit together, so a camera with other vocabulary is handled by extending them. The inactive words move from interpret_alarm_value() into that shared list unchanged. A value found outside the Data SimpleItems (ElementItem, fallback search) still goes in the note, and a topic that reduces to nothing is used as it is. Alarm on/off decisions, the value they use, ONVIF_Alarm_Text matching and the alarms map keys are unchanged; a test pins interpret_alarm_value() to its previous results. parse_event_message() and interpret_alarm_value() are now static, as they use no member state, so they can be tested. Notes change format: filters matching the old text (e.g. Notes LIKE "tns1:RuleEngine" or "/true") need updating. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: link existing tags to events and stop logging new ones as errors refs #7688 Event::AddPacket_ tagged events from object detections, but when the tag name was already in Tags it neither linked it to the event nor cached it, and leaked the Tag that Tag::find returned. Only a tag name created for the first time was ever linked, so detections of person, car, ... after the first never reached Events_Tags. Move the tagging into Event::AddTag, which finds or creates the tag, links it once per event and caches it. A mutex guards the cache so the analysis thread can tag the event too. Event_Tag::save uses INSERT IGNORE so a link another writer made first (zm_detect via pyzm) is not an error, and Tag::find returns nullptr without logging two errors when the name is not there yet, which is how callers learn a tag is new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: tag events with the objects an ONVIF camera reports refs #7688 Add a per-monitor "Tag Events From ONVIF" checkbox (Monitors.ONVIF_Event_Tags, off by default). When set, events raised by the ONVIF event listener are tagged with what the camera detected, through the existing Tags and Events_Tags tables. ONVIFEventTags() reads the object from wherever the camera puts it, using the items parse_event_message() already collects for the note: the topic (Reolink PeopleDetect), an active item name without its "Is" (Tapo IsPeople) or the classes in an item value (Ajax ClassTypes="Human Vehicle"). Camera names map to the names object detection uses, so one tag means one thing: person, vehicle, animal, package, face, and doorbell for a Visitor press. An alarm that names no object (motion, tamper, line crossing, an unknown detector) is tagged with its last topic segment, e.g. MotionAlarm. The names are a table next to the note vocabulary; items are judged by the same helper the note uses (inactive, per-object id, generic state). Each alarm entry keeps its tags beside its note, SetTagSet() returns them as SetNoteSet() returns notes, including for a pulse that has already cleared, and Monitor::Analyse() hands them to Event::AddTag(). Schema: zm_update-1.39.55.sql adds the column, zm_create.sql.in matches, version 1.39.55. Web: checkbox and help text next to ONVIF Event Listener, unticked default for the save action. Perl: Monitor field list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: map camera object names to AI object classes for ONVIF tags refs #7688 ONVIF event tags were mapped from a word list compiled into zmc, so a camera using another word for an object needed a code change. Move the mapping into the database, on the object classes ZM already has. - Add AI_Object_Classes.Aliases, a comma separated list of what cameras call the class, editable in Options, AI Classes. - Seed aliases on the COCO person class and add a Camera dataset for the objects COCO has no class for: vehicle, animal, package, face and doorbell. Aliases already set are kept when the migration reruns. - zmc loads the class names and aliases when the ONVIF listener starts on a monitor with ONVIF_Event_Tags set. A class name maps to itself, so a camera reporting Car is tagged car, as object detection would. - Without the classes (an older database) alarms are tagged with their topic, as for an alarm that names no object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: address review of the ONVIF event tags refs #7688 - Event::AddTag tries each name once per event, so a tag that can't be saved is not looked up and logged on every frame, and cuts names to the 64 characters of Tags.Name. It no longer holds tags_mutex_ over the database work, and the Events_Tags row goes through dbQueue, so the analysis thread waits on at most the tag lookup. - Tag::save returns the existing Id when another process created the same tag first, instead of failing on the unique Name. - Event_Tag::save ignores only the duplicate key, not other errors. - An ONVIF message whose first state item is inactive and a later one active (Tapo IsVehicle=false, IsPeople=true) raises the alarm. - The Is prefix of an item name is matched in any case. - load_tag_names leaves the error to zmDbFetch, which has logged it. - The help text says to restart the monitor after changing aliases. - Re-indent two lines in ProcessPullResponse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: restart ONVIF tagging monitors when an AI class changes refs #7688 zmc reads the object class names and aliases when it starts listening for ONVIF events, so an alias saved in Options, AI Classes did nothing until the monitor was restarted by hand. Saving or deleting a class now restarts the zmc of each monitor with ONVIF_Event_Listener and ONVIF_Event_Tags set, as saving zones does for their monitor. Add the Aliases label to en_gb so it can be translated like the other strings, and say in the help text that saving restarts those monitors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: address Copilot review of the ONVIF event tags refs #7688 - Only a later alarm-state item (IsX, State, Alarm, ...) overrides an inactive first one. A later ObjectId or Count describes the object, so IsInside=false followed by ObjectId=3 stays an alarm-off. - 1 is true for a flag item such as IsPeople, as it already was for State, so IsPeople=1 is tagged person rather than the topic. - Cut tag names at 64 UTF-8 characters, the size of Tags.Name, without splitting a character, using a new Utf8Truncate helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: leave ONVIF detections out of the note when they are tagged refs #7688 With ONVIF_Event_Tags on, the tags already say what the camera detected, and name the topic when no object is named, so the note repeated them: "Motion: MyRuleDetector/PeopleDetect, ONVIF" next to a person tag. Such a monitor's note now just says ONVIF. With tags off the note still names the detection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: edit AI class aliases as tags refs #7688 A plain text field gave no hint that aliases are a comma list. Edit them like an event's tags instead, with the same tag styles: each alias is a removable tag, and Enter, space or comma adds the one typed. They are still saved as the comma list zmc reads, so nothing else changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: split ONVIF class values on commas and drop the DogCat alias refs #7688 A camera listing its classes as ClassTypes="Human,Vehicle" was tagged with neither, as values were split on spaces only. Split on commas too. Drop DogCat from the animal aliases: no camera is known to send it, Reolink sends DogCatDetect. Say in the seed where the starter aliases come from, which of them have been seen from a camera, and that more are added in Options, AI Classes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: give a new AI class the next free index and refuse a taken one refs #7688 A class's index is the number its dataset's model gives it, which a dataset with no model behind it (Camera) has no use for, yet the form required one and took any number, so a second class could get 0. Leave the index empty on a new class to get the next one in its dataset, and refuse an index another class of the dataset already has, naming that class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: number the placeholders of ClassIndexInUse so translations can reorder them refs #7688 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: source the camera class seed from the 1.39.55 migration refs #7688 The migration carried a copy of db/camera_classes.sql, so the starter aliases lived in two places. Make it a .sql.in that sources the seed file, as zm_update-1.39.26.sql.in does with triggers.sql, so fresh installs and upgrades share one copy. Note in the seed that it must keep working on a 1.39.55 database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Isaac Connor <isaac@zoneminder.com>
1495 lines
73 KiB
Plaintext
1495 lines
73 KiB
Plaintext
-- MySQL dump 10.13 Distrib 5.6.13, for Linux (i686)
|
|
--
|
|
-- Host: localhost Database: @ZM_DB_NAME@
|
|
-- ------------------------------------------------------
|
|
-- Server version 5.6.13
|
|
|
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
/*!40101 SET NAMES utf8 */;
|
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|
|
|
--
|
|
-- Current Database: `@ZM_DB_NAME@`
|
|
--
|
|
|
|
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `@ZM_DB_NAME@`;
|
|
|
|
USE `@ZM_DB_NAME@`;
|
|
|
|
--
|
|
-- Table structure for table `Config`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Config`;
|
|
CREATE TABLE `Config` (
|
|
`Id` smallint(5) unsigned NOT NULL default '0',
|
|
`Name` varchar(32) NOT NULL default '',
|
|
`Value` text NOT NULL,
|
|
`Type` tinytext NOT NULL,
|
|
`DefaultValue` text,
|
|
`Hint` tinytext,
|
|
`Pattern` tinytext,
|
|
`Format` tinytext,
|
|
`Prompt` tinytext,
|
|
`Help` text,
|
|
`Category` varchar(32) NOT NULL default '',
|
|
`Readonly` tinyint(3) unsigned NOT NULL default '0',
|
|
`Private` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`System` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`Requires` text,
|
|
PRIMARY KEY (`Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `ControlPresets`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `ControlPresets`;
|
|
CREATE TABLE `ControlPresets` (
|
|
`MonitorId` int(10) unsigned NOT NULL default '0',
|
|
`Preset` int(10) unsigned NOT NULL default '0',
|
|
`Label` varchar(64) NOT NULL default '',
|
|
PRIMARY KEY (`MonitorId`,`Preset`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Controls`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Controls`;
|
|
CREATE TABLE `Controls` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Protocol` varchar(64) default NULL,
|
|
`CanWake` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanSleep` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanReset` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanReboot` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanZoom` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanAutoZoom` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanZoomAbs` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanZoomRel` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanZoomCon` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinZoomRange` int(10) unsigned default NULL,
|
|
`MaxZoomRange` int(10) unsigned default NULL,
|
|
`MinZoomStep` int(10) unsigned default NULL,
|
|
`MaxZoomStep` int(10) unsigned default NULL,
|
|
`HasZoomSpeed` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinZoomSpeed` int(10) unsigned default NULL,
|
|
`MaxZoomSpeed` int(10) unsigned default NULL,
|
|
`CanFocus` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanAutoFocus` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanFocusAbs` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanFocusRel` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanFocusCon` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinFocusRange` int(10) unsigned default NULL,
|
|
`MaxFocusRange` int(10) unsigned default NULL,
|
|
`MinFocusStep` int(10) unsigned default NULL,
|
|
`MaxFocusStep` int(10) unsigned default NULL,
|
|
`HasFocusSpeed` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinFocusSpeed` int(10) unsigned default NULL,
|
|
`MaxFocusSpeed` int(10) unsigned default NULL,
|
|
`CanIris` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanAutoIris` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanIrisAbs` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanIrisRel` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanIrisCon` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinIrisRange` int(10) unsigned default NULL,
|
|
`MaxIrisRange` int(10) unsigned default NULL,
|
|
`MinIrisStep` int(10) unsigned default NULL,
|
|
`MaxIrisStep` int(10) unsigned default NULL,
|
|
`HasIrisSpeed` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinIrisSpeed` int(10) unsigned default NULL,
|
|
`MaxIrisSpeed` int(10) unsigned default NULL,
|
|
`CanGain` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanAutoGain` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanGainAbs` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanGainRel` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanGainCon` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinGainRange` int(10) unsigned default NULL,
|
|
`MaxGainRange` int(10) unsigned default NULL,
|
|
`MinGainStep` int(10) unsigned default NULL,
|
|
`MaxGainStep` int(10) unsigned default NULL,
|
|
`HasGainSpeed` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinGainSpeed` int(10) unsigned default NULL,
|
|
`MaxGainSpeed` int(10) unsigned default NULL,
|
|
`CanWhite` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanAutoWhite` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanWhiteAbs` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanWhiteRel` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanWhiteCon` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinWhiteRange` int(10) unsigned default NULL,
|
|
`MaxWhiteRange` int(10) unsigned default NULL,
|
|
`MinWhiteStep` int(10) unsigned default NULL,
|
|
`MaxWhiteStep` int(10) unsigned default NULL,
|
|
`HasWhiteSpeed` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinWhiteSpeed` int(10) unsigned default NULL,
|
|
`MaxWhiteSpeed` int(10) unsigned default NULL,
|
|
`CanLight` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanIndicatorLight` tinyint(3) unsigned NOT NULL default '0',
|
|
`HasPresets` tinyint(3) unsigned NOT NULL default '0',
|
|
`NumPresets` tinyint(3) unsigned NOT NULL default '0',
|
|
`HasHomePreset` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanSetPresets` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanMove` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanMoveDiag` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanMoveMap` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanMoveAbs` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanMoveRel` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanMoveCon` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanPan` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinPanRange` int(10) default NULL,
|
|
`MaxPanRange` int(10) default NULL,
|
|
`MinPanStep` int(10) default NULL,
|
|
`MaxPanStep` int(10) default NULL,
|
|
`HasPanSpeed` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinPanSpeed` int(10) default NULL,
|
|
`MaxPanSpeed` int(10) default NULL,
|
|
`HasTurboPan` tinyint(3) unsigned NOT NULL default '0',
|
|
`TurboPanSpeed` int(10) default NULL,
|
|
`CanTilt` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinTiltRange` int(10) default NULL,
|
|
`MaxTiltRange` int(10) default NULL,
|
|
`MinTiltStep` int(10) default NULL,
|
|
`MaxTiltStep` int(10) default NULL,
|
|
`HasTiltSpeed` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinTiltSpeed` int(10) default NULL,
|
|
`MaxTiltSpeed` int(10) default NULL,
|
|
`HasTurboTilt` tinyint(3) unsigned NOT NULL default '0',
|
|
`TurboTiltSpeed` int(10) default NULL,
|
|
`CanAutoScan` tinyint(3) unsigned NOT NULL default '0',
|
|
`NumScanPaths` tinyint(3) unsigned NOT NULL default '0',
|
|
`CanAudioPlay` tinyint(3) unsigned NOT NULL default '0',
|
|
`MinAudioFile` int(10) unsigned default NULL,
|
|
`MaxAudioFile` int(10) unsigned default NULL,
|
|
`CanAudioVolume` tinyint(3) unsigned NOT NULL default '0',
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Devices`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Devices`;
|
|
CREATE TABLE `Devices` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` tinytext NOT NULL,
|
|
`Type` enum('X10') NOT NULL default 'X10',
|
|
`KeyString` varchar(32) NOT NULL default '',
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `EncoderTemplates`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `EncoderTemplates`;
|
|
CREATE TABLE `EncoderTemplates` (
|
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`Encoder` varchar(32) NOT NULL,
|
|
`Name` varchar(64) NOT NULL,
|
|
`Description` text,
|
|
`Params` text NOT NULL,
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY `Encoder_Name` (`Encoder`, `Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
INSERT INTO `EncoderTemplates` (`Encoder`, `Name`, `Description`, `Params`) VALUES
|
|
('libx264', 'Balanced',
|
|
'1080p recording with reasonable CPU cost. Good default for most cameras.',
|
|
'preset=fast\ncrf=23\ng=30\nprofile=high\npix_fmt=yuv420p'),
|
|
('libx264', 'Archival (high quality)',
|
|
'Slow encode for archival storage; substantially smaller files at higher CPU cost.',
|
|
'preset=slow\ncrf=20\ng=30\nprofile=high\npix_fmt=yuv420p'),
|
|
('libx264', 'Low CPU',
|
|
'Highest encoding speed for slow CPUs; quality and file size trade off.',
|
|
'preset=ultrafast\ncrf=26\ng=30\nprofile=baseline\npix_fmt=yuv420p'),
|
|
|
|
('libx265', 'Balanced',
|
|
'1080p HEVC recording with reasonable CPU cost. Significantly smaller files than x264 at similar quality.',
|
|
'preset=fast\ncrf=25\ng=30\nprofile=main\npix_fmt=yuv420p'),
|
|
('libx265', 'Archival (high quality)',
|
|
'Slow HEVC encode for archival storage.',
|
|
'preset=slow\ncrf=22\ng=30\nprofile=main\npix_fmt=yuv420p'),
|
|
('libx265', 'Low CPU',
|
|
'Highest HEVC encoding speed for slow CPUs.',
|
|
'preset=ultrafast\ncrf=28\ng=30\nprofile=main\npix_fmt=yuv420p'),
|
|
|
|
('h264_nvenc', 'Balanced',
|
|
'1080p H.264 on NVIDIA GPU; sane vbr+cq defaults, no B-frames for low latency.',
|
|
'preset=p4\nrc=vbr\ncq=23\ng=30\nbf=0\nprofile=high\npix_fmt=nv12'),
|
|
('h264_nvenc', 'Low Power',
|
|
'Faster preset for thermally-constrained NVIDIA hardware.',
|
|
'preset=p1\nrc=vbr\ncq=26\ng=30\nbf=0\nprofile=high\npix_fmt=nv12'),
|
|
|
|
('hevc_nvenc', 'Balanced',
|
|
'1080p HEVC on NVIDIA GPU; sane vbr+cq defaults, no B-frames.',
|
|
'preset=p4\nrc=vbr\ncq=28\ng=30\nbf=0\nprofile=main\npix_fmt=nv12'),
|
|
('hevc_nvenc', 'Low Power',
|
|
'Faster preset for thermally-constrained NVIDIA hardware.',
|
|
'preset=p1\nrc=vbr\ncq=30\ng=30\nbf=0\nprofile=main\npix_fmt=nv12'),
|
|
|
|
('h264_vaapi', 'Balanced',
|
|
'1080p H.264 via VA-API (Intel/AMD/Mesa); no B-frames.',
|
|
'rc_mode=CQP\nqp=24\ng=30\nbf=0\nprofile=high\npix_fmt=nv12'),
|
|
('h264_vaapi', 'Low Power',
|
|
'Lower-quality VA-API encode using the low_power codepath.',
|
|
'rc_mode=CQP\nqp=27\ng=30\nbf=0\nprofile=high\npix_fmt=nv12\nlow_power=1'),
|
|
|
|
('hevc_vaapi', 'Balanced',
|
|
'1080p HEVC via VA-API; no B-frames.',
|
|
'rc_mode=CQP\nqp=27\ng=30\nbf=0\nprofile=main\npix_fmt=nv12'),
|
|
('hevc_vaapi', 'Low Power',
|
|
'Lower-quality HEVC VA-API encode using the low_power codepath.',
|
|
'rc_mode=CQP\nqp=30\ng=30\nbf=0\nprofile=main\npix_fmt=nv12\nlow_power=1');
|
|
|
|
--
|
|
-- Table structure for table `Events`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Events`;
|
|
CREATE TABLE `Events` (
|
|
`Id` bigint unsigned NOT NULL auto_increment,
|
|
`MonitorId` int(10) unsigned NOT NULL default '0',
|
|
`StorageId` smallint(5) unsigned default 0,
|
|
`SecondaryStorageId` smallint(5) unsigned default 0,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Cause` TEXT,
|
|
`StartDateTime` datetime default NULL,
|
|
`EndDateTime` datetime default NULL,
|
|
`Width` smallint(5) unsigned NOT NULL default '0',
|
|
`Height` smallint(5) unsigned NOT NULL default '0',
|
|
`Length` decimal(10,2) NOT NULL default '0.00',
|
|
`Frames` int(10) unsigned default NULL,
|
|
`AlarmFrames` int(10) unsigned default NULL,
|
|
`DefaultVideo` VARCHAR( 64 ) DEFAULT '' NOT NULL,
|
|
`SaveJPEGs` TINYINT,
|
|
`TotScore` int(10) unsigned NOT NULL default '0',
|
|
`AvgScore` smallint(5) unsigned default '0',
|
|
`MaxScore` smallint(5) unsigned default '0',
|
|
`MaxScoreFrameId` int(10) unsigned default NULL,
|
|
`Archived` tinyint(3) unsigned NOT NULL default '0',
|
|
`Videoed` tinyint(3) unsigned NOT NULL default '0',
|
|
`Uploaded` tinyint(3) unsigned NOT NULL default '0',
|
|
`Emailed` tinyint(3) unsigned NOT NULL default '0',
|
|
`Messaged` tinyint(3) unsigned NOT NULL default '0',
|
|
`Executed` tinyint(3) unsigned NOT NULL default '0',
|
|
`Notes` text,
|
|
`StateId` int(10) unsigned NOT NULL,
|
|
`Orientation` enum('ROTATE_0','ROTATE_90','ROTATE_180','ROTATE_270','FLIP_HORI','FLIP_VERT') NOT NULL default 'ROTATE_0',
|
|
`DiskSpace` bigint unsigned default NULL,
|
|
`Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium',
|
|
`Locked` BOOLEAN NOT NULL DEFAULT False,
|
|
`Latitude` DECIMAL(10,8),
|
|
`Longitude` DECIMAL(11,8),
|
|
PRIMARY KEY (`Id`),
|
|
KEY `Events_StorageId_idx` (`StorageId`),
|
|
KEY `Events_StartDateTime_idx` (`StartDateTime`),
|
|
/*
|
|
* The two composite keys below serve the "events overlapping a time window"
|
|
* query that montage review and any DateTime filter term run:
|
|
* MonitorId = m AND StartDateTime <= T2 AND (EndDateTime IS NULL OR EndDateTime >= T1)
|
|
* Two range columns cannot both narrow one B-tree, and the two are mirror
|
|
* images: EndDateTime >= T1 is open-ended upwards, so it is cheap for a
|
|
* window near now and degenerate for an old one; StartDateTime <= T2 is
|
|
* open-ended downwards, so it is the other way round. Keeping both lets the
|
|
* optimiser pick per query.
|
|
* MonitorId leads on the StartDateTime key because it is the equality: once a
|
|
* range column is reached, later columns can no longer narrow the scan. It
|
|
* also stands in for the old MonitorId-only key as a leftmost prefix.
|
|
*/
|
|
KEY `Events_MonitorId_StartDateTime_idx` (`MonitorId`,`StartDateTime`),
|
|
/*
|
|
* EndDateTime leads here so the key also covers zmaudit's hunt for events
|
|
* that were never closed (EndDateTime IS NULL), which has no monitor to scope
|
|
* it. That was the only remaining use of the old (EndDateTime,DiskSpace) key:
|
|
* DiskSpace is set when the event is finalised in C++, so nothing scans for
|
|
* events missing it any more.
|
|
*/
|
|
KEY `Events_EndDateTime_MonitorId_idx` (`EndDateTime`,`MonitorId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
DROP TABLE IF EXISTS `Events_Hour`;
|
|
CREATE TABLE `Events_Hour` (
|
|
`EventId` BIGINT unsigned NOT NULL,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`StartDateTime` datetime default NULL,
|
|
`DiskSpace` bigint default NULL,
|
|
PRIMARY KEY (`EventId`),
|
|
KEY `Events_Hour_MonitorId_idx` (`MonitorId`),
|
|
KEY `Events_Hour_StartDateTime_idx` (`StartDateTime`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
DROP TABLE IF EXISTS `Events_Day`;
|
|
CREATE TABLE `Events_Day` (
|
|
`EventId` BIGINT unsigned NOT NULL,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`StartDateTime` datetime default NULL,
|
|
`DiskSpace` bigint default NULL,
|
|
PRIMARY KEY (`EventId`),
|
|
KEY `Events_Day_MonitorId_idx` (`MonitorId`),
|
|
KEY `Events_Day_StartDateTime_idx` (`StartDateTime`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
DROP TABLE IF EXISTS `Events_Week`;
|
|
CREATE TABLE `Events_Week` (
|
|
`EventId` BIGINT unsigned NOT NULL,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`StartDateTime` datetime default NULL,
|
|
`DiskSpace` bigint default NULL,
|
|
PRIMARY KEY (`EventId`),
|
|
KEY `Events_Week_MonitorId_idx` (`MonitorId`),
|
|
KEY `Events_Week_StartDateTime_idx` (`StartDateTime`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
DROP TABLE IF EXISTS `Events_Month`;
|
|
CREATE TABLE `Events_Month` (
|
|
`EventId` BIGINT unsigned NOT NULL,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`StartDateTime` datetime default NULL,
|
|
`DiskSpace` bigint default NULL,
|
|
PRIMARY KEY (`EventId`),
|
|
KEY `Events_Month_MonitorId_idx` (`MonitorId`),
|
|
KEY `Events_Month_StartDateTime_idx` (`StartDateTime`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
|
|
DROP TABLE IF EXISTS `Events_Archived`;
|
|
CREATE TABLE `Events_Archived` (
|
|
`EventId` BIGINT unsigned NOT NULL,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`DiskSpace` bigint default NULL,
|
|
PRIMARY KEY (`EventId`),
|
|
KEY `Events_Archived_MonitorId_idx` (`MonitorId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
/*
|
|
* Advisory locks over events, used by filters with LockRows set to claim an
|
|
* event before working on it. Deliberately NOT a row lock: claiming is a single
|
|
* autocommitted INSERT touching one row here, so no lock is held while the
|
|
* filter works, and nothing in this table can deadlock against, or block, the
|
|
* writers that touch Events, the Events_* tables and Event_Summaries.
|
|
* No foreign key to Events for the same reason - it would make every event
|
|
* delete take a lock in here. Rows for deleted events are harmless and expire.
|
|
*/
|
|
DROP TABLE IF EXISTS `Events_Lock`;
|
|
CREATE TABLE `Events_Lock` (
|
|
`EventId` BIGINT unsigned NOT NULL,
|
|
`LockedBy` varchar(64) NOT NULL, /* server id and pid of the claiming process */
|
|
`LockedAt` datetime NOT NULL,
|
|
`ExpiresAt` datetime NOT NULL, /* claims expire so a killed filter cannot hold one forever */
|
|
PRIMARY KEY (`EventId`),
|
|
KEY `Events_Lock_ExpiresAt_idx` (`ExpiresAt`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
DROP TABLE IF EXISTS `Event_Data`;
|
|
CREATE TABLE `Event_Data` (
|
|
`Id` BIGINT unsigned NOT NULL auto_increment,
|
|
`EventId` BIGINT unsigned, /* No foreign key for performance */
|
|
`MonitorId` int(10) unsigned, /* No foreign key for performance, can be NULL */
|
|
`FrameId` int(10) unsigned, /* No foriegn key for performance, can by NULL */
|
|
`Timestamp` TIMESTAMP(3),
|
|
`Data` TEXT,
|
|
PRIMARY KEY (`Id`),
|
|
KEY `Event_Data_EventId_FrameId_idx` (`EventId`, `FrameId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Filters`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Filters`;
|
|
CREATE TABLE `Filters` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`UserId` int(10) unsigned,
|
|
`ExecuteInterval` int(10) unsigned NOT NULL default '60',
|
|
`Query_json` text NOT NULL,
|
|
`AutoArchive` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoUnarchive` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoVideo` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoUpload` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoEmail` tinyint(3) unsigned NOT NULL default '0',
|
|
`EmailTo` TEXT,
|
|
`EmailSubject` TEXT,
|
|
`EmailBody` TEXT,
|
|
`EmailServer` TEXT,
|
|
`EmailFormat` enum('Individual','Summary') NOT NULL default 'Individual',
|
|
`AutoMessage` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoExecute` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoExecuteCmd` tinytext,
|
|
`AutoDelete` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoMove` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoMoveTo` smallint(5) unsigned NOT NULL default 0,
|
|
`AutoCopy` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoCopyTo` smallint(5) unsigned NOT NULL default 0,
|
|
`AutoTag` tinyint(3) unsigned NOT NULL default '0',
|
|
`AutoTagId` bigint(20) unsigned NOT NULL default 0,
|
|
`UpdateDiskSpace` tinyint(3) unsigned NOT NULL default '0',
|
|
`Background` tinyint(1) unsigned NOT NULL default '0',
|
|
`Concurrent` tinyint(1) unsigned NOT NULL default '0',
|
|
`LockRows` tinyint(1) unsigned NOT NULL default '0',
|
|
PRIMARY KEY (`Id`),
|
|
KEY `Name` (`Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Frames`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Frames`;
|
|
CREATE TABLE `Frames` (
|
|
`EventId` BIGINT UNSIGNED NOT NULL default '0',
|
|
/* FOREIGN KEY (`EventId`) REFERENCES `Events` (`Id`) ON DELETE CASCADE,*/
|
|
`FrameId` int(10) unsigned NOT NULL default '0',
|
|
`Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal',
|
|
`TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
|
`Delta` decimal(8,2) NOT NULL default '0.00',
|
|
`Score` smallint(5) unsigned NOT NULL default '0',
|
|
/* Peak audio level since the previous row, 0-100 on the same dBFS-derived
|
|
scale as Monitors.AudioThreshold. Recorded whenever the monitor has
|
|
decodable audio, independently of AudioDetection, so a threshold can be
|
|
chosen by looking at the graph. 0 means silence or no audio, which is how
|
|
the event view knows not to draw an audio line. */
|
|
`AudioLevel` tinyint(3) unsigned NOT NULL default '0',
|
|
/* Every query on Frames is anchored on EventId and orders or ranges by
|
|
FrameId within the event, so the clustered key serves them all and keeps
|
|
an event's rows together. Nothing reads Frames by Type or TimeStamp
|
|
without EventId. See zm_update-1.39.27 and zm_update-1.39.36. */
|
|
PRIMARY KEY (`EventId`,`FrameId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Groups`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Groups`;
|
|
CREATE TABLE `Groups` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`ParentId` int(10) unsigned,
|
|
FOREIGN KEY (`ParentId`) REFERENCES `Groups` (`Id`) ON DELETE CASCADE,
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Groups_Monitors`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Groups_Monitors`;
|
|
CREATE TABLE `Groups_Monitors` (
|
|
`Id` INT(10) unsigned NOT NULL auto_increment,
|
|
`GroupId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`GroupId`) REFERENCES `Groups` (`Id`) ON DELETE CASCADE,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`MonitorId`) REFERENCES `Monitors` (`Id`) ON DELETE CASCADE,
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE INDEX `Groups_Monitors_GroupId_idx` ON `Groups_Monitors` (`GroupId`);
|
|
CREATE INDEX `Groups_Monitors_MonitorId_idx` ON `Groups_Monitors` (`MonitorId`);
|
|
|
|
DROP TABLE IF EXISTS `Groups_Permissions`;
|
|
CREATE TABLE `Groups_Permissions` (
|
|
`Id` INT(10) unsigned NOT NULL auto_increment,
|
|
`GroupId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`GroupId`) REFERENCES `Groups` (`Id`) ON DELETE CASCADE,
|
|
`UserId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE,
|
|
`Permission` enum('Inherit', 'None','View','Edit') NOT NULL default 'Inherit',
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE UNIQUE INDEX `Groups_Permissions_GroupId_UserId_idx` ON `Groups_Permissions` (`GroupId`,`UserId`);
|
|
CREATE INDEX `Groups_Permissions_UserId_idx` ON `Groups_Permissions` (`UserId`);
|
|
|
|
DROP TABLE IF EXISTS `Monitors_Permissions`;
|
|
CREATE TABLE `Monitors_Permissions` (
|
|
`Id` INT(10) unsigned NOT NULL auto_increment,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`MonitorId`) REFERENCES `Monitors` (`Id`) ON DELETE CASCADE,
|
|
`UserId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE,
|
|
`Permission` enum('Inherit','None','View','Edit') NOT NULL default 'Inherit',
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE UNIQUE INDEX `Monitors_Permissions_MonitorId_UserId_idx` ON `Monitors_Permissions` (`MonitorId`,`UserId`);
|
|
CREATE INDEX `Monitors_Permissions_UserId_idx` ON `Monitors_Permissions` (`UserId`);
|
|
|
|
--
|
|
-- Table structure for table `Role_Groups_Permissions`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Role_Groups_Permissions`;
|
|
CREATE TABLE `Role_Groups_Permissions` (
|
|
`Id` INT(10) unsigned NOT NULL auto_increment,
|
|
`RoleId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`RoleId`) REFERENCES `User_Roles` (`Id`) ON DELETE CASCADE,
|
|
`GroupId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`GroupId`) REFERENCES `Groups` (`Id`) ON DELETE CASCADE,
|
|
`Permission` enum('Inherit','None','View','Edit') NOT NULL default 'Inherit',
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE UNIQUE INDEX `Role_Groups_Permissions_RoleId_GroupId_idx` ON `Role_Groups_Permissions` (`RoleId`,`GroupId`);
|
|
|
|
--
|
|
-- Table structure for table `Role_Monitors_Permissions`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Role_Monitors_Permissions`;
|
|
CREATE TABLE `Role_Monitors_Permissions` (
|
|
`Id` INT(10) unsigned NOT NULL auto_increment,
|
|
`RoleId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`RoleId`) REFERENCES `User_Roles` (`Id`) ON DELETE CASCADE,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`MonitorId`) REFERENCES `Monitors` (`Id`) ON DELETE CASCADE,
|
|
`Permission` enum('Inherit','None','View','Edit') NOT NULL default 'Inherit',
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE UNIQUE INDEX `Role_Monitors_Permissions_RoleId_MonitorId_idx` ON `Role_Monitors_Permissions` (`RoleId`,`MonitorId`);
|
|
|
|
--
|
|
-- Table structure for table `Logs`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Logs`;
|
|
CREATE TABLE `Logs` (
|
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`TimeKey` decimal(16,6) NOT NULL,
|
|
`Component` varchar(32) NOT NULL,
|
|
`ServerId` int(10) unsigned,
|
|
`Pid` int(10) DEFAULT NULL,
|
|
`Level` tinyint(3) NOT NULL,
|
|
`Code` char(3) NOT NULL,
|
|
`Message` text NOT NULL,
|
|
`File` varchar(255) DEFAULT NULL,
|
|
`Line` smallint(5) unsigned DEFAULT NULL,
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE INDEX `Logs_TimeKey_idx` ON `Logs` (`TimeKey`);
|
|
CREATE INDEX `Logs_Level_idx` ON `Logs` (`Level`);
|
|
CREATE INDEX `Logs_Component_Level_TimeKey_Id_idx` ON `Logs` (`Component`, `Level`, `TimeKey`, `Id`);
|
|
|
|
--
|
|
-- Table structure for table `Manufacturers`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Manufacturers`;
|
|
CREATE TABLE `Manufacturers` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL,
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY (`Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Models`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Models`;
|
|
CREATE TABLE `Models` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL,
|
|
`ManufacturerId` int(10),
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY (`ManufacturerId`,`Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `MonitorPresets`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `MonitorPresets`;
|
|
CREATE TABLE `MonitorPresets` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`ModelId` int unsigned, FOREIGN KEY (`ModelId`) REFERENCES `Models` (Id),
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Type` enum('Local','Remote','File','Ffmpeg','cURL','WebSite','VNC') NOT NULL default 'Local',
|
|
`Device` tinytext,
|
|
`Channel` tinyint(3) unsigned default NULL,
|
|
`Format` int(10) unsigned default NULL,
|
|
`Protocol` varchar(16) default NULL,
|
|
`Method` varchar(16) default NULL,
|
|
`Host` varchar(64) default NULL,
|
|
`Port` varchar(8) default NULL,
|
|
`Path` varchar(255) default NULL,
|
|
`SubPath` varchar(64) default NULL,
|
|
`Width` smallint(5) unsigned default NULL,
|
|
`Height` smallint(5) unsigned default NULL,
|
|
`Palette` int(10) unsigned default NULL,
|
|
`MaxFPS` decimal(5,3) default NULL,
|
|
`Controllable` tinyint(3) unsigned NOT NULL default '0',
|
|
`ControlId` varchar(16) default NULL,
|
|
`ControlDevice` varchar(255) default NULL,
|
|
`ControlAddress` varchar(255) default NULL,
|
|
`DefaultRate` smallint(5) unsigned NOT NULL default '100',
|
|
`DefaultScale` VARCHAR(16) NOT NULL default '0',
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Monitors`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Monitors`;
|
|
CREATE TABLE `Monitors` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Deleted` BOOLEAN NOT NULL default false,
|
|
`Notes` TEXT,
|
|
`ServerId` int(10) unsigned,
|
|
`StorageId` smallint(5) unsigned default 0,
|
|
`ManufacturerId` int unsigned, FOREIGN KEY (`ManufacturerId`) REFERENCES `Manufacturers` (Id),
|
|
`ModelId` int unsigned, FOREIGN KEY (`ModelId`) REFERENCES `Models` (Id),
|
|
`Type` enum('Local','Remote','File','Ffmpeg','cURL','WebSite','VNC') NOT NULL default 'Local',
|
|
`DeviceClass` enum('Camera','Speaker') NOT NULL default 'Camera',
|
|
`Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor',
|
|
`Capturing` enum('None','Ondemand', 'Always') NOT NULL default 'Always',
|
|
`Analysing` enum('None','Always') NOT NULL default 'Always',
|
|
`AnalysisSource` enum('Primary','Secondary') NOT NULL DEFAULT 'Primary',
|
|
`AnalysisImage` enum('FullColour','YChannel') NOT NULL DEFAULT 'FullColour',
|
|
`AnalysisImageOpacity` TINYINT UNSIGNED NOT NULL DEFAULT '128',
|
|
`ObjectDetection` VARCHAR(16) NOT NULL DEFAULT 'none',
|
|
`ObjectDetectionModel` VARCHAR(255) NOT NULL DEFAULT '',
|
|
`ObjectDetectionObjectThreshold` FLOAT NOT NULL DEFAULT 0.4,
|
|
`ObjectDetectionNMSThreshold` FLOAT NOT NULL DEFAULT 0.25,
|
|
`Recording` enum('None', 'OnMotion', 'Always') NOT NULL default 'Always',
|
|
`Enabled` tinyint(3) unsigned NOT NULL default '1',
|
|
`DecodingEnabled` tinyint(3) unsigned NOT NULL default '1',
|
|
`Decoding` enum('None','Ondemand','KeyFrames','KeyFrames+Ondemand', 'Always') NOT NULL default 'Always',
|
|
`WhatDisplay` enum('OnlyVideo','OnlyAudioVisualization','VideoAudioVisualization') NOT NULL default 'OnlyVideo',
|
|
`RTSP2WebEnabled` BOOLEAN NOT NULL default false,
|
|
`RTSP2WebType` enum('HLS','MSE','WebRTC') NOT NULL default 'WebRTC',
|
|
`DefaultPlayer` VARCHAR(64),
|
|
`StreamChannel` enum('Restream','CameraDirectPrimary','CameraDirectSecondary') NOT NULL DEFAULT 'Restream',
|
|
`Go2RTCEnabled` BOOLEAN NOT NULL default false,
|
|
`Go2RTCDisableBackChannel` BOOLEAN NOT NULL DEFAULT true,
|
|
`JanusEnabled` BOOLEAN NOT NULL default false,
|
|
`JanusAudioEnabled` BOOLEAN NOT NULL default false,
|
|
`Janus_Profile_Override` VARCHAR(30) NOT NULL DEFAULT '',
|
|
`Restream` BOOLEAN NOT NULL default false,
|
|
`RTSP_User` INT(10),
|
|
`Janus_RTSP_Session_Timeout` INT(10) NOT NULL DEFAULT '0',
|
|
`LinkedMonitors` varchar(255),
|
|
`Triggers` set('X10') NOT NULL default '',
|
|
`EventStartCommand` VARCHAR(255) NOT NULL DEFAULT '',
|
|
`EventEndCommand` VARCHAR(255) NOT NULL DEFAULT '',
|
|
`ONVIF_URL` VARCHAR(255) NOT NULL DEFAULT '',
|
|
`ONVIF_Events_Path` varchar(20) DEFAULT '/Events' NOT NULL,
|
|
`ONVIF_Username` VARCHAR(64) NOT NULL DEFAULT '',
|
|
`ONVIF_Password` VARCHAR(64) NOT NULL DEFAULT '',
|
|
`ONVIF_Options` VARCHAR(255) NOT NULL DEFAULT '',
|
|
`ONVIF_Event_Listener` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`ONVIF_Event_Tags` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`ONVIF_Alarm_Text` VARCHAR(30) DEFAULT 'MotionAlarm',
|
|
`use_Amcrest_API` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`Device` tinytext NOT NULL default '',
|
|
`Channel` tinyint(3) unsigned NOT NULL default '0',
|
|
`Format` int(10) unsigned NOT NULL default '0',
|
|
`V4LMultiBuffer` tinyint(1) unsigned,
|
|
`V4LCapturesPerFrame` tinyint(3) unsigned,
|
|
`Protocol` varchar(16),
|
|
`Method` varchar(16) default '',
|
|
`Host` varchar(64),
|
|
`Port` varchar(8) NOT NULL default '',
|
|
`SubPath` varchar(64) NOT NULL default '',
|
|
`Path` varchar(255),
|
|
`SecondPath` varchar(255),
|
|
`Options` varchar(255),
|
|
`User` varchar(64),
|
|
`Pass` varchar(64),
|
|
`Width` smallint(5) unsigned NOT NULL default '0',
|
|
`Height` smallint(5) unsigned NOT NULL default '0',
|
|
`Colours` tinyint(3) unsigned NOT NULL default '1',
|
|
`Palette` int(10) unsigned NOT NULL default '0',
|
|
`Orientation` enum('ROTATE_0','ROTATE_90','ROTATE_180','ROTATE_270','FLIP_HORI','FLIP_VERT') NOT NULL default 'ROTATE_0',
|
|
`Deinterlacing` int(10) unsigned NOT NULL default '0',
|
|
`Decoder` varchar(32),
|
|
`DecoderHWAccelName` varchar(64),
|
|
`DecoderHWAccelDevice` varchar(255),
|
|
`SaveJPEGs` TINYINT NOT NULL DEFAULT '3' ,
|
|
`VideoWriter` TINYINT NOT NULL DEFAULT '0',
|
|
`OutputCodec` int(10) unsigned NOT NULL default 0, /* Deprecated */
|
|
`OutputCodecName` varchar(32) NOT NULL default 'auto',
|
|
`Encoder` varchar(32),
|
|
`EncoderHWAccelName` varchar(64),
|
|
`EncoderHWAccelDevice` varchar(255),
|
|
`OutputContainer` enum('auto','mp4','mkv','webm'),
|
|
`EncoderParameters` TEXT,
|
|
`WallClockTimestamps` TINYINT NOT NULL DEFAULT '0',
|
|
`RecordAudio` TINYINT NOT NULL DEFAULT '0',
|
|
`AudioDetection` tinyint(1) unsigned NOT NULL default '0',
|
|
`AudioThreshold` tinyint(3) unsigned NOT NULL default '0',
|
|
`AudioAlarmScore` smallint(5) unsigned NOT NULL default '9',
|
|
`RecordingSource` enum('Primary','Secondary','Both') NOT NULL DEFAULT 'Primary',
|
|
`Brightness` mediumint(7) NOT NULL default '-1',
|
|
`Contrast` mediumint(7) NOT NULL default '-1',
|
|
`Hue` mediumint(7) NOT NULL default '-1',
|
|
`Colour` mediumint(7) NOT NULL default '-1',
|
|
`EventPrefix` varchar(32) NOT NULL default 'Event-',
|
|
`LabelFormat` varchar(64),
|
|
`LabelX` smallint(5) unsigned NOT NULL default '0',
|
|
`LabelY` smallint(5) unsigned NOT NULL default '0',
|
|
`LabelSize` smallint(5) unsigned NOT NULL DEFAULT '1',
|
|
`ImageBufferCount` smallint(5) unsigned NOT NULL default '3',
|
|
`MaxImageBufferCount` smallint(5) unsigned NOT NULL default '0',
|
|
`WarmupCount` smallint(5) unsigned NOT NULL default '0',
|
|
`PreEventCount` smallint(5) unsigned NOT NULL default '10',
|
|
`PostEventCount` smallint(5) unsigned NOT NULL default '10',
|
|
`StreamReplayBuffer` int(10) unsigned NOT NULL default '0',
|
|
`AlarmFrameCount` smallint(5) unsigned NOT NULL default '1',
|
|
`SectionLength` int(10) unsigned NOT NULL default '600',
|
|
`SectionLengthWarn` boolean NOT NULL default true,
|
|
`EventCloseMode` enum('system','time', 'duration', 'idle', 'alarm') NOT NULL DEFAULT 'system',
|
|
`MinSectionLength` int(10) unsigned NOT NULL default '10',
|
|
`MotionFrameSkip` smallint(5) unsigned NOT NULL default '0',
|
|
`AnalysisFPSLimit` decimal(5,2) default NULL,
|
|
`AnalysisUpdateDelay` smallint(5) unsigned NOT NULL default '0',
|
|
`MaxFPS` decimal(5,2) default NULL,
|
|
`AlarmMaxFPS` decimal(5,2) default NULL,
|
|
`FPSReportInterval` smallint(5) unsigned NOT NULL default '250',
|
|
`RefBlendPerc` tinyint(3) unsigned NOT NULL default '6',
|
|
`AlarmRefBlendPerc` tinyint(3) unsigned NOT NULL default '6',
|
|
`Controllable` tinyint(3) unsigned NOT NULL default '0',
|
|
`ControlId` int(10) unsigned,
|
|
`ControlDevice` varchar(255) default NULL,
|
|
`ControlAddress` varchar(255) default NULL,
|
|
`AutoStopTimeout` decimal(5,2) default NULL,
|
|
`TrackMotion` tinyint(3) unsigned NOT NULL default '0',
|
|
`TrackDelay` smallint(5) unsigned,
|
|
`ReturnLocation` tinyint(3) NOT NULL default '-1',
|
|
`ReturnDelay` smallint(5) unsigned,
|
|
`ModectDuringPTZ` tinyint(3) unsigned NOT NULL default '0',
|
|
`DefaultRate` smallint(5) unsigned NOT NULL default '100',
|
|
`DefaultScale` VARCHAR(16) NOT NULL default '0',
|
|
`DefaultCodec` enum('auto','MP4','MJPEG') NOT NULL default 'auto',
|
|
`SignalCheckPoints` INT UNSIGNED NOT NULL default '0',
|
|
`SignalCheckColour` varchar(32) NOT NULL default '#0000BE',
|
|
`WebColour` varchar(32) NOT NULL default 'red',
|
|
`Exif` tinyint(1) unsigned NOT NULL default '0',
|
|
`Sequence` smallint(5) unsigned default NULL,
|
|
`ZoneCount` TINYINT NOT NULL DEFAULT 0,
|
|
`Refresh` int(10) unsigned default NULL,
|
|
`Latitude` DECIMAL(10,8),
|
|
`Longitude` DECIMAL(11,8),
|
|
`RTSPServer` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`RTSPStreamName` varchar(255) NOT NULL default '',
|
|
`SOAP_wsa_compl` BOOLEAN NOT NULL default TRUE,
|
|
`Importance` enum('Normal','Less','Not') NOT NULL default 'Normal',
|
|
`MQTT_Enabled` BOOLEAN NOT NULL DEFAULT false,
|
|
`MQTT_Subscriptions` varchar(255) default '',
|
|
`StartupDelay` INT NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE INDEX `Monitors_ServerId_idx` ON `Monitors` (`ServerId`);
|
|
|
|
DROP TABLE IF EXISTS `Monitor_Status`;
|
|
--
|
|
-- Actions a monitor performs when it alarms. The device acted on is a
|
|
-- monitor in its own right and is usually NOT the monitor that triggered:
|
|
-- a doorbell camera lights its own illuminator but plays a warning through a
|
|
-- separate speaker. TargetMonitorId therefore carries its own foreign key
|
|
-- and may or may not equal MonitorId.
|
|
--
|
|
-- ActionType names a zmcontrol command; whether it is offered for a given
|
|
-- target is decided by that target's Controls row (CanLight,
|
|
-- CanIndicatorLight, CanAudioPlay), so a device can only be asked to do what
|
|
-- it has been measured to do.
|
|
--
|
|
--
|
|
-- Arbitrary commands on a schedule. Written into the same marked block of the
|
|
-- web user's crontab as the scheduled MonitorActions, so cron does the timing
|
|
-- and ZoneMinder needs no daemon of its own for this.
|
|
--
|
|
-- Command runs as the web user, so editing these takes System edit rights and
|
|
-- must pass cronCommandIsValid() on the way in. ServerId NULL means every
|
|
-- server writes it into its own crontab.
|
|
--
|
|
CREATE TABLE `CronJobs` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Enabled` tinyint(1) unsigned NOT NULL default '1',
|
|
`Schedule` varchar(64) NOT NULL default '',
|
|
`Command` text NOT NULL,
|
|
`ServerId` int(10) unsigned default NULL,
|
|
PRIMARY KEY (`Id`),
|
|
KEY `Enabled` (`Enabled`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE `MonitorActions` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`TriggerOn` enum('EventStart','EventEnd','Alarm','AlarmEnd','Manual','Schedule') NOT NULL default 'EventStart',
|
|
/* Five field cron spec, used only when TriggerOn='Schedule'. Written into
|
|
the web user's crontab; validate with cronScheduleIsValid() before it
|
|
gets here. */
|
|
`Schedule` varchar(64) NOT NULL default '',
|
|
`ActionType` enum('LightOn','LightOff','IndicatorLightOn','IndicatorLightOff','AudioPlay','AudioStop') NOT NULL default 'AudioPlay',
|
|
`TargetMonitorId` int(10) unsigned NOT NULL,
|
|
`AudioFile` int(10) unsigned default NULL,
|
|
`Label` varchar(64) NOT NULL default '',
|
|
`Enabled` tinyint(1) unsigned NOT NULL default '1',
|
|
`Sequence` smallint(5) unsigned NOT NULL default '0',
|
|
PRIMARY KEY (`Id`),
|
|
KEY `MonitorId_TriggerOn` (`MonitorId`,`TriggerOn`),
|
|
KEY `TargetMonitorId` (`TargetMonitorId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE `Monitor_Status` (
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`Status` enum('Unknown','NotRunning','Running','Connected','Signal') NOT NULL default 'Unknown',
|
|
`CaptureFPS` DECIMAL(10,2) NOT NULL default 0,
|
|
`AnalysisFPS` DECIMAL(5,2) NOT NULL default 0,
|
|
`CaptureBandwidth` INT NOT NULL default 0,
|
|
`UpdatedOn` TIMESTAMP NOT NULL default CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`MonitorId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
DROP TABLE IF EXISTS `Event_Summaries`;
|
|
CREATE TABLE `Event_Summaries` (
|
|
`MonitorId` int(10) unsigned NOT NULL,
|
|
`TotalEvents` int(10) default NULL,
|
|
`TotalEventDiskSpace` bigint default NULL,
|
|
`HourEvents` int(10) default NULL,
|
|
`HourEventDiskSpace` bigint default NULL,
|
|
`DayEvents` int(10) default NULL,
|
|
`DayEventDiskSpace` bigint default NULL,
|
|
`WeekEvents` int(10) default NULL,
|
|
`WeekEventDiskSpace` bigint default NULL,
|
|
`MonthEvents` int(10) default NULL,
|
|
`MonthEventDiskSpace` bigint default NULL,
|
|
`ArchivedEvents` int(10) default NULL,
|
|
`ArchivedEventDiskSpace` bigint default NULL,
|
|
PRIMARY KEY (`MonitorId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `States`
|
|
-- PP - Added IsActive to track custom run states
|
|
-- Also made sure Name is unique
|
|
|
|
DROP TABLE IF EXISTS `States`;
|
|
CREATE TABLE `States` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Definition` text NOT NULL,
|
|
`IsActive` tinyint(3) unsigned NOT NULL default '0',
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY (`Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
INSERT INTO States (Name,Definition,IsActive) VALUES ('default','','1');
|
|
|
|
|
|
--
|
|
-- Table structure for table `Servers`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Servers`;
|
|
CREATE TABLE `Servers` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Protocol` TEXT,
|
|
`Hostname` TEXT,
|
|
`Port` INTEGER UNSIGNED,
|
|
`PathToIndex` TEXT,
|
|
`PathToZMS` TEXT,
|
|
`PathToApi` TEXT,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`State_Id` int(10) unsigned,
|
|
`Status` enum('Unknown','NotRunning','Running') NOT NULL default 'Unknown',
|
|
`CpuLoad` DECIMAL(5,1) default NULL,
|
|
`CpuUserPercent` DECIMAL(5,1) default NULL,
|
|
`CpuNicePercent` DECIMAL(5,1) default NULL,
|
|
`CpuSystemPercent` DECIMAL(5,1) default NULL,
|
|
`CpuIdlePercent` DECIMAL(5,1) default NULL,
|
|
`CpuUsagePercent` DECIMAL(5,1) default NULL,
|
|
`TotalMem` bigint unsigned default null,
|
|
`FreeMem` bigint unsigned default null,
|
|
`TotalSwap` bigint unsigned default null,
|
|
`FreeSwap` bigint unsigned default null,
|
|
`zmstats` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`zmaudit` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`zmtrigger` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`zmeventnotification` BOOLEAN NOT NULL DEFAULT FALSE,
|
|
`Latitude` DECIMAL(10,8),
|
|
`Longitude` DECIMAL(11,8),
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE INDEX `Servers_Name_idx` ON `Servers` (`Name`);
|
|
|
|
DROP TABLE IF EXISTS `Server_Stats`;
|
|
CREATE TABLE `Server_Stats` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`ServerId` int(10) unsigned,
|
|
`TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
|
`CpuLoad` DECIMAL(5,1) default NULL,
|
|
`CpuUserPercent` DECIMAL(5,1) default NULL,
|
|
`CpuNicePercent` DECIMAL(5,1) default NULL,
|
|
`CpuSystemPercent` DECIMAL(5,1) default NULL,
|
|
`CpuIdlePercent` DECIMAL(5,1) default NULL,
|
|
`CpuUsagePercent` DECIMAL(5,1) default NULL,
|
|
`TotalMem` bigint unsigned default null,
|
|
`FreeMem` bigint unsigned default null,
|
|
`TotalSwap` bigint unsigned default null,
|
|
`FreeSwap` bigint unsigned default null,
|
|
PRIMARY KEY (Id)
|
|
);
|
|
|
|
CREATE INDEX `Server_Stats_TimeStamp_idx` ON `Server_Stats` (`TimeStamp`);
|
|
CREATE INDEX `Server_Stats_ServerId_idx` ON `Server_Stats` (`ServerId`, `TimeStamp`);
|
|
|
|
--
|
|
-- Table structure for table `Stats`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Stats`;
|
|
CREATE TABLE `Stats` (
|
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`MonitorId` int(10) unsigned NOT NULL default '0',
|
|
/* FOREIGN KEY (`MonitorId`) REFERENCES `Monitors` (`Id`) ON DELETE CASCADE, */
|
|
`ZoneId` int(10) unsigned NOT NULL default '0',
|
|
/* FOREIGN KEY (`ZoneId`) REFERENCES `Zones` (`Id`) ON DELETE CASCADE, */
|
|
`EventId` BIGINT UNSIGNED NOT NULL,
|
|
/* FOREIGN KEY (`EventId`) REFERENCES `Events` (`Id`) ON DELETE CASCADE, */
|
|
`FrameId` int(10) unsigned NOT NULL default '0',
|
|
`PixelDiff` tinyint(3) unsigned NOT NULL default '0',
|
|
`AlarmPixels` int(10) unsigned NOT NULL default '0',
|
|
`FilterPixels` int(10) unsigned NOT NULL default '0',
|
|
`BlobPixels` int(10) unsigned NOT NULL default '0',
|
|
`Blobs` smallint(5) unsigned NOT NULL default '0',
|
|
`MinBlobSize` int(10) unsigned NOT NULL default '0',
|
|
`MaxBlobSize` int(10) unsigned NOT NULL default '0',
|
|
`MinX` smallint(5) unsigned NOT NULL default '0',
|
|
`MaxX` smallint(5) unsigned NOT NULL default '0',
|
|
`MinY` smallint(5) unsigned NOT NULL default '0',
|
|
`MaxY` smallint(5) unsigned NOT NULL default '0',
|
|
`Score` smallint(5) unsigned NOT NULL default '0',
|
|
PRIMARY KEY (`Id`),
|
|
KEY `EventId_ZoneId` (`EventId`, `ZoneId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `TriggersX10`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `TriggersX10`;
|
|
CREATE TABLE `TriggersX10` (
|
|
`MonitorId` int(10) unsigned NOT NULL default '0',
|
|
`Activation` varchar(32) default NULL,
|
|
`AlarmInput` varchar(32) default NULL,
|
|
`AlarmOutput` varchar(32) default NULL,
|
|
PRIMARY KEY (`MonitorId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `User_Roles`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `User_Roles`;
|
|
CREATE TABLE `User_Roles` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Description` text,
|
|
`Stream` enum('None','View') NOT NULL default 'None',
|
|
`Events` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Control` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Monitors` enum('None','View','Edit','Create') NOT NULL default 'None',
|
|
`Groups` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Devices` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Snapshots` enum('None','View','Edit') NOT NULL default 'None',
|
|
`System` enum('None','View','Edit') NOT NULL default 'None',
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY `UC_Name` (`Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Users`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Users`;
|
|
CREATE TABLE `Users` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Username` varchar(64) character set latin1 collate latin1_bin NOT NULL default '',
|
|
`Password` varchar(64) NOT NULL default '',
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Email` varchar(64) NOT NULL default '',
|
|
`Phone` varchar(64) NOT NULL default '',/* Space for 2 numbers, country codes, etc */
|
|
`Language` varchar(16),
|
|
`Enabled` tinyint(3) unsigned NOT NULL default '1',
|
|
`Stream` enum('None','View') NOT NULL default 'None',
|
|
`Events` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Control` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Monitors` enum('None','View','Edit','Create') NOT NULL default 'None',
|
|
`Groups` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Devices` enum('None','View','Edit') NOT NULL default 'None',
|
|
`Snapshots` enum('None','View','Edit') NOT NULL default 'None',
|
|
`System` enum('None','View','Edit') NOT NULL default 'None',
|
|
`MaxBandwidth` varchar(16),
|
|
`TokenMinExpiry` BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
|
`APIEnabled` tinyint(3) UNSIGNED NOT NULL default 1,
|
|
`HomeView` varchar(64) NOT NULL DEFAULT '',
|
|
`RoleId` int(10) unsigned DEFAULT NULL,
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY `UC_Username` (`Username`),
|
|
FOREIGN KEY (`RoleId`) REFERENCES `User_Roles` (`Id`) ON DELETE SET NULL
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
source @PKGDATADIR@/db/User_Preferences.sql
|
|
|
|
--
|
|
-- Table structure for table `ZonePresets`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `ZonePresets`;
|
|
CREATE TABLE `ZonePresets` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive','Privacy') NOT NULL default 'Active',
|
|
`Units` enum('Pixels','Percent') NOT NULL default 'Percent',
|
|
`CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs',
|
|
`MinPixelThreshold` smallint(5) unsigned default NULL,
|
|
`MaxPixelThreshold` smallint(5) unsigned default NULL,
|
|
`MinAlarmPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MaxAlarmPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`FilterX` tinyint(3) unsigned default NULL,
|
|
`FilterY` tinyint(3) unsigned default NULL,
|
|
`MinFilterPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MaxFilterPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MinBlobPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MaxBlobPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MinBlobs` smallint(5) unsigned default NULL,
|
|
`MaxBlobs` smallint(5) unsigned default NULL,
|
|
`OverloadFrames` smallint(5) unsigned NOT NULL default '0',
|
|
`ExtendAlarmFrames` smallint(5) unsigned not null default 0,
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Zones`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Zones`;
|
|
CREATE TABLE `Zones` (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`MonitorId` int(10) unsigned NOT NULL default '0',
|
|
FOREIGN KEY (`MonitorId`) REFERENCES `Monitors` (`Id`) ON DELETE CASCADE,
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive','Privacy') NOT NULL default 'Active',
|
|
`Units` enum('Pixels','Percent') NOT NULL default 'Percent',
|
|
`NumCoords` tinyint(3) unsigned NOT NULL default '0',
|
|
`Coords` text NOT NULL,
|
|
`Area` int(10) unsigned NOT NULL default '0',
|
|
`AlarmRGB` int(10) unsigned default '0',
|
|
`CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs',
|
|
`MinPixelThreshold` smallint(5) unsigned default NULL,
|
|
`MaxPixelThreshold` smallint(5) unsigned default NULL,
|
|
`MinAlarmPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MaxAlarmPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`FilterX` tinyint(3) unsigned default NULL,
|
|
`FilterY` tinyint(3) unsigned default NULL,
|
|
`MinFilterPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MaxFilterPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MinBlobPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MaxBlobPixels` DECIMAL(10,2) unsigned default NULL,
|
|
`MinBlobs` smallint(5) unsigned default NULL,
|
|
`MaxBlobs` smallint(5) unsigned default NULL,
|
|
`OverloadFrames` smallint(5) unsigned NOT NULL default '0',
|
|
`ExtendAlarmFrames` smallint(5) unsigned not null default 0,
|
|
`ObjectCoords` varchar(64) default NULL,
|
|
PRIMARY KEY (`Id`),
|
|
KEY `MonitorId` (`MonitorId`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
DROP TABLE IF EXISTS `Storage`;
|
|
CREATE TABLE `Storage` (
|
|
`Id` smallint(5) unsigned NOT NULL auto_increment,
|
|
`Path` varchar(64) NOT NULL default '',
|
|
`Name` varchar(64) NOT NULL default '',
|
|
`Type` enum('local','s3fs') NOT NULL default 'local',
|
|
`Url` varchar(255) default NULL,
|
|
`DiskSpace` bigint default NULL,
|
|
`Scheme` enum('Deep','Medium','Shallow') NOT NULL default 'Medium',
|
|
`ServerId` int(10) unsigned,
|
|
`DoDelete` BOOLEAN NOT NULL DEFAULT true,
|
|
`Enabled` BOOLEAN NOT NULL DEFAULT true,
|
|
PRIMARY KEY (`Id`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Create a default storage location
|
|
--
|
|
insert into Storage VALUES (NULL, '@ZM_DIR_EVENTS@', 'Default', 'local', NULL, NULL, 'Medium', 0, true, true );
|
|
|
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
--
|
|
-- Initial data to be loaded into ZoneMinder database
|
|
--
|
|
|
|
--
|
|
-- Create a default admin user.
|
|
--
|
|
INSERT INTO `Users` (
|
|
`Username`,
|
|
`Password`,
|
|
`Language`,
|
|
`Enabled`,
|
|
`Stream`,
|
|
`Events`,
|
|
`Control`,
|
|
`Monitors`,
|
|
`Groups`,
|
|
`Devices`,
|
|
`Snapshots`,
|
|
`System`,
|
|
`MaxBandwidth`,
|
|
`TokenMinExpiry`,
|
|
`APIEnabled`,
|
|
`HomeView`
|
|
) VALUES (
|
|
'admin',
|
|
'$2b$12$NHZsm6AM2f2LQVROriz79ul3D6DnmFiZC.ZK5eqbF.ZWfwH9bqUJ6',
|
|
'' /* Language */,
|
|
1 /* Enabled */,
|
|
'View' /* Stream */,
|
|
'Edit' /* Events */,
|
|
'Edit' /* Control */,
|
|
'Create' /* Monitors */,
|
|
'Edit' /* Groups */,
|
|
'Edit' /* Devices */,
|
|
'Edit' /* Snapshots */,
|
|
'Edit' /* System */,
|
|
'' /* Max Bandwidth */,
|
|
0 /* TokenMinExpiry */,
|
|
1 /* Api Endabled */,
|
|
'' /* Homeview */);
|
|
|
|
--
|
|
-- Add a sample filter to purge the oldest 100 events when the disk is 95% full
|
|
--
|
|
|
|
INSERT INTO `Filters`
|
|
(
|
|
`Name`,
|
|
`Query_json`,
|
|
`AutoArchive`,
|
|
`AutoVideo`,
|
|
`AutoUpload`,
|
|
`AutoEmail`,
|
|
`EmailTo`,
|
|
`EmailSubject`,
|
|
`EmailBody`,
|
|
`AutoMessage`,
|
|
`AutoExecute`,
|
|
`AutoExecuteCmd`,
|
|
`AutoDelete`,
|
|
`AutoMove`,
|
|
`AutoMoveTo`,
|
|
`AutoCopy`,
|
|
`AutoCopyTo`,
|
|
`UpdateDiskSpace`,
|
|
`UserId`,
|
|
`Background`,
|
|
`Concurrent`
|
|
)
|
|
VALUES
|
|
(
|
|
'PurgeWhenFull',
|
|
'{"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="},{"cnj":"and","obr":"0","attr":"EndDateTime","op":"IS NOT","val":"NULL","cbr":"0"}],"limit":100,"sort_asc":1}',
|
|
0/*AutoArchive*/,
|
|
0/*AutoVideo*/,
|
|
0/*AutoUpload*/,
|
|
0/*AutoEmail*/,
|
|
''/*EmailTo*/,
|
|
''/*EmailSubject*/,
|
|
''/*EmailBody*/,
|
|
0/*AutoMessage*/,
|
|
0/*AutoExecute*/,'',
|
|
1/*AutoDelete*/,
|
|
0/*AutoMove*/,0/*MoveTo*/,
|
|
0/*AutoCopy*/,0/*CopyTo*/,
|
|
0/*UpdateDiskSpace*/,
|
|
1/*UserId = admin*/,
|
|
1/*Background*/,
|
|
0/*Concurrent*/
|
|
);
|
|
|
|
--
|
|
-- Add in some sample control protocol definitions
|
|
--
|
|
source @PKGDATADIR@/db/controls.sql
|
|
|
|
--
|
|
-- Add some monitor preset values
|
|
--
|
|
|
|
INSERT into MonitorPresets VALUES (NULL,NULL,'Amcrest, IP8M-T2499EW 640x480, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp','NULL',554,'rtsp://<username>:<password>@<ip-address>/cam/realmonitor?channel=1&subtype=1',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT into MonitorPresets VALUES (NULL,NULL,'Amcrest, IP8M-T2499EW 3840x2160, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp','NULL',554,'rtsp://<username>:<password>@<ip-address>/cam/realmonitor?channel=1&subtype=0',NULL,3840,2160,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 320x240, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 320x240, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 320x240, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 640x480, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 640x480, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 640x480, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 320x240, mpjpeg, B&W','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&color=0',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP, 640x480, mpjpeg, B&W','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&color=0',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 320x240, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240',NULL,320,240,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 320x240, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=320x240&req_fps=5',NULL,320,240,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 320x240, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=320x240',NULL,320,240,3,5.0,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 640x480, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480',NULL,640,480,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 640x480, mpjpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=5',NULL,640,480,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 640x480, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/axis-cgi/jpg/image.cgi?resolution=640x480',NULL,640,480,3,5.0,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Axis API v2'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT into MonitorPresets VALUES (NULL,NULL,'Axis IP, mpeg4, unicast','Remote','rtsp',0,255,'rtsp','rtpUni','<ip-address>',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT into MonitorPresets VALUES (NULL,NULL,'Axis IP, mpeg4, multicast','Remote','rtsp',0,255,'rtsp','rtpMulti','<ip-address>',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT into MonitorPresets VALUES (NULL,NULL,'Axis IP, mpeg4, RTP/RTSP','Remote','rtsp',0,255,'rtsp','rtpRtsp','<ip-address>',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT into MonitorPresets VALUES (NULL,NULL,'Axis IP, mpeg4, RTP/RTSP/HTTP','Remote',NULL,NULL,NULL,'rtsp','rtpRtspHttp','<ip-address>',554,'/mpeg4/media.amp','/trackID=',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'D-link DCS-930L, 640x480, mjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/mjpeg.cgi',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'D-Link DCS-5020L, 640x480, mjpeg','Remote','http',0,0,'http','simple','<username>:<pwd>@<ip-address>','80','/video.cgi',NULL,640,480,0,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='D-Link DCS-5020L'),NULL,'<username>:<pwd>@<ip-address>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP, 320x240, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP, 320x240, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP, 640x480, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP, 640x480, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP PTZ, 320x240, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/nphMotionJpeg?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Panasonic IP'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP PTZ, 320x240, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Panasonic IP'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP PTZ, 320x240, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=320x240&Quality=Standard',NULL,320,240,3,5.0,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Panasonic IP'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP PTZ, 640x480, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/nphMotionJpeg?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Panasonic IP'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP PTZ, 640x480, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Panasonic IP'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Panasonic IP PTZ, 640x480, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/SnapshotJPEG?Resolution=640x480&Quality=Standard',NULL,640,480,3,5.0,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Panasonic IP'),NULL,'<ip-address>:<port>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Gadspot IP, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Gadspot IP, jpeg, max 5 FPS','Remote','http',0,0,'http','simple','<ip-address>',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Gadspot IP, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/GetData.cgi',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Gadspot IP, mpjpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'IP Webcam by Pavel Khlebovich 1920x1080','Remote','/dev/video<?>','0',255,'http','simple','<ip-address>','8080','/video','',1920,1080,0,NULL,0,'0','','',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'VEO Observer, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/Jpeg/CamImg.jpg',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Blue Net Video Server, jpeg','Remote','http',0,0,'http','simple','<ip-address>',80,'/cgi-bin/image.cgi?control=0&id=admin&passwd=admin',NULL,320,240,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT into MonitorPresets VALUES (NULL,NULL,'ACTi IP, mpeg4, unicast','Remote',NULL,NULL,NULL,'rtsp','rtpUni','<ip-address>',7070,'','/track',NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'rtsp://<host/address>/axis-media/media.amp?videocodec=h264',NULL,640,480,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Vivotek FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'rtsp://<host/address>:554/live.sdp',NULL,352,240,NULL,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Axis FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'rtsp://<host/address>/axis-media/media.amp',NULL,640,480,NULL,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'ACTi TCM FFMPEG','Ffmpeg',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'rtsp://admin:123456@<host/address>:7070',NULL,320,240,NULL,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), PAL, 320x240','Local','/dev/video<?>',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), PAL, 320x240, max 5 FPS','Local','/dev/video<?>',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), PAL, 640x480','Local','/dev/video<?>',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), PAL, 640x480, max 5 FPS','Local','/dev/video<?>',0,255,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), NTSC, 320x240','Local','/dev/video<?>',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), NTSC, 320x240, max 5 FPS','Local','/dev/video<?>',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,320,240,1345466932,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), NTSC, 640x480','Local','/dev/video<?>',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L2), NTSC, 640x480, max 5 FPS','Local','/dev/video<?>',0,45056,NULL,'v4l2',NULL,NULL,NULL,NULL,640,480,1345466932,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), PAL, 320x240','Local','/dev/video<?>',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), PAL, 320x240, max 5 FPS','Local','/dev/video<?>',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), PAL, 640x480','Local','/dev/video<?>',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), PAL, 640x480, max 5 FPS','Local','/dev/video<?>',0,0,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), NTSC, 320x240','Local','/dev/video<?>',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), NTSC, 320x240, max 5 FPS','Local','/dev/video<?>',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,320,240,13,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), NTSC, 640x480','Local','/dev/video<?>',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'BTTV Video (V4L1), NTSC, 640x480, max 5 FPS','Local','/dev/video<?>',0,1,NULL,'v4l1',NULL,NULL,NULL,NULL,640,480,13,5.0,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Remote ZoneMinder','Remote',NULL,NULL,NULL,'http','simple','<ip-address>',80,'/cgi-bin/nph-zms?mode=jpeg&monitor=<monitor-id>&scale=100&maxfps=5&buffer=0',NULL,NULL,NULL,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Foscam FI8620 FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://<username>:<pwd>@<ip-address>:554/11',NULL,704,576,0,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Foscam FI8620'),'<admin_pwd>','<ip-address>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Foscam FI8608W FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://<username>:<pwd>@<ip-address>:554/11',NULL,640,480,0,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Foscam FI8608W'),'<admin_pwd>','<ip-address>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Foscam FI9821W FFMPEG H.264','Ffmpeg',NULL,NULL,NULL,NULL,'','','','rtsp://<username>:<pwd>@<ip-address>:88/videoMain',NULL,1280,720,0,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Foscam FI9821W'),'<admin_pwd>','<ip-address>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Loftek Sentinel PTZ, 640x480, mjpeg','Remote','http',0,0,NULL,NULL,'<ip-address>','80','/videostream.cgi?user=<username>&pwd=<password>&resolution=32&rate=11',NULL,640,480,4,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='Loftek Sentinel'),'','<username>:<pwd>@<ip-address>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Airlink 777W PTZ, 640x480, mjpeg','Remote','http',0,0,NULL,NULL,'<username>:<password>@<ip-address>','80','/cgi/mjpg/mjpg.cgi',NULL,640,480,4,NULL,1,(SELECT `Id` FROM `Controls` WHERE `Name`='AirLink SkyIPCam 7xx'),'','<username>:<pwd>@<ip-address>',100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'SunEyes SP-P1802SWPTZ','Ffmpeg','/dev/video<?>','0',255,'','rtpMulti','','80','rtsp://<ip-address>:554/11','',1920,1080,0,0.00,1,(SELECT `Id` FROM `Controls` WHERE `Name`='SunEyes SP-P1802SWPTZ'),'-speed=64','<ip-address>:<port>',100,33);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Qihan IP, 1280x720, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp',NULL,554,'rtsp://<ip-address>/tcp_live/ch0_0',NULL,1280,720,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
INSERT INTO MonitorPresets VALUES (NULL,NULL,'Qihan IP, 1920x1080, RTP/RTSP','Ffmpeg','rtsp',0,255,'rtsp','rtpRtsp',NULL,554,'rtsp://<ip-address>/tcp_live/ch0_0',NULL,1920,1080,3,NULL,0,NULL,NULL,NULL,100,100);
|
|
|
|
--
|
|
-- Add some zone preset values
|
|
--
|
|
INSERT INTO ZonePresets VALUES (1,'Default','Active','Percent','Blobs',25,NULL,0.5,75,3,3,0.35,75,0.3,NULL,1,NULL,0,0);
|
|
INSERT INTO ZonePresets VALUES (2,'Fast, low sensitivity','Active','Percent','AlarmedPixels',60,NULL,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0);
|
|
INSERT INTO ZonePresets VALUES (3,'Fast, medium sensitivity','Active','Percent','AlarmedPixels',40,NULL,0.5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0);
|
|
INSERT INTO ZonePresets VALUES (4,'Fast, high sensitivity','Active','Percent','AlarmedPixels',20,NULL,0.1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0);
|
|
INSERT INTO ZonePresets VALUES (5,'Best, low sensitivity','Active','Percent','Blobs',60,NULL,5,NULL,7,7,3.5,NULL,3,NULL,1,NULL,0,0);
|
|
INSERT INTO ZonePresets VALUES (6,'Best, medium sensitivity','Active','Percent','Blobs',40,NULL,1,NULL,5,5,0.7,NULL,0.6,NULL,1,NULL,0,0);
|
|
INSERT INTO ZonePresets VALUES (7,'Best, high sensitivity','Active','Percent','Blobs',20,NULL,0.2,NULL,3,3,0.14,NULL,0.12,NULL,1,NULL,0,0);
|
|
|
|
DROP TABLE IF EXISTS Maps;
|
|
|
|
CREATE TABLE Maps (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` VARCHAR(64) NOT NULL,
|
|
`Filename` VARCHAR(64) NOT NULL default '',
|
|
`NumCoords` tinyint(3) unsigned NOT NULL default '0',
|
|
`Coords` text NOT NULL,
|
|
`ParentId` int(1) unsigned,
|
|
PRIMARY KEY (`Id`)
|
|
);
|
|
|
|
DROP TABLE IF EXISTS MontageLayouts;
|
|
|
|
CREATE TABLE MontageLayouts (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` TEXT NOT NULL,
|
|
`UserId` int(10) UNSIGNED NOT NULL default 0,
|
|
`Positions` LONGTEXT,
|
|
/*`Positions` JSON,*/
|
|
PRIMARY KEY (`Id`)
|
|
);
|
|
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('Auto', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('1 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('2 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('3 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('4 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('6 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('8 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('12 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('16 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('24 Wide', NULL );
|
|
INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('48 Wide', NULL );
|
|
|
|
CREATE TABLE Sessions (
|
|
id char(32) not null,
|
|
access INT(10) UNSIGNED DEFAULT NULL,
|
|
data text,
|
|
PRIMARY KEY(id),
|
|
KEY `Sessions_access_idx` (`access`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE Snapshots (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`Name` VARCHAR(64),
|
|
`Description` TEXT,
|
|
`CreatedBy` int(10),
|
|
`CreatedOn` datetime default NULL,
|
|
PRIMARY KEY(Id)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE Snapshots_Events (
|
|
`Id` int(10) unsigned NOT NULL auto_increment,
|
|
`SnapshotId` int(10) unsigned NOT NULL,
|
|
FOREIGN KEY (`SnapshotId`) REFERENCES `Snapshots` (`Id`) ON DELETE CASCADE,
|
|
`EventId` bigint unsigned NOT NULL,
|
|
FOREIGN KEY (`EventId`) REFERENCES `Events` (`Id`) ON DELETE CASCADE,
|
|
KEY `Snapshots_Events_SnapshotId_idx` (`SnapshotId`),
|
|
PRIMARY KEY(Id)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE Reports (
|
|
Id INT(10) UNSIGNED auto_increment,
|
|
Name varchar(30),
|
|
FilterId int(10) UNSIGNED,
|
|
`StartDateTime` datetime default NULL,
|
|
`EndDateTime` datetime default NULL,
|
|
`Interval` INT(10) UNSIGNED,
|
|
`CreatedBy` int(10) unsigned,
|
|
PRIMARY KEY(Id)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE `Tags` (
|
|
`Id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
`Name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
|
|
`CreateDate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
`CreatedBy` int(10) unsigned,
|
|
`LastAssignedDate` dateTime,
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE(`Name`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE `Events_Tags` (
|
|
`TagId` bigint(20) unsigned NOT NULL,
|
|
`EventId` bigint(20) unsigned NOT NULL,
|
|
`AssignedDate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
`AssignedBy` int(10) unsigned,
|
|
PRIMARY KEY (`TagId`, `EventId`),
|
|
CONSTRAINT `Events_Tags_ibfk_1` FOREIGN KEY (`TagId`) REFERENCES `Tags` (`Id`) ON DELETE CASCADE,
|
|
CONSTRAINT `Events_Tags_ibfk_2` FOREIGN KEY (`EventId`) REFERENCES `Events` (`Id`) ON DELETE CASCADE
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
CREATE TABLE `Notifications` (
|
|
`Id` int unsigned NOT NULL AUTO_INCREMENT,
|
|
`UserId` int unsigned DEFAULT NULL,
|
|
`Token` varchar(512) NOT NULL,
|
|
`Platform` enum('android','ios','web') NOT NULL,
|
|
`MonitorList` text DEFAULT NULL,
|
|
`Interval` int unsigned NOT NULL DEFAULT 0,
|
|
`PushState` enum('enabled','disabled') NOT NULL DEFAULT 'enabled',
|
|
`AppVersion` varchar(32) DEFAULT NULL,
|
|
`Profile` varchar(128) DEFAULT NULL,
|
|
`BadgeCount` int NOT NULL DEFAULT 0,
|
|
`LastNotifiedAt` datetime DEFAULT NULL,
|
|
`CreatedOn` datetime DEFAULT NULL,
|
|
`UpdatedOn` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY `Notifications_Token_idx` (`Token`),
|
|
KEY `Notifications_UserId_idx` (`UserId`),
|
|
CONSTRAINT `Notifications_ibfk_1` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
--
|
|
-- Table structure for table `Menu_Items`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `Menu_Items`;
|
|
CREATE TABLE `Menu_Items` (
|
|
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`MenuKey` varchar(32) NOT NULL,
|
|
`Enabled` tinyint(1) NOT NULL DEFAULT 1,
|
|
`Label` varchar(64) DEFAULT NULL,
|
|
`SortOrder` smallint NOT NULL DEFAULT 0,
|
|
`Icon` varchar(128) DEFAULT NULL,
|
|
`IconType` enum('material','fontawesome','image','none') NOT NULL DEFAULT 'material',
|
|
`Link` varchar(255) DEFAULT NULL,
|
|
PRIMARY KEY (`Id`),
|
|
UNIQUE KEY `Menu_Items_MenuKey_idx` (`MenuKey`)
|
|
) ENGINE=@ZM_MYSQL_ENGINE@;
|
|
|
|
INSERT INTO `Menu_Items` (`MenuKey`, `Enabled`, `SortOrder`) VALUES
|
|
('Console', 1, 10),
|
|
('Watch', 1, 15),
|
|
('Montage', 1, 20),
|
|
('MontageReview', 1, 30),
|
|
('Events', 1, 40),
|
|
('Options', 1, 50),
|
|
('Log', 1, 60),
|
|
('Devices', 1, 70),
|
|
('IntelGpu', 1, 80),
|
|
('Groups', 1, 90),
|
|
('Filters', 1, 100),
|
|
('Snapshots', 1, 110),
|
|
('Reports', 1, 120),
|
|
('ReportEventAudit', 1, 130),
|
|
('Map', 1, 140);
|
|
|
|
source @PKGDATADIR@/db/Object_Types.sql
|
|
-- We generally don't alter triggers, we drop and re-create them, so let's keep them in a separate file that we can just source in update scripts.
|
|
source @PKGDATADIR@/db/triggers.sql
|
|
|
|
source @PKGDATADIR@/db/manufacturers.sql
|
|
source @PKGDATADIR@/db/models.sql
|
|
|
|
-- AI object-detection data model: tables then the COCO 2017 seed, then the
|
|
-- classes cameras report themselves.
|
|
source @PKGDATADIR@/db/AI_Models.sql
|
|
source @PKGDATADIR@/db/coco_dataset.sql
|
|
source @PKGDATADIR@/db/camera_classes.sql
|
|
--
|
|
-- Apply the initial configuration
|
|
--
|
|
-- This section is autogenerated by zmconfgen.pl
|
|
-- Do not edit this file as any changes will be overwritten
|
|
--
|