Pelco API SDK Programming Guide

Size: px
Start display at page:

Download "Pelco API SDK Programming Guide"

Transcription

1 Pelco API SDK Programming Guide C5617M-A

2 C5617M-A 2

3 C5617M-A Contents Contents Chapter 1: Introduction...7 Getting Started with the Pelco SDK...7 General Requirements... 8 Installing the Pelco SDK...9 System Environment Settings for the Pelco SDK...10 Including Required SDK Components For Your Application...10 Setting Up Sample Projects Registering the ActiveX Control Setting Up the Working Directory...11 Adding References to Managed Libraries for C#...14 Chapter 2: Displaying and Controlling Video Streams...17 Overview...17 Initializing the Pelco API Viewer (C++)...17 Initializing the Pelco API Viewer (C#) Setting Size and Position of Video Display Area...19 Querying an RTP Stream...19 Opening, Playing, and Displaying a Live or Playback RTP Stream Opening, Playing, and Displaying an RTSP Stream...21 Forward Playback of RTP and RTSP Streams...22 Reverse Playback of RTP and RTSP Streams Fast Forward / Reverse Playback of RTP and RTSP Streams...23 Pausing RTP and RTSP Playback Streams Frame Forward Playback of the RTP Stream...24 Frame Reverse Playback of the RTP Stream Resuming the RTP or RTSP Stream from a Paused State...24 Stopping the RTP and RTSP Stream Setting Audio Volume of a Live or Playback RTP stream...25 Displaying Analytic Events for an RTP Stream Displaying Motion Events for an RTP Stream Displaying a Timestamp Overlay for RTP and RTSP Streams Taking a Snapshot of the Current Video Frame for RTP and RTSP Streams...27 Pan, Tilt, Zoom (PTZ) Control for RTP Stream Using PelcoAPIViewer...27 Chapter 3: Pan, Tilt, Zoom (PTZ) Control Overview...29 Initializing the PTZ Control Wrapper Continuous Panning...30 Continuous Tilting Continuous Diagonal Movement...31 Stopping Continuous Movement...32 Enabling Continuous Pan/Tilt/Move and Zoom APIs via UDP Instead of TCP...32 Panning to a Specific Position Tilting to a Specific Position...33 Moving to a Specific Position...34 Moving to a Position Relative to the Current Location Getting the Camera s Current Position Managing the Magnification (Zoom) Value Managing the Focus Value...36 Iris Control...36 Scripting...37 Creating a Preset

4 Contents C5617M-A Updating an Existing Preset...38 Creating a Pattern Going to an Existing Preset Removing an Existing Preset Updating an Existing Pattern...40 Executing an Existing Pattern Stopping a Pattern Currently Being Executed Chapter 4: Events and Alarms...41 Overview...41 Where Does the Pelco SDK Fit? Event Arbiter Library...41 Event Manager...42 Event Arbiter Library Compared to Event Manager...42 Creating an Event Agent Returning the Event Subscription URL Initializing the Event Arbiter Library Initializing the Event Arbiter Library for C Initializing the Event Arbiter Library for C# Initializing the Event Manager Device or Service Specific Subscriptions...47 Using the Event Arbiter Library to Subscribe Using the Device s IP Address...47 Using the Event Arbiter Library to Subscribe Using the Event Subscription URL Using the Event Arbiter Library to Subscribe to All Instances of a Service Using the Event Arbiter Library to Unsubscribe from a Service Mass Subscriptions by Category...49 Using the Event Manager to Subscribe to All Services Using the Event Manager to Unsubscribe from All Services Handling Incoming Events Polling Events Chapter 5: Extracting Audio and Video Metadata...55 Extracting Audio and Video Metadata...55 Motion Detection Metadata...56 Pelco Analytics Drawing Primitives Timestamps Getting Started Initializing the Metadata Parser Class...57 Creating a Metadata Renderer Class Retrieving the Current Timestamp Metadata Motion Detection Metadata...59 Retrieving Motion Detection Metadata Rendering Motion Detection Metadata Drawing Metadata Retrieving Drawing Metadata Rendering Drawing Metadata Chapter 6: Exporting Video...63 Overview...63 Where Does the Pelco SDK Fit? Custom Application Development...63 Getting Started Initializing the Exporter Setting Up Overlay Data on Video to Be Exported OverlayData Parameters...65 Resetting Overlay Data...69 Exporting Video...69 Exporting a Single Video Clip

5 C5617M-A Contents Exporting Video Using a Playlist (PPX) Stitching Multiple Clips into a Single Video Export...71 Polling a Video Export...73 Stopping a Video Export Exporting A JPEG Snapshot Chapter 7: Web Service Proxies...75 Web Service Proxies General Usage Chapter 8: Discovery Device and Service Discovery Overview Initializing the Pelco SDK System Manager Wrapper...78 Automatically Determining the System Manager s IP Address and Port Number...79 Logging In and Logging Out Querying Available Devices from the System Manager Retrieving the System Manager s Time Zone...81 Retrieving the Network Time Server Address...81 Retrieving a Web Service s ID Retrieving a Specific Web Service s Control URL Retrieving the NVR Associated with the Device...83 Retrieving the Device s Friendly Name Retrieving the Device s Device Description File (DDF) URL Retrieving All Web Services Available on a Device...85 Retrieving Device Attributes Retrieving a System Manager s Attribute...87 Retrieving a Web Service s Attribute Creating an IDeviceStorage Class Appendix A: Logging...91 Appendix B: Product Compatibility...93 Appendix C: Endura...95 Appendix D: General Event Messages Appendix E: Hardware Diagnostics Event Messsages ConfigurationButton (20180) DriverFailure (20150) Fans (20020) HardDrives (20060) ImproperShutdown (20070) LinkSpeed (20200) PowerSupply (20120) UPS (20170) Appendix F: Software Diagnostics Event Messsages DataLoss InputStreams PacketLoss

6 Contents C5617M-A SEBs StorageFull StorageTime Temperature Appendix G: Glossary

7 Chapter 1 Introduction Getting Started with the Pelco SDK The Pelco SDK is a powerful software developer kit to help third parties use Pelco products alongside non-pelco products and software. While the Pelco API is both flexible and powerful, it can also potentially overwhelm some users; of course, developers are still free to directly use the Pelco API as they wish. However, Pelco has found that many of our customers enjoy the convenience and ease of use that the Pelco SDK provides. The Pelco SDK provides programmers ease of use with the following functionality: Video rendering Device and service discovery User and role management Pan, tilt, and zoom (PTZ) control Eventing support Video export Audio and video meta-data parsing What Does the Pelco SDK Contain? The Pelco SDK contains the following major components: SDK Component 1 System Manager Wrapper Pelco API Viewer PTZ Control Wrapper Event Arbiter Library 2 Features / Functionality Device discovery Service discovery Display and control MPEG-4 and H.264 streams from Pelco cameras and DVRs / NVRs / NSMs. Control Pan/Tilt/Zoom on Pelco PTZ-enabled cameras. Pan and tilt control Zoom, iris, and focus control Basic script management Advanced event subscription management: Subscribe to individual web service events Subscribe to events from all instances of a particular web service Cancel an active event subscription Event Manager 1 PelcoGsoap is not a separately installable library, but it is included in the other components as required. 2 EventArbiter component also contains Event Manager. Therefore, Event Manager is not a separately installable component. 7

8 C5617M-A Introduction Easy to use event subscription, that focuses on subscribing to categories of events instead of web service specific events. NOTE: Event Manager requires an Endura (System Manager) system. Meta-data Parser Exporter Parses Pelco Video Elementary Stream (VES) meta data: Timestamp, Motion Detection, Video Analytics Primitives Render primitives and other data to video frame Export video streams into a variety of popular video formats: AVI, 3GP, or PEF Overlay data on exported video The Pelco SDK also contains sample projects for the following: Code Sample Event Arbiter Sample Event Manager Sample Exporter Sample MetaDataParser Sample Pelco API Viewer Sample PTZ Control Wrapper Sample System Manager Sample Default Location C:\Program Files\Pelco\API\SampleCode\EventArbiterSample C:\Program Files\Pelco\API\SampleCode\EventArbiterSample C:\Program Files\Pelco\API\SampleCode\ExporterSample C:\Program Files\Pelco\API\SampleCode\MetaDataParserSample C:\Program Files\Pelco\API\SampleCode\PelcoAPIViewerSample C:\Program Files\Pelco\API\SampleCode \PTZControlWrapperSample C:\Program Files\Pelco\API\SampleCode \SystemManagerWrapperSample General Requirements Hardware The minimum hardware requirements for the client machine to use for completing the steps outlined in this document are the following: CPU: Intel 2.4 GHz Core 2 Duo (or higher) Memory: 2 GB GPU: DirectX9 Compatible; must be a dedicated card and not a motherboard integrated chip HD: 1 GB free hard disk space NOTE: Virtual machines are not supported for streaming video from Pelco cameras. In addition to your client machine, a Pelco SDK compatible Pelco device is required. A list of currently compatible Pelco hardware can be found in the Appendix. Software The software requirements for completing the steps outlined in this document are the following: Windows XP, Windows Vista [32 bit / 64 bit], Windows Server 2003 [32 bit / 64 bit], Windows Server 2008 [32 bit / 64 bit], Windows 7 [32 bit / 64 bit] 8

9 C5617M-A Introduction DirectX 9.0 c (must be installed separately, even if your system already includes DirectX 10 or 11 as part of Windows Vista or higher) Visual Studio 2008 Microsoft.NET Framework 3.5 NOTE: Improper use of audio/visual recording equipment may subject you to civil and criminal penalties. Applicable laws regarding the use of such capabilities vary between jurisdictions and may require, among other things, express written consent from the recorded subjects. You are solely responsible for insuring strict compliance with such laws and for strict adherence to any/all rights of privacy and personalty. Installing the Pelco SDK 1. Download the Pelco SDK from the Pelco Developer Network (PDN) at It can be found in the Pelco SDK Related Downloads sub-section inside the Downloads section. 2. Once finished downloading, doubleclick on the Pelco SDK installer to begin installation. Simply follow the on-screen prompts to complete installation. NOTE: If you have a previous version of the Pelco SDK installed, you must uninstall it before installing the latest version. 3. After installation, restart the system to ensure that environment variables are running correctly. Assuming the default installation path was chosen, users can find the following folders: File Folder Path C:\Program Files\Pelco\API\Include \C++\PelcoAPI 3 C:\Program Files\Pelco\API\Libs \Release 3 C:\Program Files\Pelco\API\Libs \Debug 3 C:\Program Files\Pelco\API\Libs \Release\Plugins 3 C:\Program Files\Pelco\API \SampleCode 3 C:\Program Files\Pelco\API \WebServices 3 C:\Program Files\Pelco\API\Logging 3 Description Header files for all of the Pelco SDK related classes can be found here. Pelco SDK release module libraries can be found within the Release directory. Pelco SDK debug module libraries can be found within the Debug directory. Pelco SDK release plugins can be found within the Plugins directory. Contains all the sample code projects related to Pelco SDK components. The WSDLs files for web services are in this directory. Please note that the XSDs are embedded within the WSDL files themselves. Our WSDLs, along with the embedded XSDs, provide the definition for Pelco web services and related data types. For details, please refer to the following links: Contains an application called LoggingSetup.exe which allows you to write a log file for debugging purposes. You can manage other logging related information by running LoggingSetup.exe. NOTE: Each Pelco SDK component may have additional installation and / or configuration requirements. 3 On 64-bit systems, C:\Program Files will change to C:\Program Files (x86) 9

10 C5617M-A Introduction System Environment Settings for the Pelco SDK The Pelco SDK installer adds three environment variables/paths to the installed system: EVEREST_BIN - the location of all the binaries. By default, this is set to C:\Program Files\Pelco\API\Libs EVEREST_ROOT - Location of all the Pelco header files. By default this is set to C:\Program Files\Pelco \API\Include\C++ PATH - This initially points to the C:\Program Files\Pelco\API\Libs\Debug folder NOTE: If you want to build the SDK in release mode, you must change the PATH variable to point to the Release directory (e.g., C:\Program Files\Pelco\API\Libs\Release). If any of the paths have been changed from the defaults, you will be responsible for removing the path if the SDK is uninstalled. Including Required SDK Components For Your Application When distributing your application that relies on the Pelco SDK, you must ensure that the required SDK component redistributables are installed on the target client machine. As with other re-distributables, a UI will not be presented to the user, and the re-distributable itself can be called by your custom installer. Once the re-distributable is finished, your custom installer can check the status of the install and whether or not it needs a reboot. In addition, the client machines must have DirectX 9.0c, which is the latest version, and VC9 runtime installed. As with the full SDK, download individual Pelco SDK components and Pelco SDK re-distributables from the Pelco Developer Network (PDN) at Once finished downloading, double click on the Pelco SDK installer to begin installation. Simply follow the on-screen prompts to complete installation. NOTE: For the latest Pelco documentation, visit The sample projects assume that the default target installation directory was chosen during installation. Setting Up Sample Projects WARNING: Any provided sample code is meant to be a reference implementation focused on educating developers about Pelco devices. Though there are exceptions, in general Pelco sample code is NOT intended for immediate production use without modification. NOTE: This entry assumes that users have already installed the Pelco SDK. Moreover, the Pelco API Viewer sample project requires Microsoft s DirectX 9, and a video card that supports DirectX 9. NOTE: On 64-bit machines, C# code should be compiled specifically for x86. To begin using the sample project code, locate the appropriate sample within the Pelco SDK SampleCode directory: C:\Program Files\Pelco\API\SampleCode NOTE: Some Pelco SDK sample projects, such as the Pelco API Viewer sample, are spread across more than one class. There may also be more than one sample project associated with the particular SDK component. It is assumed that you will be examining the sample projects alongside this documentation. Registering the ActiveX Control By default, the installer registers the Active X Component (OCX) in the C:\Program Files\Pelco\API\Libs \Debug directory. To ensure that the OCX registration is successful, change the PATH variable to point to this directory. For release builds, you can manually register the Pelco API Viewer ActiveX Component: PelcoAPICOMViewer.ocx. To register the PelcoAPICOMViewer.ocx ActiveX Component, open the command line and navigate to the Pelco SDK library release directory, which is by default: C:\Program Files\Pelco\API\Libs\Release Once within the folder, run the Microsoft Register Server (Regsvr32.exe) to register the SDK component as appropriate. This must be run with administrative permissions. For example, to register the PelcoAPICOMViewer.ocx file: Regsvr32 PelcoAPICOMViewer.ocx 10

11 C5617M-A Introduction Setting Up the Working Directory Next you will need to set the sample project s working directory. Assuming that you have already opened the sample project in MS Visual Studio, right-click on the project and select the Properties menu item. C++ Example 11

12 C5617M-A Introduction C# Example Now click on the Debugging menu item on the left navigation of the sample project s property page window. 12

13 C5617M-A Introduction For example, in C++: For example, in C#: 13

14 C5617M-A Introduction Depending on whether you would like to use the release version of the Pelco SDK libraries or the debug version, change the Working Directory value as appropriate. If you kept the default installation directory for the Pelco SDK, use C:\\Program Files\Pelco\API\Libs\Release to use the production version of the Pelco SDK libraries. Conversely, use C:\\Program Files\Pelco\API\Libs\Debug to use the debug version of the Pelco SDK libraries. On a 64 bit machine, set the Platform target to support x86. NOTE: Be sure to set the character set to "Use Multi-Byte Character Set" under the project properties for the sample code to compile properly. Adding References to Managed Libraries for C# Once you have registered the PelcoAPICOMViewer ActiveX object and the sample project is located, open it in Visual Studio Before building the project, users must add a reference to the managed DLL into the project. Within Visual Studio s Solution Explorer window, right click on the References project item. A menu should appear. Click on the Add Reference menu item. A dialog window should now appear. Click on the Browse tab. Assuming the default installation directory was not changed, users should be able to find the managed DLL file within the directory C:\Program Files\Pelco\API \Libs\Debug. Now select the managed DLL file and click on the Ok button. 14

15 C5617M-A Introduction NOTE: These references may already appear in the project, possibly with yellow exclamation marks. ("!") In general, these Pelco library references should still be deleted and re-added, after installing or reinstalling the SDK. Now that you ve added the managed DLL reference to the project, we need to add the managed Pelco API MPF Viewer. To add the managed Pelco API MPF Viewer, follow the same steps as before for the managed DLL. A dialog window should now appear. Click on the Browse tab. Assuming the default installation directory was not changed, users should be able to find the PelcoAPIMPFViewer.dll file within the directory C:\Program Files \Pelco\API\Libs\Debug. Now select the PelcoAPIMPFViewer.dll file and click on the Ok button. You should now see both the managed ManagedPTZControlWrapper reference and the PelcoAPIMPFViewer reference within the project. At this point you should be able to run the Pelco API Viewer sample C# project. 15

16 C5617M-A Introduction NOTE: With the PelcoAPICOMViewer.ocx control, you may need to clean and rebuild this project several times before the OCX control will work. This is apparently a Visual Studio / OCX limitation. 16

17 Chapter 2 Displaying and Controlling Video Streams Overview The most important thing in any security imaging system, is for the security operator to see what images his IP cameras are capturing. Consequently displaying a video stream and controlling its playback is most likely what you will need to get working first. Where Does the Pelco SDK Fit? To display and control video streams, use the Pelco API Viewer. The Pelco API Viewer is an easy to use Windows based tool for viewing MPEG-4 and H.264 streams from Pelco IP cameras and DVRs / NVRs / NSMs. It provides a Pelco supported player for integrating Pelco devices with 3rd party applications. This player can be configured to work in both RTP and RTSP mode. In RTP mode, the player uses one of several Pelco API methods to initiate and control streams. While in RTSP mode, the player expects to work with either devices, such as a Sarix IP camera, where RTSP is supported by default; or software solutions like the RTSP Server. The Pelco API Viewer can be used in three ways: 1. C++ 2. C# 3. OCX (ActiveX Control) Support is provided for viewing both MPEG-4 and H.264 streams, but changing a video configuration from one format to the other causes the video to stop streaming. What s Ahead There are two major tasks for viewing a video stream using the Pelco API Viewer: Opening, playing, displaying a stream Controlling the stream Initializing the Pelco API Viewer (C++) Before you can use the Pelco API Viewer, you need to declare and configure your new instance. 1. Declare the Pelco API Viewer instance. NOTE: The related source code for this entry can be found in main.cpp s main function, which resides in the PelcoAPIViewer sample project. PelcoAPI::PelcoAPIViewer _pviewer; 2. Set the instance s plug-in directory. Assuming that you did not change the default target installation directory, it can be found here: C:\Program Files\Pelco\API\Libs\Debug\Plugins\ (If running in Release mode, change this path to C:\Program Files\Pelco\API\Libs\Release\Plugins\). 17

18 C5617M-A Displaying and Controlling Video Streams The plug-in directory contains components that are key to the SDK s encoding, decoding, and transcoding capabilities. Without a proper reference, key features of the Pelco SDK may not function properly. Please note that the plug-in directory is dependent on where you installed the Pelco SDK. NOTE: The related source code for this entry can be found in main.cpp s main function, which resides in the PelcoAPIViewer sample project. _pviewer.setplugindir("c:\\program Files\\Pelco\\API\\Libs\\Debug\\Plugins\\"); 3. Create a new window handle and associate it to the Pelco API Viewer instance. Please note that logic to create the window handle can be found in the _DbgCreateParentWindow method. HWND _hwndparent = NULL; //... Logic to create a window and display it. Refer to _DbgCreateParentWindow... m_pviewer->setwindowhandle((_hwnd? _hwnd : this->m_hwnd)); Initializing the Pelco API Viewer (C#) NOTE: In release mode, you need to select the Enable unmanaged code debugging checkbox in the project settings to see console output. Before you can use the Pelco API Viewer, you need to declare and configure your new instance. PelcoAPIMPFViewer contains two components: PelcoAPIMPFViewerControl, a convenient, prebuilt control, or a managed version of the PelcoAPIViewer library that enables the developer to control the videostream programmatically. Both approaches are described below. To use the more programmable PelcoAPIViewer library, complete the following steps: declare the PelcoAPIViewer instance, set the plugin directory, and set the window handle. PelcoAPI.PelcoAPIViewerNet pviewer = new PelcoAPI.PelcoAPIViewerNet(); pviewer.setplugindir(objstreamparam.plugindir); pviewer.setwindowhandle(windowsviewerobj.handle); To use the prebuilt control PelcoAPIMPFViewerControl, complete the following steps. 1. Declare the Pelco API Viewer instance. NOTE: The related source code for this entry can be found in PelcoAPIViewerForm.designer.cs constructor, which resides in the PelcoAPIViewerSample sample project. private PelcoAPIMPFViewer.PelcoAPIMPFViewerControl _pviewer; this._pviewer = new PelcoAPIMPFViewer.PelcoAPIMPFViewerControl(); 2. Listen for the user selected plug-in directory. Assuming that you did not change the default target installation directory, it can be found here: C:\Program Files\Pelco\API\Libs\Debug\Plugins NOTE: The plug-in directory contains components that are key to the SDK s encoding, decoding, and transcoding capabilities. Without a proper reference key features of the Pelco SDK may not function properly. Please note that the plug-in directory is dependent on where you installed the Pelco SDK. private void BrowseForPluginDir(object sender, EventArgs e) { try { this._popenfolder.showdialog(this); this._txtfolder.text = _popenfolder.selectedpath + "\\"; } catch(exception /*ex*/){} } 3. Save the Plugin folder and do the final initialization. private void SaveStreamSettings(object sender, EventArgs e) { 18

19 C5617M-A Displaying and Controlling Video Streams try { _pviewer.setplugindir(_txtfolder.text); _pviewer.setupstream(_txtip.text, _txtport.text, _txtserviceid.text,_txttransport.text); } catch (Exception /*ex*/) { } } Setting Size and Position of Video Display Area Calling the SetDisplayRect method to center the video stream display inside a window with margins does not automatically center it. You need to set the size and position of the video display rectangle so that its width and height are equal to the width and the height of the window. The SetDisplayRect method allows resizing the video display area when the window is resized. Thus, SetDisplayRect would typically be called from a resize event procedure. SetDisplayRect contains the following parameters: top left width height The starting Y coordinate of the rectangle for its top side. The starting X coordinate of the rectangle for its left side. The width of the rectangle. The height of the rectangle. PELCO_API_EXPORT void SetDisplayRect(int top, int left, int width, int height)throw (); For example: TRACE_INFO("Calling SetDisplayRect\n"); _pviewer.setdisplayrect(75, 100, 824, 618); Querying an RTP Stream The VideoQuery function can be used to query the camera or the NSM to retrieve video properties of a stream. Query a camera or NSM by calling the VideoQuery method passing in the following parameters: szstarttime szendtime szipaddress szport sznvrserviceid szcameraserviceid The starting time in the stream to begin playback. This value should be in UTC format, for example, T20:32:00.For live streams, set this value to NOW. The ending time in the stream to stop playback, for example, T04:00:00. This value should be in UTC format. For live streams, set this value to INFINITE. The IP address of NSM or camera source of the stream. The NSM or camera source of the stream s port number. The ID of the NVR to use with playback. This field is not used for live streams. (Required for manual recording.) 19

