From ProventusNova DeveloperWiki
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
* '''Low-latency communication''' – Ideal for '''real-time media applications'''.
* '''Low-latency communication''' – Ideal for '''real-time media applications'''.


== ⚙️ GStreamer Daemon (`gstd`) Dependencies ==
== Installing GStreamer Daemon (`gstd`) ==
Before installing GStreamer Daemon, ensure you have the required dependencies.
Before installing GStreamer Daemon, ensure you have the required dependencies.


=== 🛠️ Build System & Development Tools ===
=== Build System & Development Tools ===
<pre>
<pre>
sudo apt install -y meson ninja-build git
sudo apt install -y meson ninja-build git
</pre>
</pre>


=== 🎞️ GStreamer Core & Plugins ===
=== GStreamer Core & Plugins ===
<pre>
<pre>
sudo apt install -y gstreamer1.0-tools gstreamer1.0-plugins-base
sudo apt install -y gstreamer1.0-tools gstreamer1.0-plugins-base
</pre>
</pre>


=== 📦 Additional GStreamer Plugins ===
=== Additional GStreamer Plugins ===
<pre>
<pre>
sudo apt install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
sudo apt install -y gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
Line 25: Line 25:
</pre>
</pre>


=== 🏗️ GStreamer Development Libraries ===
=== GStreamer Development Libraries ===
<pre>
<pre>
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
</pre>
</pre>


=== 🔗 GLib & D-Bus Dependencies ===
=== GLib & D-Bus Dependencies ===
<pre>
<pre>
sudo apt install -y libglib2.0-dev libdbus-1-dev libgirepository1.0-dev python3-gi
sudo apt install -y libglib2.0-dev libdbus-1-dev libgirepository1.0-dev python3-gi
</pre>
</pre>


=== 🌐 Daemon & Networking Libraries ===
=== Daemon & Networking Libraries ===
<pre>
<pre>
sudo apt install -y libdaemon-dev libsoup2.4-dev
sudo apt install -y libdaemon-dev libsoup2.4-dev
</pre>
</pre>


=== 📄 JSON & Editing Support ===
=== JSON & Editing Support ===
<pre>
<pre>
sudo apt install -y libjansson-dev libedit-dev
sudo apt install -y libjansson-dev libedit-dev
</pre>
</pre>


=== 🐛 Debugging Tools ===
=== Debugging Tools ===
<pre>
<pre>
sudo apt install -y valgrind
sudo apt install -y valgrind
</pre>
</pre>


== 🏗️ Installing and Running GStreamer Daemon ==
== Installing and Running GStreamer Daemon ==
To install GStreamer Daemon:
To install GStreamer Daemon:
<pre>
<pre>
Line 72: Line 72:
'''Note:''' The <code>-e</code> flag enables '''execution mode''', and <code>--tcp-base-port</code> sets the '''TCP control port'''.
'''Note:''' The <code>-e</code> flag enables '''execution mode''', and <code>--tcp-base-port</code> sets the '''TCP control port'''.


== 🎛️ <code>gst-client</code> Options ==
== Controlling GStreamer Daemon with <code>gst-client</code> ==
<code>gst-client</code> is used to interact with <code>gstd</code>. It provides multiple options:

=== 💻 Basic Commands ===
* '''<code>gst-client -h, --help</code>''' → Show help options.
* '''<code>gst-client -v, --version</code>''' → Print the current version of <code>gstd-client</code>.
* '''<code>gst-client -i, --interactive</code>''' → Enter interactive mode after executing commands.
* '''<code>gst-client -f script</code>''' → Execute commands from a file.

=== 🔗 Connection Options ===
* '''<code>gst-client -p, --tcp-port=PORT</code>''' → Connect via TCP (default: <code>5000</code>).
* '''<code>gst-client -a, --tcp-address=ADDRESS</code>''' → Specify the IP address (default: <code>localhost</code>).
* '''<code>gst-client -u, --unix</code>''' → Use UNIX socket instead of TCP.
* '''<code>gst-client -b, --unix-base-path=PATH</code>''' → Set UNIX socket path (default: <code>gstd_unix_socket</code>).

== 📡 Controlling GStreamer Daemon with <code>gst-client</code> ==


Each command follows this format:
Each command follows this format:
Line 95: Line 80:
</pre>
</pre>


=== 🎞️ Creating a Pipeline ===
=== Creating a Pipeline ===
<pre>
<pre>
gst-client pipeline_create test_pipeline "videotestsrc ! videoconvert ! autovideosink"
gst-client pipeline_create test_pipeline "videotestsrc ! videoconvert ! autovideosink"
Line 101: Line 86:


'''Parameters:'''
'''Parameters:'''
* '''pipeline_create''' Creates a new pipeline.
* '''pipeline_create''' Creates a new pipeline.
* '''test_pipeline''' Pipeline name (identifier).
* '''test_pipeline''' Pipeline name (identifier).
* '''Pipeline elements:'''
* '''Pipeline elements:'''
- '''videotestsrc''' Generates test video.
- '''videotestsrc''' Generates test video.
- '''videoconvert''' Ensures format compatibility.
- '''videoconvert''' Ensures format compatibility.
- '''autovideosink''' Displays video output.
- '''autovideosink''' Displays video output.


'''Use case:''' Used for '''testing video playback'''.
'''Use case:''' Used for '''testing video playback'''.


=== ▶️ Starting a Pipeline ===
=== Starting a Pipeline ===
<pre>
<pre>
gst-client pipeline_play test_pipeline
gst-client pipeline_play test_pipeline
Line 117: Line 102:
'''Use case:''' Runs an existing '''paused''' pipeline.
'''Use case:''' Runs an existing '''paused''' pipeline.


=== ⏹️ Stopping a Pipeline ===
=== Stopping a Pipeline ===
<pre>
<pre>
gst-client pipeline_stop test_pipeline
gst-client pipeline_stop test_pipeline
Line 124: Line 109:
'''Use case:''' Pauses '''pipeline execution''' without deleting it.
'''Use case:''' Pauses '''pipeline execution''' without deleting it.


=== Deleting a Pipeline ===
=== Deleting a Pipeline ===
<pre>
<pre>
gst-client pipeline_delete test_pipeline
gst-client pipeline_delete test_pipeline
Line 131: Line 116:
'''Use case:''' Frees up '''resources''' when a pipeline is no longer needed.
'''Use case:''' Frees up '''resources''' when a pipeline is no longer needed.


=== 📡 Example: Receiving an RTP Stream ===
== Example: Transmitting an RTP Stream ==
<pre>
<pre>
gst-client pipeline_create udp_stream "videotestsrc is-live=true pattern=ball ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=ultrafast ! rtph264pay ! udpsink host=127.0.0.1 port=5002"
gst-client pipeline_create udp_receiver "udpsrc port=5004 ! application/x-rtp, encoding-name=H264 ! rtpjitterbuffer latency=100 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false"
</pre>
</pre>


'''Parameters:'''
'''Use case:''' Receives '''real-time RTP video''' via '''UDP port 5004'''.
* '''pipeline_create udp_stream''' – Creates a new pipeline named ''udp_stream''.
* '''videotestsrc is-live=true pattern=ball''' – Generates a moving '''ball pattern''' as a live video source.
- '''''is-live=true''''' – Ensures the video source behaves like a real-time stream.
- '''''pattern=ball''''' – Uses a bouncing ball as the test video pattern.
* '''videoconvert''' – Ensures compatibility with encoders and sinks.
* '''x264enc tune=zerolatency bitrate=500 speed-preset=ultrafast''' – Encodes video into '''H.264 format''' with low latency.
- '''''tune=zerolatency''''' – Optimizes the encoding for minimal delay.
- '''''bitrate=500''''' – Sets the '''bitrate''' to 500 kbps.
- '''''speed-preset=ultrafast''''' – Uses the '''fastest''' encoding preset.
* '''rtph264pay''' – Converts H.264 video into RTP packets for network transmission.
* '''udpsink host=127.0.0.1 port=5002''' – Sends the RTP stream to '''UDP port 5002''' on '''localhost'''.

'''Use case:''' '''Broadcasting an RTP stream''' over UDP.

=== Playing the RTP Transmission ===
<pre>
gst-client pipeline_play udp_stream
</pre>

'''Use case:''' Starts broadcasting the RTP stream.

=== Stopping the RTP Transmission ===
<pre>
gst-client pipeline_stop udp_stream
</pre>

'''Use case:''' Stops broadcasting the RTP stream without deleting it.

=== Deleting the RTP Transmission Pipeline ===
<pre>
gst-client pipeline_delete udp_stream
</pre>

'''Use case:''' Removes the RTP transmission pipeline.

== Example: Receiving an RTP Stream ==
<pre>
gst-client pipeline_create udp_receiver "udpsrc port=5002 ! application/x-rtp, encoding-name=H264 ! rtpjitterbuffer latency=100 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false"
</pre>

