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.
π‘ 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
.
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 |