20 C5617M-A Displaying and Controlling Video Streams szcamuuid blowbandwidth pstreaminfo The last number of the web service endpoint URL of a camera. For example, when an endpoint URL ends with VideoOutput-4 then 4 is the service ID. The IP camera s UPnP Unique Device Name (UDN) NOTE: The IP camera s UDN is required if you want to start manual recording on a live stream. Otherwise, this parameter is optional. The flag to start a low bandwidth stream. Live only Streaming data to be filled in. This value can be passed back to live or playback StartStream call in RTP only. Opening, Playing, and Displaying a Live or Playback RTP Stream NOTE: The related source code for this entry can be found in main.cpp s main function, which belongs to the PelcoAPIViewer sample project SampleConsole9. Before being able to control a video stream, you must first open the stream, and display it on a Window instance. 1. Initialize the Pelco API Viewer. Refer to Initializing the Pelco API Viewer (C++) for details. 2. Start the video stream to display, by calling the StartStream method, passing in the following parameters: szstarttime szendtime szipaddress szport szcameraid sztransport szcamuuid sznvrid For live RTP, this value must be "NOW". For playback RTP, this must be the start time in the following format: YYYY-MM-DDTHH:MM:SS in UTC (required). For live RTP, this value must be "INFINITE". For playback, this value must be the end time in the following format: YYYY-MM-DDTHH:MM:SS in UTC (required). The IP address and port number of the source of the video stream for NSM, NVR, or EE500. For live RTP, this is the IP address of the camera. For playback, this is the IP address of the NSM/NVR (required). The IP address and port number of the source of the video stream for NSM, NVR, or EE500. For live RTP, this is the port number of the camera. For playback, this is the port number of the NSM/NVR (required). The channel number for the camera, for example, VideoOutput-1 where 1 is the channel number (required for both live and playback) The video stream s transport (RTP) URL (optional for live RTP stream, because the camera starts a MULTICAST stream if no value is supplied. Required for playback.) The IP address must be the IPv4 address of the machine on which the code is running, for the network through which it will connect to the video source. The port number must be an even number, and must not be in use. Example:rtp://ip_of_local_machine:open_port_even The IP camera s UDN (required if the user wants to start recording for a live stream. Otherwise, optional) NOTE: The IP camera s UDN is required if you want to start manual recording on a live stream (required). 20

21 C5617M-A Displaying and Controlling Video Streams The NVR s ID (optional for a live RTP stream. Required for manual recording of a live RTP stream and for a playback RTP stream) ITimeStampDelegate bvideoonly Signals if you want the timestamp returned by the API. If no timestamp is required, do not supply a value for this parameter. Stream video without audio. By default, this parameter is set to FALSE for backwards compatibility. blowbandwidth Sets the stream to low bandwidth stream from camera. The camera needs to be configured or have secondary low bandwidth stream enabled. This parameter is set to FALSE by default for backwards compatibility. NOTE: This parameter is only valid for live streams. StreamInfo If you have already queried the NSM/Camera using the VideoQuery method then you can pass the stream information back into the StartStream call with this parameter. This parameter is set to NULL by default for backwards compatibility. For a live RTP stream: MyAppNamespace::TimeStamp _pdelegate; const char* pszsesid = NULL; //... Other logic... pszsesid = _pviewer.startstream(const char* StartTime, const *endtime, " ", "49154", "1", "rtp:// :7162", "uuid:d557efb9-3a2d-48a1-b2fa-b48231f62f15", "1", &_pdelegate, False, False, NULL); where: StartTime is the time you want to start video. For live streams, use the value as "NOW", endtime is the time you want the video to end. For live streams, use the value INFINITE. NOTE: For NULL/optional values, use for strings and NULL for interface values. szserviceid is the camera service ID, etc, For a playback RTP stream: MyAppNamespace::TimeStamp _pdelegate; const char* pszsesid = NULL; //... Other logic... pszsesid = _pviewer.startstream(" t18:02:00", " T18:28:00", " ", "49154", "1", "rtp:// :7162", "uuid:d557efb9-3a2d-48a1-b2fa-b48231f62f15", "1", &_pdelegate, False, False, NULL); where: szserviceid is the camera service ID, sztransport and szcamuuid are required for playback. If successful, these methods will return a session ID, pszsesid, of the stream. This will be used throughout this document for tasks related to the Pelco API Viewer. Opening, Playing, and Displaying an RTSP Stream NOTE: The related source code for this entry can be found in main.cpp s main function, which belongs to the PelcoAPIViewer sample project SampleConsole9. 1. Initialize the Pelco API Viewer. Refer to Initializing the Pelco API Viewer (C++) or Initializing the Pelco API Viewer (C#) entry for details. 21

22 C5617M-A Displaying and Controlling Video Streams 2. Start the video stream to display, by calling the StartStream method, passing in the following parameters: The location of the RTSP stream The username to use for authentication (Optional) The password to use for authentication (Optional) A boolean indicating whether or not the stream is multicast The timestamp parameter is an object that implements the ITimeStampDelegate interface, or NULL if you don t want to receive timestamps as the video plays. (Optional) MyAppNamespace::TimeStamp _pdelegate; const char* pszsesid = NULL; //... Other logic e.g. setting up windows, and so on... //Live example: pszsesid = _pviewer.startstream( "rtsp:// /?deviceid=uuid:d557efb9-3a2d-48a1-b2fa-b48231f62f15", NULL, NULL, false, &_pdelegate); //Playback example: pszsesid = _pviewer.startstream( "rtsp:// /?deviceid=uuid:01b766f9-9d a168-5e5d179d339d&starttime= t10:00:00&endtime= t11:00:00", NULL, NULL, false, &_pdelegate); If successful, the method will return a session ID of the stream. Keep this in mind, as this will be used throughout for tasks related to the Pelco API Viewer. Forward Playback of RTP and RTSP Streams NOTE: The related source code for this entry can be found in main.cpp s main function, which belongs to the PelcoAPIViewer sample project SampleConsole9. This entry assumes that you have already completed the steps outlined in the Opening, Playing, and Displaying an RTSP Stream entry. To perform a forward or reverse playback of a currently running video stream, call the Pelco API Viewer instance s PlayForward or PlayReverse method passing in the following parameters: The target video stream s session ID. A successful call to the StartStream method returns this value. A float value representing the desired playback speed. Valid possible playback speeds can range from 0-300, with 0 representing a paused state and 1 representing regular playback speed. (Also, 1 represents the speed for live video.) const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.playforward(pszsesid, 8.0)!=0 ){ //... Handle error... } Reverse Playback of RTP and RTSP Streams To perform a reverse playback of a currently running video stream, call the Pelco API Viewer instance s PlayReverse method; passing in the following parameters: The target video stream s session ID. A successful call to the StartStream method returns this value. A float value representing the desired playback speed. Valid possible playback speeds can range from 0-300, with 0 representing a paused state and 1 representing regular playback speed. 22

23 C5617M-A Displaying and Controlling Video Streams WARNING: Reverse playback is not possible for live streams. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.playreverse(pszsesid, 8.0)!=0 ){ //... Handle error... } Fast Forward / Reverse Playback of RTP and RTSP Streams To perform a fast forward (using FrameForward, which advances by a single frame) or fast reverse playback of a currently running video stream (using FrameReverse, which reverses by a single i-frame that may include multiple p-frames), call the Pelco API Viewer instance s PlayForward or PlayReverse method (as appropriate), passing in the following parameters: The target video stream s session ID. A successful call to the StartStream method returns this value. A float value representing the desired playback speed. Valid possible playback speeds can range from to 300, with speed greater than 1 (regular playback speed). Slow motion is supported where the speed is set at half the regular speed (e.g., -0.5 or 0.5). Currently, PlayReverse only plays backward, and PlayForward only plays forward, regardless of whether the speed parameter is negative or positive. Therefore, call PlayForward for fast forward, and call PlayReverse for fast reverse. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.playforward(pszsesid, 8.0)!=0 ){ //... Handle error... } const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.playreverse(pszsesid, 8.0)!=0 ){ //... Handle error... } Pausing RTP and RTSP Playback Streams NOTE: The related source code for this entry can be found in main.cpp s main function, which belongs to the PelcoAPIViewer sample project SampleConsole9. WARNING: DO NOT pause live streams. Pausing a live stream may produce an unpredictable result. This entry assumes that you have already completed the steps outlined in the Opening, Playing, and Displaying an RTSP Stream entry. To pause currently running video stream, call the Pelco API Viewer instance s Pause method; passing in the target video stream s session ID. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.pause(pszsesid)!=0 ){ //... Handle error... } 23

24 C5617M-A Displaying and Controlling Video Streams Frame Forward Playback of the RTP Stream A frame forward operation advances playback of a currently paused video stream by a single i-frame, which may include multiple p-frames. To perform this operation, call the Pelco API Viewer instance s FrameForward method, passing in the following parameter: The target video stream s session ID. A successful call to the StartStream method, returns this value. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.frameforward(pszsesid)!=0 ){ //... Handle error... } Frame Reverse Playback of the RTP Stream A frame reverse operation steps a currently paused video stream backward by a single frame. To perform this operation, call the Pelco API Viewer instance s FrameReverse method; passing in the following parameter: The target video stream s session ID. A successful call to the StartStream method, returns this value. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.framereverse(pszsesid)!=0 ){ //... Handle error... } Resuming the RTP or RTSP Stream from a Paused State NOTE: The related source code for this entry can be found in main.cpp s main function, which belongs to the PelcoAPIViewer sample project SampleConsole9. NOTE: This entry assumes that you have already completed the steps outlined in Opening, Playing, and Displaying a Live or Playback RTP Stream. To resume a paused playback stream, call the Pelco API Viewer instance s Resume method, passing in the target video stream s session ID. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.resume(pszsesid)!=0 ){ //... Handle error... } Stopping the RTP and RTSP Stream NOTE: The related source code for this entry can be found in main.cpp s main function, which belongs to the PelcoAPIViewer sample project SampleConsole9. This entry assumes that you have already completed the steps outlined in the Opening, Playing, and Displaying the Stream entry. 24

25 C5617M-A Displaying and Controlling Video Streams To perform a stop playback of a currently running video stream, call the Pelco API Viewer instance s StopStream method; passing in the target video stream s session ID. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.stopstream(pszsesid)!=0 ){ //... Handle error... } Setting Audio Volume of a Live or Playback RTP stream Audio volume of a playback stream can be controlled using the SetAudioVolume method, by passing in the video stream s session ID and an integer volume level, where the range is 0 to 100, with 0 representing mute. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.setaudiovolume(pszsesid, 10)!=0 ){ //... Handle error... } Displaying Analytic Events for an RTP Stream To display analytic events for the currently playing video stream, call the DisplayAnalyticEvents method, passing in the target video stream s session ID and the benable set to true. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.displayanalyticevents(pszsesid, true)!=0 ){ //... Handle error... } Displaying Motion Events for an RTP Stream To display motion events for the currently playing video stream, call the DisplayMotionEvents method, passing in the target video stream s session ID and the benable set to true. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... if(_pviewer.displaymotionevents(pszsesid, true)!=0 ){ //... Handle error... } Displaying a Timestamp Overlay for RTP and RTSP Streams To display a timestamp overlay for live/playback video streams, call the DisplayTimestampOverlay method, passing in the target video stream's session ID, benable set to true, and an instance of ViewerOverlayInfo struct. If the struct (the 3rd parameter) is set to null, the default style overlay is displayed. The default style would be: Location: Bottom left Date format: MMDDYYYY Time format: HHMMSSTT Font name: Arial Font size: 9 Font color: Yellow Background color: transparent to the current screen 25

26 C5617M-A Displaying and Controlling Video Streams PelcoAPI::ViewerOverlayInfo overlay; PelcoAPI::COLOR fontcolor = {0xFF, 0xFF, 0xFF, 0xA0}; PelcoAPI::COLOR fontbgcolor = {0x00, 0x00, 0x00, 0x00}; overlay.m_dateformat = PelcoAPI::VIEWER_DATE_FORMAT_MMDDYY; overlay.m_timeformat = PelcoAPI::VIEWER_TIME_FORMAT_TTHHMMSS; overlay.m_fontcolor = fontcolor; overlay.m_fontbgcolor = fontbgcolor; overlay.m_location = PelcoAPI::VIEWER_OVERLAY_LOCATION_TOP_LEFT; overlay.m_nfontsize = 12; overlay.m_fontnamestr = "Arial"; bool bsuccess = _pviewer.displaytimestampoverlay(pszsesid, true, &overlay); System.Drawing.Color fontcolor = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xFF, 0xA0); System.Drawing.Color fontbgcolor = System.Drawing.Color.FromArgb(0x00, 0x00, 0x00, 0x00); ViewerOverlayInfoNet overlay = new ViewerOverlayInfoNet(); overlay.m_location = PelcoAPI.ViewerOverlayLocationNet.OVERLAY_LOCATION_BOTTOM_LEFT; overlay.m_dateformat = PelcoAPI.ViewerDateFormatNet.DATE_FORMAT_MMDDYYYY; overlay.m_timeformat = PelcoAPI.ViewerTimeFormatNet.TIME_FORMAT_HHMMSSTT; overlay.m_fontnamestr = "Arial"; overlay.m_nfontsize = 16; overlay.m_fontcolor = fontcolor; overlay.m_fontbgcolor = fontbgcolor; Boolean bsuccess = _rtpviewer.displaytimestampoverlay(_rtpsessionid, true, overlay); NOTE: Live and playback RTSP streams from Sarix cameras are unable to display timestamp information. 26

27 C5617M-A Displaying and Controlling Video Streams Taking a Snapshot of the Current Video Frame for RTP and RTSP Streams To take a snapshot of the current video frame, call the Pelco API Viewer instance s TakeSnapShot method; passing in the target video stream s session ID, and the desired resulting filename and file path. const char* pszsesid = NULL; //... Get pszsesid, the stream s session ID, by starting a stream... nresult = m_pviewer->takesnapshot(szsessionid, "C:\\snapshots.jpg"); Pan, Tilt, Zoom (PTZ) Control for RTP Stream Using PelcoAPIViewer Cameras with PTZ functionality can also be controlled using the PelcoAPIViewer. For more information, see Pan, Tilt, Zoom (PTZ) Control. NOTE: This only works with PelcoAPIViewer in RTP Live mode. 27

28 C5617M-A Displaying and Controlling Video Streams 28

29 Chapter 3 Pan, Tilt, Zoom (PTZ) Control Overview WARNING: Any provided sample code is meant to be a reference implementation focused on educating developers about Pelco devices. Though there are exceptions, in general Pelco sample code is NOT intended for immediate production use without modification. WARNING: The content below assumes that the default target installation directory was chosen during installation. For the latest Pelco documentation, visit After you ve found the IP camera on your network and displayed its live stream on your display, you will probably want to start controlling your camera s viewing position: up and down and left and right, as well as magnification (zoom), focus, and camera iris. The StopContinuous method is available to stop the camera from continually moving, and the Stop() call is available to stop Lens control (zoom, iris, and focus) actions. To stop continuous positioning calls, pass in a 0 value. For example, after executing ContinuousMove, call ContinuousMove(0, 0) to stop moving. Where Does the Pelco SDK Fit? To move your IP camera s current view, you need to start using the Pelco SDK s PTZ Control Wrapper. The PTZ Control Wrapper is an easy to use tool for controlling various PTZ and lens related functionality. For this section we ll only focus on panning and tilting the camera. As in the previous section we ll be examining the sample project code. Specifically, this section covers the PTZ Control Wrapper. This sample project exhibits PTZ Control Wrapper functionality. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. Initializing the PTZ Control Wrapper NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: In release mode, you need to select the Enable unmanaged code debugging checkbox in the project settings to see console output. To instantiate the managed PTZ Control Wrapper instance, use the following parameters: Your IP camera s current IP address Your IP camera s port number Your IP camera s service ID (usually 1 unless this number represents a channel in a multi-channel encoder) 29

30 C5617M-A Pan, Tilt, Zoom (PTZ) Control C++ Example PelcoAPI::PTZControlWrapper ptzcontrolwrapper(" , 49152, 1); After you are finished, stop all PTZ Control Wrapper actions: bool bsuccess = ptzcontrolwrapper.stop(); NOTE: The following stop actions are available: To stop Lens control actions such as zoom, iris, and focus, use the Stop() call. To stop continuous movement triggered by ContinuousMove, ContinuousPan, and ContinuousTilt, use the StopContinuous() call. C# Example ManagedPTZControlWrapperNet managedptzcontrol = new ManagedPTZControlWrapperNet(" , 49152, 1); After you are finished, stop all PTZ Control Wrapper actions: Boolean bsuccess = managedptzcontrol.stop(); NOTE: The following stop actions are available: To stop Lens control actions such as zoom, iris, and focus, use the Stop() call. To stop continuous movement triggered by ContinuousMove, ContinuousPan, and ContinuousTilt, use the StopContinuous() call. Continuous Panning NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This entry covers the portion of the sample project that deals with moving the camera left and right. 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the PTZ Control Wrapper instance s ContinuousPan method. To pan your IP camera left, pass in a negative rotational x parameter. To pan the IP camera right, pass in a positive value for the rotational x parameter. For more details on the ContinuousPan method, please refer to the PTZ Control Wrapper API reference documentation. //panning left bool bsuccess = ptzcontrolwrapper.continuouspan(-10000); //panning right bool bsuccess = ptzcontrolwrapper.continuouspan(10000); //panning left Boolean bsuccess = managedptzcontrol.continuouspan(-10000); //panning right Boolean bsuccess = managedptzcontrol.continuouspan(10000); 30

31 C5617M-A Pan, Tilt, Zoom (PTZ) Control 3. When you want to stop the camera from continually moving, use the StopContinuous() method (refer to Continuous Stop for details), or pass in a 0 value to the ContinuousPan method as shown in the following example. bool bsuccess = ptzcontrolwrapper.continuouspan(0); Boolean bsuccess = managedptzcontrol.continuouspan(0); Continuous Tilting NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper C++ sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This entry covers the portion of the sample project that deals with moving the camera up and down. 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the PTZ Control Wrapper instance s ContinuousTilt method. To tilt the IP camera down, pass in a negative rotational y value for the second parameter. To tilt the IP camera up, pass in a positive value for the rotational y parameter. Disregard the last four parameters. For more details on the ContinuousTilt method, please refer to the PTZ Control Wrapper API reference documentation. //tilting down bool bsuccess = ptzcontrolwrapper.continuoustilt(-9000); //tilting up bool bsuccess = ptzcontrolwrapper.continuoustilt(9000); //tilting down Boolean bsuccess = managedptzcontrol.continuoustilt(-9000); //tilting up Boolean bsuccess = managedptzcontrol.continuoustilt(9000); 3. When you want to stop the camera from continually moving, use the StopContinuous() method (refer to Continuous Stop for details), or pass in a 0 value to the ContinuousTilt method as shown in the following example. bool bsuccess = ptzcontrolwrapper.continuoustilt(0); Boolean bsuccess = managedptzcontrol.continuoustilt(0); Continuous Diagonal Movement NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper C++ sample project. 31

32 C5617M-A Pan, Tilt, Zoom (PTZ) Control NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This entry covers the portion of the sample project that deals with continuously moving the camera in a diagonal manner. 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the ContinuousMove method. The first parameter represents both speed and direction on the X plane. Use a negative integer to pan left and a positive integer to pan right. The second parameter represents both speed and direction on the Y plane. Use a negative integer to tilt down and a positive integer to tilt up. For more details on the ContinuousMove method, pplease refer to the PTZ Control Wrapper API reference documentation. //tilting down bool bsuccess = ptzcontrolwrapper.continuousmove(10000, ); //tilting up bool bsuccess = ptzcontrolwrapper.continuousmove(10000, 10000); //tilting down Boolean bsuccess = managedptzcontrol.continuousmove(10000, ); //tilting up Boolean bsuccess = managedptzcontrol.continuousmove(10000, 10000); 3. When you want to stop the camera from continually moving, use the StopContinuous() method (refer to Continuous Stop for details), or pass in a 0 value to the ContinuousMove method as shown in the following example. bool bsuccess = ptzcontrolwrapper.continuousmove(0,0); Boolean bsuccess = managedptzcontrol.continuousmove(0,0); Stopping Continuous Movement To stop the camera from continually moving, call the StopContinuous method. bool bsuccess = ptzcontrolwrapper.stopcontinuous(); Boolean bsuccess = managedptzcontrol.stopcontinuous(); Enabling Continuous Pan/Tilt/Move and Zoom APIs via UDP Instead of TCP Call the PTZ Control Wrapper's SetLowLatencyMode method, passing in true as an argument. This will send the subsequent ContinuousMove, ContinuousTilt, ContinuousPan, StopContinuous and Zoom calls via UDP. bool bsuccess = ptzcontrolwrapper.setlowlatencymode(true); 32

33 C5617M-A Pan, Tilt, Zoom (PTZ) Control Boolean bsuccess = managedptzcontrol.setlowlatencymode(true); Zoom API calls over UDP currently work on Sarix firmware Panning to a Specific Position NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This entry covers the portion of the sample project that deals with moving the camera to a specific point in 2D space. Units are shown in centidegrees (hundredths of a degree). 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the PTZ Control Wrapper s AbsolutePan method, passing in the desired position on the rotational X plane. Passing a negative value moves left of the home position. Passing a positive value moves right of the home position. For more details on the AbsolutePan method, please refer to the PTZ Control Wrapper API reference documentation. Generally, the panning range is limited to 0 to 360 degrees (0 to 36,000 centidegrees). This limit might differ, depending on the type of camera used. bool bsuccess = ptzcontrolwrapper.absolutepan(36000); Boolean bsuccess = managedptzcontrol.absolutepan(36000); Tilting to a Specific Position NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This entry covers the portion of the sample project that deals with moving the camera to a specific point in 2D space. Units are shown in centidegrees (hundredths of a degree). 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the PTZ Control Wrapper s AbsoluteTilt method, passing in the desired position on the rotational X plane. Passing a negative value moves down from horizontal.. Passing a positive value moves up from horizontal.. For more details on the AbsoluteTilt method, refer to the PTZ Control Wrapper API reference documentation. Generally, the tilting range is limited to 0 to -90 degrees (0 to centidegrees). This limit might differ, depending on the type of camera used. bool bsuccess = ptzcontrolwrapper.absolutetilt(-9000); 33

