What Is the Pelco SDK?

Pelco by Schneider Electric offers the Pelco Software Development Kit (Pelco SDK) to help our development partners write applications for controlling Pelco products and for integrating with non-Pelco products and software. The Pelco SDK handles the 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 your application.

The following diagram shows how Pelco SDK works. Your application requests information from a device, for example, a camera name. 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, a camera. The SDK then returns the result back to your application.

Overview of the SDK architecture.

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

Table 1. Pelco SDK 4.0 Features
Functionality Endura DS (Pelco API-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 N
Low Bandwidth Y Y Y
Raw Frame Support Y Y Y
Video Query Y Y Y
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 Y N
Adjust aspect ratio Y Y Y
JPEG Snapshot Y Y Y
Streaming in web browser Y Y Y
Continuous Panning Y Y Y
Continuous Tilting Y Y Y
Continuous Movement Y Y Y
Stopping Continuous Movement Y Y Y
Low Latency mode via UDP Y Y N
Panning to a specific position Y Y Y
Tilting to a specific position Y Y Y
Is Camera PTZ Y Y Y
Moving to a specific position Y Y Y
Moving to a position relative to the current location Y Y Y
Getting the Camera's current position Y Y Y
Managing the Magnification (Zoom) value Y Y Y
Managing the Focus value Y Y Y
Iris control Y Y Y
Creating a Preset Y Y N
Creating a Pattern Y Y N
Going to an existing Preset Y Y Y
Removing an existing Preset Y Y N
Updating an existing Pattern Y Y N
Executing an existing Pattern Y N Y
Stopping a Pattern currently being executed Y N Y
Toggle Wiper Y Y N
Exporting a Single Clip Y Y Y
Exporting Multiple Clips via Clip Collection N N Y
Exporting Video using Playlist Y Y N
Remote Export N N Y
Overlays when Exporting Y Y N
Subscribe to Export Events Y Y Y
Event Subscription/Unsubscription Y Y Y
Event polling Y N Y
External Events N N Y
Communication Loss Y Y Y
Motion Event Y Y N
Analytics Event Y Y Y
Physical Event Y N N
Diagnostic Event Y N Y

To get started with the Pelco SDK you can:

Before Installing the Pelco SDK

You can download the Pelco SDK from the Pelco Developer Network. However, before installing the Pelco SDK on your local machine, make sure your computer meets the following hardware and software requirements.

Contents of the Pelco SDK

When 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 a subset of the Pelco SDK features in one reusable component. Features include the System class, the Camera class, and various collection and stream-related classes.

Hardware Requirements

You 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 Requirements

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

To run the sample programs provided with Pelco SDK, you need one of the supported versions of Visual Studio® and .NET Framework plus DirectX 9.0c.

Supported Visual Studio and Microsoft.NET Framework versions:
  • Visual Studio 2013 and Microsoft.NET Framework 4.5.1
  • Visual Studio 2010 and Microsoft.NET Framework 4.0

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

Installation Directory

By 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

Pelco SDK is available from the Pelco Developer Network. Follow these steps to install it on your local computer.
  1. Uninstall any previous versions of Pelco SDK.
    1. From the Windows Control Panel > Uninstall or change a program, uninstall any previous versions of Pelco SDK.
    2. 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 and that 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.0 Windows vc12
    • For Visual Studio 2010 users, install Pelco SDK-4.0 Windows vc10
    • For those not using Visual Studio, choose Pelco SDK-4.0 Windows vc10
  4. From your Downloads directory, double-click the Pelco SDK installer .exe file to launch the SDK install process. Follow the prompts 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 can install it later.

    DirectX 9c Warning

  5. Restart the system. This ensures that the environment variables are set correctly.
By 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++\PelcoAPI Header files for all component classes.
Include\C++\PelcoSDK Header files for Object Model classes.
Libs\Debug Pelco SDK libraries that contain debug symbols to use when developing your applications.
Libs\Debug\Plugins Assemblies required to render video. For internal use.
Libs\Release Pelco SDK libraries, built for performance and without debug symbols 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:

Location of the Pelco SDK binaries, such as \Program Files\Pelco\API\Libs
Location of the Pelco SDK header files, such as \Program Files\Pelco\API\Include\C++
Location of the Pelco SDK debug directory, such as \Program Files\Pelco\API\Libs\Debug added to the PATH environment variable
Location of the Pelco SDK installation directory, such Program Files (x86)\Pelco\API\ or Program Files\Pelco\API\

Next, you might want to check out a sample program installed with Pelco SDK.

Running the ViewVideo Sample Program

Pelco SDK comes with a few sample C# and C++ programs to help you become familiar with the SDK. These sample programs are packaged as Visual Studio projects and located under installation directory\Pelco\API\SampleCode\. Let's walk through the process 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 a camera from the list and view its live video stream and play back recorded video. You'll need the user name and password of your system manager (SM).

  1. 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, under Systems, 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 system manager (SM) from the drop-down box, select Disable autodiscover, supply the IP address and port number of your system manager, and then click OK.

    ViewVideo Login screen.

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

    The ViewVideo application with live video feed.

    The system manager starts collecting the list of available cameras managed by your system. X's mark cameras that are currently off line.
  6. Right-click anywhere in the video window to view recorded playback options.

    ViewVideo application with recorded playback menu.

This 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

Now that you know how ViewVideo program works, let's take a look at the source files. This application is built using the Pelco SDK Object Model so you can see how to use the SDK classes in your Pelco applications. There's a lot going on in this ViewVideo application, so this example strips it down to the essential code required to get a video stream from a camera and play it on a monitor. 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 interface features in the Microsoft Windows operating system. These classes are not discussed here.

Tip: Run the ViewVideo program in debug mode to get an idea of what's going on.
Tip: As you peruse the source code, browse the Object Model SDK Reference available on the Pelco Developer Network (PDN).

Main Program

Starting 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 up and shuts down the SDK before the application ends. Every Pelco SDK program requires these Startup() and Shutdown() methods.

ViewVideo Code Excerpt: Main

Get System Collection and Systems

Open the LoginForm.cs file and here's the first step in a Pelco SDK application: get the appropriate system from the system collection. A SystemCollection object contains all the systems on the network. A System object contains all the devices connected to a single system. This system and device information is stored on a local database, called the device cache, and is described in more 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, and assigns a display name and UUID to each system.

ViewVideo Code Excerpt: Get System Collection and System

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

ViewVideo Code Excerpt: Get Systems

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

ViewVideo Code Excerpt: Details of the AddSystem() Method

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://");
Notice that the system scheme resembles a Web address, more specifically, the top level of the URI naming structure. A system scheme is described as follows:
Pelco SDK identifier.
User name and password for the system.
The system provider. The pelcosystem provider name means that this is an Endura system.
Host name and port number of the system.
Query string to pass in an argument. Here, alias is a friendly name used to display the system or to look 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 the Add() method on the SystemCollection. When you write your own applications, you'll discover how handy, and powerful, the system scheme can be.

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

Get Cameras and Video Streams

Open the CameraCollectionForm.cs file to see the heart of the program. The CameraCollectionForm() method creates a list 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 list of cameras. A Display object is created to represent the display that shows the video.

ViewVideo Code Excerpt: Filter a list of devices and display cameras

A Stream object is created to represent the actual video. Notice that a Camera object is passed in as an argument to the method that 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 method plays back the video at normal speed. It uses StreamConfig.VideoFormat() to change the video format to MJPEG. ViewVideo uses Stream.Timestamp() to create a Timestamp .NET event which returns a timestamp every time a timestamp is processed in the video stream.

ViewVideo Code Excerpt: Create a Stream

Handle Exceptions

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

ViewVideo Code Excerpt: Exception

Pelco Media Control

The 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 video streaming. You can use these classes to perform a variety of tasks, including:

Using the Pelco Media Control in a Windows Forms Application

The SDK installer automatically registers the Pelco Media Control with Windows. Once it has been registered you can use it in an application.

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

Add OCX using the Visual Studio Toolbox

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

Interfaces supported by the OCX

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

Interfaces supported by the OCX

Create a Stream from a pelcosystem Camera Object

The 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 = "";
    const string cameraUuid = "uuid:0901F025-8000-0000-0802-6B6C38140004";
    const string user = "admin";
    const string password = "admin";

    P.Stream _stream = null;

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

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

                _stream = ctrl.CurrentStream;

            return _stream;

            _stream = value;

Create a Stream from a pelcoedgesystem Camera Object

The following code creates a Pelco Edge System object, adds and then retrieves a camera on that system, and then configures and starts a video stream. The stream delivery mode is set to Unicast. The default delivery mode is Multicast. If your switch or router filters 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
            if ( _stream == null )
                var systems = ctrl.SystemCollection;
                P.System sys = null;
                string systemScheme = string.Format("{0}:{1}@pelcoedgedevices://{2}", user, password, systemAlias);

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


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

                config.VideoFormat = P.StreamVideoFormat.MPEG4h264;
                config.DeliveryMode = P.StreamDeliveryMode.Unicast;

                _stream = ctrl.CurrentStream;

            return _stream;

            _stream = value;

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

OCX running in a Windows Forms application

Overview of the Pelco SDK Object Model

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

Classes of the SDK 4.0 Object Model

The class diagram below introduces Pelco SDK classes as of 4.0 and shows how they interact. Collection classes indicate those classes 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 kind of Device. Green arrows indicate a "has a" relationship where the class is contained in the parent class. For example, a System contains Devices.

Diagram of Classes in SDK 4.0 Object Model

System and System Collection Classes

The 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

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 of devices 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 Edge system, also represented by a System class but with only cameras attached.

Diagram of SystemCollection and System Classes

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 or SM5000.
  • 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 Classes

The 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 to manage all devices on a system as a single entity.

Camera, Display, and Stream Classes

The combination of Camera, Display, and Stream classes display video. The Camera class represents any IP camera such as a Sarix ® or Spectra® model. The Display class represents a window on a local display that shows a video stream. The display might have 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.

Diagram of Camera, Display, and Stream Classes

Network Display and Channel Classes

The Network Display class represents a network display that can be located anywhere on the network but managed on the local computer that is running the SDK. For example, a collection of network display units can be used as a video wall, where they show video 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 of the network display. This could be a single video channel shown across the entire display area, called the 1x1 layout, or up to 16 channels, called a 4x4 layout.

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

Diagram of Camera, Channel, and Network Display Classes

Clip and Exporter Classes

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

Event Classes

Pelco 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.

Utility Classes

Pelco SDK contains convenience classes to ease application development. You can use the Exception class to handle exceptions for error conditions in the Object Model. You can use PTime, PString, and PList classes for ease in handling lists, strings, and time values.

The Pelco SDK 4.0 Object Model

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

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. The Administrator class represents a "superuser" whose credentials supersede the administrator credentials 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 represents video 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 Exporter class to export video to disk.
Device Manages a physical device contained in the video management system. The Device class can represent 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 separate windows. The Display class represents a local display attached to the computer on which the SDK is running.
Event Defines something that occurs in a system, such as changes in device online/offline state, changes in device properties, or stream failures.
EventListener Listens for events and calls an event handler when an event fires. The GlobalEventListener class listens for global events, such as changes in the SDK state, across the entire system collection. The SystemEventListener 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 and messages.
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 display instead 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 network from 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 camera details, 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.

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

Stream Plays live or recorded video. If recorded, makes available the typical video controls such as pause and 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 allows applications 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 Libraries

The 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++)