simaaidecoder

The simaaidecoder GStreamer plugin is a video decoder that supports H.264 and H.265 decoding. It integrates with SiMa.ai hardware for efficient video processing. The plugin outputs video frames in either NV12 or YUV420P format.

Properties

The following properties can be configured for the simaaidecoder plugin:

Property Name

Type

Default Value

Description

dec-width

int

0

Video file resolution width.

dec-height

int

0

Video file resolution height.

drop-threshold

int

1800

Number of consecutive out-of-size frames before posting an MQTT message (requires external MQTT setup).

drop-on-resolution-change

boolean

FALSE

When TRUE, any resolution change is dropped immediately.

dec-fps

int

0

Frames per second (FPS) control. Works only for dec-mode: split-input mode.

dec-ip-cnt

int

2 (unalign), 5 (split)

Decoder input buffer count. Default is 2 for unalign-input mode and 5 for split-input mode.

op-pool-cnt

int

30

Plugin output buffer count from the pool, as specified in the next-element property.

ip-queue-max-buffers

int

60

High watermark for the input queue; if exceeded, it blocks.

ip-queue-min-buffers

int

30

Low watermark for the input queue.

dec-type

string

h264

Decoder type: either “h264” or “h265”.

dec-mode

string

split-input

Decoder input mode: either “split-input” or “unalign-input”.

next-element

string

CVU

Consumer of output: Choose one of “CVU”, “FPGA”, “ISP”, “APU” (currently only CVU and APU are supported).

apu-mem-pool

string

malloc

A65 memory pool (works if next-element is APU): Choose “malloc” or “CMA(reserved)”.

dec-fmt

string

NV12

Output YUV format: either “NV12” or “YUV420P”.

dump-cnt

int

0

Number of decoded frames to be dumped to the specified path.

dump-path

string

/tmp

Path for decoded frames to be dumped.

memory-opt

boolean

FALSE

Optimize internal memory buffers. Note that this impacts performance; recommended only for multi-channels.

sima-allocator-type

int

1

Type of SiMa allocator to use: 1 - no segment API, 2 - segment API support.

op-buff-name

string

simaaidecoder0

Output buffer name as a custom meta for output buffer (Default: plugin name, if no CM element-name is present)

op-buff-cached

boolean

TRUE

Specify if output buffers from the decoder are cached (applicable for CVU & CMA heap).

transmit

boolean

FALSE

Transmit KPI messages.

Usage

The simaaidecoder plugin is integrated into a GStreamer pipeline like this:

gst-launch-1.0 filesrc location=input.mp4 ! h264parse ! simaaidecoder ! videoconvert ! autovideosink

Replace input.mp4 with the actual path to your H.264 video file. For H.265, use h265parse instead of h264parse. You can adjust properties using the simaaidecoder plugin’s properties as needed (e.g., simaaidecoder dec-width=1280 dec-height=720).

Installation

To install the simaaidecoder plugin, copy the plugin files from /usr/local/simaai/plugin_zoo/gst-simaai-plugins-base/gst/ into your project’s plugins/ directory.

Integration into a GStreamer Pipeline

The simaaidecoder plugin takes encoded video data (H.264 or H.265) as input on its sink pad and outputs decoded raw video data (NV12 or YUV420P) on its source pad. It’s essential to place appropriate upstream elements (e.g., filesrc, h264parse, h265parse) to provide encoded data and downstream elements (e.g., videoconvert, autovideosink) to process the decoded output. The plugin leverages SiMa.ai libraries for hardware-accelerated decoding.