34 C5617M-A Pan, Tilt, Zoom (PTZ) Control Boolean bsuccess = managedptzcontrol.absolutetilt(-9000); Moving to a Specific Position NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This entry covers the portion of the sample project that deals with moving the camera to a specific point in 2D space. Units are shown in centidegrees (hundredths of a degree). 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the PTZ Control Wrapper s AbsoluteMove method, passing in the desired position on the rotational X and Y planes. Passing a negative value for X moves the camera left of the home position. Passing a positive value for X moves the camera right of the home position. Passing a negative value for Y moves the camera down from horizontal. Passing a positive value for Y moves the camera up from horizontal. Refer to your camera model s specifications for tilt position limits. For more details on the AbsoluteMove method, please refer to the PTZ Control Wrapper API reference documentation. bool bsuccess = ptzcontrolwrapper.absolutemove(20, 40); Boolean bsuccess = managedptzcontrol.absolutemove(20, 40); Moving to a Position Relative to the Current Location Call the PTZ Control Wrapper's RelativeMove method, passing in the relative X and Y plane values that the camera should move from the current location. Units are shown in centidegrees (hundredths of a degree). bool bsuccess = ptzcontrolwrapper.relativemove(3000, 5000); Boolean bsuccess = managedptzcontrol.relativemove(3000, 5000); Getting the Camera s Current Position NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This entry covers the portion of the sample project that deals with returning the camera current position expressed as a specific point in 3D space. 34

35 C5617M-A Pan, Tilt, Zoom (PTZ) Control 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the PTZ Control Wrapper s GetAbsolutePosition method. For more details on the GetAbsolutePosition method, please refer to the PTZ Control Wrapper API reference documentation. int positionx = 0; int positiony = 0; bool bsuccess = ptzcontrolwrapper.getabsoluteposition(&positionx, &positiony); int positionx = 0; int positiony = 0; Boolean bsuccess = managedptzcontrol.getabsoluteposition(ref positionx, ref positiony); Managing the Magnification (Zoom) Value NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This section describes how to change the camera s current magnification level. Magnification refers to the camera s zoom level, which in turn describes the focal length for which the camera's lens is currently set. Zoom level is expressed as 100 times the level of magnification that you want. For example, 1x magnification becomes 100, and 18x magnification becomes To change the current magnification level, and to later retrieve the current magnification value, do the following: 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the PTZ Control Wrapper s AbsoluteZoom method passing in the desired zoom level. If the request was successful, your camera s magnification level should now be changed. For more details on the AbsoluteZoom method, refer to the PTZ Control Wrapper API reference documentation. bool bsuccess = ptzcontrolwrapper.absolutezoom(150); Boolean bsuccess = managedptzcontrol.absolutezoom(150); 3. Call the GetAbsoluteZoom method to return the camera s current magnification setting. If the request was successful, your camera s magnification level should be returned. For more details on the GetAbsoluteZoom method, refer to the PTZ Control Wrapper API reference documentation. int magnification = 0; bool bsuccess = ptzcontrolwrapper.getabsolutezoom(magnification); int magnification = 0; Boolean bsuccess = managedptzcontrol.getabsolutezoom(ref magnification); 35

36 C5617M-A Pan, Tilt, Zoom (PTZ) Control Managing the Focus Value NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. NOTE: We recommend that you let your IP camera manage focus automatically. This portion of the documentation covers how to focus near the IP camera or focus far away from the IP camera. 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the SetFocus method, passing in the desired focus command. For a little background, the SetFocus method takes in only the following values: To stop all focus related operations. To start focusing farther. To start focusing nearer. If the request was successful, your camera s focus should now be changing (unless you passed a 0). This will not stop until a SetFocus request is made with a different value, or if you call the Stop method, which will stop movement or lens related action the camera is currently doing. bool bsuccess = ptzcontrolwrapper.setfocus(1); bool bsuccess = ptzcontrolwrapper.setfocus(2); bool bsuccess = ptzcontrolwrapper.setfocus(0); Boolean bsuccess = managedptzcontrol.focus(1); Boolean bsuccess = managedptzcontrol.focus(2); Boolean bsuccess = managedptzcontrol.focus(0); 3. Alternatively the recommended way of controlling focus is to let your IP camera manage it automatically. To enable this feature, call the AutoFocus method and pass a boolean value of true. To disable it, just pass a boolean value of false. bool bsuccess = ptzcontrolwrapper.autofocus(true); Boolean bsuccess = managedptzcontrol.autofocus(true); Iris Control NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. NOTE: We recommend that you let your IP camera manage its iris automatically. 36

37 C5617M-A Pan, Tilt, Zoom (PTZ) Control This section demonstrates how to open and close your camera s iris. 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Call the SetIris method, passing in the desired iris command. For a little background, the SetIris method takes only following values: To stop all iris related operations. To start closing the iris. To start opening the iris. If the request was successful, your camera s iris should now be changing (unless you passed a 0). This will not stop until the SetIris request is made with a different value, or if you call the Stop method, which will stop movement or lens related action the camera is currently doing. bool bsuccess = ptzcontrolwrapper.setiris(1); bool bsuccess = ptzcontrolwrapper.setiris(2); Boolean bsuccess = managedptzcontrol.iris(1); Boolean bsuccess = managedptzcontrol.iris(2); 3. Alternatively the recommended way of controlling the iris is to let your IP camera manage it automatically. To enable this feature, call the AutoIris method and pass a boolean value of true. To disable it, just pass a boolean value of false. bool bsuccess = ptzcontrolwrapper.autoiris(true) Boolean bsuccess = managedptzcontrol.autoiris(true) Scripting One of Pelco s most powerful features enables users to manage and run scripts. Scripts allow you to extend the behavior of Pelco devices with little effort. Before we show you how to use the SDK s scripting related features, it s important to know about the different types of Pelco scripts: Preset A preset is a script that allows you to save a camera's stationary position, zoom, and other settings such as auto-iris and auto-focus, collectively known as a bookmark. Users can save multiple presets per camera. For example if you re monitoring several specific points using the same camera, you can set one preset for each location that needs to be monitored; each with its own set of zoom, iris, and focus values. Presets that you create must be names, such as PRESETX, where the keyword PRESET must be used (uppercase) followed by a positive integer. For example, PRESET9. The number of presets that can be saved and activated is dependent on the Pelco device. Pattern A pattern is like a group of presets combined. For example, you might control an IP PTZ camera guarding a hallway with two entrances and a window. With patterns, you can set a bookmark for camera behavior that changes the camera s view from one of the three points of interest to another every 15 seconds. 37

38 C5617M-A Pan, Tilt, Zoom (PTZ) Control Patterns that you create must be names as PATTERNX, where the keyword PATTERN must be used (uppercase) followed by a positive integer. For example, PATTERN5. NOTE: There are pre-configured patterns that cannot be created. You cannot create a Pattern by combining existing Presets. Like a preset, patterns are typically only relevant for IP cameras. The number of patterns that can be recorded and activated is dependent on the Pelco device. For example, the 16X and 18X models of the Spectra IV can store only a single pattern, while the 22X, 23X and 35X Spectra IV models can store up to eight patterns. Normal Script A general script consists of a group of commands that run over a set period of time. It is akin to a macro. Creating a Preset NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. These steps will show you how to create a preset. 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Now set up your Pelco IP camera with a combination of settings that you want to save. For example, the IP camera s current viewing position, iris setting, focus setting, zoom, and so on. 3. Then call the SetPreset method, passing in the desired name of the preset. Depending on whether the preset already exists or not, it will either create a new one or modify an existing one by that name. bool bsuccess = ptzcontrolwrapper.setpreset("preset99"); Boolean bsuccess = managedptzcontrol.setpreset("preset99"); Updating an Existing Preset To update an existing preset, just following the steps outlined in Creating a Preset, ensuring that you use the name of the existing preset to modify as the parameter for the SetPreset method. Creating a Pattern NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. This is just like creating a preset, except you will be saving more than one camera state. 1. Initialize the PTZ Control Wrapper. Refer to Initializing the PTZ Control Wrapper for details. 2. Now set up your Pelco IP camera with a combination of settings that you want to save. For example, the IP camera s current viewing position, iris setting, focus setting, zoom, and so on. 3. Then call the StartPatternRecording method, passing in the desired name of the preset. 38

39 C5617M-A Pan, Tilt, Zoom (PTZ) Control Depending on whether the pattern already exists or not, it will either create a new one or modify an existing one by that name. bool bsuccess = ptzcontrolwrapper.startpatternrecording("pattern99"); Boolean bsuccess = managedptzcontrol.startpatternrecording("pattern99"); 4. At this point start performing the actions that you d want your camera to remember as a pattern. For example, if you have three points of interest you would first go to the first point of interest with a certain zoom and focus level. After waiting for some predetermined time, you then move the camera s view into the second point of interest which has a different zoom level and iris setting; and do the same for the final point of interest. 5. Finally, call the EndPatternRecording method, passing in the same pattern name as you did before. bool bsuccess = ptzcontrolwrapper.endpatternrecording("pattern99"); Boolean bsuccess = managedptzcontrol.endpatternrecording("pattern99"); Going to an Existing Preset NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. To move the device to a specific preset state, call the PTZ Control Wrapper s GotoPreset method, passing in the name of the preset. The camera or device will move to the preset and then stop. bool bsuccess = ptzcontrolwrapper.gotopreset("preset99"); Boolean bsuccess = managedptzcontrol.gotopreset("preset99"); Removing an Existing Preset NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. To remove an existing preset, call the PTZ Control Wrapper s RemovePreset method, passing in the name of the preset. The preset will then be deleted. bool bsuccess = ptzcontrolwrapper.removepreset("preset99"); 39

40 C5617M-A Pan, Tilt, Zoom (PTZ) Control Boolean bsuccess = managedptzcontrol.removepreset("preset99"); Updating an Existing Pattern To update an existing pattern, just following the steps outlined in Creating a Pattern. Ensure that you use the name of the pattern to modify as the parameter for both the StartPatternRecording and EndPatternRecording methods. Executing an Existing Pattern NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. To run a a script, call the PTZ Control Wrapper s RunPattern method, passing in the name of the script to run. The script will continue to run until stopped by the user using the HaltPattern method, detailed Stopping a Pattern Currently Being Executed on page 40. bool bsuccess = ptzcontrolwrapper.runpattern("pattern99"); Boolean bsuccess = managedptzcontrol.runpattern("pattern99"); Stopping a Pattern Currently Being Executed NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the PTZ Control Wrapper sample project. NOTE: PTZ control functionality is also available as part of the PelcoAPIViewer. For each of the methods described in this topic, there is an equivalent method in the PelcoAPIViewer API. If you want to stop a script that is currently running, call the PTZ Control Wrapper s HaltPattern method, passing in the name of the script to stop. bool bsuccess = ptzcontrolwrapper.haltpattern("pattern99"); Boolean bsuccess = managedptzcontrol.haltpattern("pattern99"); 40

41 Chapter 4 Events and Alarms Overview WARNING: Any provided sample code is meant to be a reference implementation focused on educating developers about Pelco devices. Though there are exceptions, in general Pelco sample code is NOT intended for immediate production use without modification. WARNING: The content in this section assumes that the default target installation directory was chosen during installation. NOTE: For the latest Pelco documentation, visit For a list of the latest special issues and problems regarding the Event Arbiter library, visit content/event-arbiter-library-issues. For a list of the latest special issues and problems regarding the Event Manager, visit event-manager-issues. Events and alarms are essentially XML formatted messages triggered by Pelco products, when some particular criteria is met. Specifically Pelco products, acting as event providers, send these events and alarms to their subscribers. Typically event providers are web services, while subscribers are software clients. For example, if an IP camera s MotionDetection service detected movement within a particular region in the video frame, it can send an event to all of its subscribers such as a VMS. Where Does the Pelco SDK Fit? The Pelco SDK provides you with two components for eventing: the Event Arbiter Library and the Event Manager. The Event Arbiter Library and Event Manager both allow you to subscribe, unsubscribe, and renew subscriptions to events. However there are differences between the two components. The Event Arbiter Library is the primary component for dealing with eventing. It is for users looking for the most flexibility and control. Conversely, the Event Manager is a component that sits on top of the Event Arbiter Library. Its main purpose is to provide users with ease of use in exchange for decreased control. Event Arbiter Library The Event Arbiter Library allows you to either subscribe directly to a device s web service events or indirectly; allowing you to choose to subscribe to the particular web service from all devices providing the service. Once a subscription is established, the software client just has to wait for an event to fire. The web service will direct the event to your software client through the Pelco SDK. As for subscription renewals, it should be noted that the Event 41

42 C5617M-A Events and Alarms Arbiter Library now also handles subscription renewals automatically. You will no longer have to worry about renewing an event subscription. Environment No System Manager System Manager available; EventArbiter web service active System Manager available; EventArbiter web service NOT active Pelco SDK Consequence Only direct device subscription available. Not all event data will be parsed by Pelco SDK. Able to subscribe to all devices at once that provide a specific web service. All event data is available and parsed. Only direct device subscription is available. Event Manager The Event Manager represents a new tool for eventing and a new component within the Pelco SDK. The Event Manager provides another abstraction on top of the Event Arbiter Library, and simplifies event operations even further. It allows subscriptions to all available web services for all devices on a given network that fall under a specific category. To subscribe, all you have to provide is the event category. The categories are as follows: Alarm Array Configuration events Relay Array Configuration events Motion Detection events Environment No System Manager System Manager available; EventArbiter web service active System Manager available; EventArbiter web service NOT active Pelco SDK Consequence Does not apply -- can t use Event Manager. Able to subscribe to all available web services that are under a specified category via the SM EventArbiter web service, in one subscription. All event data is available and parsed. If the SM EventArbiter web service is not active, however, or if you choose not to use it, the EventManager library will automatically subscribe to each individual device's web service in the specified category, resulting in many subscriptions. Event Arbiter Library Compared to Event Manager Event Arbiter Harder to use, but with more options and flexibility. Does not require a System Manager. Event Manager Easier to use, but not as flexible: the user only needs to choose the category of events he is interested in receiving. Requires a System Manager. Able to subscribe to a single device s web service using either an IP address or UDN. Able to subscribe to all instances of a particular web service. That is, a user can subscribe to all MotionDetection web services for all devices with just one request. NOTE: For more Endura specific information, refer to the Appendix. 42

43 C5617M-A Events and Alarms What s Ahead This is a high level overview of what steps are needed for handling events. 1. Subscribe to the desired web service's events through the Event Arbiter Library or the Event Manager. 2. Create the method that will handle the event. Associate that method with the Event Arbiter Library instance s event handler. Wait for an event to occur (or trigger an event to test), then handle it. 3. When no longer interested in receiving events (or when finished testing), unsubscribe from the subscribed web service. Creating an Event Agent NOTE: The related source code for this entry (for C++) can be found in the MyEventAgent header file, which belongs to the Event Arbiter Library C++ sample project. The related source code for this entry (for C#) can be found in the class MyEventAgentNet in the ManagedEventArbiterSample.cs file, which belongs to the Event Arbiter Library C# sample project. The main purpose of an EventAgent class is to deal with any incoming events that have been subscribed to by the Event Arbiter. To create your own EventAgent class, implement the NotifyEvent method in the IEventAgent interface. NotifyEvent includes parameters for the response and the event. Details of implementation are left to the user. However in the MyEventAgent sample class, we demonstrate basic functionality for accessing event related data. #ifndef MYEVENTAGENT_H #define MYEVENTAGENT_H #include "PelcoAPI/IEventAgent.h" using namespace PelcoAPI; class MyEventAgent : public IEventAgent { public: STDCALL MyEventAgent(); virtual STDCALL ~MyEventAgent(); void STDCALL NotifyEvent(const char * szresponse, const Event * pevent); private: int m_ncounter; }; #endif class MyEventAgentNet:PelcoAPI.IEventAgentNet { Int32 ncounter = 0; public void NotifyEvent(String sresponse, PelcoAPI.EventNet eventnet) { Console.Write("\nNotify EVENT {0}:\n", ++ncounter); Console.Write("\tUDN: {0}\n", eventnet.m_sudn); Console.Write("\tService ID: {0}\n", eventnet.m_sserviceid); Console.Write("\tUTC Time: {0}\n", eventnet.m_sutctime); Console.Write("\tType: {0}\n", eventnet.m_ntype); Console.Write("\tFriendly Name: {0}\n", eventnet.m_sdevicefriendlyname); if (eventnet.m_ntype == 1) { Console.Write("\tAssociated Camera UDN: {0}\n", eventnet.m_sassociatecameraudn); for (Int32 i = 0; i < eventnet.m_alarmorrelayinfo.getlength(0); i++) { Console.Write("\tAlarm ID: {0}\n", eventnet.m_alarmorrelayinfo[i].m_nid); 43

44 C5617M-A Events and Alarms Console.Write("\t\tSeverity: {0}\n", eventnet.m_alarmorrelayinfo[i].m_nseverity); Console.Write("\t\tState: {0}\n", (eventnet.m_alarmorrelayinfo[i].m_bstate? "On" : "Off")); } } else if (eventnet.m_ntype == 2) { for (Int32 i = 0; i < eventnet.m_alarmorrelayinfo.getlength(0); i++) { Console.Write("\tAlarm ID: {0}\n", eventnet.m_alarmorrelayinfo[i].m_nid); Console.Write("\t\tState: {0}\n", (eventnet.m_alarmorrelayinfo[i].m_bstate? "On" : "Off")); } } else if (eventnet.m_ntype == 4) { Console.Write("\tAlarm State: {0}\n", (eventnet.m_balarmstate? "On" : "Off")); } else if (eventnet.m_ntype == 8) { Console.Write("\tAlarm State: {0}\n", (eventnet.m_balarmstate? "On" : "Off")); Console.Write("\tSeverity: {0}\n", eventnet.m_nvideoanalyticsseverity); } Console.Write("EVENT Details:\n{0}\n", sresponse); } } Returning the Event Subscription URL NOTE: The related source code for this entry can be found in main.cpp s main function (for C++), or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper C++ and C# sample project. 1. Initialize the System Manager Wrapper. Refer to Initializing the System Manager Wrapper for details. 2. Call the System Manager Wrapper instance s GetDeviceServiceAttribute method, passing in the following: login ID A result returned from a successful call to the UserLogin method. target device s Unique Device Name (UDN) To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. web service s Service ID A URN value found in the web service s corresponding WSDL file. attribute name of SYS_UpnpEventSubUrl pointer to the variable that will hold the result PelcoAPI::xstring sevnturl; bsuccess = sm.getdeviceserviceattribute(loginid, "UUID:B11DBF247E984B9BB83B7E74497DE6CA", "urn:schemas-pelco-com:service:motiondetection:1", "SYS_UpnpEventSubUrl", &sevnturl) 44

45 C5617M-A Events and Alarms Initializing the Event Arbiter Library Initializing the Event Arbiter Library for C++ NOTE: The related source code for this entry can be found in EventArbiterSample.cpp s main function which belongs to the Event Arbiter Library sample project. This assumes that you have already completed the steps outlined in Creating an Event Agent. 1. Initialize the System Manager Wrapper. Refer to Initializing the System Manager Wrapper for details. 2. Declare the Event Arbiter Library instance. Set the Event Arbiter Library instance's network location and port number, using the System Manager s IP address and port number. Refer to Automatically Determining the System Manager s IP Address and Port Number for more details. PelcoAPI::IEventArbiter * peventarbiter = new PelcoAPI::EventArbiter(" ", "60001", true); 3. Set the Event Arbiter Library instance's network location and port number, using the local host IP address and port number. peventarbiter->setupipandport(" ", "9716"); 4. Register your Event Agent class with the Event Arbiter Library instance. For details on creating an Event Agent, refer to Creating an Event Agent. MyEventAgent agent; peventarbiter->registereventagent(&agent); Initializing the Event Arbiter Library for C# NOTE: In release mode, you need to select the Enable unmanaged code debugging checkbox in the project settings to see console output. A System Manager Is Available on Your Network NOTE: The related source code for this entry can be found in ManagedEventArbiterSample.cs s main function, which belongs to the Event Arbiter Library C# sample project. This assumes that you have already completed the steps outlined in Creating an Event Agent. 1. Initialize the System Manager Wrapper. Refer to Initializing the System Manager Wrapper for details. 2. Initialize your implemented Event Agent. Refer to Creating an Event Agent for details. MyEventAgentNet pagent = new MyEventAgentNet(); 3. Next, declare the Event Arbiter Library instance. Set the following parameters: Event Arbiter Library instance's network location and port number The client machine where it resides. Your implemented Event Agent to register The System Manager s IP address and port number. boolean Refer to Automatically Determining the System Manager s IP Address and Port Number for more details. True to force the EventArbiter library to use the System Manager, false otherwise. PelcoAPI.EventArbiterNet peventarbiter = new PelcoAPI.EventArbiterNet( " ", "9716", pagent, " ", "60001", true); 45

46 C5617M-A Events and Alarms A System Manager Is Not Available on Your Network 1. Initialize your implemented Event Agent. Refer to Creating an Event Agent for details. 2. Next, declare the Event Arbiter Library instance. Set the following parameters: Event Arbiter Library instance's network location and port number The client machine where it resides. Your implemented Event Agent to register Use empty strings for parameters representing the System Manager s IP address and port number. Set the last parameter to false. Explicitly not rely on the System Manager s EventArbiter service. PelcoAPI.EventArbiterNet peventarbiter = new PelcoAPI.EventArbiterNet( " ", "9716", pagent, "", "", false); Initializing the Event Manager The related source code for this entry (for C++) can be found in EventManagerSample.cpp s main function, which belongs to the Event Manager Library C++ sample project. The related source code for this entry (for C#) can be found in the ManagedEventManagerSample.cs s main function, which belongs to the Event Manager C# sample project. This assumes that you have already completed the steps outlined in the Creating an Event Agent. These steps also require the existence of a System Manager on your network. 1. Initialize the System Manager Wrapper. Refer to Initializing the System Manager Wrapper for details. 2. Initialize your implemented Event Agent. Refer to Creating an Event Agent for details. MyEventAgentNet pagent = new MyEventAgentNet(); 3. Next, declare the Event Arbiter Library instance. Set the following parameters: Event Arbiter Library instance's network location and port number The client machine where it resides. Your implemented Event Agent to register The System Manager s IP address and port number. boolean Refer to Automatically Determining the System Manager s IP Address and Port Number for more details. True to force the EventArbiter library to use the System Manager, false otherwise. MyEventAgent agent; PelcoAPI::IEventManager * peventmanager = new PelcoAPI::EventManager( " ", "9716", &agent, false, " ", "60001"); PelcoAPI.EventManagerNet peventmanager = new PelcoAPI.EventManagerNet( " ", "9716", pagent, false, " ", "60001"); 46

