From ProventusNova DeveloperWiki
Revision as of 12:51, 24 February 2025 by Cj (talk | contribs)

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.

⚙️ GStreamer Daemon (`gstd`) Dependencies

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.

🎛️ gst-client Options

gst-client is used to interact with gstd. It provides multiple options:

💻 Basic Commands

  • gst-client -h, --help → Show help options.
  • gst-client -v, --version → Print the current version of gstd-client.
  • gst-client -i, --interactive → Enter interactive mode after executing commands.
  • gst-client -f script → Execute commands from a file.

🔗 Connection Options

  • gst-client -p, --tcp-port=PORT → Connect via TCP (default: 5000).
  • gst-client -a, --tcp-address=ADDRESS → Specify the IP address (default: localhost).
  • gst-client -u, --unix → Use UNIX socket instead of TCP.
  • gst-client -b, --unix-base-path=PATH → Set UNIX socket path (default: gstd_unix_socket).

📡 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: Receiving an RTP Stream

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"

Use case: Receives real-time RTP video via UDP port 5004.

📊 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