pelco sdk 4.2.1 quick start...

26
Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a 12 / 2016

Upload: dangxuyen

Post on 30-Aug-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

Pelco SDK 4.2.1 QuickStart Guide

C5659M-H-a   12 / 2016

Contents

2  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

ContentsWhat Is the Pelco SDK?..................................................................................................................................................... 3Before Installing the Pelco SDK...................................................................................................................................... 6Installing the Pelco SDK.................................................................................................................................................... 8Running the ViewVideo Sample Program..................................................................................................................10Looking at the Source Code...........................................................................................................................................12Pelco Media Control......................................................................................................................................................... 17Overview of the Pelco SDK Object Model................................................................................................................. 21

What Is the Pelco SDK?

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  3

What Is the Pelco SDK?Pelco by Schneider Electric offers the Pelco Software Development Kit (Pelco SDK) to help our development partners writeapplications for controlling Pelco products and for integrating with non-Pelco products and software. The Pelco SDK handlesthe interface to various Pelco devices so you don't need to. It takes care of making the API calls to the devices on behalf of yourapplication.

The following diagram shows how Pelco SDK works. Your application requests information from a device, for example, a cameraname. The request is passed on to the SDK and the SDK makes the call to the API that resides on the Pelco device, in this case, acamera. The SDK then returns the result back to your application.

The Pelco SDK provides a comprehensive Object Model that encapsulates the following Pelco products and features.

Table 1: Pelco SDK 4.2.1 Features

Functionality Endura DS (PelcoAPI-enabled)

VideoXpert

Device Collection Y Y Y

System Auto Discovery Y Y N

Device Discovery Y Y Y

Login Y Y Y

Get System Attribute Y Y Y

Get Device Attribute Y Y Y

Subscribe to system-related events Y Y Y

Live Y Y Y

Playback Y Y Y

State Transitions Y Y Y

Ability to pause live streams Y Y Y

Subscribe to stream-related events Y Y Y

Delivery Mode (Unicast/Multicast) Y Y Y

Stream Protocol (RTP/RTSP) Y RTP only RTSP only

MJPEG Support Y N Y

Low Bandwidth Y Y Y

Raw Frame Support Y Y Y

Video Query Y Y Y

What Is the Pelco SDK?

4  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Functionality Endura DS (PelcoAPI-enabled)

VideoXpert

Manual Recording Y Y N

Network Display Support Y N N

Overlays on live and recorded video Y Y N

Analytics and Motion overlays Y Y N

Audio Y N N

Adjust aspect ratio Y Y Y

JPEG Snapshot Y Y Y

Stream in web browser Y Y Y

Continuous Pan Y Y Y

Continuous Tilt Y Y Y

Continuous Movement Y Y Y

Stop Continuous Movement Y Y Y

Low Latency mode via UDP Y Y N

Pan to a specific position Y Y Y

Tilt to a specific position Y Y Y

Determine if camera supports PTZ Y Y Y

Move to a specific position Y Y Y

Move to a position relative to the current location Y Y Y

Get the Camera's current position Y Y Y

Manage the Magnification (Zoom) value Y Y Y

Manage the Focus value Y Y Y

Iris control Y Y Y

Get existing Presets and Patterns Y N Y

Create a Preset Y Y N

Create a Pattern Y Y N

Go to an existing Preset Y Y Y

Remove an existing Preset Y Y N

Update an existing Pattern Y Y N

Execute an existing Pattern Y N Y

Stop a Pattern currently being executed Y N Y

Toggle Wiper Y Y N

Export a Single Clip Y Y Y

Export Multiple Clips via Clip Collection N N Y

Export Video using Playlist Y Y N

Remote Export N N Y

Include Overlays in Export Y Y N

Subscribe to Export Events Y Y Y

What Is the Pelco SDK?

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  5

Functionality Endura DS (PelcoAPI-enabled)

VideoXpert

Event Subscription/Unsubscription Y Y Y

Poll for Events Y N Y

External Events N N Y

Communication Loss Y Y Y

Motion Event

NOTE: In VideoXpert, motion events will be displayed as“Video Analytic” events.

Y Y Y

Analytics Event Y Y N

