eSDK Pro API Reference

The eSDK Pro API provides classes, methods, and data structures for building custom multi-camera applications. The API is organized into four main areas:

  • Core API — system, server, and pipeline management
  • Camera API — camera lifecycle and parameter access
  • Processing API — tasks, task workers, and frames
  • Support API — error handling and versioning

Core API

Provides the foundation for building applications. Includes classes for managing systems, servers, and pipelines.

System Class

Represents the state of the current eSDK session. A system instance owns all servers created in the application.

Method Description
static System Create() Instantiates a new system. Usually a single instance is enough for a process.
void Destroy() Releases the system and all objects that depend on it.
Server ConnectServer(const std::string& ip) Connects to a remote server.
Server ConnectServer(const std::string& ip, uint16_t port) Connects to a remote server at a specific port.
Server CreateLocalServer() Creates a local server.
void RemoveServer(Server& server) Removes a server from the system.
std::vector<Server> GetServers() const Returns all connected servers.
std::vector<Camera> GetCameras() const Returns all active cameras (those explicitly added via Server::AddCamera()).
Pipeline GetPipeline() Returns the pipeline associated with the system.
void SetLogLevel(LogLevel level) Sets the logging verbosity.

Usage notes

  • Call Destroy() when finished to release resources.
  • A single system per process is usually sufficient.

Server Class

Represents a local or remote server that manages cameras.

Method Description
std::vector<CameraDiscoveryInfo> DiscoverCameras() Finds available cameras on the server. Returns metadata only (CameraDiscoveryInfo), not active Camera objects.
Camera AddCamera(const CameraDiscoveryInfo& info) Adds a camera from discovery results.
void RemoveCamera(Camera& camera) Removes a camera from the server.
std::vector<Camera> GetCameras() const Returns all cameras managed by the server.
std::string GetIp() const Returns the server’s IP address.
uint16_t GetPort() const Returns the server’s port.

Example

auto cameras = server.DiscoverCameras();
for (auto& camInfo : cameras) {
    Camera cam = server.AddCamera(camInfo);
    auto username = cam.GetParameter<StringCameraParam>("DeviceUserName").GetValue();
    std::cout << "Camera: " << username << std::endl;
}

Pipeline Class

Defines the data flow graph of tasks connected to cameras and plugins.

Method Description
CameraTask CreateCameraTask(const Camera& camera) Creates a task for camera streaming.
PluginTask CreatePluginTask(const Server& server, const std::string& pluginName) Creates a plugin task.
RawSavingTask CreateRawSavingTask(const Server& server, const std::string& path) Creates a task that saves raw frames.
NvencTask CreateNvencTask(...) Creates an H.264/H.265 encoding task.
void ConnectTasks(Output& out, Input& in) Connects one task’s output to another’s input.
void ConnectTasksFlexTrans(TaskOutput out, TaskInput in) Connect tasks using FlexTrans (GPU↔GPU or NIC↔NIC). Enables zero-copy transfers across devices. Linux only.
void DisconnectTasks(...) Removes a connection.
void DeleteTask(Task& task) Deletes a task from the pipeline.
void Start() Starts execution of the pipeline.
void Stop() Stops the pipeline.
void Reset() Clears all tasks and connections.

Example

for (auto& cam : server.GetCameras()) {
    CameraTask camTask = pipeline.CreateCameraTask(cam);
    RawSavingTask rawSavingTask =
        pipeline.CreateRawSavingTask(server, "/data/captures/OutputPath");

    pipeline.ConnectTasks(camTask.GetOutput(), rawSavingTask.GetInput());
}

pipeline.Start();
std::this_thread::sleep_for(std::chrono::seconds(5));
pipeline.Stop();

Example (Linux only)

/**
* Connects a source port to a destination port via FlexTrans using GPU to GPU.
* Tasks must have different GPUs set when FlexTrans will be used for data transfer.
* @param src The source output port.
* @param dst The destination input port.
*/
void ConnectTasksFlexTrans(const Output& src, const Input& dst);

/**
* Connects a source port to a destination port via FlexTrans using rivermax mellanox network cards.
* Tasks must have different servers set when FlexTrans will be used for data transfer.
* @param src The source output port.
* @param srcNicIp The ip of the source mellanox card.
* @param dst The destination input port.
* @param dstNicIp The ip of the destination mellanox card.
*/
void ConnectTasksFlexTrans(const Output& src, const std::string& srcNicIp,
                           const Input& dst, const std::string& dstNicIp);

