Senstar Symphony 8 SDK Developer Guide en-US
Senstar Symphony 8 SDK Developer Guide en-US
8.x
Developer Guide
Contents
Contents
Introduction......................................................................................................................................3
Quick start............................................................................................................................. 3
Requirements and recommendations................................................................................... 3
Portability...............................................................................................................................3
Sample code................................................................................................................................... 5
Managed libraries........................................................................................................................... 9
Media-streaming libraries..............................................................................................................10
Persistence....................................................................................................................................11
Get an image................................................................................................................................ 14
Decoration options.............................................................................................................. 14
Activate a relay............................................................................................................................. 15
Legal information.......................................................................................................................... 23
Introduction
The Senstar Symphony SDK provides sample code that helps you to build applications to extend the
functionality of and integrate third-party products with the Senstar Symphony Server.
The Senstar Symphony Client uses these same methods to ensure quality and feature completeness.
Sample applications are included for a wide variety of use cases. Reference documentation is provided in
<SDK>/Documentation/readme.html.
Note: You might need to restart Senstar Symphony services before a Senstar Symphony SDK
application works correctly.
Quick start
5. Run LiveStreamTest.exe in the Senstar Symphony SDK to see live video from the Senstar
Symphony Server.
Portability
It is possible to integrate live video from the Senstar Symphony Server directly to non-Windows platforms
using GStreamer and the RESTful Senstar Symphony Mobile Bridge interface.
The portable Senstar Symphony Mobile Bridge interface is not as full featured as the Windows accessible
SeerWS interface. If you need functionality in SeerWS from non Windows platforms, then you must
develop your own layer that provides this interface. Ported implementations of .NET will work (such
as Mono), but the referenced .NET libraries link to Windows style DLLs that require deeper platform
equivalence.
Sample code
Video
Use cases SDK projects
Get a list of cameras LiveStreamTest
FarmTest
PTZ cameras
Use cases SDK projects
Control PTZ on a video device LiveStreamTest
FarmTest
Events
Use cases SDK projects
Trigger an alarm AddAlarmToCamera
FarmTest
Farm settings
Use cases SDK projects
Retrieve farm settings WebService
Recording
Use cases SDK projects
Start/stop recording LiveStreamTest
FarmTest
Reports
Use cases SDK projects
Get a heatmap GetDensityImageJpg
Security
Use cases SDK projects
Change the currently active security profile SetActiveProfile
Video analytics
Use cases SDK projects
Get live XML metadata from a running analytics XMLStream
engine
Timeline
Use cases SDK projects
Get timeline information TimelineGetter
Navigation
Use cases SDK projects
Use navigation buttons to control video FarmTest
DIO rules
Use cases SDK projects
Import/export DIO rules from/to a CSV file AddDIORulesFromCSV
ExportDIORulesToCSV
Hardware devices
Use cases SDK projects
Get a list of all hardware devices PSA
Camera usage
Use cases SDK projects
View camera-use information ClientBandwidth
Managed libraries
Component Description
Seer.Connectivity.dll • Library for connecting to the Senstar Symphony Server (usually
used indirectly by samples)
The following managed libraries are dependencies of the above libraries and likely do not need to be used
by your code directly. However, you might need to add them as references to your project. If they do need
to be added, the compiler will fail with a message stating what reference needs to be added.
• Seer.Common.dll
• DeviceModel.Dio.dll
• DeviceModel.Security.dll
• Farm.Security.dll
• SecurityLib.dll
Media-streaming libraries
Component Description
AxVideoRecvCtrl • ActiveX control that supports the Dispatch interface
• Can be used by simple applications such as VB or Web-based
applications
OCXDll.dll • Library that allows users ti dynamically create, use, and destroy
AxVideoRecvCtrl
Persistence
Files
Files Description
_FootageArchive (*.dat) • Video
• Audio
• Overlays (decorations)
Database
Data Description
Settings • Most settings (except users, groups, and
servers)
You can use Dbupdater.exe from the command line to run SQL against the database.
Get an image
You can use the Senstar Symphony SDK to get a JPEG image from a project.
1. Use the GetJPEG command to generate a JPEG image and return its URL.
2. Use the GetJPEGImage command to get the byte array of a JPEG image for a specific time and camera.
3. Use the GetJPEGImage3 command to extend the GetJPEGImage command and add parameters for the
decorations.
4. Use the GetJPEGImage4 command to extend the GetJPEGImage3 command and add parameters for the
font used on the image.
Decoration options
The following parameters determine the decorations that JPEG images include.
// True for 24 hour time format. False for 12 hour time format.
_in24HourNotation = in24HourNotation;
Activate a relay
To activate or deactivate a relay, call the following Web service method:
To run a batch file on the Senstar Symphony Server, pass the following command to the DB Updater utility:
dbupdater "declare @xml xml, @cameraId int, @tourName varchar(250), @disabled int;
set @cameraId = 3;
set @tourName = 'Camera Tour 2';
set @disabled = 1;
select @xml = CAST(v as xml) from settings where Type = 'Camera' and Section = 'Camera' and K =
'cameraTour' and ID = @cameraId;
set @xml.modify('replace value of (/TourGroup/cameraTour[@name=sql:variable(''@tourName'')]/
disable/text())[1] with sql:variable(''@disabled'')');
update Settings set V = CAST(@xml as nvarchar(max)) where Type = 'Camera' and Section = 'Camera'
and K = 'cameraTour' and ID = @cameraId;"
In addition to the XML strings, there are some properties used to describe the analytic to the Senstar
Symphony Server. The following fields are of special note:
• Name: the name of the analytic displayed in the Senstar Symphony Server configuration interface
• Description: the description of the analytic displayed in Senstar Symphony Server configuration
interface
• Configurable: whether the analytic has Web interface for configuration
• ConfigurableForRules: whether the analytic has a Web interface for rule configuration
• SearchSupported: flag to enable/disable searching by the metadata created by the analytic
There are two projects in the Senstar Symphony SDK that provide a sample video analytic that you can
integrate with the Senstar Symphony Server:
• AlgoSample: the video analytic and rule engine project
• ConfigureWeb_AlgoSample: the video analytic and rule configuration project
If you change the names of the sample projects, the name of the configuration project must start with
ConfigureWeb_ for the Senstar Symphony Server to recognize the project.
The AlgoSample video analytic counts the number of frames that change and displays either the count or
the percentage as a decoration.
8. Modify and compile the AlgoSample and ConfigureWeb_AlgoSample projects to integrate the
third-party video analytic.
You must compile the AlgoSample and ConfigureWeb_AlgoSample projects in Release mode for
the AlgoSample video analytic to work with the Senstar Symphony Server.
9. Repeat steps 2 to 5 for the new AlgoSample and ConfigureWeb_AlgoSample projects.
SenstarIntelligenceStream-2.0.xml
<?xml version="1.0"?>
<stream
xmlns="http://www.senstar.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="SenstarIntelligenceStream-2.0.xsd">
<frame
utc='11051078632640000'
brightness='10'
contrast='10'
cordcut='1'
cameraobstructed='1'>
<!-- xml for creating a new object or tracking one already created -->
<object id='124' confidence='95'>
<class>Car</class>
<rect x='0' y='0' width='192' height='475'/>
<speed>12.6</speed>
</object>
<!-- xml for deleting an object which was tracked up until now -->
<!-- "id" must have appeared at least once in an object tag -->
<delete id='123'/>
<!-- xml for deleting an object which was stationary up until now -->
<delete id='122'/>
</frame>
</stream>
SenstarIntelligenceStream-2.0.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.senstar.com"
xmlns="http://www.senstar.com">
<xs:simpleType name="classtype">
<xs:restriction base="xs:string">
<xs:enumeration value="Car"/>
<xs:enumeration value="Person"/>
<xs:enumeration value="Unknown"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="percentage">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="statetype">
<xs:restriction base="xs:string">
<xs:enumeration value="Stationary"/>
<xs:enumeration value="Leaving"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="colourvaluetype">
<xs:restriction base="xs:string">
<xs:pattern value="#[0-9a-fA-F]{6}"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="colour">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="colourvaluetype" name="value" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="colourlist">
<xs:complexType>
<xs:sequence>
<xs:element ref="colour" minOccurs="1" maxOccurs="16"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="class">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="classtype">
<xs:attribute name="confidence" type="percentage"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="rect">
<xs:complexType>
<xs:attribute name="x" type="xs:integer"/>
<xs:attribute name="y" type="xs:integer"/>
<xs:attribute name="width" type="xs:integer"/>
<xs:attribute name="height" type="xs:integer"/>
</xs:complexType>
</xs:element>
<xs:element name="object">
<xs:complexType>
<xs:sequence>
<xs:element ref="class"/>
<xs:element ref="rect"/>
<xs:element name="speed" type="xs:decimal"/>
<xs:element name="size" type="decimal"/>
<xs:element name="state" type="statetype"/>
<xs:element ref="colourlist"/>
</xs:sequence>
<xs:attribute name="id" type="xs:integer" use="required"/>
<xs:attribute name="confidence" type="percentage" default="0"/> <!-- Our confidence that
this object should be tracked as a foreground object 0 == definitely distracting motion, 100 ==
definitely foreground -->
<xs:anyAttribute/>
</xs:complexType>
</xs:element>
<xs:element name="alarm">
<xs:complexType>
<xs:attribute name="id" type="xs:integer" use="required"/>
<xs:attribute name="policyid" type="xs:integer" use="required"/>
<xs:attribute name="alarmonid" type="xs:integer" use="required"/>
<xs:attribute name="occur" type="xs:unsignedLong"/>
<xs:anyAttribute/>
</xs:complexType>
</xs:element>
<xs:element name="delete">
<xs:complexType>
<xs:attribute name="id" type="xs:integer" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="stream">
<xs:complexType>
<xs:sequence>
<xs:element name="frame">
<xs:complexType>
<xs:sequence>
<xs:element ref="object" minOccurs="0" maxOccurs="65535"/>
<xs:element ref="delete" minOccurs="0" maxOccurs="65535"/>
<xs:element ref="alarm" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
Legal information
Copyright © 2023 Senstar Corporation and/or its Licensor(s). All rights reserved.
This material is for informational purposes only. Senstar makes no warranties, express, implied or
statutory, as to the information in this document.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights
under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Senstar Corporation
Senstar may have patents, patent applications, trademarks, copyrights, or other intellectual property rights
covering subject matter in this document. Except as expressly provided in any written license agreement
from Senstar, the furnishing of this document does not give you any license to these patents, trademarks,
copyrights, or other intellectual property.
Senstar and the Senstar logo are registered trademarks of Senstar Corporation.
All other trademarks are the property of their respective owners.