47 C5617M-A Events and Alarms Device or Service Specific Subscriptions If you want to subscribe to events from a specific web service or device, then this section will show you the most common scenarios. Using the Event Arbiter Library to Subscribe Using the Device s IP Address NOTE: This entry is relevant for users who are not relying on either the System Manager or its EventArbiter service. The related source code for this entry can be found in EventArbiterSample.cpp s main function (for C++) or ManagedEventArbiterSample.cs s main function (for C#), which belongs to the Event Arbiter Library sample project. This topic describes how to use the Event Arbiter Library to subscribe to a specific device s particular web service using the device s IP address. Having an event subscription simply tells a device that you would like to receive its event notifications. To request a event subscription, the following must be done: 1. Initialize the Event Arbiter Library. Refer to Initializing the Event Arbiter Library for details. 2. Call the Event Arbiter wrapper instance's SubscribeToEvents method (SubscribeEvents in C#), passing the event subscription URL. For details, refer to Returning the Event Subscription URL. If the request was successful, the method will return the event subscription's unique ID which will allow users to either renew or unsubscribe the event subscription. If unsuccessful, the method returns NULL. NOTE: Pelco SDK now automatically handles subscription renewals. const char * szsid_1 = peventarbiter->subscribetoevents(" event/alarmarrayconfiguration-1"); String strsid_1 = peventarbiter.subscribeevents( " ); Using the Event Arbiter Library to Subscribe Using the Event Subscription URL This topic describes how to use the Event Arbiter Library to subscribe to a specific device s particular web service using the Event Subscription URL. NOTE: This entry is ONLY relevant for users who use an Endura network, specifically with an active System Manager and an enabled EventArbiter service on the System Manager. The related source code for this entry can be found in EventArbiterSample.cpp s main function (for C++) or ManagedEventArbiterSample.cs s main function (for C#), which belongs to the Event Arbiter Library sample project. 1. Initialize the Event Arbiter Library. Refer to Initializing the Event Arbiter Library for details. 2. Construct an event service ID. It consists of the device s UDN and the web service s URN, which is its namespace on its WSDL file. (For details on determining a web service s ID, refer to Returning the Event Subscription URL.) std::string streventserviceid = "uuid:d557efb9-3a2d-48a1-b2fa-b48231f62f15/ urn:pelco-com:serviceid:alarmarrayconfiguration-1"; String streventserviceid = "uuid:d557efb9-3a2d-48a1-b2fa-b48231f62f15/ urn:pelcocom:serviceid:alarmarrayconfiguration-1"; 47

48 C5617M-A Events and Alarms 3. Call the Event Arbiter Library instance's SubscribeToEvents method (SubscribeEvents in C#), passing the event service ID. If the request was successful, the method will return the event subscription's unique ID which will allow users to either renew or unsubscribe the event subscription. NOTE: Pelco SDK now automatically handles subscription renewals. const char * szsid_1 = peventarbiter- >SubscribeToEvents(strEventServiceId.c_str()); String strsid_1 = peventarbiter.subscribeevents(streventserviceid); Using the Event Arbiter Library to Subscribe to All Instances of a Service NOTE: This entry is ONLY relevant for users who use an Endura network, specifically with an active System Manager and an enabled EventArbiter service on the System Manager. The related source code for this entry can be found in EventArbiterSample.cpp s main function (for C++) or ManagedEventArbiterSample.cs s main function (for C#), which belongs to the Event Arbiter Library sample project. If you want to subscribe to all devices that provide a specific web service like MotionDetection (or any other web service that has events), do the following: 1. Initialize the Event Arbiter Library. Refer to Initializing the Event Arbiter Library for details. 2. Construct an event URN. It is essentially the SOAP web service URN. You can determine this URN value looking at the web service s associated WSDL file (it should be near the top of the file). std::string streventurn = "urn:schemas-pelco-com:service:motiondetection:1"; String streventurn = "urn:schemas-pelco-com:service:motiondetection:1"; 3. Call the Event Arbiter wrapper instance's SubscribeToEvents method (SubscribeEvents in C#), passing the event URN. If the request was successful, the method will return the event subscription's unique ID which will allow users to either renew or unsubscribe the event subscription. NOTE: Pelco SDK now automatically handles subscription renewals. const char * szsid_1 = peventarbiter->subscribetoevents(streventurn.c_str()); String strsid_2 = peventarbiter.subscribeevents(streventurn); Using the Event Arbiter Library to Unsubscribe from a Service NOTE: The related source code for this entry can be found in EventArbiterSample.cpp s main function (for C++) or ManagedEventArbiterSample.cs s main function (for C#), which belongs to the Event Arbiter Library sample project. This entry assumes that the user has already completed the steps outlined in any of the Event Arbiter subscription-related entries. 48

49 C5617M-A Events and Alarms To unsubscribe from an existing event subscription, call the Event Arbiter wrapper instance's UnSubscribeToEvents method (UnsubscribeEvents in C#), passing the subscription identifier. You should receive subscription IDs on successful calls to SubscribeToEvents. If the request was successful, the method will return a 1 (for C++) or true (for C#). Otherwise it will return a 0 (for C++) or false (for C#). const char * szsid_1 = peventarbiter->subscribetoevents( "urn:schemas-pelco-com:service:motiondetection:1"); //... misc logic... peventarbiter->unsubscribetoevents(strsid_1); String strsid_1 = peventarbiter.subscribeevents( "urn:schemas-pelco-com:service:motiondetection:1"); //... misc logic... Boolean ret = peventarbiter.unsubscribeevents(strsid_1); Mass Subscriptions by Category If you don t really know what particular events or devices where you would like a subscription, then this section is for you. It will show you how to subscribe to all events that fall under your desired category. Using the Event Manager to Subscribe to All Services NOTE: The related source code for this entry can be found in EventManagerSample.cpp s main function (for C++) or ManagedEventManagerSample.cs s main function (for C#), which belongs to the Event Manager Library sample project. Also note that the Event Manager requires the presence of a System Manager on the network. The following steps will allow you to subscribe to all events that fall under one of several categories defined by the Pelco SDK. 1. Initialize the Event Manager. Refer to Initializing the Event Manager for details. 2. Call the Event Manager instance's Start method, passing the desired event type as defined by the Pelco SDK. The Event Manager will now start listening to events. Use one or more of the following options (you can add several of these values together to subscribe to more than one category of event at a time): enum EventType { EVENT_TYPE_UNKNOW = 0x , EVENT_TYPE_ALARM_ARRAY_CONFIGURATION = 0x , EVENT_TYPE_RELAY_ARRAY_CONFIGURATION = 0x , EVENT_TYPE_MOTION_DETECTION = 0x , EVENT_TYPE_MASK = 0x F }; enum REGISTER_EVENTS { ALARM_ARRAY = 0x , RELAY_ARRAY = 0x , MOTION_DETECTION = 0x , } Alarm Array Configuration Events that are related to the AlarmArrayConfiguration web service, such as an alarm circuit connected to the camera has been turned on or off. 49

50 C5617M-A Events and Alarms Relay Array Configuration Events that are related to the RelayArrayConfiguration web service. Motion Detection Unknown Mask Events that are related to the MotionDetection web service, such as the camera started or stopped detecting motion. This is a system-reserved value and can be disregarded. A system-reserved value that combines all the different event categories, allowing you to subscribe to all of them at once. NOTE: Always refer to the EventArbiterDefs header for the latest options. If the request was successful, the method will return true; false otherwise. bool ret = peventmanager->start(pelcoapi::event_type_mask); Boolean ret = peventmanager.start(register_events.event_type_mask); NOTE: Pelco SDK now automatically handles subscription renewals. Using the Event Manager to Unsubscribe from All Services NOTE: The related source code for this entry can be found in EventManagerSample.cpp s main function (for C++) or ManagedEventManagerSample.cs s main function (for C#), which belongs to the Event Manager Library sample project. Also note that the Event Manager requires the presence of a System Manager on the network. This entry assumes that the user has already completed the steps outlined in the Event Manager subscription-related entry. To unsubscribe from an existing event subscription for Event Manager, call the Event Manager instance s Stop method. If successful it will return true, false otherwise. The following example unsubscribes from all active event subscriptions at once. bool ret = peventmanager->stop(); Boolean ret = peventmanager.stop(); Handling Incoming Events NOTE: The related source code for this entry can be found in MyEventAgent.cpp s NotifyEvent function (for C++), or the NotifyEvent function in the class MyEventAgentNet (for C#), which belongs to the Event Arbiter Library sample project. The availability of some data is dependent on the availability of a System Manager on your network, that is, if a System Manager is not online, then some event data will be missing. The Pelco SDK already parses event related data for you. All that is required is for you to figure out how to use our provided Event struct. 1. Define a class that implements the EventAgent interface. For details, refer to Creating an Event Agent. 2. Within your EventAgent implementation is the NotifyEvent method. 50

51 C5617M-A Events and Alarms This is where you will process any incoming event notifications. Events will be represented by the Event struct as defined in the EventArbiterDefs header. (The raw event XML string data will be encapsulated by the parameter.) Common to most events are the following attributes (listed below respectively): Device UDN, web service ID The timestamp in UTC The event type as defined by the Pelco SDK The device s friendly name void MyEventAgent::NotifyEvent(const char * szresponse, const Event * pevent) { //... other logic... pevent->m_strudn.c_str(); pevent->m_strserviceid.c_str(); pevent->m_strutceventtime.c_str(); pevent->m_ntype; pevent->m_strdevicefriendlyname.c_str(); Int32 ncounter = 0; public void NotifyEvent(String sresponse, PelcoAPI.EventNet eventnet) { Console.Write("\nNotify EVENT {0}:\n", ++ncounter); Console.Write("\tUDN: {0}\n", eventnet.m_sudn); Console.Write("\tService ID: {0}\n", eventnet.m_sserviceid); Console.Write("\tUTC Time: {0}\n", eventnet.m_sutctime); Console.Write("\tType: {0}\n", eventnet.m_ntype); Console.Write("\tFriendly Name: {0}\n", eventnet.m_sdevicefriendlyname); If the incoming event is an alarm from the AlarmArrayConfiguration web service, it will provide information on the camera it is associated with as well as general alarm data. if (pevent->m_ntype == PelcoAPI::EVENT_TYPE_ALARM_ARRAY_CONFIGURATION) { //the camera associated to this event pevent->m_strassociatecameraudn.c_str(); for (size_t i = 0; i < pevent->m_alarmorrelayinfo.size(); i++) { //alarm ID pevent->m_alarmorrelayinfo[i]->m_nid; //alarm severity pevent->m_alarmorrelayinfo[i]->m_nseverity; //the state of the alarm 0 off 1 on pevent->m_alarmorrelayinfo[i]->m_bstate; } } if (eventnet.m_ntype == 1) { Console.Write("\tAssociated Camera UDN: {0}\n", eventnet.m_sassociatecameraudn); for (Int32 i = 0; i < eventnet.m_alarmorrelayinfo.getlength(0); i++) { Console.Write("\tAlarm ID: {0}\n", 51

52 C5617M-A Events and Alarms eventnet.m_alarmorrelayinfo[i].m_nid); Console.Write("\t\tSeverity: {0}\n", eventnet.m_alarmorrelayinfo[i].m_nseverity); Console.Write("\t\tState: {0}\n", (eventnet.m_alarmorrelayinfo[i].m_bstate? "On" : "Off")); } } If the incoming event is an alarm from the RelayArrayConfiguration web service, it will provide as general relay data such as the relay ID and whether or not it is enabled. if (pevent->m_ntype == PelcoAPI::EVENT_TYPE_RELAY_ARRAY_CONFIGURATION) { for (size_t i = 0; i < pevent->m_alarmorrelayinfo.size(); i++) { pevent->m_alarmorrelayinfo[i]->m_nid; pevent->m_alarmorrelayinfo[i]->m_bstate; } } else if (eventnet.m_ntype == 2) { for (Int32 i = 0; i < eventnet.m_alarmorrelayinfo.getlength(0); i++) { Console.Write("\tAlarm ID: {0}\n", eventnet.m_alarmorrelayinfo[i].m_nid); Console.Write("\t\tState: {0}\n", (eventnet.m_alarmorrelayinfo[i].m_bstate? "On" : "Off")); } } If the incoming event is from the MotionDetection web service, it will show whether or not the motion detection region is active or inactive. if (pevent->m_ntype == { pevent->m_balarmstate; } PelcoAPI::EVENT_TYPE_MOTION_DETECTION) else if (eventnet.m_ntype == 8) { Console.Write("\tAlarm State: {0}\n", (eventnet.m_balarmstate? "On" : "Off")); Console.Write("\tSeverity: {0}\n", eventnet.m_nvideoanalyticsseverity); } The szresponse parameter contains the raw event data in XML format. This is useful for debugging, or XML data binding to your classes. TRACE_INFO("EVENT Details: \n%s\n", szresponse); 52

53 C5617M-A Events and Alarms Console.Write("EVENT Details:\n{0}\n", sresponse); Polling Events NOTE: The related source code for this entry can be found in EventArbiterSample.cpp's main function (for C++) or ManagedEventArbiterSample.cs's Main function (for C#), which belongs to the Event Arbiter Library sample project. The availability of some data is dependent on the availability of a System Manager on your network, that is, if a System Manager is not online, then some event data will be missing. This API allows you to poll events instead of having to perform a callback. 1. Set the EventAgent to NULL in the RegisterEventAgent method. peventarbiter->registereventagent(null); MyEventAgentNet pagent = null; 2. To poll events one by one using Event Arbiter or Event Manager, call the Event Arbiter or Event Manager instance's PollEvent method. std::string strrawevent; PelcoAPI::Event pelcoevent // Additional logic... if (peventarbiter->pollevent(strrawevent, pelcoevent)) //... String srawevent = ""; PelcoAPI.EventNet pelcoevent = null; // Additional logic... if (peventmanager.pollevent(ref srawevent, ref pelcoevent)) //... 53

54 C5617M-A Events and Alarms 54

55 Chapter 5 Extracting Audio and Video Metadata Extracting Audio and Video Metadata WARNING: Any provided sample code is meant to be a reference implementation focused on educating developers about Pelco devices. Though there are exceptions, in general Pelco sample code is NOT intended for immediate production use without modification. WARNING: The content below assumes that the default target installation directory was chosen during installation. NOTE: For the latest Pelco documentation, visit There will always be special situations, such as custom video analytics, that call for processing video meta-data like timestamps. Where Does the Pelco SDK Fit? The Meta-data Parser is a utility for parsing Pelco Video Elementary Stream (VES) meta-data from Pelco streams. Pelco VES frames contain the following meta-data: MotionDetection active areas Timestamps Pelco Analytics drawing primitives RSA Signature and other information necessary to verify the frame The Meta-data Parser consists of an interface that provides access to the various objects within the elementary stream. 55

56 C5617M-A Extracting Audio and Video Metadata Motion Detection Metadata Motion detection involves computing the difference between two images. If the difference between the compared images crosses a certain threshold value, then motion is detected and the selected Alert is triggered. The key to Pelco s motion detection feature is the Region of Interest (ROI). The ROI denotes a motion detection region within a video frame. A motion detection region is essentially a grid of motion detection 16x16 pixel cell blocks. These cells have sensitivity and movement threshold limits. The sensitivity level dictates the amounts of movement that are registered within the ROI, while the threshold dictates the amounts of blocks that are registered within the ROI before the selected alarm is triggered. What motion detection metadata is available? Currently in terms of metadata, each video frame can only hold a single ROI. Consequently, for each frame, the metadata describes the length and width of the ROI, while also holding a Pelco base64 bit mask for the state of the ROI. NOTE: The difference between Pelco base64 and standard base64 implementations is that the Pelco version always appends an = character at the end of the encoded value. Pelco Analytics Drawing Primitives Drawing primitives are basic graphical elements. They encompass drawing points, fills, lines, arcs, and even text. This basically contains information related to the points, lines, arcs, and so on. Timestamps Timestamp metadata represents the exact date and time when the video frame was captured. The Metadata Parser Library can return this data in a number of ways. struct timeval The timestamp represented as a struct timeval. tv_sec The time interval in seconds since the epoch. tv_usec The time interval in microseconds since the epoch. typedef struct timeval { long tv_sec; long tv_usec; } timeval; struct tm The timestamp represented as a struct tm. tv_sec The time interval in seconds. (0-59) 56

57 C5617M-A Extracting Audio and Video Metadata tv_min The time interval in minutes. (0-59) tv_hour The time interval in hours. (0-23) tv_mday The time interval in day of the current month. (1-31) tv_mon The time interval in months since January. (0-11) tv_year The time interval in years since tv_wday The time interval in days since Sunday. (0-6) tv_yday The time interval in days since January 1st. (0-365) tv_isdst A boolean that is true if it is currently daylight savings time, false otherwise. typedef struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; } In addition to returning the data above, the Metadata Parser Library also returns the daylight savings offset, the current timezone, and values in local time. Getting Started For more information about getting started and setting up the working directory, refer to Setting Up Sample Projects. Depending on whether you would like to use the release version of the Pelco SDK libraries or the debug version, change the Working Directory value as appropriate. Assuming that you did not change the default installation directory for the Pelco SDK, use C:\\Program Files\Pelco\API\Libs\Release to use the production version of the Pelco SDK libraries. Conversely, use C:\\Program Files\Pelco\API\Libs\Debug to use the debug version of the Pelco SDK libraries. What s Ahead This is a high level overview of possible tasks related to metadata: 1. Access the metadata from the stream. 2. Render metadata onto a video frame. Initializing the Metadata Parser Class NOTE: The related source code for this entry can be found in main.cpp s main function, which belongs to the Metadata Parser C++ sample project. 1. Create a MetaDataParser instance. 57

58 C5617M-A Extracting Audio and Video Metadata 2. Call its SetData method, passing the buffer containing the data to analyze and the buffer length as parameters. PelcoAPI::MetaDataParser parser; parser.setdata(videobuffer, length); Creating a Metadata Renderer Class NOTE: The related source code for this entry can be found in SampleMetaDataRenderer.cpp, which belongs to the MetaDataParser C++ sample project. You are expected to implement the actual logic. This class is used for drawing onto video frames. 1. Implement the following required protected methods: a) DrawLine to draw a line using two given points: 'v1' and 'v2' virtual void DrawLine(const PelcoAPI::VECTOR &v1, const PelcoAPI::VECTOR &v2, PelcoAPI::COLOR color) throw(); b) DrawRectangle to draw a rectangle whose upper left corner is determined by the parameter v1, while the lower right corner is determined by the parameter v2. If the fill parameter is set to true, the rectangle should be solid. Otherwise, it should only be an outline. virtual void DrawRectangle(const PelcoAPI::VECTOR &v1, const PelcoAPI::VECTOR &v2, PelcoAPI::COLOR color, bool fill) throw(); c) DrawPolygon to draw a polygon with corners defined within the Vector array. If the fill parameter is set to true, the polygon should be solid. Otherwise, it should only be an outline. virtual void DrawPolygon(PelcoAPI::VECTOR *vectors, unsigned int count,pelcoapi::color fillcolor, PelcoAPI::COLOR bordercolor, bool fill) throw(); d) DrawText virtual void DrawText(const std::string &text, const PelcoAPI::VECTOR &location, PelcoAPI::COLOR color) throw(); 2. (Optional) Implement the following protected methods: a) BeginDraw to perform any pre-drawing work. virtual void BeginDraw() throw(); b) EndDraw to perform any post-drawing work. virtual void EndDraw() throw(); c) TransformVectorForDisplay to handle point translation and scaling. virtual PelcoAPI::VECTOR TransformVectorForDisplay(const PelcoAPI::VECTOR &v) throw(); Retrieving the Current Timestamp Metadata NOTE: The related source code for this entry can be found in main.cpp s ProcessTimestamp function, which belongs to the Metadata Parser C++ sample project. 1. Initialize the MetaDataParser. For details, refer to Initializing the Metadata Parser Class. 58