Camera API

Covers lifecycle control and parameter access for individual cameras.

Camera Class

Represents a single camera managed by a server.

Method Description
void StartStreaming() Starts image streaming from the camera.
void StopStreaming() Stops image streaming.
template <typename T, typename = ValidCameraParam<T>> T GetParameter(const std::string& name) const Returns a typed camera parameter.

Example

auto exposure = cam.GetParameter<UInt32CameraParam>("Exposure");
exposure.SetValue(5000); // microseconds
cam.StartStreaming();
// ...
cam.StopStreaming();

For camera-specific features (such as exposure controls or pixel formats), see the Camera Features reference.

Processing API

Defines how camera data flows through tasks, task workers, and frames in a pipeline.

Task Class

Represents a processing node in the pipeline. Tasks are created by the pipeline (not directly).

  • No Connect or Configure methods exist in this class.
  • Use the pipeline’s ConnectTasks method to connect tasks.
  • Inputs can be either image frames or control signals (such as triggers from external I/O devices).

Example

CameraTask camTask = pipeline.CreateCameraTask(cam);

UInt32CameraParam widthParam = cam.GetParameter<UInt32CameraParam>("Width");
UInt32CameraParam heightParam = cam.GetParameter<UInt32CameraParam>("Height");
UInt32CameraParam framerateParam = cam.GetParameter<UInt32CameraParam>("FrameRate");
EnumCameraParam pixelFormatParam = cam.GetParameter<EnumCameraParam>("PixelFormat");
PIXEL_FORMAT pixelFormat = StringToPixelFormat(pixelFormatParam.GetValue());

NvencTask nvencTask = pipeline.CreateNvencTask(
    server, c_gpuId, recordPath,
    widthParam.GetValue(), heightParam.GetValue(),
    pixelFormat, framerateParam.GetValue(),
    params.m_codec, params.m_bitrateKbps);

RawSavingTask rawSavingTask =
    pipeline.CreateRawSavingTask(server, "/data/captures/OutputPath");

pipeline.ConnectTasks(camTask.GetOutput(), nvencTask.GetInput());
pipeline.ConnectTasks(camTask.GetOutput(), rawSavingTask.GetInput());

TaskWorker Class

Base class for implementing custom plugin tasks.

Example

class CustomTask : public Plugin::TaskWorker {
public:
    const static inline std::string c_name{"CustomTask"};
    const static inline std::string c_inputName{"InputFrame"};

    CustomTask() {
        SetName(c_name);
        m_input = CreateFrameInput(c_inputName, HWPlatform::Host);
    }

    virtual bool Process() override {
        auto frame = m_input.GetFrame();
        std::cout << "Processing frame " << frame.GetFrameId() << std::endl;
        return true;
    }

private:
    Plugin::FrameInput m_input{};
};

Frame Class

Represents a single image frame.

Method Description
uint32_t GetWidth() const Returns the frame width in pixels.
uint32_t GetHeight() const Returns the frame height in pixels.
PIXEL_FORMAT GetPixelFormat() const Returns the pixel format.
uint8_t* GetDataPtr() const Returns a pointer to the image data.
uint64_t GetFrameId() const Returns the sequential frame ID.
uint64_t GetTimestampNs() const Returns a timestamp in nanoseconds.

Support API

Provides supporting functionality such as error handling and versioning.

Error Handling

The eSDK throws ESdkProException. Error codes are limited to:

  • Success
  • General
  • NotFound
  • Invalid

Example

try {
    System system = System::Create();
    Server server = system.ConnectServer("127.0.0.1");

    auto cams = server.DiscoverCameras();
    if (cams.empty()) {
        throw ESdkProException("NotFound", "No cameras discovered");
    }
}
catch (const ESdkProException& ex) {
    std::cerr << "eSDK Pro error: " << ex.what() << std::endl;
}

Versioning

The eSDK version is available in eSdkPro/version.h:

const char c_eSdkProVersionStr[] = "1.2.0";

const int c_eSdkProVersionMajor = 1;

const int c_eSdkProVersionMinor = 2;

const int c_eSdkProVersionPatch = 0;

Updated on
September 8, 2025
Questions?


Get in touch with us today and our team of imaging professionals will be pleased to assist you.

Contact Us