'''Parameters:'''
* '''pipeline_create udp_receiver''' – Creates a new pipeline named ''udp_receiver''.
* '''udpsrc port=5002''' – Listens on '''UDP port 5002''' for incoming RTP packets.
* '''application/x-rtp, encoding-name=H264''' – Declares the '''media format''' as RTP with '''H.264 encoding'''.
* '''rtpjitterbuffer latency=100''' – Buffers packets to compensate for '''network jitter'''.
- '''''latency=100''''' – Sets a '''buffer delay''' of 100 milliseconds.
* '''rtph264depay''' – Extracts raw H.264 video from the RTP stream.
* '''avdec_h264''' – Decodes the H.264 video stream.
* '''videoconvert''' – Ensures compatibility before displaying the video.
* '''autovideosink sync=false''' – Displays the video, '''disabling synchronization''' for lower latency.

'''Use case:''' '''Receiving an RTP video stream''' over UDP.

=== Playing the RTP Receiver ===
<pre>
gst-client pipeline_play udp_receiver
</pre>

'''Use case:''' Starts the RTP receiver pipeline.

=== Stopping the RTP Receiver ===
<pre>
gst-client pipeline_stop udp_receiver
</pre>

'''Use case:''' Stops the RTP receiver pipeline without deleting it.

=== Deleting the RTP Receiver Pipeline ===
<pre>
gst-client pipeline_delete udp_receiver
</pre>

'''Use case:''' Removes the RTP receiver pipeline.

== Stopping GStreamer Daemon ==
To stop the GStreamer Daemon:
<pre>
gstd -k
</pre>