59 C5617M-A Extracting Audio and Video Metadata 2. Verify whether the parser has found a timestamp by calling the HasTimeStamp method, which will return true if found, false otherwise. if(true == parser.hastimestamp()){ 3. If there is a timestamp, call the GetTimeStampAsString method, passing in a local time Boolean parameter, which if true returns the timestamp in local time, while false returns the UTC value: std::string timestamp = parser.gettimestampasstring(true, "%c"); Motion Detection Metadata Retrieving Motion Detection Metadata NOTE: The related source code for this entry can be found in main.cpp s ProcessMotionData function, which belongs to the Metadata Parser C++ sample project. 1. Initialize the MetaDataParser. For details, refer to Initializing the Meta-Data Parser Class. 2. Check if the parser has found motion detection data by calling the HasMotionData method, which will return true if found, false otherwise. if(true == parser.hasmotiondata()){ 3. If there is motion detection metadata, call the GetMotionData method and pull the result into a new MotionData instance. PelcoAPI::MotionData *data = parser.getmotiondata(); 4. Parse the resulting data from the MotionData instance. if(null!= data){ unsigned int cols = data->columns(); unsigned int rows = data->rows(); unsigned char *mask = data->bitmask(); // Do something with the data here // Delete the motion data object Rendering Motion Detection Metadata NOTE: The related source code for this entry can be found in main.cpp s ProcessMotionData function, which belongs to the Metadata Parser C++ sample project. NOTE: This entry assumes that the user has already completed the steps outlined in Creating a Metadata Renderer Class. 1. Initialize the MetaDataParser. For details, refer to Initializing the Meta-Data Parser Class. 2. Check if the parser has found motion detection data. Call the HasMotionData method, and if true, retrieve the motion metadata. if(true == parser.hasmotiondata()){ PelcoAPI::MotionData *data = parser.getmotiondata(); 3. After you retrieve the motion detection metadata, declare your MetaDataRenderer class. SampleMetaDataRenderer renderer; 59

60 C5617M-A Extracting Audio and Video Metadata 4. Create a new COLOR struct, setting the desired alpha transparency and colors to display on the screen. In this example, the colors (red, green, blue) are fully opaque with zero transparency. PelcoAPI::COLOR color = {255,0,128,255}; 5. Render the motion metadata onto the screen by calling the RenderMotionData method. renderer.rendermotiondata(); Drawing Metadata Retrieving Drawing Metadata NOTE: The related source code for this entry can be found in main.cpp s ProcessDrawingData function, which belongs to the Metadata Parser C++ sample project. 1. Initialize the MetaDataParser. For details, refer to Initializing the Meta-Data Parser Class. 2. Determine if the parser has found drawing data by calling the HasDrawingData method, which will return true if found, false otherwise. if(true == parser.hasdrawingdata()){ 3. If drawing metadata is found, call the GetDrawingData method, pulling the result into a DrawingData instance. PelcoAPI::DrawingData *data = parser.getdrawingdata(); 4. Parse the resulting data by iterating through the returned drawing primitives. PelcoAPI::DrawingPrimitive *primitive = data->getnextprimitive();; while(primitive!= NULL){ primitive->getprimitivetype(); PelcoAPI::DrawingPrimitive::FreePrimitive(primitive); primitive = data->getnextprimitive(); } Rendering Drawing Metadata NOTE: The related source code for this entry can be found in main.cpp s RenderDrawingData function, which belongs to the Metadata Parser C++ sample project. This entry assumes that the user has already completed the steps outlined in Creating a Metadata Renderer Class. 1. Iinitialize the MetaDataParser. For details, refer to Initializing the Metadata Parser Class. 2. Determine if the parser has found drawing data by calling the HasDrawingData method, and if true, retrieve the drawing metadata by calling the GetDrawingData. if(true == parser.hasdrawingdata()){ PelcoAPI::DrawingData *data = parser.getdrawingdata(); 3. After you grab the drawing metadata, declare your MetaDataRenderer class. SampleMetaDataRenderer renderer; 4. Create a new COLOR struct, setting the desired alpha transparency and colors to show on the screen. In this example, the colors (red, green, and blue) are fully opaque with zero transparency. PelcoAPI::COLOR color = {255,0,128,255}; 5. Render the drawing metadata onto the screen by calling the RenderDrawingData method. renderer.renderdrawingdata(); 60

61 C5617M-A Extracting Audio and Video Metadata 61

62 C5617M-A Extracting Audio and Video Metadata 62

63 Chapter 6 Exporting Video Overview WARNING: Any provided sample code is meant to be a reference implementation focused on educating developers about Pelco devices. Though there are exceptions, in general Pelco sample code is NOT intended for immediate production use without modification. NOTE: The content in this section assumes that the default target installation directory was chosen during installation. NOTE: For the latest Pelco documentation, visit At some point, you ll need to export your video into a variety of major formats. Where Does the Pelco SDK Fit? The Exporter module is a Pelco API SDK component that can export playback video, and save it in either AVI, MP4, 3GP, or PEF format. It is multi-threaded to help ensure good performance and to export as many streams as possible at any given time. Moreover, users will be able to export or playback saved streams without having to initialize the stream. Consequently it provides the flexibility to specify the camera, the start time and an end time value. This tool is also able to embed meta-data (timestamp, and so on) into streams (this requires transcoding which affects performance and authentication). When available, audio will be included in the export in either PEF or AVI format. Custom Application Development Using the Exporter, a simple application can be written to select, initiate, and receive these streams to save them to a video file. The most common file format for such video files is AVI. However, AVI is only a container format, not a compression format. From this point forward, there are two principally different implementations for video storage: recoding and native. Re-coding Video To avoid a complicated process, decoding and re-encoding is often employed to allow the video to be played back using the standard codecs provided with the Windows Media Player. The native video format is either MPEG-4 or H.264, depending on the camera settings. If the video stream coming from the camera is encoded using MPEG-4, the exported file will generally use MPEG-4 as well. No re-coding will be necessary unless you add overlays to the export. If the video stream coming from the camera is encoded using H.264, the exported file may use H.264 or MPEG-4, depending on the container format (3GP, AVI, MP4, PEF) and whether you add overlays to the export. (There is relatively little difference in size between container formats and compression formats.) By default, Windows Media Player supports MPEG-4, but not H.264. VLC supports both MPEG-4 and H.264. Native Video For recording large amounts of video data, such as when building near line storage solutions, storage in the original (or native) format is essential as it preserves the bit rate. To play back these native video files, a codec that supports the full ISO MPEG-4 standard (or at least the ISO MPEG4 SP profile) must be installed in the end user's media player. If 63

64 C5617M-A Exporting Video a codec does not support the ISO MPEG-4 SP profile, the video received from the Endura system will not play back. Fortunately there are many complete ISO MPEG-4 codecs available; ranging from free, open source versions to highly optimized commercial versions Getting Started For more information about getting started and setting up the working directory, refer to Setting Up Sample Projects. What s Ahead This is a high level overview of possible tasks related to export. 1. Set up desired video clips to export. Configure desired parameters for each video clip to export. If overlays are desired, set up overlays for each video clip. 2. Start the export, and continue to poll its status until it finishes successfully or encounters an error. Initializing the Exporter The related source code for this entry (for C++) can be found in main.cpp s main function, which belongs to the Export C++ sample project. The related source code for this entry (for C#) can be found in Program.cs s Main function, which belongs to the Export C# sample project. NOTE: In release mode, you need to select the Enable unmanaged code debugging checkbox in the project settings to see console output. Create the EnduraExporter instance, and then call its Setup method, passing the following: The location of the plugins directory. The plugin directory contains components that are key to the SDK s encoding, decoding, and transcoding capabilities. Without a proper reference, key features of the Pelco SDK may not function properly. Assuming that you didn t change the default target installation directory, it can be found here: C:\Program Files\Pelco\API\Libs\Debug\Plugins\ (if running in debug mode) or here: C:\Program Files\Pelco\API\Libs\Release\Plugins\ (release mode). The System Manager s IP address. For details on the importance of the System Manager for the Exporter, refer to Video Exports in the Appendix. The IP Address to use for receiving incoming stream(s) The client machine using the Pelco SDK. (Optional) The name of the user that is performing the export. (Optional) The initial local port to use for the export. NOTE: If you are running simultaneous exports, you must provide different port values. (Optional) The end port to use if initial port is in use. The exporter will keep increasing port numbers starting with the initial port number until the end port is reached. PelcoAPI::EnduraExporter exporter; exporter.setup("c:\\program Files\\Pelco\\API\\Libs\\Debug\\Plugins", " ", " ", USERNAME, 8000, -1); PelcoAPI.EnduraExporterNet penduraexporternet = new PelcoAPI.EnduraExporterNet(); penduraexporternet.setup("c:\\program Files\\Pelco\\API\\Libs\\Debug\\Plugins", 64

65 C5617M-A Exporting Video " ", " ", USERNAME, 8000, -1); Setting Up Overlay Data on Video to Be Exported The related source code for this entry (for C++) can be found in main.cpp s main function, which belongs to the Export C++ sample project. The related source code for this entry (for C#) can be found in Program.cs s Main function, which belongs to the Export C# sample project. NOTE: This entry assumes that you are already familiar with the content in Exporting Video. NOTE: If you choose to embed overlays with your video export, regardless of input source stream s format, the resulting exported file will be in MPEG-4 format. 1. First decide on what type of overlay that you would like to create. There are several types as defined in the EnduraExporterDefines header file: enum OverlayType { OVERLAY_TYPE_TIMESTAMP = 0, OVERLAY_TYPE_CAMERANAME = 1, OVERLAY_TYPE_TEXTSTRING = 2, OVERLAY_TYPE_PICTURE = 3 }; 2. Next, create the overlay structure. If performing a single video clip export as described in Exporting A Single Video Clip, the user must use the OverlayData method for each desired overlay type before starting the export. exporter.overlaydata(pelcoapi::overlay_type_timestamp, PelcoAPI::OVERLAY_LOCATION_BOTTOM_LEFT, NULL, FONTNAME, 10, fontcolor, fontbgcolor, 0); penduraexporternet.overlaydata(pelcoapi.overlaytypenet.overlay_type_timestamp, PelcoAPI.OverlayLocationNet.OVERLAY_LOCATION_BOTTOM_LEFT, "", FONTNAME, 10, FONTCOLOR, FONTBGCOLOR, 0, DATEFORMAT, TIMEFORMAT); If performing a stitched video clip export described in Stitching Multiple Clips Into a Single Video Export, the user must use an OverlayInfo/OverlayInfoNet instance for each overlay type wanted before starting the export. exportinfo[i].overlayinfo = new PelcoAPI::OverlayInfo[overlayNum]; exportinfo[i].overlayinfo[0].type = PelcoAPI::OVERLAY_TYPE_TIMESTAMP; // configure other parameters for the 1st overlay PelcoAPI.OverlayInfoNet overlayinfo_0 = new PelcoAPI.OverlayInfoNet(); overlayinfo_0.type = PelcoAPI.OverlayTypeNet.OVERLAY_TYPE_TIMESTAMP; // configure other parameters for the 1st overlay OverlayData Parameters OverlayData contains the following parameters. (Note that PPX export does not currently support overlays.) timestamp The overlay displays a timestamp that provides the time in local time. cameraname 65

66 C5617M-A Exporting Video textstring picture The overlay displays a camera s name. Typically the camera name displayed is the source of the video stream. The overlay displays text that the user specifies. The overlay displays a picture that the user specifies. Now create a new instance of OverlayInfoNet and, based on the type of overlay you chose, simply start assigning the desired values with it such the font to use, the color of the font, the location of the overlay, and so on. The following is a list of other overlay settings (some may or may not apply to certain overlay types as noted): location The general screen location of the overlay. (Refer to the DataMixerPluginDefines header for the latest definition of OverlayLocation.) enum OverlayLocation { OVERLAY_LOCATION_UNKNOWN, OVERLAY_LOCATION_TOP_LEFT, OVERLAY_LOCATION_TOP_MIDDLE, OVERLAY_LOCATION_TOP_RIGHT, OVERLAY_LOCATION_CENTER, OVERLAY_LOCATION_BOTTOM_LEFT, OVERLAY_LOCATION_BOTTOM_MIDDLE, OVERLAY_LOCATION_BOTTOM_RIGHT, OVERLAY_LOCATION_COORDINATE }; unknown top_left top_middle top_right center bottom_left bottom_middle bottom_right coordinate value fontname fontsize This denotes that the overlay will not appear on the screen. The overlay will appear in the top left corner of the screen. The overlay will appear in the top of the screen. The overlay will appear in the top right corner of the screen. The overlay will appear in the center of the screen. The overlay will appear in the bottom left corner of the screen. The overlay will appear in the bottom of the screen. The overlay will appear in the bottom right corner of the screen. This is a system reserved value. Please disregard this value. The actual value to display. For picture overlays, this is the full path to the picture to display. While for cameraname overlays, this is the name of the camera. Finally for textstring overlays, this is just the alphanumeric value to display on the overlay. (This does not apply to timestamp overlays.) This is the name of an available font to use for displaying overlays. (This does not apply to picture overlays. ) This is the size of a font. (This does not apply to picture overlays.) 66

67 C5617M-A Exporting Video fontcolor fontbgcolor pictureopacity dateformat This is the color of a font. (This does not apply to picture overlays.) This is the font s color. (This does not apply to picture overlays.) The opacity of the overlay. This ranges from transparent (0% opacity) to solid (100% opacity). (This is only relevant for picture overlays.) This is only relevant to the timestamp overlay. enum DateFormat { DATE_FORMAT_MDYYYY = 0, DATE_FORMAT_MDYY = 1, DATE_FORMAT_MMDDYY = 2, DATE_FORMAT_MMDDYYYY = 3, DATE_FORMAT_YYMMDD = 4, DATE_FORMAT_YYYY_MM_DD = 5, DATE_FORMAT_DD_MM_YY = 6, DATE_FORMAT_DMYY = 7, DATE_FORMAT_DDMMYY = 8, DATE_FORMAT_DMYYYY = 9, DATE_FORMAT_DDMMYYYY = 10, DATE_FORMAT_YYMD = 11, DATE_FORMAT_YYYYMD = 12, DATE_FORMAT_YYYYMMDD = 13, DATE_FORMAT_YYYY_M_D = 14, }; mdyyy mdyy mmddyy mmddyyyy yymmdd yyyy_mm_dd dd_mm_yy dmyy ddmmyy This date format conforms to the following structure: m/d/yyyy (month/day/year), where both 'm' and 'd' could be either one or two digits, for example, 12/8/2001 or 2/23/2001 This date format conforms to the following structure: m/d/yy (month/day/year), where both 'm' and 'd' could be either one or two digits, for example, 12/8/01 or 2/23/01 This date format conforms to the following structure: mm/dd/yy. (month/day/year), for example, 02/23/01 This date format conforms to the following structure: mm/dd/yyyy (month/day/year), for example, 02/23/2001 This date format conforms to the following structure: yy/mm/dd (year/month/day), for example, 01/02/23 This date format conforms to the following structure: yyyy_mm_dd (year_month_day), for example, This date format conforms to the following structure: dd_mm_yy (day_month_year), for example, This date format conforms to the following structure: d/m/yy (day/month/year), where both 'm' and 'd' could be either one or two digits, for example, 23/2/01 or 8/12/01 This date format conforms to the following structure: dd/mm/yy (day/month/year), for example, 08/12/01 or 23/02/01 67

68 C5617M-A Exporting Video dmyyyy ddmmyyyy yymd yyyymd yyyymmdd yyyy_m_d timeformat This date format conforms to the following structure: d/m/yyyy (day/month/year), where both 'm' and 'd' could be either one or two digits, for example, 23/2/2001 or 8/12/2001 This date format conforms to the following structure: dd/mm/yyyy (day/month/year), for example, 21/03/2001 This date format conforms to the following structure: yy/m/d (year/month/day), where both 'm' and 'd' could be either one or two digits, for example, 54/1/31 or 73/12/1 This date format conforms to the following structure: yyyy/m/d (year/month/day), where both 'm' and 'd' could be either one or two digits, for example, 1954/1/31 or 1973/12/1 This date format conforms to the following structure: yyyy/mm/dd (year/month/day), for example, 2001/02/23 This date format conforms to the following structure: yyyy_m_d (year_month_day), where both 'm' and 'd' could be either one or two digits, for example, or This is only relevant to the timestamp overlay. enum TimeFormat { TIME_FORMAT_HHMMSSTT = 10, TIME_FORMAT_HMMSSTT = 11, TIME_FORMAT_HMMSS = 12, TIME_FORMAT_HHMMSS = 13, TIME_FORMAT_HMSTT = 14, TIME_FORMAT_TTHMS = 15, TIME_FORMAT_TTHHMMSS = 16, TIME_FORMAT_HMS = 17, }; hhmmsstt hmmsstt hmmss hhmmss hmstt tthms tthhmmss This time format conforms to the following 12 hour structure: hh:mm:ss tt (hours:minutes:seconds AM/PM), for example, 06:07:12 AM or 12:07:12 PM This time format conforms to the following 12 hour structure: h:mm:ss tt (hours:minutes:seconds AM/ PM), where 'h' could be either one or two digits, for example, 6:07:12 AM or 12:07:12 PM This time format conforms to the following 24 hour structure: h:mm:ss (hours:minutes:seconds), where 'h' could be either one or two digits, for example, 6:07:12 or 18:07:12 This time format conforms to the following 24 hour structure: hh:mm:ss (hours:minutes:seconds), for example, 06:07:12 or 18:07:12 This time format conforms to the following 12 hour structure: h:m:s tt (hours:minutes:seconds), where 'h', 'm', or 's' could be either one or two digits, for example, 6:7:12 AM, 12:17:12 PM, or 12:3:2 PM This time format conforms to the following 12 hour structure: tt h:m:s (AM/PM hours:minutes:seconds), where 'h', 'm', or 's' could be either one or two digits, for example, AM 6:7:12, PM 12:17:12, or PM 12:3:2 This time format conforms to the following 12 hour structure: tt hh:mm:ss (AM/PM hours:minutes:seconds), for example, AM 06:07:12, PM 12:17:12, or PM 12:03:02 68

69 C5617M-A Exporting Video hms This time format conforms to the following 24 hour structure: H:m:s (hours:minutes:seconds), where 'h', 'm', or 's' could be either one or two digits, for example, 6:7:12, 12:17:12, or 12:3:2 Resetting Overlay Data To reset overlay data to default values for the video being exported, call the ResetData method. bool bsuccess = exporter.resetdata(); Boolean bsuccess = penduraexporternet.resetdata(); Exporting Video This section describes various video export methods and scenarios. Exporting a Single Video Clip The related source code for this entry (for C++) can be found in main.cpp s main function, which belongs to the Export C++ sample project. The related source code for this entry (for C#) can be found in Program.cs s Main function, which belongs to the Export C# sample project. 1. Determine the System Manager s IP address. Refer to Automatically Determining the System Manager s IP Address and Port Number in the Device and Service Discovery section for details. 2. Initialize the Exporter. Refer to Initializing the Exporter for details. 3. Optional: If you would like to overlay data onto the resulting export, do so now. Refer to Setting Up Overlay Data on Video to Be Exported 4. Begin the video export by calling the Exporter s StartExport method, passing in the following parameters: The full path, including file name, of the resulting exported video. The format changes based on the operating system, for example, Windows or Linux. The UUID of the camera from which to export video The desired resulting video format for the export Refer to the EnduraExporterDefines header for the latest options. enum VideoCodecType { CODEC_ID_NONE = 0, /* video codecs */ CODEC_ID_MPEG1 = 1, CODEC_ID_MPEG2 = 2, CODEC_ID_MJPEG = 8, CODEC_ID_MPEG4 = 13, CODEC_ID_H264 = 28 }; The starting time of the recorded video to export in UTC (GMT), not local time, using the format yyyymm-ddthh:mm:ss The ending time of the recorded video to export in UTC (GMT), not local time, using the format yyyymm-ddthh:mm:ss The videoonly parameter 69

70 C5617M-A Exporting Video Set to true to export only video, while setting this to false to include audio (if it is available). If you want audio to be included, it will be available in either PEF or AVI format. The UUID of the stream to export s audio source, if separate from the video source of the export bool bsuccess = exporter.startexport("d:\\video\\test123.avi", "uuid:691fd c-4fc c13e977ce4", PelcoAPI::CODEC_ID_MPEG4, " T22:10:35", " T22:11:15", false, "uuid:691fd c-4fc c13e977ce4"); Boolean bsuccess = exporter.startexport("d:\\video\\test123.avi", "uuid:691fd c-4fc c13e977ce4", PelcoAPI::CODEC_ID_MPEG4, " T22:10:35", " T22:11:15", false, "uuid:691fd c-4fc c13e977ce4"); 5. Poll the status of the video export repeatedly, for example, once per second, until it is finished. For more information, see Polling a Video Export. Exporting Video Using a Playlist (PPX) The playlist (PPX) format supports advanced playback features, including synchronized and sequential (stitched) playback. For the following play-list example consider the following scenario; we have a system with nine cameras, named camera_x, where x is the spelling of a number from zero to eight. We want to play the files in the following way; camera_zero from 9:05-9:10, followed by camera_one and camera_three played together in a 2x1 layout both from 9:11 to 9:15. Assume that the video from camera_one for 9:13 has been deleted. Following this we want to play camera_four from 9:20 to 9:30, then we want to play camera_two, camera_six, and camera_seven from 9:30 to 9:45, assume that camera_two s video for 9:31-9:33 has been deleted, and that its video from 9:42 to 9:44 has been deleted. Finally, we want to view camera_eight from 9:42 to 10:00. The following diagram illustrates the view flow. 1. Determine the System Manager s IP address. Refer to Automatically Determining the System Manager s IP Address and Port Number in the Device and Service Discovery section for details. 2. Initialize the Exporter. Refer to Initializing the Exporter for details. 3. Call the PlaylistExportInfo method to set up the clip groups that will be played sequentially in the order provided. PlaylistExportInfo contains the following parameters: DeviceID The UUID of the camera from which to export video 70

71 C5617M-A Exporting Video AudioDeviceID StartTime EndTime VideoOnly ClipGroup The UUID of the stream to export s audio source, if separate from the video source of the export. The start time in UTC (GMT), not local time, using the format yyyy-mm-ddthh:mm:ss The end time in UTC (GMT), not local time, using the format yyyy-mm-ddthh:mm:ss A boolean indicating if the clip should be exported with video only. If false, audio will also be included. An integer representing the sequential order to play video clips. Up to 4 clips can be in the same clip group which will play in sync within the export player. PelcoAPI::PlaylistExportInfo playlistexportinfo[ NUM_CLIPS ]; playlistexportinfo[0].sdeviceid = CAMERA_1; playlistexportinfo[0].sstarttime = START_TIME_1; playlistexportinfo[0].sendtime = END_TIME_1; playlistexportinfo[0].bvideoonly = false; playlistexportinfo[0].nclipgroup = 1; ArrayList playlistexportinfo = new ArrayList( num_clips ); playlistexportinfo.add( new PelcoAPI.PlaylistExportInfoNet( CAMERA_1, "", START_TIME_1, END_TIME_1, false, 1 ) ); 4. Begin the video export by calling the Exporter s StartExport method, passing in the following parameters: exportfolder playlistname The path of the folder for exports. (The format changes based on operating system.) The name of the playlist. This should be a simple name with no extensions playlistexportinfo An array of playlist information for export. exportinfocount The number of export info entries bool bsuccess = exporter.startexport("d:\\video\\test123", PlaylistName, PlaylistExportInfo, exportinfocount); Boolean bsuccess = penduraexporternet.startexport("d:\\video\\test123", PlaylistName, PlaylistExportInfo, exportinfocount); 5. Poll the status of the video export repeatedly, for example, once per second, until it is finished. For more information, see Polling a Video Export. Stitching Multiple Clips into a Single Video Export NOTE: This stitching procedure is DEPRECATED. Stitched video clips do not play correctly with Pelco Export Player. Please use Exporting Video Using a Playlist (PPX). NOTE: Enabling sequential stitching may or may not be much slower than exporting a single video clip, depending on whether any of the clips need to be transcoded. There are occasions where you will need to export a single video from multiple video clips. 71

72 C5617M-A Exporting Video First initialize as many video clip export settings (ExportInfo) instances as you will need. For details on how to set up one set of video clip export settings, refer tosetting Up Overlay Data on Video to Be Exported. At this point determine if you want to associate any overlays to the video clips. If so, create and initialize any overlays to associate with the video clip to export. In the example excerpt below, we have associated four previously created OverlayInfo instances with two ExportInfo instances. 1. Determine the System Manager s IP address. Refer to Automatically Determining the System Manager s IP Address and Port Number in the Device and Service Discovery section for details. 2. Initialize the Exporter. Refer to Initializing the Exporter for details. 3. Optional: If you would like to overlay data onto the resulting export, do so now. Refer to Setting Up Overlay Data on Video to Be Exported for details. 4. Begin the video export by calling the Exporter s StartExport method, passing in the following parameters: The full path, including file name, of the resulting exported video. The format changes based on operating system, for example, Linux or Windows. The desired resulting video format for the export. Refer to the EnduraExporterDefines header for the latest options. enum VideoCodecType { CODEC_ID_NONE = 0, /* video codecs */ CODEC_ID_MPEG1 = 1, CODEC_ID_MPEG2 = 2, CODEC_ID_MJPEG = 8, CODEC_ID_MPEG4 = 13, CODEC_ID_H264 = 28 }; An array of the ExportInfo instances, containing instances of OverlayInfo. The number of ExportInfo instances, one for each clip to stitch. Below is a stitched video export example: int i = 0; int clipnum = 2; int overlaynum = 4; PelcoAPI::ExportInfo * exportinfo = new PelcoAPI::ExportInfo[clipNum]; exportinfo[0].sdeviceid = "uuid:00047d01-4ca "; exportinfo[0].sstarttime = " T05:08:00"; exportinfo[0].sendtime = " T05:09:00"; exportinfo[0].bvideoonly = false; exportinfo[0].overlaynum = overlaynum; exportinfo[1].sdeviceid = "uuid:691fd c-4fc c13e977ce4"; // configure other export settings for the 2nd clip to export if (overlaynum > 0) { for (i = 0; i < clipnum; i++) { exportinfo[i].overlayinfo = new PelcoAPI::OverlayInfo[overlayNum]; exportinfo[i].overlayinfo[0].type = PelcoAPI::OVERLAY_TYPE_TIMESTAMP; // configure other settings for the 1st overlay exportinfo[i].overlayinfo[1].type = 72

73 C5617M-A Exporting Video PelcoAPI::OVERLAY_TYPE_CAMERANAME; // configure other settings for the 2nd overlay exportinfo[i].overlayinfo[2].type = PelcoAPI::OVERLAY_TYPE_PICTURE; // configure other settings for the 3rd overlay exportinfo[i].overlayinfo[3].type = PelcoAPI::OVERLAY_TYPE_TEXTSTRING; // configure other settings for the 4th overlay } } bool bsuccess = exporter.startexport("d:\\video\\test123.mp4", PelcoAPI::CODEC_ID_MPEG4, exportinfo, 2); PelcoAPI.ExportInfoNet exportinfo_0 = new PelcoAPI.ExportInfoNet(); exportinfo_0.sdeviceid = "uuid:00047d01-4ca "; exportinfo_0.sstarttime = " T05:08:00"; exportinfo_0.sendtime = " T05:09:00"; exportinfo_0.bvideoonly = true; PelcoAPI.ExportInfoNet exportinfo_1 = new PelcoAPI.ExportInfoNet(); // initialize another export video clip setting exportinfo_0.overlayinfo = new ArrayList(); exportinfo_0.overlayinfo.add(overlayinfo_0); // add any other overlay settings here exportinfo_1.overlayinfo = new ArrayList(); exportinfo_1.overlayinfo.add(overlayinfo_0); // add any other overlay settings here ArrayList exportinfo = new ArrayList(2); exportinfo.add(exportinfo_0); exportinfo.add(exportinfo_1); Boolean bsuccess = penduraexporternet.startexport("c:\\test456.avi", PelcoAPI.VideoCodecTypeNet.CODEC_ID_MPEG4, exportinfo, 2); 5. Poll the status of the video export repeatedly, for example, once per second, until it is finished. For more information, see Polling a Video Export. Polling a Video Export To poll the status of the video export until it is finished, perform the following: for( int clipcounter = 0; clipcounter < NUM_CLIPS; ++clipcounter ) { int status = 0; while( status < 100 && status!= -1 ) { int temp = exporter.pollstatus(); if (temp!= status) { status = temp; TRACE_INFO("Polling status %d\n", status); } } } Int32 clipcounter = 0; 73

74 C5617M-A Exporting Video while (clipcounter < num_clips) { Int32 status = 0; Int32 temp = 0; while (status < 100 && status!= -1) { temp = penduraexporternet.pollstatus(60); if (temp!= status) { status = temp; Console.WriteLine("Polling status - {0}\n", status); } } ++clipcounter; } Stopping a Video Export When you want to force a video export that is currently in progress to stop, just call the StopExport method. bool bsuccess = exporter.stopexport(); Boolean bsuccess = exporter.stopexport(); Exporting A JPEG Snapshot To create a JPEG snapshot, call the ExportSnapshot method, passing in a.jpeg or.jpg file name, camera uuid, and timestring (use "NOW" for a live snapshot). The following is an example of a live snapshot. bool bsuccess = exporter.exportsnapshot("testsnapshot.jpeg", "uuid:00047d ", "NOW"); Boolean bsuccess = exporter.exportsnapshot("testsnapshot.jpeg", "uuid:00047d ", "NOW"); The following is an example of a recorded snapshot. bool bsuccess = exporter.exportsnapshot("testsnapshot.jpeg", "uuid:00047d ", " T19:30:00"); Boolean bsuccess = exporter.exportsnapshot("testsnapshot.jpeg", "uuid:00047d ", " T19:30:00"); 74

75 Chapter 7 Web Service Proxies Web Service Proxies WARNING: Any provided sample code is meant to be a reference implementation focused on educating developers about Pelco devices. Though there are exceptions, in general Pelco sample code is NOT intended for immediate production use without modification. WARNING: The content below assumes that the default target installation directory was chosen during installation. For the latest Pelco documentation, visit Overview PelcoGSoap is a static linked library generated by gsoap tools, based on the WSDL files with minor modifications. The PelcoGSoap library provides an interface for SOAP clients to make SOAP calls to Pelco devices. It accounts for most issues regarding making SOAP calls to Pelco devices. General Usage NOTE: This entry assumes that users have already installed the Pelco SDK. 1. Include the stdsoap2 header and the web service proxy header. For example, if you want to utilize the CameraConfiguration web service, you should include the CameraConfigurationProxy header. #include "PelcoAPI/stdsoap2.h" #include "PelcoAPI/CameraConfigurationProxy.h" 2. Declare your web service proxy. In this case, it will be CameraConfigurationProxy. CameraConfigurationProxy CameraConfiguration; 3. Set the SOAP header. psoap->header = (struct SOAP_ENV Header *) soap_malloc(cameraconfiguration, sizeof(struct SOAP_ENV Header)); 4. Set the web service s control point URL. For details on the proper way to retrieve the control point URL, refer to Retrieving a Specific Web Service s Control URL. CameraConfiguration.soap_endpoint = strendpointurl.c_str(); 5. Create a new web service action request instance. This will hold your request parameters for the web service action ResetConfiguration. 6. Create a new web service action response instance. In the below example, we create an instance of CameraConfiguration s ResetConfigurationResponse data type. _CameraConfiguration ResetConfigurationResponse * presetconfigurationresponse = soap_new CameraConfiguration ResetConfigurationResponse( 75

76 C5617M-A Web Service Proxies &CameraConfiguration, -1); This will hold the web service s response including related values to your request. 7. Call the CameraConfiguration web service proxy ResetConfiguration action, passing in both the earlier created ResetConfiguration and ResetConfigurationResponse parameters. Then determine if the operation was successful. CameraConfiguration.ResetConfiguration(pResetConfiguration, presetconfigurationresponse); #include "PelcoAPI/stdsoap2.h" #include "PelcoAPI/LensControlProxy.h" #include "GSOAPSample.h" using namespace PelcoAPI; void GSOAPSample::StopLens() throw() { LensControlProxy LensControl; std::string cameraaddress = " "; std::string cameraport = "49152"; psoap->header = (struct SOAP_ENV Header *) soap_malloc(lenscontrol, sizeof(struct SOAP_ENV Header)); std::string strendpointurl = " + cameraaddress + (cameraport.empty()? "" : ":" + cameraport) + "/control/lenscontrol-1"; LensControl.soap_endpoint = strendpointurl.c_str(); _LensControl Stop * pstop = soap_new LensControl Stop(&LensControl, -1); _LensControl StopResponse * pstopresponse = soap_new LensControl StopResponse(&LensControl, -1); if (LensControl.Stop(pStop, pstopresponse)!= SOAP_OK) 76

77 Chapter 8 Discovery Device and Service Discovery Overview WARNING: Any provided sample code is meant to be a reference implementation focused on educating developers about Pelco devices. Though there are exceptions, in general Pelco sample code is NOT intended for immediate production use without modification. WARNING: The content below assumes that the default target installation directory was chosen during installation. For the latest Pelco documentation, visit One of the most basic tasks is to programmatically determine what devices and services are available on your network. Where Does the Pelco SDK Fit? The key to performing device and service discovery related tasks is the System Manager Wrapper. The System Manager Wrapper is a component of the Pelco SDK. It provides users with convenience functions for device and service queries. The majority of the tasks covered in this section can be found in the the System Manager Wrapper C++ sample project. You should examine the sample project source code while reading this documentation. NOTE: For more Endura specific information, refer to the Endura appendix. Getting Started For more information about getting started and setting up the working directory, refer to Setting Up Sample Projects. 77

78 C5617M-A Discovery Depending on whether you would like to use the release version of the Pelco SDK libraries or the debug version, change the Working Directory value as appropriate. Assuming that you did not change the default installation directory for the Pelco SDK, use C:\\Program Files\Pelco\API\Libs\Release to use the production version of the Pelco SDK libraries. Conversely, use C:\\Program Files\Pelco\API\Libs\Debug to use the debug version of the Pelco SDK libraries. Next Steps The following set of tasks are essential for using the Pelco SDK: Determine the System Manager s IP address and port number, either manually, or automatically through the Pelco SDK as described in Automatically Determining the System Manager s IP Address and Port Number. Create a class that implements the IDeviceStorageNet interface. Query all available Pelco devices on your network. Initializing the Pelco SDK System Manager Wrapper NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. Before performing any of the tasks associated with the System Manager Wrapper, you must initialize an instance of it. Then you can use the instance to log in to the System Manager, since most System Manager Wrapper methods require a login ID. NOTE: In release mode, you need to select the Enable unmanaged code debugging checkbox in the project settings to see console output. 1. Declare and initialize the System Manager Wrapper. a) If you need to determine the System Manager s IP address, refer to Automatically Determining the System Manager s IP Address and Port Number. b) If you already know the System Manager s IP address, enter it into the SetSMAddress method as shown below. PelcoAPI::SystemManagerWrapper sm; int nret = sm.setsmaddress((char *) ssmipaddress); PelcoAPI.SystemManagerWrapperNet sm = new PelcoAPI.SystemManagerWrapperNet(); int nret = sm.setsmaddress(" "); 2. Log in to the System Manager with the proper credentials. Call the System Manager Wrapper instance s UserLogin method, passing in the username and password. int loginid = sm.userlogin("brian", "pelco"); Int32 loginid = sm.userlogin("brian", "pelco"); If successful, this step should return an ID of your login session. Make a note of this login ID, because it is used for many of the System Manager Wrapper s methods. 3. After you have logged in to System Manager, you will eventually have to log out. When you have finished all System Manager related operations, log out by calling the System Manager Wrapper instance s UserLogout method, passing in your login ID as the parameter. For more details on authenticating to a Pelco system, refer to Logging In and Logging Out. sysmgr.userlogout(loginid); 78

79 C5617M-A Discovery sm.userlogout(loginid); Automatically Determining the System Manager s IP Address and Port Number NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. 1. Initialize the System Manager Wrapper by calling its AutoDiscoverSM method to automatically determine the System Manager's IP address and port number. The 120 parameter represents the duration in seconds before a timeout. int nret = sm.autodiscoversm(120); 2. To access the System Manager s IP address and port number, call the GetSMAddress method. int rport = 0; //... Auto discover SM... // Return the SM IP Address PelcoAPI::xstring sipaddress; sm.getsmaddress(&sipaddress,&rport); TRACE_INFO("The SM IpAdress - %s and Port - %d\n", sipaddress.data, rport); PelcoAPI::xfree(&sIpAddress); //... Auto discover SM... String ssmipaddress = ""; Int32 nport = -1; if( sm.getsmaddress(ref ssmipaddress, ref nport ) ) Console.WriteLine("SM address -> {0}:{1}\n", ssmipaddress, nport); else Console.WriteLine( "Could not get SM address\n" ); Logging In and Logging Out NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. In many cases, you might need to both log in and log out of System Manager. 1. To log in to the System Manager with the proper credentials, call the System Manager Wrapper instance s UserLogin method, passing in the username and password. int loginid = sm.userlogin("brian", "pelco"); If successful, this step should return an ID of your login session. NOTE: Make a note of this login ID, because it is used for many of the System Manager Wrapper s methods. 2. When you have finished all System Manager related operations, log out of the System Manager. Call the System Manager Wrapper instance s UserLogout method, passing in your login ID as the parameter. sysmgr.userlogout(loginid); 79

80 C5617M-A Discovery Querying Available Devices from the System Manager NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. NOTE: Before proceeding with this entry, it is assumed that you have already completed the steps outlined in Creating an IDeviceStorage Class. The first major task that you need to complete is to query all Pelco devices available on your network. Completing this enables you to access a device s Unique Device Name (UDN) and many other device-related attributes that are needed for other Pelco SDK related tasks. 1. Initialize the System Manager Wrapper. See Initializing the System Manager Wrapper for details. 2. Make a call to the System Manager Wrapper's GetDevices method, passing in the following parameters: Your login ID: This ID is returned after a successful login. See Initializing the System Manager Wrapper for details. The sequence number: This is used to filter results, only returning newly added or changed devices. GetDevices calls return a new integer value once every few minutes during successive calls. New values are 1 larger than the one before, for example, if the 1st call returned 1, then the subsequent call will return a 2. The device type you would like to use to filter the results. Known device types include the following: Camera Encoder Decoder Monitor a NULL value (to not filter results by type of device) NOTE: This is not a definitive list of Pelco device types. This list will expand as Pelco expands its product line. A pointer to your IDeviceStorage implementation. int seqnum = 0; MyStorage storage; //... You must define this class... int loginid = sm.userlogin("brian", "pelco"); sm.getdevices(loginid, &seqnum, "Camera", &storage); int seqnum = 0; DeviceInformation devstore = new DeviceInformation(); // You must define this class int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm.getdevices(loginid, seqnum, "Camera", devstore); 3. Perform the needed operations on the returned device data and store them into your IDeviceStorage class instance. See Creating an IDeviceStorage Class for further details. 4. To query any changes with available devices from the System Manager, use the returned sequence number value from your last call to the GetDevices method with your next call to the same method. This call returns Pelco devices that have changed or are new to the network. Every subsequent call returns only new changes within your network. int seqnum = 0; MyStorage storage; //... You must define this class... int loginid = sm.userlogin("brian", "pelco"); sm.getdevices(loginid, &seqnum, "Camera", &storage); //... seqnum changes here to 1... //... Misc logic... 80

81 C5617M-A Discovery sm.getdevices(loginid, &seqnum, "Camera", &storage); //... seqnum changes here to 2... int seqnum = 0; DeviceInformation devstore = new DeviceInformation(); // You must define this class int loginid = sm.userlogin("brian", "pelco"); sm.getdevices(loginid, ref seqnum, "Camera", &storage); // seqnum changes here to 1... //... Misc logic... sm.getdevices(loginid, ref seqnum, "Camera", &storage); // seqnum changes here to 2... Retrieving the System Manager s Time Zone NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. To determine your System Manager s current time zone, do the following: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetSystemAttribute method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) SYS_CFG_TzInfo The time zone attribute s ID. &stimezoneinfo A pointer to your time zone variable. PelcoAPI::xstring stimezoneinfo; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getsystemattribute(loginid, "SYS_CFG_TzInfo", &stimezoneinfo); int loginid = sm.userlogin("brian", "pelco"); String stimezone = ""; Boolean bsuccess = sm.getsystemattribute(loginid, "SYS_CFG_TzInfo", ref stimezone); Retrieving the Network Time Server Address NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. To your network s network time server s IP Address, do the following: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetSystemAttribute method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) SYS_CFG_NtpAddr The network time server's attribute s ID. &stimezoneinfo A pointer to your NTP address variable. 81

82 C5617M-A Discovery PelcoAPI::xstring sntpaddress; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getsystemattribute(loginid, "SYS_CFG_NtpAddr", &sntpaddress); int loginid = sm.userlogin("brian", "pelco"); String sntpaddress = ""; Boolean bsuccess = sm.getsystemattribute(loginid, "SYS_CFG_NtpAddr", ref sntpaddress); Retrieving a Web Service s ID NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. NOTE: This entry assumes that you have already completed the steps outlined in Querying Available Devices from the System Manager, which provides you with UDNs for Pelco devices available on your network. To determine your web service's ID, do the following: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetServiceID method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) The target device s Unique Device Name (UDN) value To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. sservicetype sserviceid The name of desired web service, such as VideoOutput. The pointer to the variable that will hold the result. PelcoAPI::xstring sserviceid; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getserviceid(loginid, "uuid:00047d01-4ca ", "VideoOutput", &sserviceid); Retrieving a Specific Web Service s Control URL NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. NOTE: This entry assumes that you have already completed the steps outlined in Querying Available Devices from the System Manager, which provides you with UDNs for Pelco devices available on your network. Obtaining a web service s control URL is essential for many Pelco-related operations. 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetDeviceServiceAttribute method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) 82

83 C5617M-A Discovery The target device s Unique Device Name (UDN) value To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. The target web service s ID Refer to Retrieving a Web Service s ID for details. SYS_UpnpControlUrl sctrlurl The control URL attribute s ID. A pointer to the variable that will store the result of the web service control URL. PelcoAPI::xstring sctrlurl; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getdeviceserviceattribute(loginid, "urn:schemas-pelco-com:service:motiondetection:1", "uuid:00047d01-4ca ", "SYS_UpnpControlUrl", &sctrlurl); String sctrlurl = ; int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm.getdeviceserviceattribute(loginid, "urn:schemas-pelco-com:service:motiondetection:1", "uuid:00047d01-4ca ", "SYS_UpnpControlUrl", ref sctrlurl); Retrieving the NVR Associated with the Device NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. NOTE: This entry assumes that you have already completed the steps outlined in Querying Available Devices from the System Manager, which provides you with UDNs for Pelco devices available on your network. To determine to which NVR or NSM your camera is connected to record, complete the following steps: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetDeviceAttributeValue method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) The target device s Unique Device Name (UDN) value To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. SYS_NvrAssoc snvr The NVR association attribute s ID. The pointer to the variable that will hold the result. PelcoAPI::xstring snvr; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getdeviceattributevalue(loginid, "uuid:00047d01-4ca ", "SYS_NvrAssoc",&sNvr); 83

84 C5617M-A Discovery String snvr = ; int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm.getdeviceattributevalue(loginid, "uuid:00047d01-4ca ", "SYS_NvrAssoc", ref snvr); Retrieving the Device s Friendly Name NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. NOTE: This entry assumes that you have already completed the steps outlined in Querying Available Devices from the System Manager, which provides you with UDNs for Pelco devices available on your network. To determine a device s friendly name, you can simply parse through the results of a GetDevices method call, which includes both the device UDN and its accompanying attributes. Alternatively, you can complete the following steps: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetDeviceAttributeValue method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) The target device s Unique Device Name (UDN) value To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. SYS_UpnpFriendlyName The attribute name. sfriendlyname The pointer to the variable that will hold the result. PelcoAPI::xstring sfriendlyname; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getdeviceattributevalue(loginid, "uuid:00047d01-4ca ", "SYS_UpnpFriendlyName", &sfriendlyname); Retrieving the Device s Device Description File (DDF) URL NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. What is DDF? The Device Descriptor File (DDF) is file containing device related data such as manufacturer, model name, and so on, in XML format. To get the location of a specific device s DDF, do the following: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetDeviceAttributeValue method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) The target device s Unique Device Name (UDN) value To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. SYS_UpnpDevDescUrl 84

85 C5617M-A Discovery sddfurl The attribute ID. The pointer to the variable that will hold the result. PelcoAPI::xstring sfriendlyname; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getdeviceattributevalue(loginid, "uuid:00047d01-4ca ", "SYS_UpnpDevDescUrl", &sddfurl); String sfriendlyname = ; int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm.getdeviceattributevalue(loginid, "uuid:00047d01-4ca ", "SYS_UpnpDevDescUrl", ref sddfurl); Retrieving All Web Services Available on a Device NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. To show all available web services on a particular Pelco device, complete the following steps: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetServiceInfoSync method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) The sequence number This has the same function as other Pelco query methods, in that it can help limit the results to only new or changed items. This makes sense for querying devices on a network. However, a device s available web services does not change very often, if ever, without a new firmware update. Therefore, this value should almost always be a 0. The target device s Unique Device Name (UDN) value storage To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. The pointer to the variable that will hold the result. int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm. GetServiceInfoSync(loginId, 0, "uuid:00047d01-4ca ", &storage); int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm. GetServiceInfoSync(loginId, 0, "uuid:00047d01-4ca ", storage); Retrieving Device Attributes NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. 85

