1 .TH "GStreamer" "1" "May 2007"
3 gst\-launch \- build and run a GStreamer pipeline
5 \fBgst\-launch\fR \fI[OPTION...]\fR PIPELINE\-DESCRIPTION
8 \fIgst\-launch\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.
15 For a complete description of possible PIPELINE-DESCRIPTIONS see the section
16 \fIpipeline description\fR below or consult the GStreamer documentation.
18 Please note that \fIgst\-launch\fP is primarily a debugging tool for
19 developers and users. You should not build applications on top of it. For
20 applications, use the gst_parse_launch() function of the GStreamer API as an
21 easy way to construct pipelines from pipeline descriptions.
25 \fIgst\-launch\fP accepts the following options:
28 Print help synopsis and available FLAGS
31 Output status information and property notifications
34 Do not print any progress information
37 Output messages posted on the pipeline's bus
40 Output tags (also known as metadata)
42 .B \-e, \-\-eos\-on\-shutdown
43 Force an EOS event on sources before shutting the pipeline down. This is
44 useful to make sure muxers create readable files when a muxing pipeline is
45 shut down forcefully via Control-C.
48 Gather and print index statistics. This is mostly useful for playback or
52 Do not install a fault handler
55 Print memory allocation traces. The feature must be enabled at compile time to
60 .SH "GSTREAMER OPTIONS"
62 \fIgst\-launch\fP also accepts the following options that are common
63 to all GStreamer applications:
66 Prints the version string of the \fIGStreamer\fP core library.
68 .B \-\-gst\-fatal\-warnings
69 Causes \fIGStreamer\fP to abort if a warning message occurs. This is equivalent
70 to setting the environment variable G_DEBUG to 'fatal_warnings' (see the
71 section \fIenvironment variables\fR below for further information).
73 .B \-\-gst\-debug=STRING
74 A comma separated list of category_name:level pairs to specify debugging levels
75 for each category. Level is in the range 0-9 where 0 will show no messages, and
76 9 will show all messages. The wildcard * can be used to match category names.
77 Note that the order of categories and levels is important, wildcards at the
78 end may override levels set earlier. The log levels are: 1=ERROR, 2=WARNING,
79 3=FIXME, 4=INFO, 5=DEBUG, 6=LOG, 7=TRACE, 9=MEMDUMP. Since GStreamer 1.2 one
80 can also use the debug level names, e.g. \-\-gst\-debug=*sink:LOG. A full
81 description of the various debug levels can be found in the GStreamer core
82 library API documentation, in the "Running GStreamer Applications" section.
84 Use \-\-gst\-debug\-help to show category names
87 GST_CAT:5,GST_ELEMENT_*:3,oggdemux:5
90 .B \-\-gst\-debug\-level=LEVEL
91 Sets the threshold for printing debugging messages. A higher level
92 will print more messages. The useful range is 0-9, with the default
93 being 0. Level 6 (LOG level) will show all information that is usually
94 required for debugging purposes. Higher levels are only useful in very
95 specific cases. See above for the full list of levels.
97 .B \-\-gst\-debug\-no\-color
98 \fIGStreamer\fP normally prints debugging messages so that the
99 messages are color-coded when printed to a terminal that handles
100 ANSI escape sequences. Using this option causes \fIGStreamer\fP
101 to print messages without color. Setting the \fBGST_DEBUG_NO_COLOR\fR
102 environment variable will achieve the same thing.
104 .B \-\-gst\-debug\-disable
107 .B \-\-gst\-debug\-help
108 Prints a list of available debug categories and their default debugging level.
110 .B \-\-gst\-plugin\-spew
111 \fIGStreamer\fP info flags to set
112 Enable printout of errors while loading \fIGStreamer\fP plugins
114 .B \-\-gst\-plugin\-path=PATH
115 Add directories separated with ':' to the plugin search path
117 .B \-\-gst\-plugin\-load=PLUGINS
118 Preload plugins specified in a comma-separated list. Another way to specify
119 plugins to preload is to use the environment variable GST_PLUGIN_PATH
121 .SH "PIPELINE DESCRIPTION"
123 A pipeline consists \fIelements\fR and \fIlinks\fR. \fIElements\fR can be put
124 into \fIbins\fR of different sorts. \fIElements\fR, \fIlinks\fR and \fIbins\fR
125 can be specified in a pipeline description in any order.
129 ELEMENTTYPE \fI[PROPERTY1 ...]\fR
131 Creates an element of type ELEMENTTYPE and sets the PROPERTIES.
137 Sets the property to the specified value. You can use \fBgst\-inspect\fR(1) to
138 find out about properties and allowed values of different elements.
140 Enumeration properties can be set by name, nick or value.
144 \fI[BINTYPE.]\fR ( \fI[PROPERTY1 ...]\fR PIPELINE-DESCRIPTION )
147 Specifies that a bin of type BINTYPE is created and the given properties are
148 set. Every element between the braces is put into the bin. Please note the dot
149 that has to be used after the BINTYPE. You will almost never need this
150 functionality, it is only really useful for applications using the
151 gst_launch_parse() API with 'bin' as bintype. That way it is possible to build
152 partial pipelines instead of a full-fledged top-level pipeline.
156 \fI[[SRCELEMENT].[PAD1,...]]\fR ! \fI[[SINKELEMENT].[PAD1,...]]\fR
157 \fI[[SRCELEMENT].[PAD1,...]]\fR ! CAPS ! \fI[[SINKELEMENT].[PAD1,...]]\fR
159 Links the element with name SRCELEMENT to the element with name SINKELEMENT,
160 using the caps specified in CAPS as a filter.
161 Names can be set on elements with the name property. If the name is omitted, the
162 element that was specified directly in front of or after the link is used. This
163 works across bins. If a padname is given, the link is done with these pads. If
164 no pad names are given all possibilities are tried and a matching pad is used.
165 If multiple padnames are given, both sides must have the same number of pads
166 specified and multiple links are done in the given order.
168 So the simplest link is a simple exclamation mark, that links the element to
169 the left of it to the element right of it.
174 MEDIATYPE \fI[, PROPERTY[, PROPERTY ...]]]\fR \fI[; CAPS[; CAPS ...]]\fR
176 Creates a capability with the given media type and optionally with given
177 properties. The media type can be escaped using " or '.
178 If you want to chain caps, you can add more caps in the same format afterwards.
182 NAME=\fI[(TYPE)]\fRVALUE
184 in lists and ranges: \fI[(TYPE)]\fRVALUE
186 Sets the requested property in capabilities. The name is an alphanumeric value
187 and the type can have the following case-insensitive values:
189 - \fBi\fR or \fBint\fR for integer values or ranges
191 - \fBf\fR or \fBfloat\fR for float values or ranges
193 - \fBb\fR, \fBbool\fR or \fBboolean\fR for boolean values
195 - \fBs\fR, \fBstr\fR or \fBstring\fR for strings
197 - \fBfraction\fR for fractions (framerate, pixel-aspect-ratio)
199 - \fBl\fR or \fBlist\fR for lists
201 If no type was given, the following order is tried: integer, float, boolean,
204 Integer values must be parsable by \fBstrtol()\fP, floats by \fBstrtod()\fP. FOURCC values may
205 either be integers or strings. Boolean values are (case insensitive) \fIyes\fR,
206 \fIno\fR, \fItrue\fR or \fIfalse\fR and may like strings be escaped with " or '.
208 Ranges are in this format: [ VALUE, VALUE ]
210 Lists use this format: { VALUE \fI[, VALUE ...]\fR }
212 .SH "PIPELINE EXAMPLES"
214 The examples below assume that you have the correct plug-ins available.
215 In general, "osssink" can be substituted with another audio output
216 plug-in such as "esdsink", "alsasink", "osxaudiosink", or "artsdsink".
217 Likewise, "xvimagesink" can be substituted with "ximagesink", "sdlvideosink",
218 "osxvideosink", or "aasink". Keep in mind though that different sinks might
219 accept different formats and even the same sink might accept different formats
220 on different machines, so you might need to add converter elements like
221 audioconvert and audioresample (for audio) or videoconvert (for video)
222 in front of the sink to make things work.
227 gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! audioresample ! osssink
229 Play the mp3 music file "music.mp3" using a libmad-based plug-in and
230 output to an OSS device
233 gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! osssink
235 Play an Ogg Vorbis format file
238 gst\-launch gnomevfssrc location=music.mp3 ! mad ! osssink
241 gst\-launch gnomevfssrc location=http://domain.com/music.mp3 ! mad ! audioconvert ! audioresample ! osssink
243 Play an mp3 file or an http stream using GNOME\-VFS
246 gst\-launch gnomevfssrc location=smb://computer/music.mp3 ! mad ! audioconvert ! audioresample ! osssink
248 Use GNOME\-VFS to play an mp3 file located on an SMB server
253 gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
255 Convert an mp3 music file to an Ogg Vorbis file
258 gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! flacenc ! filesink location=test.flac
260 Convert to the FLAC format
265 gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! audioresample ! osssink
267 Plays a .WAV file that contains raw audio data (PCM).
270 gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
273 gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! lame ! filesink location=music.mp3
275 Convert a .WAV file containing raw audio data into an Ogg Vorbis or mp3 file
278 gst\-launch cdparanoiasrc mode=continuous ! audioconvert ! lame ! id3v2mux ! filesink location=cd.mp3
280 rips all tracks from compact disc and convert them into a single mp3 file
283 gst\-launch cdparanoiasrc track=5 ! audioconvert ! lame ! id3v2mux ! filesink location=track5.mp3
285 rips track 5 from the CD and converts it into a single mp3 file
287 Using \fBgst\-inspect\fR(1), it is possible to discover settings like the above
288 for cdparanoiasrc that will tell it to rip the entire cd or only tracks of it.
289 Alternatively, you can use an URI and gst-launch will find an element (such as
290 cdparanoia) that supports that protocol for you, e.g.:
292 gst\-launch cdda://5 ! lame vbr=new vbr-quality=6 ! filesink location=track5.mp3
295 gst\-launch osssrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=input.ogg
297 records sound from your audio input and encodes it into an ogg file
302 gst\-launch filesrc location=JB_FF9_TheGravityOfLove.mpg ! dvddemux ! mpeg2dec ! xvimagesink
304 Display only the video portion of an MPEG-1 video file, outputting to
308 gst\-launch filesrc location=/flflfj.vob ! dvddemux ! mpeg2dec ! sdlvideosink
310 Display the video portion of a .vob file (used on DVDs), outputting to
314 gst\-launch filesrc location=movie.mpg ! dvddemux name=demuxer demuxer. ! queue ! mpeg2dec ! sdlvideosink demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
316 Play both video and audio portions of an MPEG movie
319 gst\-launch filesrc location=movie.mpg ! mpegdemux name=demuxer demuxer. ! queue ! mpeg2dec ! videoconvert ! sdlvideosink demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
321 Play an AVI movie with an external text subtitle stream
323 This example also shows how to refer to specific pads by name if an element
324 (here: textoverlay) has multiple sink or source pads.
327 gst\-launch textoverlay name=overlay ! videoconvert ! videoscale ! autovideosink filesrc location=movie.avi ! decodebin2 ! videoconvert ! overlay.video_sink filesrc location=movie.srt ! subparse ! overlay.text_sink
330 Play an AVI movie with an external text subtitle stream using playbin2
333 gst\-launch playbin2 uri=file:///path/to/movie.avi suburi=file:///path/to/movie.srt
337 Stream video using RTP and network elements.
340 gst\-launch 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
342 This command would be run on the transmitter
345 gst\-launch udpsrc port=5000 ! application/x-rtp, clock-rate=90000,payload=96 ! rtph263pdepay queue-delay=0 ! ffdec_h263 ! xvimagesink
347 Use this command on the receiver
352 gst\-launch -v fakesrc num-buffers=16 ! fakesink
354 Generate a null stream and ignore it (and print out details).
357 gst\-launch audiotestsrc ! audioconvert ! audioresample ! osssink
359 Generate a pure sine tone to test the audio output
362 gst\-launch videotestsrc ! xvimagesink
365 gst\-launch videotestsrc ! ximagesink
367 Generate a familiar test pattern to test the video output
371 You can use the decodebin element to automatically select the right elements
372 to get a working pipeline.
375 gst\-launch filesrc location=musicfile ! decodebin ! audioconvert ! audioresample ! osssink
377 Play any supported audio format
380 gst\-launch filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! osssink decoder. ! videoconvert ! xvimagesink
382 Play any supported video format with video and audio output. Threads are used
383 automatically. To make this even easier, you can use the playbin element:
386 gst\-launch playbin uri=file:///home/joe/foo.avi
390 .B Filtered connections
392 These examples show you how to use filtered caps.
395 gst\-launch videotestsrc ! 'video/x-raw,format=YUY2;video/x-raw,format=YV12' ! xvimagesink
397 Show a test image and use the YUY2 or YV12 video format for this.
400 gst\-launch osssrc ! 'audio/x-raw,rate=[32000,64000],format={S16LE,S24LE,S32LE}' ! wavenc ! filesink location=recording.wav
402 record audio and write it to a .wav file. Force usage of signed 16 to 32 bit
403 samples and a sample rate between 32kHz and 64KHz.
406 .SH "ENVIRONMENT VARIABLES"
409 Comma-separated list of debug categories and levels (e.g.
410 GST_DEBUG=totem:4,typefind:5). '*' is allowed as a wildcard as part of
411 debug category names (e.g. GST_DEBUG=*sink:6,*audio*:6). Since 1.2.0 it is
412 also possible to specify the log level by name (1=ERROR, 2=WARN, 3=FIXME,
413 4=INFO, 5=DEBUG, 6=LOG, 7=TRACE, 9=MEMDUMP) (e.g. GST_DEBUG=*audio*:LOG)
415 \fBGST_DEBUG_NO_COLOR\fR
416 When this environment variable is set, coloured debug output is disabled.
418 \fBGST_DEBUG_DUMP_DOT_DIR\fR
419 When set to a filesystem path, store 'dot' files of pipeline graphs there.
420 These can then later be converted into an image using the 'dot' utility from
421 the graphviz set of tools, like this: dot foo.dot -Tsvg -o foo.svg (png or jpg
422 are also possible as output format)
425 Path of the plugin registry file. Default is
426 ~/.cache/gstreamer-GST_API_VERSION/registry-CPU.bin where CPU is the
427 machine/cpu type GStreamer was compiled for, e.g. 'i486', 'i686', 'x86-64',
428 'ppc', etc. (check the output of "uname -i" and "uname -m" for details).
430 \fBGST_REGISTRY_UPDATE\fR
431 Set to "no" to force GStreamer to assume that no plugins have changed,
432 been added or been removed. This will make GStreamer skip the initial check
433 whether a rebuild of the registry cache is required or not. This may be useful
434 in embedded environments where the installed plugins never change. Do not
435 use this option in any other setup.
437 \fBGST_PLUGIN_PATH\fR
438 Specifies a list of directories to scan for additional plugins.
439 These take precedence over the system plugins.
441 \fBGST_PLUGIN_SYSTEM_PATH\fR
442 Specifies a list of plugins that are always loaded by default. If not set,
443 this defaults to the system-installed path, and the plugins installed in the
444 user's home directory
447 Set this variable to a file path to redirect all GStreamer debug
448 messages to this file. If left unset, debug messages with be output
449 unto the standard error.
452 Useful Orc environment variable. Set ORC_CODE=debug to enable debuggers
453 such as gdb to create useful backtraces from Orc-generated code. Set
454 ORC_CODE=backup or ORC_CODE=emulate if you suspect Orc's SIMD code
455 generator is producing incorrect code. (Quite a few important
456 GStreamer plugins like videotestsrc, audioconvert or audioresample use Orc).
459 Useful GLib environment variable. Set G_DEBUG=fatal_warnings to make
460 GStreamer programs abort when a critical warning such as an assertion failure
461 occurs. This is useful if you want to find out which part of the code caused
462 that warning to be triggered and under what circumstances. Simply set G_DEBUG
463 as mentioned above and run the program in gdb (or let it core dump). Then get
464 a stack trace in the usual way.
468 ~/.cache/gstreamer-GST_API_VERSION/registry-*.bin
469 The plugin cache; can be deleted at any time, will be re-created
470 automatically when it does not exist yet or plugins change. Based on
471 XDG_CACHE_DIR, so may be in a different location than the one suggested.
474 .BR gst\-inspect\-GST_API_VERSION (1),
475 .BR gst\-launch\-GST_API_VERSION (1),
477 The GStreamer team at http://gstreamer.freedesktop.org/