Physical Event Y N N

Diagnostic Event Y N Y

To get started with the Pelco SDK you can:

• Make sure you meet the right hardware and software requirements before you begin.• Install the Pelco SDK on your computer.• Run a sample SDK application.• From Visual Studio, view the source code.• Learn more about the object model introduced with Pelco SDK 3.0.

Before Installing the Pelco SDK

6  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Before Installing the Pelco SDKYou can download the Pelco SDK from the Pelco Developer Network. However, before installing the Pelco SDK on your localmachine, make sure your computer meets the following hardware and software requirements.

Contents of the Pelco SDKWhen downloading the Pelco SDK you are installing into the Pelco/API directory the following items:

• Two sets of libraries, one for Debug, the other for Release.• Include files.• Sample programs that demonstrate how the SDK works. These programs can also serve as templates for writing your own

applications.

In addition, the installer registers the Pelco Media Control OCX. The Pelco Media Control is an ActiveX control that encapsulates asubset of the Pelco SDK features in one reusable component. Features include the System class, the Camera class, and variouscollection and stream-related classes.

Hardware RequirementsYou can use the Pelco SDK with a Pelco SDK-compatible device, for example, an Endura video management system or an IP-enabled camera.

Recommended Configuration:

• CPU: Intel Core i7 2.4GHz Quad Core (or greater)• Memory: 4 GB (or greater)• Graphics: Dedicated graphics card with at least 1024 MB of memory, PCI Express bus, and supports DirectX® 9.0c for

multimedia• Hard disk: 1GB available hard disk space

NOTE: Pelco SDK and Pelco cameras do not support displaying video on virtual machines.

Software RequirementsYou can run the Pelco SDK on any of the following Windows® operating systems: Windows 10, Windows 8.1, Windows 7, WindowsServer® 2012, or Windows Server® 2008 R2.

When deploying your application along with the Pelco SDK, the following dependencies apply. The Pelco SDK installer will installthese dependencies, eliminating the need to install them manually.

Dependencies for the Visual Studio 2013 (VC12) SDK:

• Microsoft .NET Framework 4.5.1• Microsoft® DirectX 9.0c (Microsoft Download Center)• x86 Visual C++ Redistributable Packages for Visual Studio 2013 (Microsoft Download Center)

Dependencies for the Visual Studio 2010 (VC10) SDK:

• Microsoft .NET Framework 4.5.1• Microsoft® DirectX 9.0c (Microsoft Download Center)• x86 Visual C++ Redistributable Packages for Visual Studio 2010 SP1 (Microsoft Download Center)

NOTE: Microsoft® DirectX 9.0c is required even if you have a later version on your computer. You can download DirectX 9c fromthe Microsoft Download Center.

Deployment DependenciesWhen deploying your application along with the Pelco SDK redistributables, the following dependencies apply. The Pelco SDKinstaller will install these dependencies, eliminating the need to install them manually.

Dependencies for the Visual Studio 2013 (VC12) redistributables:

• Microsoft .NET Framework 4.5.1• Microsoft® DirectX 9.0c (Microsoft Download Center)

Before Installing the Pelco SDK

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  7

• x86 Visual C++ Redistributable Packages for Visual Studio 2013 (Microsoft Download Center)

Dependencies for the Visual Studio 2010 (VC10) redistributables:

• Microsoft .NET Framework 4.5.1• Microsoft® DirectX 9.0c (Microsoft Download Center)• x86 Visual C++ Redistributable Packages for Visual Studio 2010 SP1 (Microsoft Download Center)

Installation DirectoryBy default, Pelco SDK is located under either:

• 64-bit systems: C:\Program Files (x86)• 32-bit systems: C:\Program Files

What's Next?Follow the installation instructions.

Installing the Pelco SDK

8  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Installing the Pelco SDK

About this taskPelco SDK is available from the Pelco Developer Network. Follow these steps to install it on your local computer.

Procedure1. Uninstall any previous versions of Pelco SDK.

a) From the Windows Control Panel > Uninstall or change a program, uninstall any previous versions of Pelco SDK.b) Navigate to the installation directory and remove \Pelco\API:

• 64-bit systems: C:\Program Files (x86)\Pelco\API\• 32-bit systems: C:\Program Files\Pelco\API\

NOTE: You must remove previous versions of the Pelco SDK to ensure Windows environment variables are set up correctly andthat code samples run without error.

2. Get the latest Pelco SDK installation package. Go to http://pdn.pelco.com/content/pelco-sdk-related-downloads and select:Downloads > Pelco SDK Related Downloads.

3. Select the appropriate version and save the file in your local Downloads directory.

• For Visual Studio 2013 users, install Pelco SDK-4.2.1 Windows vc12• For Visual Studio 2010 users, install Pelco SDK-4.2.1 Windows vc10• For those not using Visual Studio, choose Pelco SDK-4.2.1 Windows vc10

4. From your Downloads directory, double-click the Pelco SDK installer .exe file to launch the SDK install process. Follow theprompts to perform the installation.

NOTE: If you get the following warning it means that DirectX 9c is missing on your computer, click OK to continue. You caninstall it later.

5. Restart the system. This ensures that the environment variables are set correctly.

ResultsBy default, the Pelco SDK is located in:

• 64-bit systems:C:\Program Files (x86)\Pelco\API\• 32-bit systems:C:\Program Files\Pelco\API\

Several directories were installed under Pelco\API:

Pelco API directory Description

Include\C++\PelcoSDK Header files for Object Model classes.

Libs\Debug Pelco SDK libraries that contain debug symbols to use whendeveloping your applications.

Libs\Debug\Plugins Assemblies required to render video. For internal use.

Installing the Pelco SDK

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  9

Pelco API directory Description

Libs\Release Pelco SDK libraries, built for performance and without debugsymbols to use when building your final application.

Libs\Release\Plugins Assemblies required to render video. For internal use.

Logging A logging application to use when creating log files.

SampleCode Sample C# and C++ Visual Studio projects.

In addition, your local environment variables were updated to include Pelco SDK paths as follows:

EVEREST_BIN Location of the Pelco SDK binaries, such as \Program Files\Pelco\API\Libs

EVEREST_ROOT Location of the Pelco SDK header files, such as \Program Files\Pelco\API\Include\C++

PATH Location of the Pelco SDK debug directory, such as \Program Files\Pelco\API\Libs\Debug added to the PATH environment variable

PELCO_SDK Location of the Pelco SDK installation directory, such Program Files (x86)\Pelco\API\or Program Files\Pelco\API\

What to do nextNext, you might want to check out a sample program installed with Pelco SDK.

Running the ViewVideo Sample Program

10  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Running the ViewVideo Sample Program

About this taskPelco SDK comes with a few sample C# and C++ programs to help you become familiar with the SDK. These sample programs arepackaged as Visual Studio projects and located under installation directory\Pelco\API\SampleCode\. Let's walk through theprocess of building and running the C# program called ViewVideo.

When you start ViewVideo, you log in to a system and get a list of the cameras that the system recognizes. You can select acamera from the list and view its live video stream and play back recorded video. You'll need the user name and password of yoursystem manager (SM).

Procedure1. From Visual Studio, open Pelco\API\SampleCode\DotNet\ViewVideo\VS2010\ViewVideo.csproj.2. From the Build menu, select Build Solution.3. Start the program in debug mode.

The ViewVideo program starts and prompts you for the user name and password of your system manager (SM).4. Connect to a system:

• If you're on an Endura system on the same VLAN, enter the user name and password for your system manager, underSystems, select New, then click OK.

• If you're not on an Endura system or if you are on a different VLAN, under Systems, select the location of your systemmanager (SM) from the drop-down box, select Disable autodiscover, supply the IP address and port number of your systemmanager, and then click OK.

5. From the ViewVideo window, click a camera listed on the left to start viewing a live video stream on the right.

Running the ViewVideo Sample Program

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  11

The system manager starts collecting the list of available cameras managed by your system. X's mark cameras that arecurrently off line.

6. Right-click anywhere in the video window to view recorded playback options.

What to do nextThis gives you an idea what a Pelco application can do. Now let's look at the source code for this application to see what's involved.You might be surprised at what little code is required to interact with Pelco devices.