86 C5617M-A Discovery NOTE: This entry assumes that you have already completed the steps outlined in Querying Available Devices from the System Manager, which provides you with UDNs for Pelco devices available on your network. Device attributes are values that describe the device in some way such as its model number or its model name. The following are the most common device attributes: SYS_UpnpPelcoDeviceUdn A Pelco device s Unique Device Name (UDN); a special device identifier for networks. SYS_UpnpFriendlyName A more human readable version of the device s name. A separate attribute, friendlyname, may be present. Endura users can customize this attribute. When present, friendlyname should be used in place of SYS_UpnpFriendlyName for display purposes. SYS_UpnpDeviceType A URN that denotes the device s category. SYS_UpnpDevDescUrl This shows the location of the device s UPnP Device Descriptor File (DDF). SYS_UpnpSerialNumber The device s serial number. SYS_UpnpModelNumber The device s model number. SYS_UpnpModelDescription A more detailed description of the device. SYS_UpnpManufacturerUrl SYS_UpnpModelName The device manufacturer s website. The device s model name. This outlines the steps needed to return a specific device attribute: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetDeviceAttributeValue method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) The target device s Unique Device Name (UDN) value To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. The name of the device attribute to query. The pointer to the variable that will hold the result. PelcoAPI::xstring smodelnumber; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getdeviceattributevalue(loginid, "uuid:00047d01-4ca ", "SYS_UpnpModelNumber", &smodelnumber); String smodelnumber = ""; int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm.getdeviceattributevalue(loginid, "uuid:00047d01-4ca ", "SYS_UpnpModelNumber", ref smodelnumber); 86

