No edit summary |
|||
Line 1: | Line 1: | ||
= GStreamer Interpipes = |
= GStreamer Interpipes = |
||
'''GStreamer Interpipes''' is a plugin that enables |
'''GStreamer Interpipes''' is a feature from the RidgeRun ''gst-interpipe'' plugin that enables '''dynamic pipeline communication'''. It allows: |
||
* '''Multi-pipeline sharing''' β Pass data between multiple GStreamer pipelines. |
|||
* '''Dynamic linking''' β Connect or disconnect pipelines '''without restarting'''. |
|||
* '''Low-latency media routing''' β Efficiently stream audio/video between pipelines. |
|||
== βοΈ Installing ''gst-interpipe'' == |
|||
== π Features == |
|||
Before using Interpipes, ensure you have the required dependencies. |
|||
* Low-latency pipeline communication. |
|||
* Supports inter-source and inter-sink elements. |
|||
* Dynamically link/unlink pipelines without restarting. |
|||
=== π οΈ Build System & Development Tools === |
|||
== π Key Concepts == |
|||
<pre> |
|||
Interpipes introduce: |
|||
sudo apt install -y meson ninja-build git |
|||
* '''interpipesink''' β Acts as a producer of media buffers. |
|||
</pre> |
|||
* '''interpipesrc''' β Acts as a consumer, receiving data from interpipesink. |
|||
=== ποΈ GStreamer Core & Plugins === |
|||
== π‘ Use Cases == |
|||
<pre> |
|||
* '''Multi-camera setups''' β Combine multiple camera feeds efficiently. |
|||
sudo apt install -y gstreamer1.0-plugins-base |
|||
* '''Live video processing''' β Apply real-time filters across multiple streams. |
|||
</pre> |
|||
* '''Edge AI & Computer Vision''' β Process data from multiple sources dynamically. |
|||
=== π¦ Additional GStreamer Plugins === |
|||
== π Example Pipeline == |
|||
<pre> |
|||
sudo apt install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ |
|||
gstreamer1.0-plugins-ugly gstreamer1.0-libav |
|||
</pre> |
|||
=== |
=== ποΈ GStreamer Development Libraries === |
||
<pre> |
<pre> |
||
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev |
|||
gst-launch-1.0 -e interpipesrc name=src1 is-live=true ! interpipesink name=sink1 |
|||
</pre> |
</pre> |
||
=== |
=== π Documentation Tools (Optional) === |
||
<pre> |
<pre> |
||
sudo apt install -y gtk-doc-tools |
|||
gst-launch-1.0 -e interpipesrc listen-to=sink1 ! autovideosink |
|||
</pre> |
</pre> |
||
*(You can disable GTK-Doc with ''-Dgtk_doc=disabled'' in Meson if not needed.)* |
|||
=== π Installing ''gst-interpipe'' Plugin === |
|||
To install the RidgeRun ''gst-interpipe'' plugin: |
|||
<pre> |
|||
git clone https://github.com/RidgeRun/gst-interpipe.git |
|||
cd gst-interpipe |
|||
meson build |
|||
ninja -C build |
|||
sudo ninja -C build install |
|||
</pre> |
|||
Verify installation: |
|||
<pre> |
|||
gst-inspect-1.0 interpipesrc |
|||
</pre> |
|||
'''Expected Output:''' |
|||
<code> |
|||
Factory Details: |
|||
Rank none (0) |
|||
Long-name Inter pipeline source |
|||
Klass Generic/Source |
|||
Description Source for internal pipeline buffers communication |
|||
Author Michael GrΓΌner <michael.gruner@ridgerun.com>Plugin Details: |
|||
Name interpipe |
|||
Description Elements to communicate buffers across pipelines |
|||
Filename /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstinterpipe.so |
|||
Version 1.1.8 |
|||
License LGPL |
|||
Source module gst-interpipe |
|||
Binary package GstInterpipe |
|||
Origin URL http://www.ridgerun.com</code> |
|||
== π Core Concepts == |
|||
Interpipes introduce two main elements: |
|||
{| class="wikitable" |
|||
|+ '''Interpipe Elements''' |
|||
|- |
|||
! Element !! Description |
|||
|- |
|||
| '''interpipesink''' || Sends data to other pipelines. |
|||
|- |
|||
| '''interpipesrc''' || Receives data from ''interpipesink''. |
|||
|} |
|||
== π‘ Controlling GStreamer Interpipes with ''gst-client'' == |
|||
Each command follows this format: |
|||
<pre> |
|||
gst-client COMMAND pipeline_name "PIPELINE_DESCRIPTION" |
|||
</pre> |
|||
=== ποΈ Creating an Interpipes Source Pipeline === |
|||
<pre> |
|||
gst-client pipeline_create producer_pipeline "videotestsrc is-live=true ! interpipesink name=sink1" |
|||
</pre> |
|||
'''Parameters:''' |
|||
* '''pipeline_create producer_pipeline''' β Creates a new pipeline named ''producer_pipeline''. |
|||
* '''videotestsrc is-live=true''' β Generates a '''live''' video test source. |
|||
* '''interpipesink name=sink1''' β Creates an Interpipe sink named '''sink1'''. |
|||
'''Use case:''' This pipeline '''produces video''' for other pipelines to consume. |
|||
=== ποΈ Creating an Interpipes Consumer Pipeline === |
|||
<pre> |
|||
gst-client pipeline_create consumer_pipeline "interpipesrc listen-to=sink1 ! videoconvert ! autovideosink" |
|||
</pre> |
|||
'''Parameters:''' |
|||
* '''pipeline_create consumer_pipeline''' β Creates a new pipeline named ''consumer_pipeline''. |
|||
* '''interpipesrc listen-to=sink1''' β Reads data from '''sink1'''. |
|||
* '''videoconvert''' β Ensures format compatibility. |
|||
* '''autovideosink''' β Displays the received video. |
|||
'''Use case:''' This pipeline '''consumes''' data from ''sink1''. |
|||
=== βΆοΈ Playing the Producer Pipeline === |
|||
<pre> |
|||
gst-client pipeline_play producer_pipeline |
|||
</pre> |
|||
'''Use case:''' Starts the producer pipeline. |
|||
=== βΆοΈ Playing the Consumer Pipeline === |
|||
<pre> |
|||
gst-client pipeline_play consumer_pipeline |
|||
</pre> |
|||
'''Use case:''' Starts the consumer pipeline. |
|||
=== βΉοΈ Stopping the Producer Pipeline === |
|||
<pre> |
|||
gst-client pipeline_stop producer_pipeline |
|||
</pre> |
|||
'''Use case:''' Stops the producer without deleting it. |
|||
=== βΉοΈ Stopping the Consumer Pipeline === |
|||
<pre> |
|||
gst-client pipeline_stop consumer_pipeline |
|||
</pre> |
|||
'''Use case:''' Stops the consumer without deleting it. |
|||
=== β Deleting the Producer Pipeline === |
|||
<pre> |
|||
gst-client pipeline_delete producer_pipeline |
|||
</pre> |
|||
'''Use case:''' Removes the producer pipeline. |
|||
=== β Deleting the Consumer Pipeline === |
|||
<pre> |
|||
gst-client pipeline_delete consumer_pipeline |
|||
</pre> |
|||
'''Use case:''' Removes the consumer pipeline. |
|||
== π Switching Between Interpipes == |
|||
Interpipes allow you to dynamically switch sources. |
|||
=== ποΈ Changing the Consumer Pipeline's Source === |
|||
<pre> |
|||
gst-client pipeline_create new_source "videotestsrc pattern=ball ! interpipesink name=sink2" |
|||
gst-client pipeline_set consumer_pipeline "interpipesrc listen-to=sink2 ! videoconvert ! autovideosink" |
|||
</pre> |
|||
'''Use case:''' The consumer pipeline now '''receives data from ''sink2''''' instead of ''sink1''. |
|||
== π Stopping GStreamer Daemon == |
|||
To stop the GStreamer Daemon: |
|||
<pre> |
|||
gstd -k |
|||
</pre> |
|||
'''Use case:''' Terminates the running ''gstd''. |
|||
== β
Checking if ''gstd'' is Running == |
|||
To verify if GStreamer Daemon is running: |
|||
<pre> |
|||
ps aux | grep gstd |
|||
</pre> |
|||
'''Use case:''' Displays ''gstd'' processes if running. |
|||
== π Summary == |
|||
GStreamer Interpipes enable '''seamless pipeline communication''' via '''dynamic linking'''. |
|||
{| class="wikitable" |
|||
== π References == |
|||
|+ '''GStreamer Interpipes Key Features''' |
|||
* [https://gstreamer.freedesktop.org/documentation/?gi-language=c GStreamer Documentation] |
|||
|- |
|||
! Feature !! Description |
|||
|- |
|||
| '''Pipeline Communication''' || Share data across multiple pipelines. |
|||
|- |
|||
| '''Dynamic Source Switching''' || Change data sources on the fly. |
|||
|- |
|||
| '''Low Latency''' || Efficient buffer sharing for real-time applications. |
|||
|- |
|||
| '''Optimized for Embedded Systems''' || Reduces memory overhead. |
|||
|} |
Revision as of 13:16, 24 February 2025
GStreamer Interpipes
GStreamer Interpipes is a feature from the RidgeRun gst-interpipe plugin that enables dynamic pipeline communication. It allows:
- Multi-pipeline sharing β Pass data between multiple GStreamer pipelines.
- Dynamic linking β Connect or disconnect pipelines without restarting.
- Low-latency media routing β Efficiently stream audio/video between pipelines.
βοΈ Installing gst-interpipe
Before using Interpipes, ensure you have the required dependencies.
π οΈ Build System & Development Tools
sudo apt install -y meson ninja-build git
ποΈ GStreamer Core & Plugins
sudo apt install -y gstreamer1.0-plugins-base
π¦ Additional GStreamer Plugins
sudo apt install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-ugly gstreamer1.0-libav
ποΈ GStreamer Development Libraries
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
π Documentation Tools (Optional)
sudo apt install -y gtk-doc-tools
- (You can disable GTK-Doc with -Dgtk_doc=disabled in Meson if not needed.)*
π Installing gst-interpipe Plugin
To install the RidgeRun gst-interpipe plugin:
git clone https://github.com/RidgeRun/gst-interpipe.git cd gst-interpipe meson build ninja -C build sudo ninja -C build install
Verify installation:
gst-inspect-1.0 interpipesrc
Expected Output:
Factory Details:
Rank none (0)
Long-name Inter pipeline source
Klass Generic/Source
Description Source for internal pipeline buffers communication
Author Michael GrΓΌner <michael.gruner@ridgerun.com>Plugin Details:
Name interpipe
Description Elements to communicate buffers across pipelines
Filename /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstinterpipe.so
Version 1.1.8
License LGPL
Source module gst-interpipe
Binary package GstInterpipe
Origin URL http://www.ridgerun.com
π Core Concepts
Interpipes introduce two main elements:
Element | Description |
---|---|
interpipesink | Sends data to other pipelines. |
interpipesrc | Receives data from interpipesink. |
π‘ Controlling GStreamer Interpipes with gst-client
Each command follows this format:
gst-client COMMAND pipeline_name "PIPELINE_DESCRIPTION"
ποΈ Creating an Interpipes Source Pipeline
gst-client pipeline_create producer_pipeline "videotestsrc is-live=true ! interpipesink name=sink1"
Parameters:
- pipeline_create producer_pipeline β Creates a new pipeline named producer_pipeline.
- videotestsrc is-live=true β Generates a live video test source.
- interpipesink name=sink1 β Creates an Interpipe sink named sink1.
Use case: This pipeline produces video for other pipelines to consume.
ποΈ Creating an Interpipes Consumer Pipeline
gst-client pipeline_create consumer_pipeline "interpipesrc listen-to=sink1 ! videoconvert ! autovideosink"
Parameters:
- pipeline_create consumer_pipeline β Creates a new pipeline named consumer_pipeline.
- interpipesrc listen-to=sink1 β Reads data from sink1.
- videoconvert β Ensures format compatibility.
- autovideosink β Displays the received video.
Use case: This pipeline consumes data from sink1.
βΆοΈ Playing the Producer Pipeline
gst-client pipeline_play producer_pipeline
Use case: Starts the producer pipeline.
βΆοΈ Playing the Consumer Pipeline
gst-client pipeline_play consumer_pipeline
Use case: Starts the consumer pipeline.
βΉοΈ Stopping the Producer Pipeline
gst-client pipeline_stop producer_pipeline
Use case: Stops the producer without deleting it.
βΉοΈ Stopping the Consumer Pipeline
gst-client pipeline_stop consumer_pipeline
Use case: Stops the consumer without deleting it.
β Deleting the Producer Pipeline
gst-client pipeline_delete producer_pipeline
Use case: Removes the producer pipeline.
β Deleting the Consumer Pipeline
gst-client pipeline_delete consumer_pipeline
Use case: Removes the consumer pipeline.
π Switching Between Interpipes
Interpipes allow you to dynamically switch sources.
ποΈ Changing the Consumer Pipeline's Source
gst-client pipeline_create new_source "videotestsrc pattern=ball ! interpipesink name=sink2" gst-client pipeline_set consumer_pipeline "interpipesrc listen-to=sink2 ! videoconvert ! autovideosink"
Use case: The consumer pipeline now receives data from sink2 instead of sink1.
π Stopping GStreamer Daemon
To stop the GStreamer Daemon:
gstd -k
Use case: Terminates the running gstd.
β Checking if gstd is Running
To verify if GStreamer Daemon is running:
ps aux | grep gstd
Use case: Displays gstd processes if running.
π Summary
GStreamer Interpipes enable seamless pipeline communication via dynamic linking.
Feature | Description |
---|---|
Pipeline Communication | Share data across multiple pipelines. |
Dynamic Source Switching | Change data sources on the fly. |
Low Latency | Efficient buffer sharing for real-time applications. |
Optimized for Embedded Systems | Reduces memory overhead. |