Looking at the Source Code

12  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Looking at the Source CodeNow that you know how ViewVideo program works, let's take a look at the source files. This application is built using the PelcoSDK Object Model so you can see how to use the SDK classes in your Pelco applications. There's a lot going on in this ViewVideoapplication, so this example strips it down to the essential code required to get a video stream from a camera and play it on amonitor. The following example walks you through the source code and explains what's going on. Here, the ViewVideo program:

1. Creates a System object to represent a real-world video management system. If no system exists, it creates one.2. Gets a list of the system's devices and filters it for a list of cameras.3. Creates a Camera object to represent the video source.4. Creates a Display object to represent the display that shows the video.5. Creates a Stream object to represent the video stream that plays live or recorded video.

Note that the ViewVideo program uses the .NET System.Windows.Forms namespace to take advantage of the user interfacefeatures in the Microsoft Windows operating system. These classes are not discussed here.

TIPRun the ViewVideo program in debug mode to get an idea of what's going on.

TIPAs you peruse the source code, browse the Object Model SDK Reference available on thePelco Developer Network (PDN).

Main ProgramStarting with main(), located in the file, program.cs, notice that the program is framed with Startup() and Shutdown()methods. Startup() is required to initialize the Pelco software before you start using it. Likewise, Shutdown() cleans upand shuts down the SDK before the application ends. Every Pelco SDK program requires these Startup() and Shutdown()methods.

Get System Collection and SystemsOpen the LoginForm.cs file and here's the first step in a Pelco SDK application: get the appropriate system from the systemcollection. A SystemCollection object contains all the systems on the network. A System object contains all the devices connected

Looking at the Source Code

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  13

to a single system. This system and device information is stored on a local database, called the device cache, and is described inmore detail in the Pelco SDK Programmer's Guide.

The following code creates a SystemCollection object to contain all the systems on the network, iterates over the collection, andassigns a display name and UUID to each system.

The following code creates a System object if the system exists. The GetItem() method of SystemCollection assigns the specifiedsystem to the System object. If a system doesn't exist, it creates one, which occurs in the AddSystem() method.

Go to the AddSystem() method and you'll see how to create the very first System object. First, you construct a system schemeand create a System passing in the system scheme.

Looking at the Source Code

14  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Now, let's look at the system scheme in more detail. Here's a simpler example than the one in ViewVideo:

PelcoSDK::System system("admin:admin@pelcosystem://1.2.3.4:80?alias=Alias");

Notice that the system scheme resembles a Web address, more specifically, the top level of the URI naming structure. A systemscheme is described as follows:

PelcoSDK Pelco SDK identifier.

admin:admin@ User name and password for the system.

pelcosystem: The system provider. The pelcosystem provider name means that this is an Endura system.

//1.2.3.4:80 Host name and port number of the system.

?alias=Alias Query string to pass in an argument. Here, alias is a friendly name used to display the system or tolook it up in the database.

Using the system scheme is a short cut for adding an initial system and for accessing it later on. It replaces the need to use theAdd() method on the SystemCollection. When you write your own applications, you'll discover how handy, and powerful, thesystem scheme can be.

After the System is created (or retrieved), the application then gets the system's DeviceCollection to perform the interesting part ofthe application. In ViewVideo, this occurs on the last line of AddSystem() with the call to DisplayDevices().

Get Cameras and Video StreamsOpen the CameraCollectionForm.cs file to see the heart of the program. The CameraCollectionForm() method creates alist of the system's devices and iterates over the list of devices. For each camera, it creates a Camera object and adds it to the listof cameras. A Display object is created to represent the display that shows the video.

Looking at the Source Code

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  15

A Stream object is created to represent the actual video. Notice that a Camera object is passed in as an argument to the methodthat creates the Stream. The Display.Show() method shows the video on the monitor.

Notice, also, that the video switches from live to recorded video on the same Stream object. In this case, the Stream.Play methodplays back the video at normal speed. It uses StreamConfig.VideoFormat() to change the video format to MJPEG. ViewVideouses Stream.Timestamp() to create a Timestamp .NET event which returns a timestamp every time a timestamp is processed inthe video stream.

Looking at the Source Code