87 C5617M-A Discovery Retrieving a System Manager s Attribute NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. A System Manager s attributes are similar to a generic Pelco device s attributes, except in most cases a System Manager attribute is exclusive to Pelco System Managers. If you aren t familiar with device attributes, System Manager attributes are simply values that describe the System Manager in some way such as its current time zone or its current security mode. The following are the more common System Manager attributes: SYS_CFG_NtpAddr SYS_CFG_SecMode SYS_CFG_SmtpAddr SYS_CFG_TzInfo Change Time DST Offset GMT Offset This value is used to indicate the location at which the NTP server (if any) can be located. The expected value is an IP address. This value is used to identify the system's current security mode. This value is used to indicate the location at which the SMTP server (if any) can be located. The expected value is an IP address. This value is used to report time zone information. This value is comma delimited (without whitespace). The following describes each number in the order in which they appear in the commadelimited list (for example, ,60,480): This number is the absolute daylight savings time (in time_t time() seconds). If this value is zero, there is no daylight savings time for the time zone and nothing will have to be done to support daylight savings. If the value is non-zero, the time zone does support daylight savings time. In this case, if the value is negative, the time value is being used to indicate the time to turn off daylight savings time. If the value is positive, the value is being used to indicate the time at which daylight savings time is to be turned on. This number is the number of minutes to adjust the time when daylight savings time is in affect. The offset should be added to the GMT time after adding the GMT offset (see next value). This value indicate the number of minutes to adjust the GMT time in order to get the local time (this is the minutes "west" of the GMT). To get the current local time, simply subtract this number of minutes from the current GMT time. SYS_CFG_UPNP_RENEWAL The UPnP renewal value in seconds. The default setting is 1800 seconds (30 min). SYS_CFG_UserLanguage This value is used to indicate the default user language. To determine a particular attribute value on your System Manager, do the following: 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetSystemAttribute method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) systemattribute The name of the System Manager attribute. Parameter of type pointer to xstring, value SYS_CFG_TzInfo. A pointer to the variable that will hold the result. int iupnprenewal; int loginid = sm.userlogin("brian", "pelco"); 87

