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
34 Output messages posted on the pipeline's bus
37 Output tags (also known as metadata)
39 .B \-o FILE, \-\-output=FILE
40 Save XML representation of pipeline to FILE and exit
43 Do not install a fault handler
46 Print memory allocation traces. The feature must be enabled at compile time to
51 .SH "GSTREAMER OPTIONS"
53 \fIgst\-launch\fP also accepts the following options that are common
54 to all GStreamer applications:
57 Prints the version string of the \fIGStreamer\fP core library.
59 .B \-\-gst\-fatal\-warnings
60 Causes \fIGStreamer\fP to abort if a warning message occurs. This is equivalent
61 to setting the environment variable G_DEBUG to 'fatal_warnings' (see the
62 section \fIenvironment variables\fR below for further information).
64 .B \-\-gst\-debug=STRING
65 A comma separated list of category_name:level pairs to specify debugging levels
66 for each category. Level is in the range 0-5 where 0 will show no messages, and
67 5 will show all messages. The wildcard * can be used to match category names.
69 Use \-\-gst\-debug\-help to show category names
72 GST_CAT:5,GST_ELEMENT_*:3,oggdemux:5
75 .B \-\-gst\-debug\-level=LEVEL
76 Sets the threshold for printing debugging messages. A higher level
77 will print more messages. The useful range is 0-5, with the default
80 .B \-\-gst\-debug\-no\-color
81 \fIGStreamer\fP normally prints debugging messages so that the
82 messages are color-coded when printed to a terminal that handles
83 ANSI escape sequences. Using this option causes \fIGStreamer\fP
84 to print messages without color. Setting the \fBGST_DEBUG_NO_COLOR\fR
85 environment variable will achieve the same thing.
87 .B \-\-gst\-disable\-debug
90 .B \-\-gst\-debug\-help
91 Prints a list of available debug categories and their default debugging level.
93 .B \-\-gst\-plugin\-spew
94 \fIGStreamer\fP info flags to set
95 Enable printout of errors while loading \fIGStreamer\fP plugins
97 .B \-\-gst\-plugin\-path=PATH
98 Add directories separated with ':' to the plugin search path
100 .B \-\-gst\-plugin\-load=PLUGINS
101 Preload plugins specified in a comma-separated list. Another way to specify
102 plugins to preload is to use the environment variable GST_PLUGIN_PATH
104 .SH "PIPELINE DESCRIPTION"
106 A pipeline consists \fIelements\fR and \fIlinks\fR. \fIElements\fR can be put
107 into \fIbins\fR of different sorts. \fIElements\fR, \fIlinks\fR and \fIbins\fR
108 can be specified in a pipeline description in any order.
112 ELEMENTTYPE \fI[PROPERTY1 ...]\fR
114 Creates an element of type ELEMENTTYPE and sets the PROPERTIES.
120 Sets the property to the specified value. You can use \fBgst\-inspect\fR(1) to
121 find out about properties and allowed values of different elements.
123 Enumeration properties can be set by name, nick or value.
127 \fI[BINTYPE.]\fR ( \fI[PROPERTY1 ...]\fR PIPELINE-DESCRIPTION )
130 Specifies that a bin of type BINTYPE is created and the given properties are
131 set. Every element between the braces is put into the bin. Please note the dot
132 that has to be used after the BINTYPE. You will almost never need this
133 functionality, it is only really useful for applications using the
134 gst_launch_parse() API with 'bin' as bintype. That way it is possible to build
135 partial pipelines instead of a full-fledged top-level pipeline.
139 \fI[[SRCELEMENT].[PAD1,...]]\fR ! \fI[[SINKELEMENT].[PAD1,...]]\fR
140 \fI[[SRCELEMENT].[PAD1,...]]\fR ! CAPS ! \fI[[SINKELEMENT].[PAD1,...]]\fR
142 Links the element with name SRCELEMENT to the element with name SINKELEMENT,
143 using the caps specified in CAPS as a filter.
144 Names can be set on elements with the name property. If the name is omitted, the
145 element that was specified directly in front of or after the link is used. This
146 works across bins. If a padname is given, the link is done with these pads. If
147 no pad names are given all possibilities are tried and a matching pad is used.
148 If multiple padnames are given, both sides must have the same number of pads
149 specified and multiple links are done in the given order.
151 So the simplest link is a simple exclamation mark, that links the element to
152 the left of it to the element right of it.
157 MIMETYPE \fI[, PROPERTY[, PROPERTY ...]]]\fR \fI[; CAPS[; CAPS ...]]\fR
159 Creates a capability with the given mimetype and optionally with given
160 properties. The mimetype can be escaped using " or '.
161 If you want to chain caps, you can add more caps in the same format afterwards.
165 NAME\fI[:TYPE]\fR=VALUE
167 in lists and ranges: [TYPE=]VALUE
169 Sets the requested property in capabilities. The name is an alphanumeric value
170 and the type can have the following case-insensitive values:
172 - \fBi\fR or \fBint\fR for integer values or ranges
174 - \fBf\fR or \fBfloat\fR for float values or ranges
176 - \fB4\fR or \fBfourcc\fR for FOURCC values
178 - \fBb\fR, \fBbool\fR or \fBboolean\fR for boolean values
180 - \fBs\fR, \fBstr\fR or \fBstring\fR for strings
182 - \fBfraction\fR for fractions (framerate, pixel-aspect-ratio)
184 - \fBl\fR or \fBlist\fR for lists
186 If no type was given, the following order is tried: integer, float, boolean,
189 Integer values must be parsable by \fBstrtol()\fP, floats by \fBstrtod()\fP. FOURCC values may
190 either be integers or strings. Boolean values are (case insensitive) \fIyes\fR,
191 \fIno\fR, \fItrue\fR or \fIfalse\fR and may like strings be escaped with " or '.
193 Ranges are in this format: [ PROPERTY, PROPERTY ]
195 Lists use this format: ( PROPERTY \fI[, PROPERTY ...]\fR )
197 .SH "PIPELINE CONTROL"
199 A pipeline can be controlled by signals. SIGUSR2 will stop the pipeline
200 (GST_STATE_NULL); SIGUSR1 will put it back to play (GST_STATE_PLAYING).
201 By default, the pipeline will start in the playing state.
203 There are currently no signals defined to go into the ready or pause
204 (GST_STATE_READY and GST_STATE_PAUSED) state explicitely.
206 .SH "PIPELINE EXAMPLES"
208 The examples below assume that you have the correct plug-ins available.
209 In general, "osssink" can be substituted with another audio output
210 plug-in such as "esdsink", "alsasink", "osxaudiosink", or "artsdsink".
211 Likewise, "xvimagesink" can be substituted with "ximagesink", "sdlvideosink",
212 "osxvideosink", or "aasink". Keep in mind though that different sinks might
213 accept different formats and even the same sink might accept different formats
214 on different machines, so you might need to add converter elements like
215 audioconvert and audioresample (for audio) or ffmpegcolorspace (for video)
216 in front of the sink to make things work.
221 gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! audioresample ! osssink
223 Play the mp3 music file "music.mp3" using a libmad-based plug-in and
224 output to an OSS device
227 gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! osssink
229 Play an Ogg Vorbis format file
232 gst\-launch gnomevfssrc location=music.mp3 ! mad ! osssink
235 gst\-launch gnomevfssrc location=http://domain.com/music.mp3 ! mad ! audioconvert ! audioresample ! osssink
237 Play an mp3 file or an http stream using GNOME\-VFS
240 gst\-launch gnomevfssrc location=smb://computer/music.mp3 ! mad ! audioconvert ! audioresample ! osssink
242 Use GNOME\-VFS to play an mp3 file located on an SMB server
247 gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
249 Convert an mp3 music file to an Ogg Vorbis file
252 gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! flacenc ! filesink location=test.flac
254 Convert to the FLAC format
259 gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! audioresample ! osssink
261 Plays a .WAV file that contains raw audio data (PCM).
264 gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
267 gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! lame ! filesink location=music.mp3
269 Convert a .WAV file containing raw audio data into an Ogg Vorbis or mp3 file
272 gst\-launch cdparanoia ! lame ! filesink location=cd.mp3
274 rips all tracks from compact disc and convert them into a single mp3 file
276 Using \fBgst\-inspect\fR(1), it is possible to discover settings for cdparanoia
277 that will tell it to rip individual tracks. Alternatively, you can use an URI
278 and gst-launch will find an element (such as cdparanoia) that supports that
279 protocol for you, e.g.:
281 gst\-launch cdda://5 ! lame vbr=new vbr-quality=6 ! filesink location=track5.mp3
284 gst\-launch osssrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=input.ogg
286 records sound from your audio input and encodes it into an ogg file
291 gst\-launch filesrc location=JB_FF9_TheGravityOfLove.mpg ! dvddemux ! mpeg2dec ! xvimagesink
293 Display only the video portion of an MPEG-1 video file, outputting to
297 gst\-launch filesrc location=/flflfj.vob ! dvddemux ! mpeg2dec ! sdlvideosink
299 Display the video portion of a .vob file (used on DVDs), outputting to
303 gst\-launch filesrc location=movie.mpg ! dvddemux name=demuxer demuxer. ! queue ! mpeg2dec ! sdlvideosink demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
305 Play both video and audio portions of an MPEG movie
308 gst\-launch filesrc location=movie.mpg ! mpegdemux name=demuxer demuxer. ! queue ! mpeg2dec ! ffmpegcolorspace ! sdlvideosink demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
314 Stream video using RTP and network elements.
317 gst\-launch v4l2src ! video/x-raw-yuv,width=128,height=96,format='(fourcc)'UYVY ! ffmpegcolorspace ! ffenc_h263 ! video/x-h263 ! rtph263ppay pt=96 ! udpsink host=192.168.1.1 port=5000 sync=false
319 Use this command on the receiver
322 gst\-launch udpsrc port=5000 ! application/x-rtp, clock-rate=90000,payload=96 ! rtph263pdepay queue-delay=0 ! ffdec_h263 ! xvimagesink
324 This command would be run on the transmitter
329 gst\-launch -v fakesrc num-buffers=16 ! fakesink
331 Generate a null stream and ignore it (and print out details).
334 gst\-launch audiotestsrc ! audioconvert ! audioresample ! osssink
336 Generate a pure sine tone to test the audio output
339 gst\-launch videotestsrc ! xvimagesink
342 gst\-launch videotestsrc ! ximagesink
344 Generate a familiar test pattern to test the video output
348 You can use the decodebin element to automatically select the right elements
349 to get a working pipeline.
352 gst\-launch filesrc location=musicfile ! decodebin ! audioconvert ! audioresample ! osssink
354 Play any supported audio format
357 gst\-launch filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! osssink decoder. ! ffmpegcolorspace ! xvimagesink
359 Play any supported video format with video and audio output. Threads are used
360 automatically. To make this even easier, you can use the playbin element:
363 gst\-launch playbin uri=file:///home/joe/foo.avi
367 .B Filtered connections
369 These examples show you how to use filtered caps.
372 gst\-launch videotestsrc ! 'video/x-raw-yuv,format=(fourcc)YUY2;video/x-raw-yuv,format=(fourcc)YV12' ! xvimagesink
374 Show a test image and use the YUY2 or YV12 video format for this.
377 gst\-launch osssrc ! 'audio/x-raw-int,rate=[32000,64000],width=[16,32],depth={16,24,32},signed=(boolean)true' ! wavenc ! filesink location=recording.wav
379 record audio and write it to a .wav file. Force usage of signed 16 to 32 bit
380 samples and a sample rate between 32kHz and 64KHz.
383 .SH "ENVIRONMENT VARIABLES"
386 Comma-separated list of debug categories and levels, e.g.
387 GST_DEBUG=totem:4,typefind:5
389 \fBGST_DEBUG_NO_COLOR\fR
390 When this environment variable is set, coloured debug output is disabled.
392 \fBGST_DEBUG_DUMP_DOT_DIR\fR
393 When set to a filesystem path, store dot files of pipeline graphs there.
396 Path of the plugin registry file. Default is
397 ~/.gstreamer-GST_MAJORMINOR/registry-CPU.xml where CPU is the machine/cpu type
398 GStreamer was compiled for, e.g. 'i486', 'i686', 'x86-64', 'ppc', etc. (check
399 the output of "uname -i" and "uname -m" for details).
401 \fBGST_PLUGIN_PATH\fR
402 Specifies a list of directories to scan for additional plugins.
403 These take precedence over the system plugins.
405 \fBGST_PLUGIN_SYSTEM_PATH\fR
406 Specifies a list of plugins that are always loaded by default. If not set,
407 this defaults to the system-installed path, and the plugins installed in the
408 user's home directory
411 Useful liboil environment variable. Set OIL_CPU_FLAGS=0 when valgrind or
412 other debugging tools trip over liboil's CPU detection (quite a few important
413 GStreamer plugins like videotestsrc, audioconvert or audioresample use liboil).
416 Useful GLib environment variable. Set G_DEBUG=fatal_warnings to make
417 GStreamer programs abort when a critical warning such as an assertion failure
418 occurs. This is useful if you want to find out which part of the code caused
419 that warning to be triggered and under what circumstances. Simply set G_DEBUG
420 as mentioned above and run the program in gdb (or let it core dump). Then get
421 a stack trace in the usual way.
425 ~/.gstreamer-GST_MAJORMINOR/registry-*.xml
426 The xml plugin database; can be deleted at any time, will be re-created
427 automatically when it does not exist yet or plugins change.
430 .BR gst\-feedback (1),
431 .BR gst\-inspect (1),
432 .BR gst\-typefind (1)
434 The GStreamer team at http://gstreamer.freedesktop.org/