16  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Handle ExceptionsNotice how exceptions are handled throughout. Any time your program needs to display an exception, the Exception object canparse errors and display the specified error message.

Pelco Media Control

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  17

Pelco Media ControlThe Pelco Media Control is an ActiveX control that encapsulates a subset of the Pelco SDK features in one reusable component.The control can be included in a Windows Forms application (described here) or web page.

The Pelco Media Control supports interfaces and classes related to system setup, camera and device collection, and videostreaming. You can use these classes to perform a variety of tasks, including:

• Create and connect to System objects• Add devices (to a Pelco Edge system)• Retrieve specific cameras and other devices attached to a System• Configure and start a video stream• Take a snapshot of the current stream image

Using the Pelco Media Control in a Windows Forms ApplicationThe SDK installer automatically registers the Pelco Media Control with Windows. Once it has been registered you can use it in anapplication.

Add the Pelco Media Control to a Windows Forms application using the Visual Studio Toolbox. Pick the PelcoMediaControl from theCOM tab.

After the control has been added to the project you can drop it onto a form and start writing code that uses the control.

Pelco Media Control

18  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Use the Object Browser to get a list of the interfaces, classes, and methods supported by the control.

Create a Stream from a pelcosystem Camera ObjectThe following code creates a Pelco System object, retrieves a camera attached to that system, and then starts a video stream.

using P = PelcoMediaControl;

public partial class Form1 : Form{ // Replace with constants that apply to your environment const string systemAddress = "10.220.198.146"; const string cameraUuid = "uuid:0901F025-8000-0000-0802-6B6C38140004"; const string user = "admin"; const string password = "admin";

P.Stream _stream = null;

P.Stream stream { get { if( _stream == null ) { var systems = ctrl.SystemCollection; P.System sys = null; string systemScheme = string.Format("{0}:{1}@pelcosystem://{2}", user, password, systemAddress); try { sys = systems.GetItemByKey( systemScheme ); } catch( Exception ) { sys = systems.Add( systemScheme ); } sys.Login( user, password );

P.Camera camera = sys.GetCameraByUUID(cameraUuid); ctrl.CreateStream(camera);

_stream = ctrl.CurrentStream; }

return _stream;

Pelco Media Control

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  19

}

set { _stream = value; } }}

Create a Stream from a pelcoedgesystem Camera ObjectThe following code creates a Pelco Edge System object, adds and then retrieves a camera on that system, and then configures andstarts a video stream. The stream delivery mode is set to Unicast. The default delivery mode is Multicast. If your switch or routerfilters out mulicast packets then try unicast. In addition, the video format is explicitly set to MPEG/H.264.

using P = PelcoMediaControl;

public partial class Form1 : Form{ // Replace with constants that apply to your environment const string systemAlias = "?alias=SampleEdgeSystem";

P.Stream _stream = null;

P.Stream stream { get { if ( _stream == null ) { var systems = ctrl.SystemCollection; P.System sys = null; string systemScheme = string.Format("{0}:{1}@pelcoedgedevices://{2}", user, password, systemAlias);

try { sys = systems.GetItemByKey( systemScheme ); } catch( Exception ) { sys = systems.Add( systemScheme ); }

sys.CameraCollection.Add("admin:admin@pelcoedgedevices://192.168.0.99");

P.Camera camera = sys.CameraCollection.GetCameraByIndex(0); ctrl.CreateStream(camera); P.StreamConfiguration config = ctrl.CurrentStream.GetConfiguration();

config.VideoFormat = P.StreamVideoFormat.MPEG4h264; config.DeliveryMode = P.StreamDeliveryMode.Unicast; ctrl.CurrentStream.SetConfiguration(config);

_stream = ctrl.CurrentStream; }

return _stream; }

set { _stream = value; }

Pelco Media Control

20  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

}}

The Pelco Media Control displays the active video stream in the control. This applies to cameras in both Edge and non-Edgesystems.

Overview of the Pelco SDK Object Model

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  21

Overview of the Pelco SDK Object ModelThe Pelco SDK introduced the Object Model to define classes to represent pieces of a Pelco video management system. Classesrepresent systems and the connected devices, such cameras, recorders, encoders, decoders, and monitors.

