Minimal eSDK Pro Project

This example shows the simplest possible C++ program using eSDK Pro. It connects to all available cameras, adds them to a pipeline, and runs the pipeline for a short time.

A pipeline is the framework that links cameras to processing tasks or plugins. This minimal project includes no processing tasks, so it demonstrates only how to set up and start the system. Other examples build on this one by adding tasks or plugins.

You can copy this code into a CPP file, build it, and run it directly.

#include <eSdkPro/system.h>
#include <chrono>
#include <iostream>
#include <thread>
 
using namespace eSdkPro;
 
int main()
{
	System system = System::GetInstance();
	try
	{
    	Server server = system.ConnectServer("127.0.0.1");
 
    	CameraOpenConfig camOpenConfig{};
    	for (auto& camInfo : server.DiscoverCameras())
    	{
        	std::cout << "Opening camera " << camInfo.m_serialNumber << std::endl;
        	Camera cam = server.AddCamera(camInfo);
        	cam.Open(camOpenConfig);
    	}
 
    	Pipeline pipeline = system.GetPipeline();
    	for (auto& cam : server.GetCameras())
    	{
        	CameraTask cameraTask = pipeline.CreateCameraTask(cam);
        	// Connect tasks here...
    	}
 
    	std::cout << "Starting pipeline" << std::endl;
    	pipeline.Start();
    	std::this_thread::sleep_for(std::chrono::seconds(3));
    	std::cout << "Stopping pipeline" << std::endl;
    	pipeline.Stop();
	}
	catch (const std::exception& ex)
	{
    	printf("Exception: %s\n", ex.what());
	}
	system.Release();
	return 0;
}

See Also

Updated on
August 28, 2025
Questions?


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

Contact Us