1. Introduction
The LT API is built around the REST architecture (Representational State Transfer). REST defines a structured approach for exposing system functionalities via a consistent interface.
A REST API is typically accessed using predefined URLs, which represent various resources returned as JSON objects. These resources support standard methods such as GET, POST, and DELETE.
The LT API requests are processed by a host service called lt310agent, which utilizes standard OS mechanisms such as IPC, SG-DMA, and shared memory. This ensures minimal latency when handling API requests. To optimize performance, video and audio data are shared among consumers using memory segments, allowing large data buffers and concurrent access.
With LT boards designed to be seen as hardware-as-a-service approach, the LT API abstracts hardware-specific implementations behind a unified API. This allows users to focus on core functionalities such as capturing, playing, recording, and streaming audio/video data.
The LT API is accessible through various clients, including the ecurl command line interface (CLI) and the ecap graphical user interface (GUI). The API can also be accessed directly through C++, Python, DirectShow, V4L2, NamedPipe, and UART.
2. Installation
2.1. Windows
Download and run the latest lt310install_x.x.x.exe to install the lt310 family drivers, tools and services. If necessary the previous version will be uninstalled.
Once installed, the lt310agent service will be started automatically and will be (re)started automatically with each system (re)boot.
The lt310agent can be controlled using the Windows Services Manager or the command line. For more details, see [control_service].
The LT boards plugged into the host should appear in the Windows Device Manager under the Sound, video and game controllers.
|
Note
|
To uninstall the lt310 family drivers, tools and services, run the installer and choose "Remove" or use "Apps & features" menu. |
2.2. Linux
Download and extract the latest lt310install_x.x.x.tar.gz, then run the lt310install.sh script to install the lt310 family drivers, tools and services. If necessary, the previous version will be uninstalled.
Upon successful installation, the lt310agent daemon will start automatically and will also (re)started with each system (re)boot. If the installation fails, contact us and check the lt310install.log file for details.
The lt310agent can be controlled using the command line. For more details, see [control_service].
|
Note
|
To uninstall the lt310 family drivers, tools and services, run lt310_uninstall.sh from the installation directory. |
2.3. SDK
Download the latest lt310sdk_x.x.x.zip or lt310sdk_x.x.x.tar.gz archive and extract it anywhere you want. The SDK contains the API documentation, the API libraries and examples for the following languages Go, C++ and Python.
Please navigate through the examples to learn how to program the API.
You can also create scripts using the ecurl command-line tool. For more details, see [ecurl].
2.4. Tools
Two tools are installed along with the lt310agent service:
By default, the service and tools are added to the PATH environment variable, allowing you to use them from any command line.
2.5. lt310agent Controls
To access the LT API, ensure that the lt310agent is installed and running on your host system.
You can use the following commands, which require administrative privileges, to control the lt310agent.
$ lt310agent start
$ lt310agent stop
$ lt310agent version
$ lt310agent status
2.6. Board Firmware
If the boards installed in the host require a firmware update, the lt310agent service will automatically update them when the service starts. This process may take up to 2 minutes, depending on the board type. The service will be unavailable until the update is completed.
Please use the command below if you want to check the firmware version of the boards.
$ lt310agent version
It is also possible to manually update the board firmware.
$ lt310agent update
|
Note
|
To update the board firmware, the lt310agent must be stopped. |
3. ecurl (CLI)
The ecurl program is a developer tool to help you make requests on the LT API directly from your terminal. The tool is deployed along with the lt310agent at the installation stage. The tool has been developed with our SDK and is available for both Linux and Windows platforms.
You can use the ecurl CLI to:
-
Create, retrieve, update or delete LT API objects.
-
Play and record any video or audio resources.
-
Use the multi-channel feature of the LT boards.
-
Control and test the installed LT boards.
|
Note
|
The lt310agent must be running otherwise ecurl will not work. |
3.1. GET command
$ ecurl get <url>
Send a GET request to retrieve a specific API object identified by the <url>.
Examples
$ ecurl get lt310:/
$ ecurl get lt310:/0
$ ecurl get lt310:/0/{in}/0/file -d type=image/jpeg
3.2. POST command
$ ecurl post <url> [-d @file.json] [-d field=value] [-d data=@file.bin]
Create or modify the resource designated by the <url>.
Arguments may be added to the request with the -d optional flags. It is possible to use a file content as input by preceding the filename with the @ character. By preceding the filename with the $ charater, relative path will be translated to the absolute full path.
Examples
$ ecurl post lt310:/canvas/0/init -d source=$video.mp4
$ ecurl post lt310:/0/hdmi-in/0/edid -d data=@custom.edid
3.3. DELETE Command
$ ecurl delete <url>
Delete or reset the resource pointed by the <url>.
Examples
$ ecurl delete lt310:/canvas/0
3.4. PLAY Command
$ ecurl play <url> [-d]
Play video or audio source until Ctrl+c is pressed.
Arguments may be added to the request with the -d optional flags.
Examples
$ ecurl play lt310:/0/hdmi-in/0 -d media=video/yuyv
$ ecurl play lt310:/0/hdmi-in/0 -d media=audio/pcm
3.5. REC Command
$ ecurl rec <url> [-d]
Record video or audio source until Ctrl+c is pressed.
Arguments may be added to the request with the -d optional flags.
Examples
$ ecurl rec lt310:/0/hdmi-in/0/file -d media=video/mp4
$ ecurl rec lt310:/0/camera/0 -d media=video/mp4 -d extra.hw=nvenc -d extra.codec=hevc
4. ecap (GUI)
The ecap program is a simple graphical user interface designed to capture and record using the LT310 boards. The tool has been developed with our SDK and is available for both Linux and Windows platforms. You can use the ecap GUI to:
|
|
Note
|
The lt310agent must be running; otherwise, ecap will not work. |
5. API Description
5.1. Endpoint Structure
An API endpoint is a URL where the API processes requests for a specific resource. Endpoints are accessed via URLs using the syntax scheme:/path, which consists of:
-
A non-empty scheme component followed by a colon
lt310: -
A path component made up of path segments separated by slashes
/
For clarity in this documentation, the scheme lt310: is omitted from endpoint URLs.
5.2. Request and Response Format
All API endpoints use JSON format for requests and responses. Endpoints are divided into two categories:
-
Read-write endpoints: Support both GET and POST methods to retrieve and modify parameters
-
Read-only endpoints: Support only GET method to retrieve current state
5.2.1. Retrieve parameters (GET)
To retrieve parameters, send a GET request to the appropriate endpoint. The server returns the complete object with all current parameter values. |
5.2.2. Update parameters (POST)
To update parameters, send a POST request with the attributes you want to modify. You don’t have to send the complete object. The server will:
|
|
Note
|
Specific examples with actual endpoints and parameters are provided in each endpoint’s documentation section. |
5.2.3. Error Handling
If a request fails, the server returns an error response with an explicit message describing the cause of the failure.
Common error causes include:
-
Invalid parameter values (out of range)
-
Missing required parameters
-
Invalid endpoint or resource ID
-
Hardware not responding
{
"error": "invalid parameter value",
"message": "parameter must be between 0 and 100, got 150",
"code": 400
}
5.3. Audio/Video structures
This section describes the JSON data structures used to represent audio and video stream information. These structures are embedded in various endpoints related to audio/video sources and outputs.
5.3.1. Audio object
The |
| Attribute | Type | Description |
|---|---|---|
description |
string |
A short description of the audio signal. |
format |
string |
The audio sample format |
channels |
int |
The number of audio channels. |
samplerate |
int |
The number of audio samples per second. |
depth |
int |
The number of bits per audio sample. |
signal |
string |
The audio signal status: `none` (not found), or `locked` (ready to use). |
5.3.2. Video object
The |
| Attribute | Type | Description |
|---|---|---|
description |
string |
A short description of the video signal. |
format |
string |
The pixel color format |
size |
[2]int |
The video frame width and height in pixel units. |
framerate |
float |
The number of video frames per second. |
interlaced |
bool |
The video frame interlaced status. |
signal |
string |
The video signal status: `none` (not found), or `locked` (ready to use). |
5.4. Agent
The agent endpoint allows to retrieve the lt310agent software version.
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve the current agent information. |
5.4.1. Agent Object
The agent object provides information about the currently running lt310agent software. |
| Attribute | Type | Description |
|---|---|---|
version |
string |
The current agent version. |
5.4.2. Agent Configuration File
The agent can be configured using an optional configuration file named lt310agent.cfg.
Configuration options:
| Option | Description |
|---|---|
|
Working directory for the agent (default: current working directory) |
|
Number of canvas objects to create (default: 4) |
|
Default pixel format for video input (default: nv12) |
|
Settings for when no video signal is detected (default: gray background with "NO SIGNAL" text) |
|
Enable/disable DirectShow filters (default: true) |
|
Enable/disable V4l2 filters (default: false) |
|
Enable/disable development mode (default: false) |
If you choose to use it, place the file in the same directory as the application executable. This file is already included in the agent folder. The configuration file is optional and may be omitted if no custom configuration is required.
|
Note
|
The configuration file is read only when the agent starts. Any changes to the file will take effect only after restarting the agent. |
5.5. Board
The board endpoint provides access to information about boards installed in the host system.
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve information about the board installed in the host system. |
URL parameters
-
:boardDevice position into the host[0 .. 1].
5.5.1. Board Object
The board object provides information about a specific board installed in the host system. |
| Attribute | Type | Description |
|---|---|---|
model |
string |
Board model identifier. Could be |
sn |
uint32 |
Board serial number. |
cpu |
uint32 |
Embedded processing cpu tagged time. |
fpga |
uint32 |
Processing fpga tagged time. |
bridge |
uint32 |
Bridge fpga tagged time. |
5.6. HDMI Input
This endpoint allows you to monitor the hdmi-in signal status and access the audio and video streams, when available, in various formats.
Data can be retrieved as raw data or files, in different formats and encodings. Native formats are yuyv or nv12 (video) and pcm (audio).
Depending on the requested format, the host CPU and/or GPU may be used for processing and conversion.
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve the current HDMI Input information. |
|
POST |
Retrieve raw data from the HDMI Input. |
|
POST |
Retrieve a file from the HDMI Input. |
|
GET, POST |
Retrieve or set the EDID data for the HDMI Input. |
URL parameters
-
:boardDevice position into the host[0 .. 1]. -
:idhdmi-in index, dependent on the board type:not applicablefor LT311,[0 .. 1]for LT312,0for LT313.
5.6.1. HDMI Input Object
The hdmi-in object contains the current state of its audio and video signals. |
| Attribute | Type | Description |
|---|---|---|
audio |
object |
Audio object for the HDMI Input. |
video |
object |
Video object for the HDMI Input. |
5.6.2. EDID Object
The edid object provides the Extended Display Identification Data (EDID) which describe capabilities for a specific hdmi-in. A default EDID is provided, it supports standard resolutions up to 4K 60Hz and audio format 2 channels PCM 48kHz. The EDID can be customized by the user, but make sure it matches the board capabilities. |
| Attribute | Type | Description |
|---|---|---|
data |
[256]byte |
The 256-byte E-EDID data. |
POST Example
These code examples demonstrate how to set custom EDID data for the HDMI Input.
ecurl
To set a custom EDID using ecurl, the custom EDID file must be provided using the data=@filename syntax:
$ ecurl post lt310:/0/hdmi-in/0/edid -d data=@customEdid.bin
GO
body := lt.JSON{
"data": "00FFFFFFFFFF00..." // 256-byte EDID data
}
err := lt.Post("lt310:/0/hdmi-in/0/edid", body, nil)
C++
lt::json body = {
{"data", "00FFFFFFFFFF00..."} // 256-byte EDID data
};
lt::error err = lt::Post("lt310:/hdmi-in/0/edid", body, nullptr);
Python
edid = {
"data": "00FFFFFFFFFF00..." # 256-byte EDID data
}
response, err = Post("lt310:/0/hdmi-in/0/edid", edid)
5.7. SDI Input
This endpoint allows you to monitor the sdi-in signal status and access the audio and video streams, when available, in various formats.
Data can be retrieved as raw data or files, in different formats and encodings. Native formats are yuyv or nv12 (video) and pcm (audio).
Depending on the requested format, the host CPU and/or GPU may be used for processing and conversion.
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve the current SDI Input information. |
|
POST |
Retrieve raw data from the SDI Input. |
|
POST |
Retrieve a file from the SDI Input. |
URL parameters
-
:boardDevice position into the host[0 .. 1]. -
:idsdi-in index, dependent on the board type:[0 .. 3]for LT311,not applicablefor LT312,[0 .. 1]for LT313.
5.7.1. SDI Input Object
The sdi-in object contains the current state of its audio and video signals. |
| Attribute | Type | Description |
|---|---|---|
audio |
object |
Audio object for the SDI Input. |
video |
object |
Video object for the SDI Input. |
5.8. HDMI Output
Allows to configure the physical hdmi outputs on a LT board.
| Endpoint | Method | Description |
|---|---|---|
GET, POST |
Retrieve or configure the specified hdmi-out. |
URL parameters
-
:boardDevice position into the host[0 .. 1]. -
:idhdmi-out index0.
5.8.1. HDMI Output Object
The HDMI Output object provides configuration and status information about a specific hdmi-out. |
| Attribute | Type | Description |
|---|---|---|
source |
string |
The hdmi-out source. Values can be |
overlay |
string |
The overlay source applied on the hdmi-out. Values can be |
overlayMode |
string |
Controls how overlay content is processed on the output device. This parameter affects
the quality and performance of overlays. Values can be |
format |
string |
The color format applied to the output. Values can be |
link |
string |
The hdmi-out link carrier. Values can be |
audio |
object |
The audio object for the HDMI Output (read only). |
video |
object |
The video object for the HDMI Output (read only). |
GET Example
These code examples demonstrate how to retrieve the configuration and status of hdmi-out 0 on board 0.
ecurl
$ ecurl get lt310:/0/hdmi-out/0
GO
var response lt.Output // struct to store the response
err := lt.Get("lt310:/0/hdmi-out/0", &response)
C++
lt::Output response; // struct to store the response
lt::error err = lt::Get("lt310:/0/hdmi-out/0", response);
Python
response, err = Get("lt310:/0/hdmi-out/0")
POST Example
These code examples demonstrate how to enable the overlay with canvas 0 on hdmi-out 0.
ecurl
$ ecurl post lt310:/0/hdmi-out/0 -d overlay=canvas/0
GO
body := lt.JSON{
"overlay": "canvas/0",
}
var response lt.Output // struct to store the response
err := lt.Post("lt310:/0/hdmi-out/0", body, &response)
C++
lt::json body = {
{"overlay", "canvas/0"}
};
lt::Output response; // struct to store the response
lt::error err = lt::Post("lt310:/0/hdmi-out/0", body, response);
Python
body = {
"overlay": "canvas/0"
}
response, err = Post("lt310:/0/hdmi-out/0", body)
5.9. Canvas
The canvas endpoint is both a virtual audio/video source and a dynamic synthetic image generator which supports draw operations. It could be used to emulate the LT boards video inputs and to send overlay images onto the hdmi and/or sdi outputs.
| Endpoint | Method | Description |
|---|---|---|
GET |
canvas :id configuration. |
|
POST |
Data stream |
|
POST |
File recording |
| Endpoint | Method | Description |
|---|---|---|
POST |
Initialize the canvas. |
|
POST |
Draw text on the canvas. |
|
POST |
Draw a line on the canvas. |
|
POST |
Draw an ellipse on the canvas. |
|
POST |
Draw a rectangle on the canvas. |
|
POST |
Put an image on the canvas. |
|
POST |
Put a video on the canvas. |
|
POST |
Clear a canvas area or a source. |
|
POST |
Perform a single draw operation on the canvas. |
|
POST |
Perform multiple draw operations on the canvas. |
URL parameters
-
:idcanvas index[0 .. 3](configurable withnumCanvasesin agent configuration file)
5.9.1. Canvas Object
The Canvas object provides status information about a specific canvas. |
| Attribute | Type | Description |
|---|---|---|
audio |
object |
The audio object for the Canvas (read only). |
video |
object |
The video object for the Canvas (read only). |
5.9.2. Understanding Canvas Operations
Each drawing operation works within a container - a rectangular area that defines where and how the element is drawn. The schema of a container is illustrated below:
All operations share these common parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
position |
[2]int |
|
The top-left corner coordinates |
size |
[2]int |
varies |
The container dimensions |
angle |
float |
|
Rotation angle in degrees, applied around the center of the container. |
anchor |
[2]int |
|
The pivot point for rotation and scaling transformations, relative to the container’s top-left corner. |
The mandatory parameters for each operation are highlighted in the respective sections below.
Rendering Order Rules:
-
Standard drawing operations (
text,line,ellipse,rectangle,image) are stacked in the order they are sent. Later operations draw over earlier ones. -
Video sources (
videooperations) are always rendered on top of all standard drawing operations. -
Among multiple video sources, the most recently added video appears on top of earlier video sources.
Note: There is no layer system - operations cannot be reordered after being sent.
5.9.3. Initialize Canvas
Canvas initialization is done using the init operation. This operation sets up the canvas with the specified background color, size, and framerate. If a file source is provided, the canvas size and framerate are derived from the file content. |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
source |
string |
Path to the file source. Supported formats are |
color |
[4]int |
The RGBA background color with transparency. Default |
size |
[2]int |
The video frame width and height in pixel units. Default |
framerate |
float |
The video frame rate in frames per second. Default |
5.9.4. Drawing Operations
5.9.4.1. Text Operation
Draw text onto the canvas with various font styles and attributes. The text can be positioned, rotated and scaled within a defined container. |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
text |
string |
Text to draw. This parameter is mandatory. |
align |
string |
Set the text position into the container. The possible values are |
font |
string |
Font type. Default is |
fontSize |
int |
Font size in pt unit. Default is |
italic |
bool |
Draw the text with the italic attribute. Default |
bold |
bool |
Draw the text with the bold attribute. Default |
color |
[4]int |
Text color in RGBA format. Default |
See Understanding Canvas Operations section for container parameters.
5.9.4.2. Line Operation
Draw a line within the container. The line extends from the top-left corner to the bottom-right corner of the container defined by |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
width |
int |
The shape width size in pixel unit. Default |
color |
[4]int |
The shape RGBA color. Default is |
pattern |
[]int |
The dash size pattern in pixel units. The pattern is repeated. Default no dash pattern: |
See Understanding Canvas Operations section for container parameters.
5.9.4.3. Ellipse Operation
Draw an ellipse that fits within the container rectangle. The ellipse is inscribed in a bounding box defined by the container’s |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
width |
int |
The shape width size in pixel unit. Default |
color |
[4]int |
The shape RGBA color. Default is |
pattern |
[]int |
The dash size pattern in pixel units. The pattern is repeated. Default no dash pattern: |
fill |
[4]int |
Fill the shape with a RGBA color. Default is |
See Understanding Canvas Operations section for container parameters.
5.9.4.4. Rectangle Operation
Draw a rectangle that exactly matches the container boundaries. The rectangle’s top-left corner is positioned at |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
width |
int |
The shape width size in pixel unit. Default |
color |
[4]int |
The shape RGBA color. Default is |
pattern |
[]int |
The dash size pattern in pixel units. The pattern is repeated. Default no dash pattern: |
fill |
[4]int |
Fill the shape with a RGBA color. Default is |
rounded |
int |
The rectangle corner rounding radius in pixel unit. Default |
See Understanding Canvas Operations section for container parameters.
5.9.4.5. Image Operation
Draw an image within the container. There are two ways to provide the image:
If the |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
source |
string |
Filepath. Supported formats are |
format |
string |
The image data format. Could be |
data |
[]byte |
Image data buffer. |
width |
int |
Image width. Mandatory for |
height |
int |
Image height. Mandatory for |
See Understanding Canvas Operations section for container parameters.
5.9.4.6. Video Operation
Draw a live video source within the container. The video source can be a board input (SDI/HDMI) or another canvas. If the Note: The |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
source |
string |
Supported sources are |
See Understanding Canvas Operations section for container parameters.
5.9.5. Clear Operation
The clear operation can be used for two purposes that can be combined: 1. Remove video sources:
2. Clear a canvas area:
Default behavior: If no parameters are provided, the entire canvas is cleared to transparent black. All drawing operations are removed, but video sources remain untouched. |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation identifier. |
source |
string |
Video source to remove. Supported values: |
color |
[4]int |
The RGBA background color with transparency. Default |
position |
[2]int |
The top-left corner coordinates of the area to clear. If omitted, starts at |
size |
[2]int |
Dimensions of the area to clear. If omitted, clears the entire canvas (except video sources). |
thickness |
int |
Expand the clearing area by this number of pixels on all sides (acts as padding). Default |
5.9.6. Single Operation Endpoint
The The operation type is determined by the |
| Attribute | Type | Description |
|---|---|---|
op |
string |
Operation type. Must be one of: |
… |
varies |
Additional parameters depend on the operation type. See the corresponding operation section for details. |
5.9.7. Batch Operations Endpoint
The This is useful for:
Each operation in the array must include an |
| Attribute | Type | Description |
|---|---|---|
ops |
[]object |
Array of operation objects. Each object must contain an |
5.9.8. Examples
This section provides practical examples demonstrating common canvas use cases. Additional examples are available in the SDK code samples.
5.9.8.1. Example 1: Simple text banner
This example demonstrates how to create a simple text banner overlay using standard drawing operations. The canvas is assumed to be already initialized with dimensions 1920x1080 and a transparent background.
A semi-transparent dark banner is drawn at the bottom of the screen with white centered text. This is commonly used for displaying information, captions, or alerts over video content.
Step 1: Draw the banner background using a rectangle with rounded corners and transparency. |
Step 2: Add centered text on top of the banner. |
These operations use the standard drawing endpoints (/rectangle and /text) which are specific to each operation type.
Code Examples
ecurl
$ ecurl post lt310:/canvas/0/rectangle -d position=50,900 -d size=1200,100 -d fill=0,0,0,180 -d rounded=10
$ ecurl post lt310:/canvas/0/text -d position=50,900 -d size=1200,100 -d text="Hello, World!" -d fontSize=48 -d color=255,255,255,255 -d align=center
GO
// Add semi-transparent background bar
body := lt.JSON{
"position": []int{50, 900},
"size": []int{1200, 100},
"fill": []int{0, 0, 0, 180},
"rounded": 10,
}
err := lt.Post("lt310:/canvas/0/rectangle", body, nil)
// Add text over the background
body = lt.JSON{
"position": []int{50, 900},
"size": []int{1200, 100},
"text": "Hello, World!",
"fontSize": 48,
"color": []int{255, 255, 255, 255},
"align": "center",
}
err = lt.Post("lt310:/canvas/0/text", body, nil)
C++
// Add semi-transparent background bar
lt::json body = {
{"position", {50, 900}},
{"size", {1200, 100}},
{"fill", {0, 0, 0, 180}},
{"rounded", 10}
};
lt::error err = lt::Post("lt310:/canvas/0/rectangle", body, nullptr);
// Add text over the background
body = {
{"position", {50, 900}},
{"size", {1200, 100}},
{"text", "Hello, World!"},
{"fontSize", 48},
{"color", {255, 255, 255, 255}},
{"align", "center"}
};
err = lt::Post("lt310:/canvas/0/text", body, nullptr);
Python
# Add semi-transparent background bar
body = {
"position": [50, 900],
"size": [1200, 100],
"fill": [0, 0, 0, 180],
"rounded": 10
}
resp, err = Post("lt310:/canvas/0/rectangle", body)
# Add text over the background
body = {
"position": [50, 900],
"size": [1200, 100],
"text": "Hello, World!",
"fontSize": 48,
"color": [255, 255, 255, 255],
"align": "center"
}
resp, err = Post("lt310:/canvas/0/text", body)
5.9.8.2. Example 2: Side-by-Side SDI Display
Create a 4K canvas displaying two sdi sources side-by-side with labels. This example uses batch operations to set up the entire composition in a single request, including canvas initialization.
|
Instead of using standard drawing endpoints, all operations are sent via the batch endpoint /ops in a single request.
Code Examples
ecurl
To perform the batch operation using ecurl, a JSON file is created containing all the operations as described above, and then sent in a single POST request.
$ ecurl post lt310:/canvas/0/ops -d @batch_ops.json
GO
body := lt.JSON{
"ops": []lt.JSON{
{
"op": "init",
"size": []int{3840, 2160},
"color": []int{0, 0, 0, 255},
"framerate": 30.0,
},
{
"op": "video",
"source": "0/sdi-in/0",
"position": []int{0, 600},
"size": []int{1920, 1080},
},
{
"op": "text",
"text": "SDI 0",
"fontSize": 48,
"color": []int{255, 255, 255, 255},
"align": "center",
"position": []int{0, 1680},
"size": []int{1920, 100},
},
{
"op": "video",
"source": "0/sdi-in/1",
"position": []int{1920, 600},
"size": []int{1920, 1080},
},
{
"op": "text",
"text": "SDI 1",
"fontSize": 48,
"color": []int{255, 255, 255, 255},
"align": "center",
"position": []int{1920, 1680},
"size": []int{1920, 100},
},
},
}
err := lt.Post("lt310:/canvas/0/ops", body, nil)
C++
lt::json body = {
{"ops", {
{
{"op", "init"},
{"size", {3840, 2160}},
{"color", {0, 0, 0, 255}},
{"framerate", 30.0}
},
{
{"op", "video"},
{"source", "0/sdi-in/0"},
{"position", {0, 600}},
{"size", {1920, 1080}}
},
{
{"op", "text"},
{"text", "SDI 0"},
{"fontSize", 48},
{"color", {255, 255, 255, 255}},
{"align", "center"},
{"position", {0, 1680}},
{"size", {1920, 100}}
},
{
{"op", "video"},
{"source", "0/sdi-in/1"},
{"position", {1920, 600}},
{"size", {1920, 1080}}
},
{
{"op", "text"},
{"text", "SDI 1"},
{"fontSize", 48},
{"color", {255, 255, 255, 255}},
{"align", "center"},
{"position", {1920, 1680}},
{"size", {1920, 100}}
}
}}
};
lt::error err = lt::Post("lt310:/canvas/0/ops", body, nullptr);
Python
body = {
"ops": [
{
"op": "init",
"size": [3840, 2160],
"color": [0, 0, 0, 255],
"framerate": 30.0
},
{
"op": "video",
"source": "0/sdi-in/0",
"position": [0, 600],
"size": [1920, 1080]
},
{
"op": "text",
"text": "SDI 0",
"fontSize": 48,
"color": [255, 255, 255, 255],
"align": "center",
"position": [0, 1680],
"size": [1920, 100]
},
{
"op": "video",
"source": "0/sdi-in/1",
"position": [1920, 600],
"size": [1920, 1080]
},
{
"op": "text",
"text": "SDI 1",
"fontSize": 48,
"color": [255, 255, 255, 255],
"align": "center",
"position": [1920, 1680],
"size": [1920, 100]
}
]
}
resp, err = lt.Post("lt310:/canvas/0/ops", body)
5.10. Workers
All the API processing is based on Worker objects created by the multimedia server on behalf of clients requests. A Worker is a software entity that receives, processes, and outputs streams of Packets. Packets encapsulate video, audio, or control data moving through the system. Workers allow the construction of pipelines that capture data from Enciris boards, process it, or store it in files.
The workers creation endpoints are easily recognizable by their URLs patterns:
| Endpoint | Method | Description |
|---|---|---|
POST |
Create a data worker for the specified resource. |
|
POST |
Create a file worker for the specified resource. |
URL parameters
-
:urlURL can be any valid API resource that point toward adataor afileendpoint.
There are two types of workers available:
-
dataworkers expose media data directly to the client application for real-time analysis or custom processing. The worker object provides packets containing shared memory buffers with raw video or audio data, ensuring minimal latency and zero-copy transfer. Data workers are useful for applications that require direct access to raw frames or audio samples. -
fileworkers record media streams into files on disk, supporting features such as file splitting and multiple container formats. The worker object provides packets containing recording status information instead of raw media buffers. File workers are ideal for applications that need to store streams for later playback or archival.
The general workflow is the same for both worker types:
-
The client creates a worker by sending a POST request to the appropriate endpoint (
/:url/dataor/:url/file) with the desired configuration. -
The API responds with a redirect URL to the newly created worker object.
-
The client follows this redirect to access the worker object, which provides status information and related packets.
The client can also stop the worker at any time by sending a POST request to the /:url/stop endpoint.
This workflow is illustrated in the diagram below:
The following sections provide further details on:
-
Worker creation and configuration parameters,
-
The structure of the worker object,
-
The packet and shared packet object models,
-
The worker lifecycle and its associated threads,
-
Usage examples for common scenarios.
5.10.1. Worker Creation
Workers are created by sending a POST request to the appropriate endpoint (/:url/data for data workers or /:url/file for file workers) along with the required parameters.
If successful, the API responds with a redirect URL that identifies the newly created worker. This URL must be used by the client to fetch updates or to send commands to the worker.
The configuration for each worker type varies based on the media type and processing requirements. The media are separated into distinct categories, each with its own set of parameters and options.
-
Audio workers focus on audio data processing and support parameters like channels, sample rate, and bit depth.
Available media:audio/pcm,audio/wav,audio/aac. -
Image workers are designed for image data processing and include parameters such as width, height, and pixel format.
Available media:image/yuyv,image/yuv422,image/nv12,image/rgba,image/rgb,image/jpeg,image/png,image/bmp. -
Video workers are tailored for video data processing and support parameters like frame rate, resolution, and codec.
Available media:video/yuyv,video/nv12,video/h264,video/mp4.
The following sections detail the parameters and usage for each worker type.
5.10.1.1. Audio Workers
This section describes the parameters used for configuring audio workers. The data worker provides direct access to audio packets for real-time use, while the file worker records audio into a file according to the specified parameters.
The URL used with the POST request must point to an audio source, such as :board/hdmi-in/:id/data or :board/sdi-in/:id/data.
Common parameters
|
Additional file worker parameters
|
Response
Returns the location of the worker object onto the form of a redirect error. |
Data Worker Creation |
File Worker Creation |
Examples
GO
// Create Data worker
err := lt.Post("lt310:/:url/data", lt.AudioDataWorker{Media: "audio/pcm"}, nil)
// Create File worker
// err := lt.Post("lt310:/:url/file", lt.AudioFileWorker{Media: "audio/wav"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
// Create Data worker
lt::error err = lt::Post("lt310:/:url/data", lt::AudioDataWorker{ "audio/pcm" }, nullptr);
// Create File worker
// err := lt.Post("lt310:/:url/file", lt.AudioFileWorker{Media: "audio/wav"}, nil);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
Python
# Create Data worker
resp, err = Post("lt310:/:url/data", {'media': "audio/pcm"})
# Create File worker
# err := lt.Post("lt310:/:url/file", lt.AudioFileWorker{Media: "audio/wav"}, nil);
if not lt.ErrorIs(err, lt.ErrRedirect):
exit(err)
workerURL = lt.RedirectLocation(err)
5.10.1.2. Image Workers
This section describes the parameters used for configuring image workers. The data worker provides direct access to image packets, while the file worker records images into a file according to the specified parameters.
The URL used with the POST request must point to an image source, such as :board/hdmi-in/:id :board/sdi-in/:id or canvas/:id.
Common parameters
|
Additional file worker parameters
|
Response
Returns the location of the worker object onto the form of a redirect error. |
Data Worker Creation |
File Worker Creation |
Examples
GO
// Create Data worker
err := lt.Post("lt310:/:url/data", lt.ImageDataWorker{Media: "image/jpeg"}, nil)
// Create File worker
// err := lt.Post("lt310:/:url/file", lt.ImageFileWorker{Media: "image/jpeg"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
// Create Data worker
lt::error err = lt::Post("lt310:/:url/data", lt::ImageDataWorker{ "image/jpeg" }, nullptr);
// Create File worker
// lt::error err = lt::Post("lt310:/:url/file", lt::ImageFileWorker{ "image/jpeg" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
Python
# Create Data worker
resp, err = Post("lt310:/:url/data", {'media': "image/jpeg"})
# Create File worker
// resp, err = Post("lt310:/:url/file", {'media': "image/jpeg"})
if not lt.ErrorIs(err, lt.ErrRedirect):
exit(err)
workerURL = lt.RedirectLocation(err)
5.10.1.3. Video Workers
This section describes the parameters used for configuring video workers. The data worker provides direct access to video packets for real-time use, while the file worker records video into a file according to the specified parameters.
The URL used with the POST request must point to a video source, such as :board/hdmi-in/:id, :board/sdi-in/:id or canvas/:id.
Common parameters
|
Additional file worker parameters
|
Response
Returns the location of the worker object onto the form of a redirect error. |
Data Worker Creation |
File Worker Creation |
Examples
GO
// Create Data worker
err := lt.Post("lt310:/:url/data", lt.VideoDataWorker{Media: "video/nv12"}, nil)
// Create File worker
// err := lt.Post("lt310:/:url/nv12", lt.VideoFileWorker{Media: "video/nv12"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
// Create Data worker
lt::error err = lt::Post("lt310:/:url/data", lt::VideoDataWorker{ "video/nv12" }, nullptr);
// Create File worker
// lt::error err = lt::Post("lt310:/:url/file", lt::VideoFileWorker{ "video/nv12" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
Python
# Create Data worker
resp, err = Post("lt310:/:url/data", {'media': "video/nv12"})
# Create File worker
// resp, err = Post("lt310:/:url/file", {'media': "video/nv12"})
if not lt.ErrorIs(err, lt.ErrRedirect):
exit(err)
workerURL = lt.RedirectLocation(err)
5.10.2. Worker Object
The Worker object is the result of a GET request onto a worker endpoint. It contains the worker status, data packets and metadata. A Worker might process one or multiples tracks and the SDK provides helpers functions to automatically parse the worker into a comprehensive structure with the contained audio and video packets.
|
5.10.3. Packet and SharedPacket Objects
Packets are the fundamental units delivered by a worker. They may contain raw media data (PCM audio samples, raw video frames), or status information (e.g., file recording progress).
Two packet models exist:
-
Packet: contains metadata and inline media data.
-
SharedPacket: references a buffer in shared memory for zero-copy access to larger media payloads.
Clients must release packets after processing them to free system resources.
Common parameters
Packet object specific parameters
SharedPacket object specific parameters
|
To simplify integration, the SDK provides a helper function that automatically parses each packet type into a unified structure, making it easier for developers to work with the data. This approach streamlines packet handling and ensures consistency across different worker types and media formats. The new packet object model maintains common parameters while standardizing how the data sections are represented, as described below.
|
5.10.3.1. Metadata
The content of metadata structure present in packet object or shared packet object depends on the packet type. It exposes some fields that are specific to the type of media being processed. The following sections describe the fields for audio, image and video metadata.
Audio Metadata
|
Image Metadata
|
Video Metadata
|
5.10.4. Worker lifecycle
The worker lifecycle consists of three main stages: creation, processing, and termination. The following diagram provides a detailed view of this workflow:
The first step is to create the worker by sending a POST request to the appropriate endpoint. If the request is successful, the response contains the location of the created worker (workerURL), which can be used to interact with the worker during its lifecycle.
To manage this interaction, two client-side threads are typically used:
-
Worker Update Thread: continuously fetches the worker object from the server, updating its status and packets. The loop continues until an
EOFerror is returned, indicating that the worker has completed its task. -
User Command Thread (optional): processes user commands and forwards them to the worker. Typical commands include
stop,pause, andstart. Sending such a command will eventually lead to anEOFbeing returned to the update thread, signaling the end of the worker.
5.10.4.1. Worker Update Thread
This thread is responsible for regularly fetching the worker object from the server, processing the returned packets and worker status, and detecting the EndOfStream (EOF) condition. It usually runs concurrently with the main application logic.
Step by step:
|
5.10.4.2. User Command Thread
This thread handles user commands and sends them to the worker. It is optional and may not be needed in all applications. Supported commands are: stop, pause, and start.
Step by step:
|
5.10.5. Example 1: fetching audio data with a data worker
This example demonstrates how to create an audio data worker, fetch audio packets, and process them using the SDK. The audio data can then be played back or analyzed as needed.
Only the Worker Update Thread is used in this example, since the User Command Thread is optional.
Creating an audio data worker
Send the following request to create a data worker for fetching audio from 0/hdmi-in/0 input:
If successful, the server responds with a redirect containing the worker location (workerURL):
The user can now start the Worker Update Thread to fetch and process audio packets.
Fetching worker updates
To fetch updates, send a GET request to the worker URL:
Possible outcomes:
-
null: request successful, worker object returned. -
EOF: special error returned by the server indicating EndOfStream - no more packets will be produced. -
Any other value: an error occurred while fetching the update.
Processing the worker object
A successful response contains the worker object, including status, packets, and metadata.
Example parsed by the SDK:
Notes:
|
Release each packet with Close() to free resources. Loop back to fetch the next update until the server returns an EOF error.
End of Stream handling
A data worker runs indefinitely until explicitly stopped. To stop it, the client should:
-
Send a
stopcommand via the User Command Thread (recommended). -
Or terminate the application directly (not recommended, may leave resources inconsistent).
After receiving stop, the worker finishes processing any remaining data. The client must continue fetching updates until the server returns an EOF error, which signals that the worker has terminated.
5.10.6. Example 2: recording a video stream with a file worker
This example demonstrates how to create a video file worker to record a video stream from an input source and process worker updates.
Only the Worker Update Thread is implemented in this example, as the User Command Thread is optional.
Creating a video file worker
Send the following request to create a file worker for recording video from 0/sdi-in/0 input with this configuration:
-
recording format:
video/mp4 -
save files to
C:\Users\A\Videos -
record 10 seconds, splitting every 5 seconds
-
other parameters are left to default values.
If successful, the server responds with a redirect containing the worker location (workerURL):
Recording starts immediately. The client can now start the Worker Update Thread to fetch and process packets.
Fetching worker updates
To fetch updates, send a GET request to the worker URL:
Possible outcomes:
-
null: request successful, worker object returned. -
EOF: special error returned by the server indicating EndOfStream - no more packets will be produced. -
Any other value: an error occurred while fetching the update.
Processing the worker object
Notes:
|
Release each packet with Close() and loop back to fetch the next update until the server returns EOF.
End of Stream handling
This file worker runs for a specified duration and automatically completes the recording.
The client should continue fetching updates until the server returns an EOF error, indicating that no more packets will be produced and the worker is terminated.
On the final worker object, "status" is typically completed, and "duration" reflects the total recording time.
6. Cheatsheet
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve the current agent information. |
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve information about the board installed in the host system. |
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve the current HDMI Input information. |
|
POST |
Retrieve raw data from the HDMI Input. |
|
POST |
Retrieve a file from the HDMI Input. |
|
GET, POST |
Retrieve or set the EDID data for the HDMI Input. |
| Endpoint | Method | Description |
|---|---|---|
GET |
Retrieve the current SDI Input information. |
|
POST |
Retrieve raw data from the SDI Input. |
|
POST |
Retrieve a file from the SDI Input. |
| Endpoint | Method | Description |
|---|---|---|
GET, POST |
Retrieve or configure the specified hdmi-out. |
| Endpoint | Method | Description |
|---|---|---|
GET |
canvas :id configuration. |
|
POST |
Data stream |
|
POST |
File recording |
| Endpoint | Method | Description |
|---|---|---|
POST |
Initialize the canvas. |
|
POST |
Draw text on the canvas. |
|
POST |
Draw a line on the canvas. |
|
POST |
Draw an ellipse on the canvas. |
|
POST |
Draw a rectangle on the canvas. |
|
POST |
Put an image on the canvas. |
|
POST |
Put a video on the canvas. |
|
POST |
Clear a canvas area or a source. |
|
POST |
Perform a single draw operation on the canvas. |
|
POST |
Perform multiple draw operations on the canvas. |
7. Changelog
# 1.4.0 (28/11/2025):
- Add NV12 native support
- Add audio recording
- Add 2K DCI resolution support
- Improve audio acquisition
- Improve QoS
- Improve HDMI input
- Improve SDK clients & examples
- Update documentation
# 1.3.1 (25/08/2025):
- Add audio/video player example (Go & C++)
- Improve audio fetching
# 1.3.0 (29/04/2025):
- Add HEVC codec options
- Add interlace support
- Add python client
- Add video encoder parameters
- Improve agent reliability
- Improve canvas
- Improve HDMI output
- Improve overlay performance
- Minor fixes
- Hardware acceleration on Linux currently works only with Intel QSV (Quick Sync Video)
# 1.2.0 (18/12/2024):
- Improve DirectShow filters
- Update sdk
- Change boards EDID
- Minor fixes
# 1.1.0 (27/09/2024):
- Add DirectShow audio
# 1.0.0 (10/07/2024):
- First official release