Classes of the SDK 4.2.1 Object ModelThe class diagram below introduces Pelco SDK classes as of 4.2.1 and shows how they interact. Collection classes indicate thoseclasses that exist in containers so that you can manage them as one entity.

Orange arrows indicate an "is a" relationship where the class is derived from the parent class. For example, a Camera is a kindof Device. Green arrows indicate a "has a" relationship where the class is contained in the parent class. For example, a Systemcontains Devices.

System and System Collection ClassesThe System class represents a system on a Pelco video management system (VMS), such as a VideoXpert system.

The System class enables you to perform the following tasks:

• Retrieve a system manager (SM) by its display name, UUID, IP address and port number, or its alias• Retrieve the devices connected to the System, such as cameras, encoders, decoders, and network video recorders (NVRs)• Store and retrieve device information• Remove systems

Overview of the Pelco SDK Object Model

22  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

The System class can also represent a Pelco Endura system.

The System class can also represent a Pelco Edge system, which is a special kind of "virtual" system that consists of a set ofdevices without using a system manager (SM).

The SystemCollection class represents a collection of systems that comprise a Pelco network.

Here's a picture that illustrates a video management system, represented by a SystemCollection. It contains an Endura system,represented by a System class with connected cameras, two NVRs, and a System Manager (SM). It also contains a Pelco Edgesystem, also represented by a System class but with only cameras attached.

Currently, the System class can represent the following Pelco video management system products:

• VideoXpert, the scalable video management and surveillance system that aggregates other Pelco VMS products.• Endura, the Pelco video management system that is managed by a system manager (SM) appliance such as an SM5200.• Pelco Aggregation Software, which allows Endura customers to observe multiple Endura installation sites through a common

user interface.• Pelco Edge system, which is a Pelco SDK "virtual" system that enables SDK applications to connect to cameras without using

a system manager.• Digital Sentry products: Network Video Recorder and Analog Encoder.

Device and Device Collection ClassesThe Device class represents a single device connected to the system manager such as a camera, encoder, and decoder, recorder,or monitor. The DeviceCollection class, which represents all devices associated with a system, enables SDK applications tomanage all devices on a system as a single entity.

Camera, Display, and Stream ClassesThe combination of Camera, Display, and Stream classes display video. The Camera class represents any IP camera such as aSarix ® or Spectra® model. The Display class represents a window on a local display that shows a video stream. The display mighthave several windows where each window shows a separate video stream.

A Stream class represents live or recorded video.

The StreamConfiguration class gives you the ability to change a stream's:

• Delivery mode from unicast to mulitcast• Video format from MJPEG to MPEG-4/H.264• Frame rate

The following figure illustrates that it takes the three classes to show a video: Camera, Stream and Display.

Overview of the Pelco SDK Object Model

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  23

Network Display and Channel ClassesThe Network Display class represents a network display that can be located anywhere on the network but managed on the localcomputer that is running the SDK. For example, a collection of network display units can be used as a video wall, where they showvideo from several locations but are managed from a single keyboard.

The Channel class represents the channel through which video is transmitted from the camera to show in a rectangular area ofthe network display. This could be a single video channel shown across the entire display area, called the 1x1 layout, or up to 16channels, called a 4x4 layout.

The following figure shows how channels transmit video from a camera to a network display.

Clip and Exporter ClassesThe Clip and Exporter classes of the Pelco SDK Object Model make it easy to export video from a camera to disk. You create anexcerpt of recorded video with an instance of Clip, and control the export process with an instance of Exporter. Currently, theseclasses are available on Pelco Aggregation systems only.

Event ClassesPelco SDK contains three event classes to provide a way to handle events in your applications:

• With the Event class, you declare which events you want your application to handle.• With the EventListener class, you callback to your event handler.• With the Events class, you subscribe and unsubscribe to events to start and stop listening for events.

Overview of the Pelco SDK Object Model

24  |   Pelco SDK 4.2.1 Quick Start Guide C5659M-H-a

Utility ClassesPelco SDK contains convenience classes to ease application development. You can use the Exception class to handle exceptionsfor error conditions in the Object Model. You can use PTime, PString, and PList classes for ease in handling lists, strings, and timevalues.

