GStreamer Bridge Components#
Authors: NVIDIA Corporation (NVIDIA Corporation)
Supported platforms: x86_64, aarch64
Language: C++, Python
Last modified: April 27, 2026
Latest version: 1.0.0
Minimum Holoscan SDK version: 3.8.0
Tested Holoscan SDK versions: 3.8.0
Contribution metric: Level 2 - Trusted
This directory contains components that provide a bridge between Holoscan and GStreamer, enabling integration with the vast ecosystem of GStreamer plugins for video encoding, streaming, and multimedia processing.
Overview#
The GStreamer bridge provides:
- Operators for integrating GStreamer functionality into Holoscan pipelines
- Resources for managing GStreamer elements and memory allocation within the Holoscan resource framework
- Low-level bridge objects that can be used in both Holoscan and non-Holoscan applications
- C++ RAII wrappers for safe and convenient GStreamer API usage
These components allow you to:
- Integrate GStreamer's extensive plugin ecosystem into Holoscan applications
- Record and stream video using GStreamer encoders and protocols
- Support both host (CPU) and device (GPU) memory for efficient processing
- Build complex media processing pipelines combining Holoscan and GStreamer
- Use GStreamer functionality in custom applications outside the Holoscan framework
Components#
Operators#
GstVideoRecorderOp#
Records incoming Holoscan tensors to video files using GStreamer encoding pipelines.
This operator is available in both C++ and Python. The Python binding mirrors the C++ interface and supports the same constructor keywords.
Key Features:
- Multiple codec support: H.264 (nvh264, x264), H.265 (nvh265, x265)
- Configurable encoder properties (bitrate, preset, quality, etc.)
- Support for both host and device (CUDA) memory
- MP4 and MKV container output
Input:
- Port
"input": Video frames as Holoscan tensors (RGB888/RGBA8888 format)
Parameters:
filename(string): Output video file path (default: "output.mp4")encoder(string): Encoder to use - "nvh264", "nvh265", "x264", "x265" (default: "nvh264")format(string): Pixel format - "RGBA", "RGB", "BGRA", "BGR", "GRAY8" (default: "RGBA")framerate(string): Target framerate as fraction "num/den" or decimal (default: "30/1")properties(map): Encoder-specific properties (e.g., bitrate, preset, gop-size) max-buffers(size_t): Maximum number of buffers to queue, 0 = unlimited (default: 10)block(bool): Block when queue is full vs. drop/timeout (default: true)
Resources#
Resources provide Holoscan-managed wrappers for GStreamer elements and allocators, integrating them into the Holoscan resource lifecycle and memory management system.
Note: Resource implementations will be added in future updates.
Low-Level Bridge Objects#
Low-level bridge objects implement core GStreamer integration functionality in a framework-agnostic way. These can be used:
- Within Holoscan applications (via operators and resources)
- In standalone C++ applications without Holoscan dependencies
- In custom integration scenarios
These objects handle the detailed work of data transfer, format conversion, and GStreamer API interaction.
GstSrcBridge#
GstSrcBridge is a framework-agnostic class that bridges tensor/video data into GStreamer pipelines via the appsrc element. It can be used independently of Holoscan in any C++ application that needs to feed data into GStreamer.
Key capabilities:
- Push video frames from host or device (CUDA) memory into GStreamer pipelines
- Configurable caps (capabilities) for proper format specification
- Buffer queuing with configurable size limits and blocking behavior
- Support for various pixel formats (RGBA, RGB, NV12, I420, etc.)
- Automatic timestamp generation based on framerate
- End-of-stream (EOS) signaling
- Zero-copy operation when wrapping tensor memory
C++ Wrapper Classes#
The bridge includes a set of C++ RAII wrapper classes for GStreamer objects (located in the gst/ subdirectory).
Key wrapper classes include (subset):
gst::Element: Wrapper for GstElement (pipeline elements)gst::Pipeline: Wrapper for GstPipeline (top-level pipelines)gst::Bus: Wrapper for GstBus (message handling)gst::Caps: Wrapper for GstCaps (media format capabilities)gst::Buffer: Wrapper for GstBuffer (data buffers)gst::Message: Wrapper for GstMessage (bus messages)gst::Allocator: Wrapper for GstAllocator (memory allocation)
These wrappers provide:
- Automatic reference counting and cleanup
- Type-safe property setting with compile-time string conversion
- Convenient API for common GStreamer operations
- Exception-based error handling
Note: These wrapper classes can be used independently in non-Holoscan applications for safer GStreamer programming.
Usage Example#
For a complete working example demonstrating how to use GstVideoRecorderOp in a Holoscan application, see the gst_video_recorder application. It shows:
- Integration with
V4L2VideoCaptureOpfor camera input - Integration with pattern generators for synthetic video
- Proper use of
FormatConverterOpfor format handling - Configuration of encoder properties
- YAML-based configuration
Requirements#
System Packages:
A Dockerfile with all dependencies pre-installed is provided at operators/gstreamer/Dockerfile for containerized builds.
For local development, install all required dependencies using the provided script:
./operators/gstreamer/install_deps.sh
Optional (for CUDA support):
gstreamer1.0-cuda(requires GStreamer 1.24+)
Holoscan SDK:
- Minimum version: 3.8.0
Advanced Configuration#
Encoder Properties#
Encoder properties are passed directly to the underlying GStreamer encoder element. Common properties include:
NVIDIA H.264/H.265 (nvh264enc/nvh265enc):
bitrate: Target bitrate in kbps (e.g., "5000")preset: Encoding preset 0-3 (0=slowest/best quality, 3=fastest/lower quality)gop-size: GOP (Group of Pictures) size in frames
x264/x265 (software encoders):
bitrate: Target bitrate in kbpsspeed-preset: Encoding speed preset (e.g., "ultrafast", "medium", "slow")tune: Tuning preset (e.g., "zerolatency", "film")
For a complete list of available properties, consult the GStreamer plugin documentation or use gst-inspect-1.0 <encoder> (e.g., gst-inspect-1.0 nvh264enc).
CUDA Memory Support#
When HOLOSCAN_GSTREAMER_CUDA_SUPPORT is enabled (requires GStreamer 1.24+), the operator automatically detects and uses CUDA memory for zero-copy data transfer from GPU to encoder.
References#
API Reference#
holoscan::gst::Allocator#
Inherits from: holoscan::gst::AllocatorBase< Allocator, ::GstAllocator >
Wrapper class for ::GstAllocator.
Methods#
| Method | Description |
|---|---|
Allocator(::GstAllocator *allocator=nullptr) |
|
Allocator(const AllocatorBase &other) |
|
Allocator(AllocatorBase &&other) |
|
GType get_type_func() |
holoscan::gst::AllocatorBase#
Inherits from: holoscan::gst::ObjectBase< Derived, NativeType >
Templated base class for GStreamer allocator types (GstAllocator and its derivatives)
Methods#
| Method | Description |
|---|---|
AllocatorBase(NativeType *allocator=nullptr) |
|
AllocatorBase(const ObjectBase< Derived, NativeType > &other) |
|
AllocatorBase(ObjectBase< Derived, NativeType > &&other) |
holoscan::gst::AppSink#
Inherits from: holoscan::gst::AppSinkBase< AppSink, ::GstAppSink >
Wrapper class for ::GstAppSink.
Methods#
| Method | Description |
|---|---|
AppSink(::GstAppSink *appsink=nullptr) |
|
AppSink(const AppSinkBase &other) |
|
AppSink(AppSinkBase &&other) |
|
::GType get_type_func() |
holoscan::gst::AppSinkBase#
Inherits from: holoscan::gst::ElementBase< Derived, NativeType >
Base template class for GstAppSink-derived wrappers.
Methods#
| Method | Description |
|---|---|
AppSinkBase(NativeType *appsink=nullptr) |
|
AppSinkBase(const ObjectBase< Derived, NativeType > &other) |
|
AppSinkBase(ObjectBase< Derived, NativeType > &&other) |
|
void set_callbacks(::GstAppSinkCallbacks *callbacks, ::gpointer user_data, ::GDestroyNotify notify) |
Set callbacks for the AppSink element. |
Sample try_pull_sample(::GstClockTime timeout) |
Try to pull a sample from the appsink with timeout. |
holoscan::gst::AppSrc#
Inherits from: holoscan::gst::AppSrcBase< AppSrc, ::GstAppSrc >
Wrapper class for ::GstAppSrc.
Methods#
| Method | Description |
|---|---|
AppSrc(::GstAppSrc *appsrc=nullptr) |
|
AppSrc(const AppSrcBase &other) |
|
AppSrc(AppSrcBase &&other) |
|
::GType get_type_func() |
holoscan::gst::AppSrcBase#
Inherits from: holoscan::gst::ElementBase< Derived, NativeType >
Base template class for GstAppSrc-derived wrappers.
Methods#
| Method | Description |
|---|---|
AppSrcBase(NativeType *appsrc=nullptr) |
|
AppSrcBase(const ObjectBase< Derived, NativeType > &other) |
|
AppSrcBase(ObjectBase< Derived, NativeType > &&other) |
|
::GstFlowReturn push_buffer(Buffer buffer) |
Push a buffer into the AppSrc element. |
::GstFlowReturn end_of_stream() |
Signal end of stream to the AppSrc element. |
holoscan::gst::BinBase#
Inherits from: holoscan::gst::ElementBase< Derived, NativeType >
Templated base class for GStreamer bin types (GstBin, GstPipeline, etc.)
Methods#
| Method | Description |
|---|---|
BinBase(NativeType *bin=nullptr) |
|
BinBase(const ElementBase< Derived, NativeType > &other) |
|
BinBase(ElementBase< Derived, NativeType > &&other) |
|
bool add(const Element &element) |
Add a single element to the bin. |
void add_many(const Elements &... elements) |
Add multiple elements to the bin. |
Element get_by_name(const std::string &name) const |
Get an element from the bin by name. |
holoscan::gst::Pipeline#
Inherits from: holoscan::gst::BinBase< Pipeline, ::GstPipeline >
Wrapper class for ::GstPipeline.
Methods#
| Method | Description |
|---|---|
Pipeline(::GstPipeline *pipeline=nullptr) |
|
Pipeline(const BinBase &other) |
|
Pipeline(BinBase &&other) |
|
Pipeline create(const std::string &name) |
Create a new pipeline with the given name. |
GType get_type_func() |
holoscan::gst::Buffer#
Inherits from: holoscan::gst::MiniObjectBase< Buffer, ::GstBuffer >
RAII wrapper for GstBuffer with automatic reference counting and member functions.
Methods#
| Method | Description |
|---|---|
Buffer(::GstBuffer *buffer=nullptr) |
Constructor from native GstBuffer. |
gsize get_size() const |
Get buffer size in bytes. |
GstBufferFlags flags() const |
Get buffer flags. |
void append_memory(const gst::Memory &memory) |
Append a memory block to the buffer. |
guint n_memory() const |
Get the number of memory blocks in the buffer. |
gst::Memory get_memory(guint idx) const |
Get a memory block from the buffer. |
bool map(::GstMapInfo *info, ::GstMapFlags flags) const |
Map buffer for access. |
void unmap(::GstMapInfo *info) const |
Unmap previously mapped buffer. |
Buffer create() |
Create a new empty GStreamer buffer. |
holoscan::gst::Bus#
Inherits from: holoscan::gst::BusBase< Bus, ::GstBus >
Wrapper class for ::GstBus.
Methods#
| Method | Description |
|---|---|
Bus(::GstBus *bus=nullptr) |
|
Bus(const BusBase &other) |
|
Bus(BusBase &&other) |
|
GType get_type_func() |
holoscan::gst::BusBase#
Inherits from: holoscan::gst::ObjectBase< Derived, NativeType >
Templated base class for GStreamer bus types (GstBus and its derivatives)
Methods#
| Method | Description |
|---|---|
BusBase(NativeType *bus=nullptr) |
|
BusBase(const ObjectBase< Derived, NativeType > &other) |
|
BusBase(ObjectBase< Derived, NativeType > &&other) |
|
Message pop_filtered(::GstMessageType types) const |
Pop a message from the bus with filtering (non-blocking) |
Message timed_pop_filtered(::GstClockTime timeout, ::GstMessageType types) const |
Pop a message from the bus with timeout and filtering. |
holoscan::gst::Caps#
Inherits from: holoscan::gst::MiniObjectBase< Caps, ::GstCaps >
RAII wrapper for GstCaps with automatic reference counting and member functions.
Methods#
| Method | Description |
|---|---|
Caps(::GstCaps *caps=nullptr) |
Constructor from GstCaps pointer (takes ownership) |
Caps(const std::string &caps_string) |
Constructor from caps string. |
const char * get_structure_name(guint index=0) const |
Get the name of the first structure in the caps. |
const GValue * get_structure_value(const char *fieldname, guint index=0) const |
Get the value of a specific field in a specific structure. |
::GstStructure * get_structure(guint index=0) const |
Get a structure from the caps at the specified index. |
std::optional<VideoInfo> get_video_info() const |
Extract video format information from caps. |
bool is_empty() const |
Check if caps are empty (follows GStreamer semantics) Note: Empty caps means gst_caps_new_empty(), NOT nullptr. |
guint get_size() const |
Get the number of structures in caps. |
bool has_feature(const char *feature_name) const |
Check if caps contain a specific feature. |
std::string to_string() const |
Convert caps to human-readable string. |
holoscan::gst::Element#
Inherits from: holoscan::gst::ElementBase< Element, ::GstElement >
Wrapper class for ::GstElement.
Methods#
| Method | Description |
|---|---|
Element(::GstElement *element=nullptr) |
|
Element(const ElementBase &other) |
|
Element(ElementBase &&other) |
|
GType get_type_func() |
holoscan::gst::ElementBase#
Inherits from: holoscan::gst::ObjectBase< Derived, NativeType >
Templated base class for GStreamer element types (GstElement and its derivatives)
Methods#
| Method | Description |
|---|---|
ElementBase(NativeType *element=nullptr) |
|
ElementBase(const ObjectBase< Derived, NativeType > &other) |
|
ElementBase(ObjectBase< Derived, NativeType > &&other) |
|
Bus get_bus() const |
Get the bus from this element. |
::GstStateChangeReturn set_state(::GstState state) |
Set the state of this element. |
::GstStateChangeReturn get_state(::GstState *state, ::GstState *pending, ::GstClockTime timeout=GST_CLOCK_TIME_NONE) const |
Get the state of this element. |
bool link(const T &dest) const |
Link this element to another element. |
bool link_many(Elements &&... elements) const |
Link this element to multiple elements in sequence. |
std::string get_name() const |
Get the name of this element. |
Pad get_static_pad(const std::string &name) const |
Get a static pad from this element. |
holoscan::gst::Error#
RAII wrapper for GError with automatic cleanup.
Methods#
| Method | Description |
|---|---|
Error(::GError *error=nullptr) |
Constructor from raw pointer (takes ownership) |
::GError * get() const |
Get the raw pointer. |
const ::GError * operator->() const |
Access GError members directly. |
operator bool() const |
Bool conversion. |
holoscan::GstSinkBridge#
Bridge between GStreamer and external data consumers.
Methods#
| Method | Description |
|---|---|
GstSinkBridge(const std::string &name, const std::string &caps_string, size_t max_buffers, bool qos) |
Constructor - creates and initializes the GStreamer appsink element. |
GstSinkBridge(const GstSinkBridge &)=delete |
|
GstSinkBridge & operator=(const GstSinkBridge &)=delete |
|
GstSinkBridge(GstSinkBridge &&)=delete |
|
GstSinkBridge & operator=(GstSinkBridge &&)=delete |
|
gst::Element get_gst_element() const |
Get the underlying GStreamer element. |
std::shared_future<void> get_eos_future() const |
Get a future that will be ready when EOS is received by the appsink. |
std::future<gst::Buffer> pull_buffer() |
Asynchronously pull the next buffer from the GStreamer pipeline. |
TensorMap create_tensor_map_from_buffer(gst::Buffer buffer) const |
Create a TensorMap from GStreamer buffer with zero-copy. |
gst::Caps get_current_caps() const |
Get the current negotiated caps from the sink pad. |
holoscan::GstSinkOp#
Inherits from: Operator
Operator for bridging GStreamer data into Holoscan.
Methods#
| Method | Description |
|---|---|
void setup(OperatorSpec &spec) override |
Setup the operator specification. |
void compute(InputContext &input, OutputContext &output, ExecutionContext &context) override |
Compute function that processes GStreamer buffers. |
holoscan::GstSinkResource#
Inherits from: Resource
Holoscan Resource that wraps GstSinkBridge for GStreamer pipeline integration.
Methods#
| Method | Description |
|---|---|
void setup(ComponentSpec &spec) override |
Setup the resource parameters. |
void initialize() override |
Initialize the GStreamer sink resource. |
std::shared_future<gst::Element> get_gst_element() const |
Get the underlying GStreamer element. |
std::future<gst::Buffer> pull_buffer() |
Asynchronously pull the next buffer from the GStreamer pipeline. |
TensorMap create_tensor_map_from_buffer(gst::Buffer buffer) const |
Create a TensorMap from GStreamer buffer with zero-copy. |
holoscan::GstSrcBridge#
Bridge between GStreamer and external data sources.
Methods#
| Method | Description |
|---|---|
GstSrcBridge(const std::string &name, const std::string &caps_string, size_t max_buffers, bool block=true) |
Constructor - creates and initializes the GStreamer appsrc element. |
GstSrcBridge(const GstSrcBridge &)=delete |
|
GstSrcBridge & operator=(const GstSrcBridge &)=delete |
|
GstSrcBridge(GstSrcBridge &&)=delete |
|
GstSrcBridge & operator=(GstSrcBridge &&)=delete |
|
gst::Element get_gst_element() const |
Get the underlying GStreamer element. |
bool send_eos() |
Send End-Of-Stream signal to appsrc. |
bool push_buffer(gst::Buffer buffer) |
Push a buffer into the GStreamer pipeline. |
gst::Buffer create_buffer_from_tensor_map(const TensorMap &tensor_map) |
Create a GStreamer buffer from a TensorMap. |
gst::Caps get_current_caps() const |
Get the current negotiated caps from the source pad. |
holoscan::GstSrcOp#
Inherits from: Operator
Operator for bridging Holoscan data into GStreamer.
Methods#
| Method | Description |
|---|---|
void setup(OperatorSpec &spec) override |
Setup the operator specification. |
void compute(InputContext &input, OutputContext &output, ExecutionContext &context) override |
Compute function that processes Holoscan entities. |
void stop() override |
Stop function called when operator execution ends. |
holoscan::GstSrcResource#
Inherits from: Resource
Holoscan Resource that wraps GstSrcBridge for GStreamer pipeline integration.
Methods#
| Method | Description |
|---|---|
void setup(ComponentSpec &spec) override |
Setup the resource parameters. |
void initialize() override |
Initialize the GStreamer source resource. |
std::shared_future<gst::Element> get_gst_element() const |
Get the underlying GStreamer element. |
bool send_eos() |
Send End-Of-Stream signal to appsrc. |
bool push_buffer(gst::Buffer buffer) |
Push a buffer into the GStreamer pipeline. |
gst::Buffer create_buffer_from_tensor_map(const TensorMap &tensor_map) const |
Create a GStreamer buffer from a TensorMap. |
holoscan::GstVideoRecorderOp#
Inherits from: Operator
Operator for recording video streams to file using GStreamer.
Methods#
| Method | Description |
|---|---|
void setup(OperatorSpec &spec) override |
Setup the operator specification. |
void start() override |
Start function called after initialization but before first compute. |
void compute(InputContext &input, OutputContext &output, ExecutionContext &context) override |
Compute function that processes video frames. |
void stop() override |
Stop function called when recording ends. |
holoscan::GstWaitGroup#
GstWaitGroup for tracking active operations and waiting for completion.
Methods#
| Method | Description |
|---|---|
GstWaitGroup() |
Construct a GstWaitGroup with initial count of 0. |
GstWaitGroup(const GstWaitGroup &)=delete |
|
GstWaitGroup & operator=(const GstWaitGroup &)=delete |
|
GstWaitGroup(GstWaitGroup &&)=delete |
|
GstWaitGroup & operator=(GstWaitGroup &&)=delete |
|
void add() |
Increment the counter. |
void done() |
Decrement the counter and notify waiters if it reaches zero. |
void wait() |
Wait until the counter reaches zero. |
size_t count() const |
Get the current counter value. |
holoscan::GstWaitGroupGuard#
RAII guard for GstWaitGroup add/done.
Methods#
| Method | Description |
|---|---|
GstWaitGroupGuard(GstWaitGroup &wg) |
|
GstWaitGroupGuard(const GstWaitGroupGuard &)=delete |
|
GstWaitGroupGuard & operator=(const GstWaitGroupGuard &)=delete |
|
GstWaitGroupGuard(GstWaitGroupGuard &&)=delete |
|
GstWaitGroupGuard & operator=(GstWaitGroupGuard &&)=delete |
holoscan::gst::Memory#
Inherits from: holoscan::gst::MiniObjectBase< Memory, ::GstMemory >
RAII wrapper for GstMemory with automatic cleanup.
Methods#
| Method | Description |
|---|---|
Memory(::GstMemory *memory=nullptr) |
Constructor from raw pointer (takes ownership) |
gsize get_sizes(gsize *offset=nullptr, gsize *max_size=nullptr) const |
Get the size of the memory. |
bool map(::GstMapInfo *info, ::GstMapFlags flags) const |
Map memory for access. |
void unmap(::GstMapInfo *info) const |
Unmap previously mapped memory. |
Memory create_wrapped(::GstMemoryFlags flags, void *data, gsize maxsize, gsize offset, gsize size, void *user_data, ::GDestroyNotify notify) |
Create a memory object that wraps existing data. |
holoscan::gst::Message#
Inherits from: holoscan::gst::MiniObjectBase< Message, ::GstMessage >
RAII wrapper for GstMessage with automatic cleanup.
Methods#
| Method | Description |
|---|---|
Message(::GstMessage *message=nullptr) |
Constructor from raw pointer (takes ownership) |
::GstMessageType get_type() const |
Get the type of this message. |
Error parse_error() const |
Parse error message and extract error information. |
Error parse_error(std::string &debug_info) const |
Parse error message and extract error and debug information. |
void parse_state_changed(::GstState *oldstate, ::GstState *newstate, ::GstState *pending) const |
Parse state changed message and extract state information. |
holoscan::gst::MiniObjectBase#
Inherits from: holoscan::gst::GstWrapperBase
Internal RAII base class for GStreamer GstMiniObject types with automatic cleanup.
Methods#
| Method | Description |
|---|---|
MiniObjectBase(NativeType *object=nullptr) |
|
NativeType * get() const |
|
NativeType * operator->() const |
|
operator bool() const |
|
Derived & ref() |
|
const Derived & ref() const |
|
void reset() |
holoscan::gst::ObjectBase#
Inherits from: holoscan::gst::GstWrapperBase
Internal RAII base class for GStreamer GstObject types with automatic cleanup.
Methods#
| Method | Description |
|---|---|
ObjectBase(NativeType *object=nullptr) |
|
NativeType * get() const |
|
NativeType * operator->() const |
|
operator bool() const |
|
Derived & ref() |
Increment GStreamer reference count (advanced: for external ownership transfer) |
const Derived & ref() const |
Const overload of ref() for const objects. |
Derived & ref_sink() |
Sink floating reference. |
const Derived & ref_sink() const |
|
void set_properties(Args &&... args) |
|
bool find_and_set_property(const std::string &name, const std::string &value) |
|
void reset() |
holoscan::gst::Pad#
Inherits from: holoscan::gst::PadBase< Pad, ::GstPad >
Wrapper class for ::GstPad.
Methods#
| Method | Description |
|---|---|
Pad(::GstPad *pad=nullptr) |
|
Pad(const PadBase &other) |
|
Pad(PadBase &&other) |
|
GType get_type_func() |
holoscan::gst::PadBase#
Inherits from: holoscan::gst::ObjectBase< Derived, NativeType >
Templated base class for GStreamer pad types (GstPad and its derivatives)
Methods#
| Method | Description |
|---|---|
PadBase(NativeType *pad=nullptr) |
|
PadBase(const ObjectBase< Derived, NativeType > &other) |
|
PadBase(ObjectBase< Derived, NativeType > &&other) |
|
Caps get_current_caps() const |
Get the current caps of this pad. |
holoscan::gst::PipelineBusMonitor#
Base class for monitoring GStreamer pipeline bus messages.
Methods#
| Method | Description |
|---|---|
PipelineBusMonitor(Pipeline pipeline) |
Construct a pipeline bus monitor. |
PipelineBusMonitor(const PipelineBusMonitor &)=delete |
|
PipelineBusMonitor & operator=(const PipelineBusMonitor &)=delete |
|
void start() |
Start monitoring the pipeline bus in a background thread. |
void stop() |
Stop monitoring the pipeline bus. |
bool is_running() const |
Check if the monitor is currently running. |
std::shared_future<void> get_completion_future() |
Get the future for monitoring completion. |
holoscan::gst::Sample#
Inherits from: holoscan::gst::MiniObjectBase< Sample, ::GstSample >
RAII wrapper for GstSample with automatic cleanup.
Methods#
| Method | Description |
|---|---|
Sample(::GstSample *sample=nullptr) |
Constructor from raw pointer (takes ownership) |
Buffer get_buffer() const |
Get the buffer associated with this sample. |
holoscan::gst::VideoInfo#
Video information extracted from GstCaps.
Methods#
| Method | Description |
|---|---|
VideoInfo() |
Default constructor - initializes empty video info. |
VideoInfo(const Caps &caps) |
Constructor from Caps object. |
gsize get_size() const |
Get total buffer size for all planes. |
gsize get_stride(int plane_index) const |
Get stride (bytes per line) for a specific plane. |
gsize get_comp_height(int plane_index) const |
Get component height for a specific plane. |
gsize get_comp_width(int plane_index) const |
Get component width for a specific plane. |
gsize get_size(int plane_index) const |
Get plane size for a specific plane. |
gsize get_n_components() const |
Get number of components. |
gsize get_n_planes() const |
Get number of planes. |
gsize get_comp_pstride(int component) const |
Get pixel stride for a specific component. |
GstVideoFormat get_format() const |
Get video format. |
gint get_width() const |
Get width. |
gint get_height() const |
Get height. |
bool set_format(GstVideoFormat format, gint width, gint height) |
Set video format information. |
const ::GstVideoInfo * get() const |
Get underlying GstVideoInfo pointer. |
GstVideoRecorderOp#
Operator for recording video streams to file using GStreamer.
==Named Inputs==
input : TensorMap Video frames to encode and write to file. Width, height, and storage type are automatically detected from the first frame.
Parameters#
fragment : holoscan.core.Fragment
Fragment that owns the operator.
encoder : str
Encoder base name (e.g. "nvh264", "nvh265", "x264", or "x265").
The "enc" suffix is automatically appended to form the element name.
Default value is "nvh264".
format : str
Pixel format for video data (e.g. "RGBA", "RGB", "BGRA", "BGR", and "GRAY8").
Default value is "RGBA".
framerate : str
Video framerate as a fraction or decimal, for example "30/1",
"30000/1001", "29.97", or "60".
Special value "0/1" enables live mode with no framerate control.
Default value is "30/1"
max_buffers : int
Maximum number of buffers to queue (0 = unlimited).
Default value is 10.
block : bool
Whether push_buffer() blocks when the internal queue is full (True = block, False = non-blocking, may drop/timeout).
Default value is True.
filename : str
Output video filename.
If no extension is provided, ".mp4" is automatically appended.
Default value is "output.mp4".
properties : dict of str to str
Map of encoder-specific properties.
Examples include {"bitrate": "8000", "preset": "1", "gop-size": "30"}.
Default value is an empty dictionary.
name : str
Operator name.
Default value is "gst_video_recorder".
Methods#
initialize: Initialize the operator.setup: Define the operator specification.