1 .TH "GStreamer" "1" "May 2007"
3 gst\-launch\-1.0 \- build and run a GStreamer pipeline
5 \fBgst\-launch\-1.0\fR \fI[OPTION...]\fR PIPELINE\-DESCRIPTION
8 \fIgst\-launch\-1.0\fP is a tool that builds and runs basic
9 \fIGStreamer\fP pipelines.
11 In simple form, a PIPELINE\-DESCRIPTION is a list of
12 elements separated by exclamation marks (!). Properties may be appended to
13 elements, in the form \fIproperty=value\fR. A "preset" can also be set using
14 the \fI@preset=<preset name>\fR syntax.
16 For a complete description of possible PIPELINE-DESCRIPTIONS see the section
17 \fIpipeline description\fR below or consult the GStreamer documentation.
19 Please note that \fIgst\-launch\-1.0\fP is primarily a debugging tool for
20 developers and users. You should not build applications on top of it. For
21 applications, use the gst_parse_launch() function of the GStreamer API as an
22 easy way to construct pipelines from pipeline descriptions.
26 \fIgst\-launch\-1.0\fP accepts the following options:
29 Print help synopsis and available FLAGS
32 Output status information and property notifications
35 Do not print any progress information
38 Output messages posted on the pipeline's bus
41 Output tags (also known as metadata)
43 .B \-e, \-\-eos\-on\-shutdown
44 Force an EOS event on sources before shutting the pipeline down. This is
45 useful to make sure muxers create readable files when a muxing pipeline is
46 shut down forcefully via Control-C.
49 Gather and print index statistics. This is mostly useful for playback or
53 Do not install a fault handler
56 Print memory allocation traces. The feature must be enabled at compile time to
60 Do not print current position of pipeline.
61 If this option is unspecified, the position will be printed when stdout is a TTY.
62 To enable printing position when stdout is not a TTY,
63 use "force-position" option.
65 .B \-\-force\-position
66 Allow printing current position of pipeline even if stdout is not a TTY.
67 This option has no effect if the "no-position" option is specified.
71 .SH "GSTREAMER OPTIONS"
73 \fIgst\-launch\-1.0\fP also accepts the following options that are common
74 to all GStreamer applications:
77 Prints the version string of the \fIGStreamer\fP core library.
79 .B \-\-gst\-fatal\-warnings
80 Causes \fIGStreamer\fP to abort if a warning message occurs. This is equivalent
81 to setting the environment variable G_DEBUG to 'fatal_warnings' (see the
82 section \fIenvironment variables\fR below for further information).
84 .B \-\-gst\-debug=STRING
85 A comma separated list of category_name:level pairs to specify debugging levels
86 for each category. Level is in the range 0-9 where 0 will show no messages, and
87 9 will show all messages. The wildcard * can be used to match category names.
88 Note that the order of categories and levels is important, wildcards at the
89 end may override levels set earlier. The log levels are: 1=ERROR, 2=WARNING,
90 3=FIXME, 4=INFO, 5=DEBUG, 6=LOG, 7=TRACE, 9=MEMDUMP. Since GStreamer 1.2 one
91 can also use the debug level names, e.g. \-\-gst\-debug=*sink:LOG. A full
92 description of the various debug levels can be found in the GStreamer core
93 library API documentation, in the "Running GStreamer Applications" section.
95 Use \-\-gst\-debug\-help to show category names
98 GST_CAT:5,GST_ELEMENT_*:3,oggdemux:5
101 .B \-\-gst\-debug\-level=LEVEL
102 Sets the threshold for printing debugging messages. A higher level
103 will print more messages. The useful range is 0-9, with the default
104 being 0. Level 6 (LOG level) will show all information that is usually
105 required for debugging purposes. Higher levels are only useful in very
106 specific cases. See above for the full list of levels.
108 .B \-\-gst\-debug\-no\-color
109 \fIGStreamer\fP normally prints debugging messages so that the
110 messages are color-coded when printed to a terminal that handles
111 ANSI escape sequences. Using this option causes \fIGStreamer\fP
112 to print messages without color. Setting the \fBGST_DEBUG_NO_COLOR\fR
113 environment variable will achieve the same thing.
115 .B \-\-gst\-debug\-color\-mode
116 \fIGStreamer\fP normally prints debugging messages so that the
117 messages are color-coded when printed to a terminal that handles
118 ANSI escape sequences (on *nix), or uses W32 console API to color the
119 messages printed into a console (on W32). Using this option causes
120 \fIGStreamer\fP to print messages without color ('off' or 'disable'),
121 print messages with default colors ('on' or 'auto'), or print messages
122 using ANSI escape sequences for coloring ('unix'). Setting the
123 \fBGST_DEBUG_COLOR_MODE\fR environment variable will achieve the same thing.
125 .B \-\-gst\-debug\-disable
128 .B \-\-gst\-debug\-help
129 Prints a list of available debug categories and their default debugging level.
131 .B \-\-gst\-plugin\-spew
132 \fIGStreamer\fP info flags to set
133 Enable printout of errors while loading \fIGStreamer\fP plugins
135 .B \-\-gst\-plugin\-path=PATH
136 Add directories separated with ':' to the plugin search path
138 .B \-\-gst\-plugin\-load=PLUGINS
139 Preload plugins specified in a comma-separated list. Another way to specify
140 plugins to preload is to use the environment variable GST_PLUGIN_PATH
142 .SH "PIPELINE DESCRIPTION"
144 A pipeline consists \fIelements\fR and \fIlinks\fR. \fIElements\fR can be put
145 into \fIbins\fR of different sorts. \fIElements\fR, \fIlinks\fR and \fIbins\fR
146 can be specified in a pipeline description in any order.
150 ELEMENTTYPE \fI[PROPERTY1 ...]\fR
152 Creates an element of type ELEMENTTYPE and sets the PROPERTIES.
158 Sets the property to the specified value. You can use \fBgst\-inspect\-1.0\fR(1) to
159 find out about properties and allowed values of different elements.
161 Enumeration properties can be set by name, nick or value.
165 @preset=<preset name> ...
167 Sets the preset on the element. you can use \fbgst\-inspect\-1.0\fr(1) to
168 find out what presets are available for a specific element.
172 \fI[BINTYPE.]\fR ( \fI[PROPERTY1 ...]\fR PIPELINE-DESCRIPTION )
175 Specifies that a bin of type BINTYPE is created and the given properties are
176 set. Every element between the braces is put into the bin. Please note the dot
177 that has to be used after the BINTYPE. You will almost never need this
178 functionality, it is only really useful for applications using the
179 gst_launch_parse() API with 'bin' as bintype. That way it is possible to build
180 partial pipelines instead of a full-fledged top-level pipeline.
184 \fI[[SRCELEMENT].[PAD1,...]]\fR ! \fI[[SINKELEMENT].[PAD1,...]]\fR
185 \fI[[SRCELEMENT].[PAD1,...]]\fR ! CAPS ! \fI[[SINKELEMENT].[PAD1,...]]\fR
186 \fI[[SRCELEMENT].[PAD1,...]]\fR : \fI[[SINKELEMENT].[PAD1,...]]\fR
187 \fI[[SRCELEMENT].[PAD1,...]]\fR : CAPS : \fI[[SINKELEMENT].[PAD1,...]]\fR
189 Links the element with name SRCELEMENT to the element with name SINKELEMENT,
190 using the caps specified in CAPS as a filter.
191 Names can be set on elements with the name property. If the name is omitted, the
192 element that was specified directly in front of or after the link is used. This
193 works across bins. If a padname is given, the link is done with these pads. If
194 no pad names are given all possibilities are tried and a matching pad is used.
195 If multiple padnames are given, both sides must have the same number of pads
196 specified and multiple links are done in the given order.
198 So the simplest link is a simple exclamation mark, that links the element to
199 the left of it to the element right of it.
201 Linking using the : operator attempts to link all possible pads between
207 MEDIATYPE \fI[, PROPERTY[, PROPERTY ...]]]\fR \fI[; CAPS[; CAPS ...]]\fR
209 Creates a capability with the given media type and optionally with given
210 properties. The media type can be escaped using " or '.
211 If you want to chain caps, you can add more caps in the same format afterwards.
215 NAME=\fI[(TYPE)]\fRVALUE
217 in lists and ranges: \fI[(TYPE)]\fRVALUE
219 Sets the requested property in capabilities. The name is an alphanumeric value
220 and the type can have the following case-insensitive values:
222 - \fBi\fR or \fBint\fR for integer values or ranges
224 - \fBf\fR or \fBfloat\fR for float values or ranges
226 - \fBb\fR, \fBbool\fR or \fBboolean\fR for boolean values
228 - \fBs\fR, \fBstr\fR or \fBstring\fR for strings
230 - \fBfraction\fR for fractions (framerate, pixel\-aspect\-ratio)
232 - \fBl\fR or \fBlist\fR for lists
234 If no type was given, the following order is tried: integer, float, boolean,
237 Integer values must be parsable by \fBstrtol()\fP, floats by \fBstrtod()\fP. FOURCC values may
238 either be integers or strings. Boolean values are (case insensitive) \fIyes\fR,
239 \fIno\fR, \fItrue\fR or \fIfalse\fR and may like strings be escaped with " or '.
241 Ranges are in this format: [ VALUE, VALUE ]
243 Lists use this format: { VALUE \fI[, VALUE ...]\fR }
245 .SH "PIPELINE EXAMPLES"
247 The examples below assume that you have the correct plug-ins available.
248 In general, "pulsesink" can be substituted with another audio output
249 plug-in such as "alsasink" or "osxaudiosink"
250 Likewise, "xvimagesink" can be substituted with "ximagesink", "glimagesink",
251 or "osxvideosink". Keep in mind though that different sinks might
252 accept different formats and even the same sink might accept different formats
253 on different machines, so you might need to add converter elements like
254 audioconvert and audioresample (for audio) or videoconvert (for video)
255 in front of the sink to make things work.
259 Play the mp3 music file "music.mp3" using a libmpg123-based plug-in and
260 output to an Pulseaudio device
263 gst\-launch\-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
265 Play an Ogg Vorbis format file
268 gst\-launch\-1.0 filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! pulsesink
270 Play an mp3 file or an http stream using GIO
273 gst\-launch\-1.0 giosrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! pulsesink
276 gst\-launch\-1.0 giosrc location=http://domain.com/music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
278 Use GIO to play an mp3 file located on an SMB server
281 gst\-launch\-1.0 giosrc location=smb://computer/music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
285 Convert an mp3 music file to an Ogg Vorbis file
288 gst\-launch\-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
290 Convert to the FLAC format
293 gst\-launch\-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! flacenc ! filesink location=test.flac
297 Plays a .WAV file that contains raw audio data (PCM).
300 gst\-launch\-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! audioresample ! pulsesink
302 Convert a .WAV file containing raw audio data into an Ogg Vorbis or mp3 file
305 gst\-launch\-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
308 gst\-launch\-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! lamemp3enc ! filesink location=music.mp3
310 Rips all tracks from compact disc and convert them into a single mp3 file
313 gst\-launch\-1.0 cdparanoiasrc mode=continuous ! audioconvert ! lamemp3enc ! mpegaudioparse ! id3v2mux ! filesink location=cd.mp3
315 Rips track 5 from the CD and converts it into a single mp3 file
318 gst\-launch\-1.0 cdparanoiasrc track=5 ! audioconvert ! lamemp3enc ! mpegaudioparse ! id3v2mux ! filesink location=track5.mp3
320 Using \fBgst\-inspect\-1.0\fR(1), it is possible to discover settings like the above
321 for cdparanoiasrc that will tell it to rip the entire cd or only tracks of it.
322 Alternatively, you can use an URI and gst\-launch\-1.0 will find an element (such as
323 cdparanoia) that supports that protocol for you, e.g.:
325 gst\-launch\-1.0 cdda://5 ! lamemp3enc vbr=new vbr\-quality=6 ! filesink location=track5.mp3
327 Records sound from your audio input and encodes it into an ogg file
330 gst\-launch\-1.0 pulsesrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=input.ogg
334 Display only the video portion of an MPEG-1 video file, outputting to
338 gst\-launch\-1.0 filesrc location=JB_FF9_TheGravityOfLove.mpg ! dvddemux ! mpegvideoparse ! mpeg2dec ! xvimagesink
340 Display the video portion of a .vob file (used on DVDs), outputting to
344 gst\-launch\-1.0 filesrc location=/flflfj.vob ! dvddemux ! mpegvideoparse ! mpeg2dec ! sdlvideosink
346 Play both video and audio portions of an MPEG movie
349 gst\-launch\-1.0 filesrc location=movie.mpg ! dvddemux name=demuxer demuxer. ! queue ! mpegvideoparse ! mpeg2dec ! sdlvideosink demuxer. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
351 Play an AVI movie with an external text subtitle stream
354 gst\-launch\-1.0 filesrc location=movie.mpg ! mpegdemux name=demuxer demuxer. ! queue ! mpegvideoparse ! mpeg2dec ! videoconvert ! sdlvideosink demuxer. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
356 This example also shows how to refer to specific pads by name if an element
357 (here: textoverlay) has multiple sink or source pads.
360 gst\-launch\-1.0 textoverlay name=overlay ! videoconvert ! videoscale ! autovideosink filesrc location=movie.avi ! decodebin ! videoconvert ! overlay.video_sink filesrc location=movie.srt ! subparse ! overlay.text_sink
362 Play an AVI movie with an external text subtitle stream using playbin
365 gst\-launch\-1.0 playbin uri=file:///path/to/movie.avi suburi=file:///path/to/movie.srt
369 Stream video using RTP and network elements.
371 This command would be run on the transmitter
374 gst\-launch\-1.0 v4l2src ! video/x\-raw,width=128,height=96,format=UYVY ! videoconvert ! ffenc_h263 ! video/x\-h263 ! rtph263ppay pt=96 ! udpsink host=192.168.1.1 port=5000
376 Use this command on the receiver
379 gst\-launch\-1.0 udpsrc port=5000 ! application/x\-rtp, clock\-rate=90000,payload=96 ! rtph263pdepay queue\-delay=0 ! ffdec_h263 ! xvimagesink
383 Generate a null stream and ignore it (and print out details).
386 gst\-launch\-1.0 \-v fakesrc num\-buffers=16 ! fakesink
388 Generate a pure sine tone to test the audio output
391 gst\-launch\-1.0 audiotestsrc ! audioconvert ! audioresample ! pulsesink
393 Generate a familiar test pattern to test the video output
396 gst\-launch\-1.0 videotestsrc ! xvimagesink
399 gst\-launch\-1.0 videotestsrc ! ximagesink
403 You can use the decodebin element to automatically select the right elements
404 to get a working pipeline.
406 Play any supported audio format
409 gst\-launch\-1.0 filesrc location=musicfile ! decodebin ! audioconvert ! audioresample ! pulsesink
411 Play any supported video format with video and audio output. Threads are used
412 automatically. To make this even easier, you can use the playbin element:
415 gst\-launch\-1.0 filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! pulsesink decoder. ! videoconvert ! xvimagesink
418 gst\-launch\-1.0 playbin uri=file:///home/joe/foo.avi
421 .B Filtered connections
423 These examples show you how to use filtered caps.
425 Show a test image and use the YUY2 or YV12 video format for this.
428 gst\-launch\-1.0 videotestsrc ! 'video/x\-raw,format=YUY2;video/x\-raw,format=YV12' ! xvimagesink
430 Record audio and write it to a .wav file. Force usage of signed 16 to 32 bit
431 samples and a sample rate between 32kHz and 64KHz.
434 gst\-launch\-1.0 pulsesrc ! 'audio/x\-raw,rate=[32000,64000],format={S16LE,S24LE,S32LE}' ! wavenc ! filesink location=recording.wav
437 .SH "ENVIRONMENT VARIABLES"
440 Comma-separated list of debug categories and levels (e.g.
441 GST_DEBUG=totem:4,typefind:5). '*' is allowed as a wildcard as part of
442 debug category names (e.g. GST_DEBUG=*sink:6,*audio*:6). Since 1.2.0 it is
443 also possible to specify the log level by name (1=ERROR, 2=WARN, 3=FIXME,
444 4=INFO, 5=DEBUG, 6=LOG, 7=TRACE, 9=MEMDUMP) (e.g. GST_DEBUG=*audio*:LOG)
446 \fBGST_DEBUG_NO_COLOR\fR
447 When this environment variable is set, coloured debug output is disabled.
449 \fBGST_DEBUG_DUMP_DOT_DIR\fR
450 When set to a filesystem path, store 'dot' files of pipeline graphs there.
451 These can then later be converted into an image using the 'dot' utility from
452 the graphviz set of tools, like this: dot foo.dot \-Tsvg \-o foo.svg (png or jpg
453 are also possible as output format). There is also a utility called 'xdot'
454 which allows you to view the .dot file directly without converting it first.
456 When the pipeline changes state through NULL to PLAYING and back to NULL, a
457 dot file is generated on each state change. To write a snapshot of the
458 pipeline state, send a SIGHUP to the process.
461 Path of the plugin registry file. Default is
462 ~/.cache/gstreamer\-1.0/registry\-CPU.bin where CPU is the
463 machine/cpu type GStreamer was compiled for, e.g. 'i486', 'i686', 'x86\-64', 'ppc',
464 etc. (check the output of "uname \-i" and "uname \-m" for details).
466 \fBGST_REGISTRY_UPDATE\fR
467 Set to "no" to force GStreamer to assume that no plugins have changed,
468 been added or been removed. This will make GStreamer skip the initial check
469 whether a rebuild of the registry cache is required or not. This may be useful
470 in embedded environments where the installed plugins never change. Do not
471 use this option in any other setup.
473 \fBGST_PLUGIN_PATH\fR
474 Specifies a list of directories to scan for additional plugins.
475 These take precedence over the system plugins.
477 \fBGST_PLUGIN_SYSTEM_PATH\fR
478 Specifies a list of plugins that are always loaded by default. If not set,
479 this defaults to the system-installed path, and the plugins installed in the
480 user's home directory
483 Set this variable to a file path to redirect all GStreamer debug
484 messages to this file. If left unset, debug messages with be output
485 unto the standard error.
488 Useful Orc environment variable. Set ORC_CODE=debug to enable debuggers
489 such as gdb to create useful backtraces from Orc-generated code. Set
490 ORC_CODE=backup or ORC_CODE=emulate if you suspect Orc's SIMD code
491 generator is producing incorrect code. (Quite a few important
492 GStreamer plugins like videotestsrc, audioconvert or audioresample use Orc).
495 Useful GLib environment variable. Set G_DEBUG=fatal_warnings to make
496 GStreamer programs abort when a critical warning such as an assertion failure
497 occurs. This is useful if you want to find out which part of the code caused
498 that warning to be triggered and under what circumstances. Simply set G_DEBUG
499 as mentioned above and run the program in gdb (or let it core dump). Then get
500 a stack trace in the usual way.
504 ~/.cache/gstreamer\-1.0/registry\-*.bin
505 The plugin cache; can be deleted at any time, will be re-created
506 automatically when it does not exist yet or plugins change. Based on
507 XDG_CACHE_DIR, so may be in a different location than the one suggested.
510 .BR gst\-inspect\-1.0 (1),
511 .BR gst\-launch\-1.0 (1),
513 The GStreamer team at http://gstreamer.freedesktop.org/