The Pelco SDK 4.2.1 Object ModelThe following table summarizes the classes defined in the Pelco SDK Object Model as of SDK 4.2.1.

Table 2: List of the Pelco SDK Classes

Class Function

Administrator Manages all systems without requiring the user name and password of any single system. TheAdministrator class represents a "superuser" whose credentials supersede the administratorcredentials of all individual systems.

Camera Manages an IP camera such as a Sarix® or Spectra® model.

Channel Transmits a single channel of video to a multichannel remote monitor. The Channel class representsvideo that appears in a rectangle on the network display.

Clip Creates an excerpt of recorded video by specifying the start and stop time. Used with the Exporterclass to export video to disk.

Device Manages a physical device contained in the video management system. The Device class canrepresent a camera, encoder, decoder, digital video recorder (DVR), or network video recorder(NVR).

Display Displays video streams in a window on a display/monitor. Multiple streams appear in separatewindows. The Display class represents a local display attached to the computer on which the SDK isrunning.

Event Defines something that occurs in a system, such as changes in device online/offline state, changes indevice properties, or stream failures.

EventListener Listens for events and calls an event handler when an event fires. The GlobalEventListener classlistens for global events, such as changes in the SDK state, across the entire system collection. TheSystemEventListener class listens for events on a specific system and its associated devices.

Events Subscribes and unsubscribes to events.

Exception Handles exceptions on Try and Catch execution. The Exception class can return error codes andmessages.

Exporter Exports recorded video and saves it to a video file. Available for Pelco Aggregation systems only.

ExternalEvent Injects Events generated by non-Pelco external systems into VideoXpert.

ExternalSituation Injects Situations generated by non-Pelco external systems into VideoXpert.

MediaFrame Provides a way to get raw frames from the stream which can be rendered on the user’s displayinstead of a Display object.

NetworkDisplay Displays video on a remote monitor, where each video channel appears in a rectangle on the monitor.The NetworkDisplay class allows an operator to manage monitors residing elsewhere on the networkfrom a local computer running the SDK.

Overlay Displays custom information over streaming video or exported video.

Playlist Assembles a list of multiple clip collections for export. Each clip contains information such as cameradetails, start time, end time, and audio.

Property Defines and manages arbitrary name/value pairs used in your application.

PList Represents items in a list. Use this object to iterate over collections.

PString Defines and manages character strings.

PTime Retrieves and sets time by day, hour, minute, month, year, and so on.

PTZProvides pan, tilt and zoom functions in active cameras with PTZ hardware.

SearchFilter Parameters on which to base the search for video/audio.

Overview of the Pelco SDK Object Model

C5659M-H-a Pelco SDK 4.2.1 Quick Start Guide   |  25

Class Function

Stream Plays live or recorded video. If recorded, makes available the typical video controls such as pauseand rewind.

Stream Configuration Changes how the Stream class behaves, for example, video format (MJPEG or MPEG-4/H.264),protocol (RTP, RTSP, or HTTP), delivery mode (unicast or multicast) and whether it contains audio.

System Creates and manages systems and devices. The System class represents a System Manager (SM),DS, VideoExpert, or a Pelco Edge system. A System object can also represent a system that allowsapplications to send calls directly to a Pelco Aggregation System.

Multiple Collection classes Enables iterating over a collection. The collection can consist of one of these classes: Channel, Clip,Device, ExtermalEvent, ExternalSituation, Property, and System.

Object Model LibrariesThe Object Model features are contained in a dynamic link library file (.dll). There is one for .NET and one for C++.

• Pelco.SDK.dll (any .NET language)• PelcoSDK.dll (C++)

Pelco by Schneider Electric3500 Pelco Way Clovis, California 93612-5699 USA(800) 289-9100 Tel (800) 289-9150 Fax+1 (559) 292-1981 International Tel+1 (559) 348-1120 International Faxwww.pelco.com © 2016 Schneider Electric. All Rights Reserved. All trademarks are owned by Schneider Electric IndustriesSAS or its affiliated companies. www.schneider-electric.com

C5659M-H-a