'''Use case:''' Terminates the running GStreamer Daemon (`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 ==
== Summary ==
GStreamer Daemon enables '''remote control of pipelines''' via <code>gst-client</code>.
GStreamer Daemon enables '''remote control of pipelines''' via <code>gst-client</code>.


Line 154: Line 228:
| '''Embedded System Friendly''' || Works efficiently with TCP and UNIX socket connections
| '''Embedded System Friendly''' || Works efficiently with TCP and UNIX socket connections
|}
|}


= 🏗 Need a Solution for Your Project? =
Are you looking for ways to:

✅ Optimize your '''embedded system''' for better performance?

✅ Integrate '''AI and computer vision''' into your products?

✅ Improve '''multimedia processing''' for real-time applications?

✅ Develop a '''robust and scalable''' web platform?

Our team has helped businesses across multiple industries solve these challenges.

📩 '''Let’s collaborate!''' Contact us at '''[support@proventusnova.com](mailto:support@proventusnova.com)''' or visit '''[ProventusNova.com](https://proventusnova.com)''' to discuss your project. -->

Latest revision as of 03:50, 2 March 2025

GStreamer Daemon (GstD)

GStreamer Daemon (GstD) is a service that enables remote control of GStreamer pipelines via gst-client. It allows:

  • Remote pipeline management – Start, stop, modify pipelines dynamically.
  • Multi-client access – Multiple users can control pipelines simultaneously.
  • Embedded & network control – Use gst-client to manage pipelines over TCP or UNIX sockets.
  • Low-latency communication – Ideal for real-time media applications.

Installing GStreamer Daemon (`gstd`)

Before installing GStreamer Daemon, 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-tools 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

GLib & D-Bus Dependencies

sudo apt install -y libglib2.0-dev libdbus-1-dev libgirepository1.0-dev python3-gi

Daemon & Networking Libraries

sudo apt install -y libdaemon-dev libsoup2.4-dev

JSON & Editing Support

sudo apt install -y libjansson-dev libedit-dev

Debugging Tools

sudo apt install -y valgrind

Installing and Running GStreamer Daemon

To install GStreamer Daemon:

git clone https://gitlab.freedesktop.org/gstreamer/gstd.git
cd gstd
meson build
ninja -C build
sudo ninja -C build install

Verify installation:

gstd --version

To start the daemon:

gstd -e --tcp-base-port=5000

Note: The -e flag enables execution mode, and --tcp-base-port sets the TCP control port.

Controlling GStreamer Daemon with gst-client

Each command follows this format:

gst-client COMMAND pipeline_name "PIPELINE_DESCRIPTION"

Creating a Pipeline

gst-client pipeline_create test_pipeline "videotestsrc ! videoconvert ! autovideosink"

Parameters:

  • pipeline_create – Creates a new pipeline.
  • test_pipeline – Pipeline name (identifier).
  • Pipeline elements:
 - videotestsrc – Generates test video.
 - videoconvert – Ensures format compatibility.
 - autovideosink – Displays video output.

Use case: Used for testing video playback.

Starting a Pipeline

gst-client pipeline_play test_pipeline

Use case: Runs an existing paused pipeline.

Stopping a Pipeline

gst-client pipeline_stop test_pipeline

Use case: Pauses pipeline execution without deleting it.

Deleting a Pipeline

gst-client pipeline_delete test_pipeline

Use case: Frees up resources when a pipeline is no longer needed.

Example: Transmitting an RTP Stream

gst-client pipeline_create udp_stream "videotestsrc is-live=true pattern=ball ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=ultrafast ! rtph264pay ! udpsink host=127.0.0.1 port=5002"

Parameters:

  • pipeline_create udp_stream – Creates a new pipeline named udp_stream.
  • videotestsrc is-live=true pattern=ball – Generates a moving ball pattern as a live video source.
 - is-live=true – Ensures the video source behaves like a real-time stream.
 - pattern=ball – Uses a bouncing ball as the test video pattern.
  • videoconvert – Ensures compatibility with encoders and sinks.
  • x264enc tune=zerolatency bitrate=500 speed-preset=ultrafast – Encodes video into H.264 format with low latency.
 - tune=zerolatency – Optimizes the encoding for minimal delay.
 - bitrate=500 – Sets the bitrate to 500 kbps.
 - speed-preset=ultrafast – Uses the fastest encoding preset.
  • rtph264pay – Converts H.264 video into RTP packets for network transmission.
  • udpsink host=127.0.0.1 port=5002 – Sends the RTP stream to UDP port 5002 on localhost.

Use case: Broadcasting an RTP stream over UDP.

Playing the RTP Transmission

gst-client pipeline_play udp_stream

Use case: Starts broadcasting the RTP stream.

Stopping the RTP Transmission

gst-client pipeline_stop udp_stream

Use case: Stops broadcasting the RTP stream without deleting it.

Deleting the RTP Transmission Pipeline

gst-client pipeline_delete udp_stream

Use case: Removes the RTP transmission pipeline.

Example: Receiving an RTP Stream

gst-client pipeline_create udp_receiver "udpsrc port=5002 ! application/x-rtp, encoding-name=H264 ! rtpjitterbuffer latency=100 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false"

Parameters:

  • pipeline_create udp_receiver – Creates a new pipeline named udp_receiver.
  • udpsrc port=5002 – Listens on UDP port 5002 for incoming RTP packets.
  • application/x-rtp, encoding-name=H264 – Declares the media format as RTP with H.264 encoding.
  • rtpjitterbuffer latency=100 – Buffers packets to compensate for network jitter.
 - latency=100 – Sets a buffer delay of 100 milliseconds.
  • rtph264depay – Extracts raw H.264 video from the RTP stream.
  • avdec_h264 – Decodes the H.264 video stream.
  • videoconvert – Ensures compatibility before displaying the video.
  • autovideosink sync=false – Displays the video, disabling synchronization for lower latency.

Use case: Receiving an RTP video stream over UDP.

Playing the RTP Receiver

gst-client pipeline_play udp_receiver

Use case: Starts the RTP receiver pipeline.

Stopping the RTP Receiver

gst-client pipeline_stop udp_receiver

Use case: Stops the RTP receiver pipeline without deleting it.

Deleting the RTP Receiver Pipeline

gst-client pipeline_delete udp_receiver

Use case: Removes the RTP receiver pipeline.

Stopping GStreamer Daemon

To stop the GStreamer Daemon:

gstd -k

Use case: Terminates the running GStreamer Daemon (`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 Daemon enables remote control of pipelines via gst-client.

GStreamer Daemon Key Features
Feature Description
Remote Pipeline Control Manage GStreamer pipelines via gst-client
Dynamic Modification Add/remove elements in real-time
Multi-Client Access Multiple users can control pipelines
Embedded System Friendly Works efficiently with TCP and UNIX socket connections


🏗 Need a Solution for Your Project?

Are you looking for ways to:

✅ Optimize your embedded system for better performance?

✅ Integrate AI and computer vision into your products?

✅ Improve multimedia processing for real-time applications?

✅ Develop a robust and scalable web platform?

Our team has helped businesses across multiple industries solve these challenges.

📩 Let’s collaborate! Contact us at [support@proventusnova.com](mailto:support@proventusnova.com) or visit [ProventusNova.com](https://proventusnova.com) to discuss your project. -->