88 C5617M-A Discovery bool bsuccess = sm.getsystemattribute(loginid, "SYS_CFG_UPNP_RENEWAL", &iupnprenewal); int iupnprenewal; int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm.getsystemattribute(loginid, "SYS_CFG_UPNP_RENEWAL", ref iupnprenewal); Retrieving a Web Service s Attribute NOTE: The related source code for this entry can be found in main.cpp s main function (for C++) or Program.cs s Main function (for C#), which belongs to the System Manager Wrapper sample project. NOTE: This entry assumes that you have already completed the steps outlined in Querying Available Devices from the System Manager, which provides you with UDNs for Pelco devices available on your network. 1. Initialize the System Manager Wrapper. (Refer to Initializing the System Manager Wrapper for details.) 2. Call the System Manager Wrapper s GetDeviceServiceAttribute method, passing in the following parameters: Your login ID This ID is returned after a successful login. (Refer to Initializing the System Manager Wrapper for details.) The target device s Unique Device Name (UDN) value To retrieve a deviceudn, cycle through the stored results of a GetDevices call within your IDeviceStorage class instance. For details, refer to Querying Available Devices from the System Manager. The target web service s ID Refer to Retrieving a Web Service s ID for details. The ID of the web service attribute For example, SYS_UpnpControlUrl or SYS_UpnpEventSubUrl A pointer to the variable that will store the result. PelcoAPI::xstring sctrlurl; int loginid = sm.userlogin("brian", "pelco"); bool bsuccess = sm.getdeviceserviceattribute(loginid, "urn:schemas-pelco-com:service:motiondetection:1", "uuid:00047d01-4ca ", "SYS_UpnpControlUrl", &sctrlurl); String sctrlurl = ""; int loginid = sm.userlogin("brian", "pelco"); Boolean bsuccess = sm.getdeviceserviceattribute(loginid, "urn:schemas-pelco-com:service:motiondetection:1", "uuid:00047d01-4ca ", "SYS_UpnpControlUrl", ref sctrlurl); Creating an IDeviceStorage Class NOTE: The related source code for this entry can be found in the MyStorage.h and MyStorage.cpp files (for C++) or DeviceInformation.cs file (for C#), which belongs to the System Manager Wrapper sample project. 88

89 C5617M-A Discovery What is the IDeviceStorageNet class? An IDeviceStorageNet is simply an interface that parses XML responses from the System Manager and stores the resulting device data from the XML response internally. Users need an implementation of this interface, if they wish to manage device data using the System Manager Wrapper. 1. Ensure that the IDeviceStorageNet class implements the following methods: virtual bool AddDevice(const char* sudn, const char* sattributes): This method adds a new device to the IDeviceStorageNet class. It takes the following parameters: The device s Unique Device Name (UDN) The devices s attributes, given as XML virtual bool DeleteDevice(const char* sudn): This method deletes an existing device within IDeviceStorageNet. The device s Unique Device Name (UDN) virtual bool UpdateDevice(const char* sudn, const char* sattributes) The System Manager Wrapper will use these methods every time you call its GetDevices method, which in turn will update your IDeviceStorage instance contents. #ifndef PELCO_API_IDEVICE_STORAGE_H #define PELCO_API_IDEVICE_STORAGE_H #include <string> namespace PelcoAPI { class IDeviceStorage { public: virtual ~IDeviceStorage(){}; virtual bool AddDevice(const char* sudn, const char* sxmlattributes)=0; virtual bool DeleteDevice(const char* sudn)=0; virtual bool UpdateDevice(const char* sudn, const char* sxmlattributes)=0; }; } #endif using System; using System.Collections.Generic; using System.Text; namespace SystemManagerWrapperNet { class DeviceInformation : PelcoAPI.IDeviceStorageNet { public void AddDevice(string sudn, string sattributes) { //... User implemented logic here... } public void DeleteDevice(string sudn) { //... User implemented logic here... } } } 2. Note that the System Manager Wrapper sample project has an implementation of IDeviceStorage called MyStorage. 89

90 C5617M-A Discovery MyStorage is a stub class. It does not implement anything that is essential for production usage, such as parsing the System Manager s XML response data (attributes). Nor does it associate the device UDN/attribute XML pairs into any constructs. Those exercises are left to the user. 90

91 Appendix A Logging Logging is specific to Endura, and is configurable. 1. To configure logging, run the LoggingSetup application in the C:\Program Files\Pelco\API\Logging folder. 2. Select the items that you want to log, as well as the folder where the logs should be stored and the max logfile size. 3. Click Set to save the settings. NOTE: Logging should be run by an administrative account, because other users do not have write permissions to C:\Program Files (x86) or subdirectories by default. 4. To view the current log, run the LoggingSetup application in the C:\Program Files\Pelco\API\Logging folder. Click the View Log File button. NOTE: The maximum log size is 50MB. Any settings over that value will be reset back to the default 50MB restriction. Usually, logging should be off (no items checked) unless Pelco technical support asks for logging information when tracing issues. In the Logging dialog box, the following settings are available: Error Memory Info Verbose Logs error messages. This is usually the most important item. Logs memory allocation statistics. This should usually be left unchecked. The next level of severity below Error. 91

92 C5617M-A Logging Logs actions that occur often and should normally not be logged because they fill up the logfile quickly. 92

93 Appendix B Product Compatibility The following table shows the compatability of Pelco products with API components. Product Event Arbiter Event Manager DX Video Recorders Digital Sentry Exporter Meta-data Parser Pelco API Viewer PTZ Control Wrapper N N N N N N N N N N N N N N DVR5100 Y Y Y Y Y Y 4 Y Endura Express Y Y 5 Y 5 Y Y Y 4 Y 5 IP110 Y Y 5 N Y Y Y Y 5 IP3701 Y Y 5 N Y Y N Y 5 NET5301R Y Y 5 N Y Y N Y 5 NET5402R- HD Y Y 5 N Y Y N Y 5 NET5301T Y Y 5 N Y Y Y 4 Y 5 NET5308T Y Y 5 N Y Y Y 4 Y 5 NET5301T-I Y Y 5 N Y Y Y 4 Y 5 NET5400T-I Y Y 5 N Y Y Y 4 Y 5 NSM5200 Y Y 5 Y 5 Y Y Y 4 Y 5 Sarix Y Y 5 N Y Y N Y 5 Spectra HD Y Y 5 N Y Y Y Y 5 Spectra IV IP Y Y 5 N Y Y Y Y 5 Spectra Mini Y Y 5 N Y Y Y Y 5 SM5000 Y Y N Y N Y 4 Y SM Wrapper 4 Active only if the attached IP camera is PTZ capable. 5 Active only if an active System Manager is available on the network. 93

94 C5617M-A Product Compatibility 94

95 Appendix C Endura In 2005, Endura provided a distributed architecture that delivered both flexibility and performance. Endura is a complete solution for high definition video encoding, recording, and display. It controls the origination, transport, recording, and display of integrated, security-related audio and video. From a technical standpoint, what defines an Endura system? System Manager + Endura Devices = Endura System System Manager (SM) First and foremost, an Endura system must have a System Manager (SM). The SM is the heart of Endura. It is responsible for the following: Managing devices such as cameras, decoders, and NVRs, including administering rights and privileges Storing device information, like status Administering users, which includes permissions management Logging errors and alarms Security key management Endura Devices Endura devices can be defined as IP cameras, encoders, decoders, NVRs, or even work stations. Each Endura device, including the SM itself, has an Application Programming Interface (API). An API is simply a specified way for software clients to programmatically communicate with Endura devices, allowing access to their functionality. All Endura devices provide an API through a set of related web services. These web services adhere to the SOAP standard. (For more details on SOAP, please refer to the following It is beyond the scope of this documentation to fully describe all Endura web services. For details, such as the SOAP web service API reference, please refer to the Pelco Developer Network (PDN) at One of the main purposes of a System Manager is to provide a central place to retrieve information on all Endura devices. How does the System Manager collect all of this information? 95

96 C5617M-A Endura 1. The System Manager constantly provides a broadcast of its location on the Endura Network. Once a device comes online, it will listen for this broadcast. When the new device finds the SM, it will then register itself to the System Manager. 2. At some point the System Manager will query the device s available web services and its attributes, using a variety of sources including the UPnP Device Description File (DDF). DDFs are files containing device attributes in XML format. 3. After the initial query, the System Manager will periodically update the device s status. To be considered online, a device must constantly notify the SM that it is still alive. 4. At any point a client can make requests to the System Manager regarding devices, including the SM itself, and their web services. Endura Events and Alarms There are two major ways to subscribe to Endura web service events: Directly contacting the device on which the target web service resides Using the System Manager as an intermediary to perform actual eventing related work On newer Endura network deployments, the first option is the default. Users can enable the System Manager to act as an intermediary by enabling its EventArbiter web service (not to be confused with the Event Arbiter Library). The EventArbiter web service is used for receiving GENA events from devices within an Endura network. The Event Arbiter provides two ways for subscribing to events: Through control URLs By subscribing to events with event URIs provided 96

97 C5617M-A Endura Figure 1: Subscribing to Events through Control URLs Figure 2: Subscribing to Events with Event URIs Provided The URI is provided by the user through the System Manager's EventArbiter service. What is the advantage of using the System Manager as an intermediary for Endura events? The System Manager can help manage all event related network traffic, ensuring that an Endura network never gets overwhelmed by eventing network traffic. 97

Appendix A. CMS(Client Management Software)

Appendix A. CMS(Client Management Software) Appendix A. CMS(Client Management Software) A-1. Install CMS for Windows PC CMS is a program for communication between DVR and PC to control signal and video. Insert the enclosed CD, and go to CD-ROM Drive

More information

ivms-4500 (Android) Mobile Client Software User Manual (V3.1)

ivms-4500 (Android) Mobile Client Software User Manual (V3.1) ivms-4500 (Android) Mobile Client Software User Manual (V3.1) UD.6L0202D1111A01 Thank you for purchasing our product. This manual applies to ivms-4500 (Android) V3.1 mobile client software; please read

More information

Access to remote DVR from IE USER S MANUAL CONTENT

Access to remote DVR from IE USER S MANUAL CONTENT Access to remote DVR from IE CONTENT... 2 Preface... 2 1. Introduction... 2 2. System requirement and executing environment... 2 2.1. Supported operating System:... 2 2.2. Hardware requirement (recommend):...

More information

User Manual of Web Client

User Manual of Web Client User Manual of Web Client 1 Index Chapter 1 Software Installation... 3 Chapter 2 Begin to Use... 5 2.1 Login and Exit... 5 2.2 Preview Interface Instruction... 6 2.3 Preview Image... 7 Chapter 3 Playback...

More information

How To Set Up Flir Cloud Client For Pc Or Mac Or Mac (For Pc Or Ipad) On A Pc Or Pc Or Mouse (For Mac) On An Iphone Or Ipa) On Pc Or Tv (For Ipa

How To Set Up Flir Cloud Client For Pc Or Mac Or Mac (For Pc Or Ipad) On A Pc Or Pc Or Mouse (For Mac) On An Iphone Or Ipa) On Pc Or Tv (For Ipa Instruction Manual FLIR Cloud Services Client Instruction Manual FLIR Cloud Services Client #LX400018; r. 2.0/14567/14568; en-us iii Table of contents 1 Setting up FLIR Cloud Client for PC or Mac...1

More information

ivms-4500 (iphone) Mobile Client Software User Manual (V3.1)

ivms-4500 (iphone) Mobile Client Software User Manual (V3.1) ivms-4500 (iphone) Mobile Client Software User Manual (V3.1) UD.6L0202D1029A01 Thank you for purchasing our product. This manual applies to ivms-4500 (iphone) mobile client software; please read it carefully

More information

Professional Surveillance System User s Manual

Professional Surveillance System User s Manual Professional Surveillance System User s Manual \ 1 Content Welcome...4 1 Feature...5 2 Installation...6 2.1 Environment...6 2.2 Installation...6 2.3 Un-installation...8 3 Main Window...9 3.1 Interface...9

More information

ImagineWorldClient Client Management Software. User s Manual. (Revision-2)

ImagineWorldClient Client Management Software. User s Manual. (Revision-2) ImagineWorldClient Client Management Software User s Manual (Revision-2) (888) 379-2666 US Toll Free (905) 336-9665 Phone (905) 336-9662 Fax www.videotransmitters.com 1 Contents 1. CMS SOFTWARE FEATURES...4

More information

KViewCenter Software User Manual 2012 / 04 / 20 Version 2.2.1.0

KViewCenter Software User Manual 2012 / 04 / 20 Version 2.2.1.0 KViewCenter Software User Manual 2012 / 04 / 20 Version 2.2.1.0 Table of Contents Chapter 1. KViewCenter Interface... 5 1.1. Log in.... 5 1.2. Log out... 5 1.3. Control Panel... 6 1.4. Control Panel (Preview

More information

USER S MANUAL. AXIS Media Control

USER S MANUAL. AXIS Media Control USER S MANUAL AXIS Media Control AXIS Media Control - Notices Notices About This Document This manual is intended for administrators and users of the AXIS cameras and video encoders that want more detailed

More information

Server Application. ACTi NVR v2.2. Quick Installation Guide

Server Application. ACTi NVR v2.2. Quick Installation Guide Server Application ACTi NVR v2.2 Quick Installation Guide ACTi APP-2000 This document is copyrighted, 2003-2008 by ACTi Corporation. All rights are reserved. ACTi Corporation reserves the right to make

More information

SMS (Server Management Software) Digital Video Recorder. User s Manual

SMS (Server Management Software) Digital Video Recorder. User s Manual SMS (Server Management Software) Digital Video Recorder User s Manual 1 SMS User s Guide Table of Contents Chapter 1 Overview.....03 1.1 In This Manual..03 1.2 Overview 03 1.3 SMS Features...03 1.4 Product

More information

DVR4C Remote Viewer Operation Manual Table of Contents EN 3 1. OVERVIEW...5 1.1 MINIMUM PC REQUIREMENTS...5 2. INSTALLING THE PROGRAM...

DVR4C Remote Viewer Operation Manual Table of Contents EN 3 1. OVERVIEW...5 1.1 MINIMUM PC REQUIREMENTS...5 2. INSTALLING THE PROGRAM... DVR4x4RemoteViewer.book Page 3 Tuesday, February 15, 2005 9:19 AM DVR4C Remote Viewer Operation Manual Table of Contents EN 3 1. OVERVIEW...5 1.1 MINIMUM PC REQUIREMENTS...5 2. INSTALLING THE PROGRAM...5

More information

NVMS - 1000 USER MANUAL. Version 2.1.0

NVMS - 1000 USER MANUAL. Version 2.1.0 NVMS - 1000 USER MANUAL Version 2.1.0 Contents 1 Software Introduction... 1 1.1 Summary... 1 1.2 Operation Environment... 1 1.3 Install and Uninstall... 2 1.3.1 Install the Software... 2 1.3.2 Uninstall

More information

Remote Client Program... 3. Web Client... 39

Remote Client Program... 3. Web Client... 39 Remote Client / Web Client USER MANUAL T Series Digital Video Recorder Remote Client Program... 3 Remote Client Program Installation... 4 Remote Client... 6 Main Window... 6 Site Registration... 7 Group

More information

PowerVideo Plus. EverFocus Central Management Software. for Networked Video Devices Management. User s Manual

PowerVideo Plus. EverFocus Central Management Software. for Networked Video Devices Management. User s Manual EverFocus Central Management Software for Networked Video Devices Management User s Manual Copyright EverFocus Electronics Corp. Release Date: January, 2013 Copyright 2012 EverFocus Electronics Corp. All

More information

ivms-4500 (Android Tablet) Mobile Client Software User Manual (V3.0)

ivms-4500 (Android Tablet) Mobile Client Software User Manual (V3.0) ivms-4500 (Android Tablet) Mobile Client Software User Manual (V3.0) Thank you for purchasing our product. This manual applies to ivms-4500 (Android Tablet) mobile client software; please read it carefully

More information

ivms-4200 Client Software Quick Start Guide V1.02

ivms-4200 Client Software Quick Start Guide V1.02 ivms-4200 Client Software Quick Start Guide V1.02 Contents 1 Description... 2 1.1 Running Environment... 2 1.2 Surveillance System Architecture with an Performance of ivms-4200... 3 2 Starting ivms-4200...

More information

Guarding Expert (Android Tablet) Mobile Client Software User Manual (V3.1)

Guarding Expert (Android Tablet) Mobile Client Software User Manual (V3.1) Guarding Expert (Android Tablet) Mobile Client Software User Manual (V3.1) UD.6L0202D1080A01 Thank you for purchasing our product. This manual applies to Guarding Expert (Android Tablet) mobile client

More information

Central Management Software CV3-M1024

Central Management Software CV3-M1024 Table of Contents Chapter 1. User Interface Overview...5 Chapter 2. Installation...6 2.1 Beginning Installation...6 2.2 Starting the CMS software...10 2.3 Starting it from the Start menu...10 2.4 Starting

More information

SMS (Server Management Software) Digital Video Recorder. User s Manual

SMS (Server Management Software) Digital Video Recorder. User s Manual SMS (Server Management Software) Digital Video Recorder User s Manual Contents 1 - Introduction 2 1.1 About this manual 2 1.2 Configuration 2 1.3 SMS Functions 2 1.4 Product Information 2 1.5 System Requirements

More information

1. Central Monitoring System Software

1. Central Monitoring System Software 1. Central Monitoring System Software 1-1. General information CMS program is an application with which users not only watch and control remote DVRs, but also receive video/audio data or alarm signals

More information

SMS (Server Management Software) Digital Video Recorder. User s Manual

SMS (Server Management Software) Digital Video Recorder. User s Manual SMS (Server Management Software) Digital Video Recorder User s Manual 1 Table of Contents Chapter 1 Overview.....03 1.1 In This Manual..03 1.2 Overview 03 1.3 SMS Features...03 1.4 Product Information..03

More information

Quick-Start Guide. Remote Surveillance & Playback SUPER DVR MONITORING SOFTWARE. For use on Q-See s QSDT series of PC Securitiy Surveillance Cards

Quick-Start Guide. Remote Surveillance & Playback SUPER DVR MONITORING SOFTWARE. For use on Q-See s QSDT series of PC Securitiy Surveillance Cards Quick-Start Guide SUPER DVR MONITORING SOFTWARE Remote Surveillance & Playback For use on Q-See s QSDT series of PC Securitiy Surveillance Cards 2 CONFIGURING ROUTER FOR REMOTE ACCESS REMOTE SURVEILLANCE

More information

Manual Client Management Software HDR50-CMS

Manual Client Management Software HDR50-CMS Manual Client Management Software HDR50-CMS HDR50-CMS (Client Management Software) A-1. Install HDR50-CMS for Windows PC HDR50-CMS is a program for communication between DVR and PC to control signal and

More information

ACTi Central Management System

ACTi Central Management System ACTi Central Management System User s Manual Version 1.1.05.06 2012/10/12 Table of Contents 1 Overview 5 Software Architecture... 5 2 Installation 6 Requirements... 6 Operating System... 6 Hardware System

More information

AXIS Video Capture Driver. AXIS Video Capture Driver. User s Manual

AXIS Video Capture Driver. AXIS Video Capture Driver. User s Manual AXIS Video Capture Driver User s Manual 1 Introduction The AXIS Video Capture Driver enables video stream input from one Axis network video product to be recorded and shown with third party products, e.g.

More information

1. Central Monitoring System Software

1. Central Monitoring System Software 1. Central Monitoring System Software 1-1. General information CMS program is an application with which users not only watch and control remote DVRs, but also receive video/audio data or alarm signals

More information

INSTALLATION GUIDE. AXIS Camera Station

INSTALLATION GUIDE. AXIS Camera Station INSTALLATION GUIDE AXIS Camera Station About this Guide This guide is intended for administrators and users of the AXIS Camera Station, and is applicable for software release 3.50 and later. It covers

More information

VMS A1 Client Software. User Manual (V2.0)

VMS A1 Client Software. User Manual (V2.0) VMS A1 Client Software User Manual (V2.0) Contents Chapter 1 Overview...4 1.1 Description...4 1.2 Running Environment...4 1.3 Function Modules...5 Chapter 2 Live View...7 2.1 User Registration and Login...7

More information

Multi Client (Integration)

Multi Client (Integration) Multi Client (Integration) Installation and User s Guide Ver 12.10.x *All contents of this document may change without prior notice. INDEX 1. Index 01 2. Introduction 02 3. Installation 03 4. Using Multi

More information

SeeTec ExpansionPackage

SeeTec ExpansionPackage SeeTec ExpansionPackage Contents Contents 1 SeeTec WebClient...1 1.1 System requirements... 2 1.1.1 Server requirements for Apache HTTP Server, SeeTec TranscodingEngine (STE) and SeeTec ApplicationGateway

More information

CMS-DH CENTRAL MANAGEMENT SOFTWARE

CMS-DH CENTRAL MANAGEMENT SOFTWARE CMS-DH CENTRAL MANAGEMENT SOFTWARE CMS-DH is a central management software that allows you to view and manage up to 300 DH200 series DVRs. System Requirements Your system must meet the system requirements

More information

Facility Commander 2.2.3 Release Notes

Facility Commander 2.2.3 Release Notes Facility Commander 2.2.3 Release Notes Security Products by GE are now part of the UTC Fire & Security family P/N 460578005A ISS 19NOV10 Content Introduction 2 New features 3 Known issues 6 Application

More information

1. Central Monitoring System Software

1. Central Monitoring System Software 1. Central Monitoring System Software 1-1. General information CMS program is an application with which users not only watch and control remote DVRs, but also receive video/audio data or alarm signals

More information

Avigilon Control Center 5 System Integration Guide. for Software House C Cure 9000

Avigilon Control Center 5 System Integration Guide. for Software House C Cure 9000 Avigilon Control Center 5 System Integration Guide for Software House C Cure 9000 2011-2015 Avigilon Corporation. All rights reserved. Unless expressly granted in writing, no license is granted with respect

More information

ScriptLogic Enterprise Security Reporter. VERSION 3 Installation Guide

ScriptLogic Enterprise Security Reporter. VERSION 3 Installation Guide ScriptLogic Enterprise Security Reporter VERSION 3 Installation Guide ENTERPRISE SECURITY REPORTER 3 INSTALLATION GUIDE II Copyright 2011 by ScriptLogic Corporation All rights reserved. This publication

More information

1 DVR 670 Series firmware version 2.1.2 (date 2014-06-17)

1 DVR 670 Series firmware version 2.1.2 (date 2014-06-17) Video Recorder 670 Series 1 DVR 670 Series firmware version 2.1.2 (date 2014-06-17) File name: 600rtseries_2.1.2_140617.bin - When a unit detects a HDD error, the DVR will automatically reboot so that

More information

ACS CLIENT SOFTWARE USER MANUAL

ACS CLIENT SOFTWARE USER MANUAL ACS CLIENT SOFTWARE USER MANUAL 1 ACS USER GUIDE 1.1 System Requirement Recommended System Requirement OS CPU VGA RAM HDD WindowXP, Vista Pentium 4, 2Ghz 1024*768, 64MB 24bit color graphic card 1GB 20MB

More information

AXIS 262+ Network Video Recorder

AXIS 262+ Network Video Recorder 31433/EN/R4/0803 Complete Network Video Recording Solution Complete Network Video Recording Solution Picture this: A simple and reliable, plug-and-play video surveillance system for hotels, shops, banks,

More information

Professional Surveillance System User s Manual

Professional Surveillance System User s Manual Professional Surveillance System User s Manual Version 4.06 Table of Contents 1 OVERVIEW AND ENVIRONMENT... 1 1.1 Overview...1 1.2 Environment...1 2 INSTALLATION AND UPGRADE... 2 2.1 Installation...2 2.2

More information

User Manual V1.0. Remote Software

User Manual V1.0. Remote Software User Manual V1.0 Notice: The information in this manual was current when published. The manufacturer reserves the right to revise and improve its products. All specifications are therefore subject to change

More information

AXIS Camera Station. User Manual

AXIS Camera Station. User Manual User Manual About This Document This manual is intended for administrators and users of AXIS Camera Station and is applicable for software release 4.00 and later. It covers configuration of AXIS Camera

More information

Advanced System Management Software

Advanced System Management Software C O N F I G U R A T I O N Advanced System Management Software For use with WS5000 version 2.x models C3691M-C (2/13) 2 C3691M-C (2/13) C3691M-C (2/13) 3 Contents About Endura.........................................................................................................

More information

ivms-4500(windows Mobile) Mobile Client Software User Manual Version 1.0

ivms-4500(windows Mobile) Mobile Client Software User Manual Version 1.0 ivms-4500(windows Mobile) Mobile Client Software User Manual Version 1.0 Thank you for purchasing our product. This manual applies to ivms-4500 (Windows Mobile) mobile client software, please read it carefully

More information

Central Management System

Central Management System Central Management System Software Installation Guide Ver. 1.5.0.101115.001 ... ii System Introduction... 3 Client/Server Architecture...3 System Requirements... 4 System Setup...4 Multiple Monitor Configuration...5

More information

Instruction for IE network monitor

Instruction for IE network monitor Instruction for IE network monitor This system features a built-in browser-based software that allows you to access your system remotely over your local area network (LAN) or over the Internet (WAN) using

More information

DIGICLIENT 8.0 Remote Agent Software

DIGICLIENT 8.0 Remote Agent Software DIGICLIENT 8.0 Remote Agent Software MODEL: D17800 Series Instruction Manual English Version 1.0 Copyright 2007 Digimerge Technologies Inc Table of Contents Table of Contents About the DigiClient 8.0...

More information

Central Management System (CMS) USER MANUAL

Central Management System (CMS) USER MANUAL Central Management System (CMS) USER MANUAL LEGAL INFORMATION Reproduction, transfer, distribution or storage of part or all of the contents in this document in any form without the prior written permission

More information

Avigilon View Software Release Notes

Avigilon View Software Release Notes Version 4.6.3 System Version 4.6.3 includes the following components: Avigilon VIEW Version 4.6.3 R-Series Version 4.6.3 Rialto Version 4.6.3 ICVR-HD Version 3.7.1 ICVR-SD Version 2.6.3 System Requirements

More information

Configuration Manager 1.6

Configuration Manager 1.6 Configuration Manager 1.6 en Manual Configuration Manager 1.6 Table of Contents en 1 Table of Contents 1 Introduction 3 1.1 About this manual 3 1.2 Conventions in this manual 3 1.3 System requirements

More information

1. Click and select to enter the Device Management interface. 2. Click to add a new device.

1. Click and select to enter the Device Management interface. 2. Click to add a new device. Overview Guarding Expert (Android Tablet) V3.1 mobile client software, which is designed for Android Tablet on the basis of Android OS (Version 3.0 or higher), can be used to remotely monitor the live

More information

TVI End User Guide. Version: Summer 2009 Release

TVI End User Guide. Version: Summer 2009 Release TVI End User Guide Version: Summer 2009 Release Table of Contents Control Center for Windows...2 TVI Control Center for Windows XP/Vista...2 Features...2 System Requirements...3 Installing Control Center...3

More information

Preface Version 1.0 (1808. rev. 2)

Preface Version 1.0 (1808. rev. 2) A brand that is integrated into Samsung s network products, stands for a convenient world (Polis) made safe (Polis) through Samsung s superior network performance (Internet protocol). With products, clear

More information

NetClient software user manual

NetClient software user manual NetClient software user manual 1-1. General information Net Client is an application which provides users not only viewing and controling remote DVRs, but also receiving realtime event data or alarm signals

More information

RSM Web Gateway RSM Web Client INSTALLATION AND ADMINISTRATION GUIDE

RSM Web Gateway RSM Web Client INSTALLATION AND ADMINISTRATION GUIDE RSM Web Gateway RSM Web Client INSTALLATION AND ADMINISTRATION GUIDE Installation and Administration Guide RSM Web Client and RSM Web Gateway 17 August, 2004 Page 1 Copyright Notice 2004 Sony Corporation.

More information

contents 1.1 Introduction...4 1.2 running the environment...4 Chapter 2 install and uninstall 2.1 The installation of monitoring software...

contents 1.1 Introduction...4 1.2 running the environment...4 Chapter 2 install and uninstall 2.1 The installation of monitoring software... 1 Chapter 1 monitoring software is introduced. contents 1.1 Introduction...4 1.2 running the environment...4 Chapter 2 install and uninstall 2.1 The installation of monitoring software...5 2.2 Monitoring

More information

i -CEN S USER S Manual 2007. 08. 13.

i -CEN S USER S Manual 2007. 08. 13. i -CEN S i -CEN'S USER S Manual 2007. 08. 13. i -CEN S Table of Contents Overview of i-cen S software... 4 1 Introduction of i-cen S... 4 2 Key Features... 5 3 Key Benefits... 5 4 System Specification...

More information

Contents. Introduction 3. Installation 4

Contents. Introduction 3. Installation 4 VMS User Manual Contents Introduction 3 Installation 4 Minimum Recommended Requirements 4 Login 4 Main Window 5 Menu Items 5 Toolbar Items 6 Play Bar Items 7 Configuration 8 Add network cameras/ digital

More information

11.1. Performance Monitoring

11.1. Performance Monitoring 11.1. Performance Monitoring Windows Reliability and Performance Monitor combines the functionality of the following tools that were previously only available as stand alone: Performance Logs and Alerts

More information

How To Use The Workstation Program On A Pc Or Mac Or Macbook Or Macintosh (Aero) With A Computer Or Ipa (A2) With An Ipa Or Ipad (A3) With The Powerpoint 2.

How To Use The Workstation Program On A Pc Or Mac Or Macbook Or Macintosh (Aero) With A Computer Or Ipa (A2) With An Ipa Or Ipad (A3) With The Powerpoint 2. Mirasys NVR 6.1 User s Guide CONTENTS Contents... 2 Before you start... 3 Introduction... 6 Logging in... 9 User interface... 13 Navigator... 16 Cameras... 25 Video outputs... 41 Digital outputs... 46

More information

CDVS-7000 Series Remote Software Users Guide

CDVS-7000 Series Remote Software Users Guide CDVS-7000 Series Remote Software Users Guide Crest Electronics, Inc. Version 12.1005 Remote Surveillance Program The remote surveillance program enables users of the Crest 7000 series DVRs to connect remotely

More information

Integrated Intelligent Video Surveillance Management System. User's Manual V2.0

Integrated Intelligent Video Surveillance Management System. User's Manual V2.0 Integrated Intelligent Video Surveillance Management System User's Manual V2.0 1 Contents 1. Product Description... 4 1.1. General Information... 4 1.2. System Topology... 5 1.3. Operating Environment...

More information

Network Camera. User s Guide Software Version 1.3 Before operating the unit, please read this manual thoroughly and retain it for future reference.

Network Camera. User s Guide Software Version 1.3 Before operating the unit, please read this manual thoroughly and retain it for future reference. 4-194-204-14 (1) Network Camera User s Guide Software Version 1.3 Before operating the unit, please read this manual thoroughly and retain it for future reference. SNC-CH110/CH210 SNC-DH110/DH110T/DH210/DH210T

More information

This section will focus on basic operation of the interface including pan/tilt, video, audio, etc.

This section will focus on basic operation of the interface including pan/tilt, video, audio, etc. Catalogue Basic Operation... 2 For Internet Explorer... 2 For Other Non-IE Web Browsers... 5 Camera Settings... 6 System... 6 About... 6 PT Setting... 7 Backup and Restore Setup... 8 NTP Setting... 8 System

More information

idvr-pro Viewer Software for Mac User Manual ver 0.1

idvr-pro Viewer Software for Mac User Manual ver 0.1 idvr-pro Viewer Software for Mac User Manual ver 0.1 1 Contents 1. Introduction... Error! Bookmark not defined. 1.1 Summary... Error! Bookmark not defined. 2. Install... Error! Bookmark not defined. 2.1

More information

NVMS-1200. User Manual

NVMS-1200. User Manual NVMS-1200 User Manual Contents 1 Software Introduction... 1 1.1 Summary... 1 1.2 Install and Uninstall... 1 1.2.1 Install the Software... 1 2 Login Software... 3 2.1 Login... 3 2.2 Control Panel Instruction...

More information

Professional Surveillance System User s Manual

Professional Surveillance System User s Manual Professional Surveillance System User s Manual Version 4.06 Table of Contents 1 OVERVIEW AND ENVIRONMENT... 1 1.1 Overview... 1 1.2 Environment... 1 2 INSTALLATION AND UPGRADE... 2 2.1 Installation...

More information

ADTVision (ios) Mobile Client Software User Manual (V1.6)

ADTVision (ios) Mobile Client Software User Manual (V1.6) ADTVision (ios) Mobile Client Software User Manual (V1.6) Thank you for purchasing our product. This manual applies to ADTVision (ios) mobile client software, please read it carefully for the better use

More information

Practice Fusion API Client Installation Guide for Windows

Practice Fusion API Client Installation Guide for Windows Practice Fusion API Client Installation Guide for Windows Quickly and easily connect your Results Information System with Practice Fusion s Electronic Health Record (EHR) System Table of Contents Introduction

More information

LOREX CLIENT 2.2 Integrated Remote Agent Software

LOREX CLIENT 2.2 Integrated Remote Agent Software LOREX CLIENT 2.2 Integrated Remote Agent Software Instruction Manual English Version 1.0 MODEL: L15LD420 / L17LD420 Series Copyright 2008 LOREX Technology Inc. www.lorexcctv.com Table of Contents Table

More information

Network Camera. User s Guide Software Version 1.2 Before operating the unit, please read this manual thoroughly and retain it for future reference.

Network Camera. User s Guide Software Version 1.2 Before operating the unit, please read this manual thoroughly and retain it for future reference. 4-194-204-13 (1) Network Camera User s Guide Software Version 1.2 Before operating the unit, please read this manual thoroughly and retain it for future reference. SNC-CH110/CH210 SNC-DH110/DH110T/DH210/DH210T

More information

How To Use A Pew V.V.V (Windows) V.A.1.1 (Windows 8) (Windows 7) (Powerpoint) (For Windows) (Win Xp) (V.A) (Amd)

How To Use A Pew V.V.V (Windows) V.A.1.1 (Windows 8) (Windows 7) (Powerpoint) (For Windows) (Win Xp) (V.A) (Amd) VIDEO VIEWER USER MANUAL Please read instructions thoroughly before operation and retain it for future reference. Video_viewer_V1.0 LEGAL INFORMATION Reproduction, transfer, distribution or storage of

More information

IP Surveillance System. User s manual

IP Surveillance System. User s manual IP Surveillance System User s manual IP Surveillance system Table of Contents TABLE OF CONTENTS TABLE OF CONTENTS...1 SYSTEM REQUIREMENT...3 INSTALLATION...4 1. MAIN CONSOLE...12 1.1 Start...14 1.2 Information

More information

TANDBERG MANAGEMENT SUITE 10.0

TANDBERG MANAGEMENT SUITE 10.0 TANDBERG MANAGEMENT SUITE 10.0 Installation Manual Getting Started D12786 Rev.16 This document is not to be reproduced in whole or in part without permission in writing from: Contents INTRODUCTION 3 REQUIREMENTS

More information

Network Video Monitor Software

Network Video Monitor Software Network Video Monitor Software V1.0.0.0 Operation menu Chapter 1 Product Overview 1.1 Performance instruction Network video monitoring software is a centralized management tool for I8 protocol surveillance

More information

User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream

User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream User Manual Onsight Management Suite Version 5.1 Another Innovation by Librestream Doc #: 400075-06 May 2012 Information in this document is subject to change without notice. Reproduction in any manner

More information

AXIS Camera Station Quick Installation Guide

AXIS Camera Station Quick Installation Guide AXIS Camera Station Quick Installation Guide Copyright Axis Communications AB April 2005 Rev. 3.5 Part Number 23997 1 Table of Contents Regulatory Information.................................. 3 AXIS Camera

More information

CX Series. Video Recording Server. Quick Start Guide CX784 / CX788 / CX7816. Version 1.05.00

CX Series. Video Recording Server. Quick Start Guide CX784 / CX788 / CX7816. Version 1.05.00 CX Series Video Recording Server CX784 / CX788 / CX7816 Quick Start Guide Version 1.05.00 Contents 1.Introduction...1 1.1.Packages Contents...1 1.2.Hardware Features...2 1.3.Functional Features...4 1.4.Hard

More information

CamGuard Security System CamGuard Security System Manual

CamGuard Security System CamGuard Security System Manual CamGuard Security System Manual JMC Electron Co.,LTD Brief Introduction... 3 Features... 3 System Requirements... 3 Configuration... 4 Add Camera... 4 Device Options... 4 About Alarm... 5 Alarm Actions...

More information

IP Camera Centralization Management. Client Application. (IPCMonitor) Feb, 2013 Version 1.9. User Manual

IP Camera Centralization Management. Client Application. (IPCMonitor) Feb, 2013 Version 1.9. User Manual IP Camera Centralization Management Client Application (IPCMonitor) Feb, 2013 Version 1.9 User Manual INDEX 1 Introduction...3 2 Computer Requirement...3 3 Installation...4 4 Devices list...4 4.1 Adding

More information

SecuGuard. Basic 5.0. User s manual. Jun. 2010 Version: 5.0.2.xxx

SecuGuard. Basic 5.0. User s manual. Jun. 2010 Version: 5.0.2.xxx SecuGuard Basic 5.0 User s manual Jun. 2010 Version: 5.0.2.xxx SecuGuard Basic System Requirement...6 Installation...7 Before Installing the Software... 7 Starting the Installation... 7 Quick Start...10

More information

CMS Pro. User`s Manual. Professional Central Monitoring Software. Full-featured Enterprise Class Surveillance Solution MADE IN KOREA

CMS Pro. User`s Manual. Professional Central Monitoring Software. Full-featured Enterprise Class Surveillance Solution MADE IN KOREA Professional Central Monitoring Software CMS Pro Full-featured Enterprise Class Surveillance Solution User`s Manual MADE IN KOREA M11131CMSProDR This document contains preliminary information and is subject

More information

ivms 4000(V2.0) User Manual

ivms 4000(V2.0) User Manual ivms 4000(V2.0) User Manual Table of Contents Chapter 1 Welcome to ivms 4000 (V2.0)...4 1.1 Overview...4 1.2 Computer Disposition Request...4 1.3 Convention...4 Chapter 2 Install & Uninstall...5 2.1 Install

More information

Mobile Video Analysis Software User Guide. Version 2.0.8

Mobile Video Analysis Software User Guide. Version 2.0.8 User Guide Version 2.0.8 Content 1. Introduction......1 1.1 Software Overview... 1 1.2 Documentation Overview... 1 1.3 Application Range... 1 1.4 System Requirements... 1 2. Getting Started... 3 2.1 Main

More information

IEI emerge and Milestone Systems Network Video Recorder. Setup and Integration Guide. Milestone Version 6.5 and emerge Version 3.

IEI emerge and Milestone Systems Network Video Recorder. Setup and Integration Guide. Milestone Version 6.5 and emerge Version 3. IEI emerge and Milestone Systems Network Video Recorder Setup and Integration Guide Milestone Version 6.5 and emerge Version 3.2 and above CONTENTS Requirements for Milestone NVR/IEI emerge Integration...

More information

ipims Software Manual

ipims Software Manual ipims Software Manual Enterprise Software for idvr-pro8 and idvr-pro16 Security DVRs Ver 1.0 Contents Target Audience for this Document... 6 Copyright, Trademarks and Important Information... 6 Copyright...

More information

Legal Notes. Regarding Trademarks. 2013 KYOCERA Document Solutions Inc.

Legal Notes. Regarding Trademarks. 2013 KYOCERA Document Solutions Inc. Legal Notes Unauthorized reproduction of all or part of this guide is prohibited. The information in this guide is subject to change without notice. We cannot be held liable for any problems arising from

More information

DVS Net (Integration)

DVS Net (Integration) DVS Net (Integration) Installation and User s Guide Ver 11.10.x Digital Video Security System Digital Video Recorder www.tuniss.com PLEASE CALL TUNISS COMPUTER AT: 650-401-6138 FOR ANY QUASTIONS REGARDING

More information

ivms-4000 (V2.03.07) Client Software User Manual

ivms-4000 (V2.03.07) Client Software User Manual ivms-4000 (V2.03.07) Client Software User Manual Table of Contents User Manual... 2 Table of Contents... 1 Chapter 1 Welcome to ivms-4000 (V2.03.04.07)... 4 1.1 Overview... 4 1.2 Computer Disposition Request...

More information

TruVision Navigator v6

TruVision Navigator v6 Video Surveillance Navigator v6 License-free video management system OVERVIEW Navigator v6.0 from Interlogix, represents the latest advancement in video management software. This license-free video management

More information

<User s Guide> Plus Viewer. monitoring. Web

<User s Guide> Plus Viewer. monitoring. Web Plus Viewer 1 < Plus Viewer (web ) > 1-1 Access Method The user can access the DVR system through the web. 1 Enter the IP for the DVR system in the address field of the web browser. 2 The

More information

Avigilon Control Center 5 System Integration Guide. Video and Event Viewer for Lenel OnGuard

Avigilon Control Center 5 System Integration Guide. Video and Event Viewer for Lenel OnGuard Avigilon Control Center 5 System Integration Guide Video and Event Viewer for Lenel OnGuard 2013-2015, Avigilon Corporation. All rights reserved. AVIGILON, the AVIGILON logo, ACC and AVIGILON CONTROL CENTER

More information

ivms-4200 Intelligent Video Management System Quick Start Guide

ivms-4200 Intelligent Video Management System Quick Start Guide ivms-4200 Intelligent Video Management System Quick Start Guide Notices The information in this documentation is subject to change without notice and does not represent any commitment on behalf of HIKVISION.

More information

User s Manual of DVR DVS Remote Client Software V 4.0.1

User s Manual of DVR DVS Remote Client Software V 4.0.1 User s Manual of DVR DVS Remote Client Software V 4.0.1 Index Version description...4 1 Introduction...8 2 Software Install, Uninstall and use...9 2.1 Install remote client software ver4.0.1...9 2.2 Uninstall

More information

Local Playback Software User Manual (V2.0)

Local Playback Software User Manual (V2.0) User Manual (V2.0) Thank you for purchasing our product. This manual applies to Local Playback software, please read it carefully for the better use of this software. The contents in this manual are subject

More information

Network Viewing Software User and Administrators Guide

Network Viewing Software User and Administrators Guide Network Viewing Software User and Administrators Guide Contents Contents...2 Introduction...3 System requirements...3 Connecting through a firewall....3 Connecting using a proxy server....3 Using Network

More information

Digital Sentry DS ControlPoint

Digital Sentry DS ControlPoint O P E R A T I O N Digital Sentry DS ControlPoint C3674M-I (5/11) 2 C3674M-I (5/11) C3674M-I (5/11) 3 Contents Description...........................................................................................................

More information

How To Install An Aneka Cloud On A Windows 7 Computer (For Free)

How To Install An Aneka Cloud On A Windows 7 Computer (For Free) MANJRASOFT PTY LTD Aneka 3.0 Manjrasoft 5/13/2013 This document describes in detail the steps involved in installing and configuring an Aneka Cloud. It covers the prerequisites for the installation, the

More information

Client Software-4000(V2.00.02) User Manual

Client Software-4000(V2.00.02) User Manual Client Software-4000(V2.00.02) User Manual Index Chapter 1 Welcome to Client Software-4000 (V2.0)... 1 1.1 Overview... 1 1.2 Computer Disposition Request... 1 1.3 Convention... 1 Chapter 2 Install & Uninstall...

More information