LinuxCommandLibrary

gst-launch-1.0

Run GStreamer pipelines from command line

TLDR

Play test video in a window

$ gst-launch-1.0 videotestsrc ! autovideosink
copy

Play test audio
$ gst-launch-1.0 audiotestsrc ! autoaudiosink
copy

Play a media file in a window
$ gst-launch-1.0 playbin uri=[protocol]://[host]/[path/to/file]
copy

Re-encode a media file
$ gst-launch-1.0 filesrc location=[path/to/file] ! [file_type]demux ! [codec_type]dec ! [codec_type]enc ! [file_type]mux ! filesink location=[path/to/file]
copy

Stream a file to an RTSP server
$ gst-launch-1.0 filesrc location=[path/to/file] ! rtspclientsink location=rtsp://[host_IP]/[path/to/file]
copy

Force an End Of Stream event if the pipeline is shut down with for containers that require finalization such as mp4
$ gst-launch-1.0 [[-e|--eos-on-shutdown]] videotestsrc ! x264enc ! mp4mux ! filesink location=[path/to/file.mp4]
copy

Multiplex together test video and test audio into a file
$ gst-launch-1.0 [[-e|--eos-on-shutdown]] videotestsrc ! x264enc ! [element_name]. audiotestsrc ! opusenc ! [element_name]. matroskamux name=[element_name] ! filesink location=[path/to/file.mkv]
copy

Dump a pipeline into a .dot file which can then be rendered with tools like dot
$ GST_DEBUG_DUMP_DOT_DIR=[path/to/directory] gst-launch-1.0 [pipeline]
copy

SYNOPSIS

gst-launch-1.0 [OPTION...] [PIPELINE-DESCRIPTION]

PARAMETERS

-v, --verbose
    Output status information and property notifications. Use multiple times for increased verbosity.

-q, --quiet
    Suppress progress information, print only errors.

-m, --messages
    Output status messages and timestamped property notifications.

-t, --trace
    Print memory allocation trace (if enabled at compile time).

-V, --version
    Print version information and exit.

-e, --eos-on-shutdown
    Force end-of-stream on sources before pipeline shutdown.

-M, --list-media-types
    List all raw media types supported by installed plugins.

--help-all
    Show complete list of help options.

--help-gst
    Show GStreamer-specific options.

--help-gst-launch
    Show gst-launch-1.0-specific options.

-?, -h, --help
    Show basic help options.

--no-fault
    Disable installation of fault handler.

DESCRIPTION

gst-launch-1.0 is a versatile command-line utility from the GStreamer multimedia framework designed to build, link, and execute media processing pipelines directly from textual descriptions. It enables quick prototyping, testing, playback, encoding, and streaming without compiling custom applications.

Users specify pipelines using element names separated by !, such as videotestsrc ! videoconvert ! autovideosink. Properties are set with dot notation like filesrc location=/path/to/file.mp4, and pads can be explicitly named for dynamic or complex links (e.g., ! .src_0). The tool automatically handles plugin loading, negotiation of capabilities, and pipeline state changes.

Ideal for developers debugging elements, users testing hardware, or scripting media tasks, it supports verbose logging, message output, and error reporting. GStreamer plugins provide sources (filesrc, udpsrc), filters (videoscale, audioconvert), demuxers, decoders, encoders, muxers, and sinks (xvimagesink, alsasink, rtpmanager). Environment variables like GST_PLUGIN_PATH and GST_DEBUG enhance functionality.

While powerful for ad-hoc use, it prints pipeline graphs and stats, making it indispensable for GStreamer workflows across Linux, Unix, and embedded systems.

CAVEATS

Intended for testing and prototyping, not production; lacks fine-grained control, async handling, and UI integration of custom apps. Use ! for 'sometimes' pads in dynamic links.

PIPELINE SYNTAX

Elements linked by !: element[.padname][.property=value] ! element. Use % for URI escaping, ^ for pad blocking probes.

EXAMPLES

Video test pattern: gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
Play file: gst-launch-1.0 playbin uri=file:///path/video.mp4
Encode audio: gst-launch-1.0 audiotestsrc ! audioconvert ! lamemp3 bitrate=192 ! filesink location=test.mp3

HISTORY

Part of GStreamer project initiated in 1999 by Wim Taymans for cross-platform multimedia. gst-launch-1.0 debuted in early versions for pipeline testing; stabilized in GStreamer 1.0 (2012), with ongoing enhancements for new plugins and features.

SEE ALSO

gst-inspect-1.0(1), gst-typefind-1.0(1), gst-play-1.0(1), gst-validate-1.0(1)

Copied to clipboard