simaaisrc
The simaaisrc
GStreamer plugin is a source element that reads data from a file or multiple files specified via properties and pushes it into a GStreamer pipeline. It supports reading data from a single file or multiple files using a format specifier in the location property. Alternatively it can read from multiple files specified through the segments
property. The plugin is designed to work with SiMa.ai memory allocators and buffer pools, enabling efficient handling of large data buffers.
Properties
Property |
Type |
Default |
Description |
---|---|---|---|
location |
string |
NULL |
Path to the input file (or a format string when multiple files are expected). |
index |
int |
0 |
Starting file index when using format specifier in location property. |
node-name |
string |
NULL |
Output node name used in custom metadata. |
mem-target |
int |
0 |
Specifies the memory target (0: generic, 1: EV74, 2: DMS0). |
delay |
int64 |
0 |
Milliseconds to sleep between buffer creations. |
stream-id |
string |
“unknown-stream-id” |
Stream ID or Camera ID, used in custom metadata. |
pool-size |
uint |
2 |
Number of buffers allocated in the output buffer pool. |
loop |
boolean |
FALSE |
If TRUE, loops back to the initial index after reaching the last file. |
segments |
string |
NULL |
Comma separated key=value pairs where key is segment name and value is file path. |
Usage
The simaaisrc
plugin is integrated into a GStreamer pipeline as a source element. It can be configured using properties.
Example using the ``location`` property to read from a single file:
gst-launch-1.0 simaaisrc location=/tmp/input.bin node-name=mynode ! fakesink dump=true
Example using the ``location`` property and index to read multiple files:
gst-launch-1.0 simaaisrc location=/tmp/input%d.bin index=1 node-name=mynode loop=true ! fakesink dump=true
Example using the ``segments`` property to read data from multiple files:
gst-launch-1.0 simaaisrc segments="hm_tensor=/data/hm_tensor.bin,paf_tensor=/data/paf_tensor.bin" node-name=mynode mem-target=1 ! fakesink dump=true
Installation
To install the simaaisrc
plugin, copy the plugin files (from /usr/local/simaai/plugin_zoo/gst-simaai-plugins-base/gst/
) into your GStreamer plugins directory (usually plugins/
).
Integrating into a GStreamer Pipeline
The simaaisrc
element reads data from the specified file(s) and pushes it as GstBuffer
objects downstream in the pipeline. Each buffer contains custom metadata including:
buffer-id: Physical memory address of the buffer.
buffer-name: Name of the node (specified via the
node-name
property).buffer-offset: Offset within the buffer.
frame-id: Sequential frame ID.
stream-id: Stream ID (specified via the
stream-id
property).timestamp: Timestamp of when the buffer was created.
The plugin uses SiMa.ai memory allocation, therefore make sure your build system has appropriate dependencies and linker paths configured. The output buffer’s memory will reflect the memory target specified through the mem-target
property.