tools: deprecate gst-xmllaunch and print fat warning if someone tries to use it
[platform/upstream/gstreamer.git] / tools / gst-launch.1.in
1 .TH "GStreamer" "1" "May 2007"
2 .SH "NAME"
3 gst\-launch \- build and run a GStreamer pipeline
4 .SH "SYNOPSIS"
5 \fBgst\-launch\fR \fI[OPTION...]\fR PIPELINE\-DESCRIPTION
6 .SH "DESCRIPTION"
7 .LP 
8 \fIgst\-launch\fP is a tool that builds and runs basic
9 \fIGStreamer\fP pipelines.
10
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.
14
15 For a complete description of possible PIPELINE-DESCRIPTIONS see the section
16 \fIpipeline description\fR below or consult the GStreamer documentation.
17
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.
22 .
23 .SH "OPTIONS"
24 .l
25 \fIgst\-launch\fP accepts the following options:
26 .TP 8
27 .B  \-\-help
28 Print help synopsis and available FLAGS
29 .TP 8
30 .B  \-v, \-\-verbose
31 Output status information and property notifications
32 .TP 8
33 .B  \-q, \-\-quiet
34 Do not print any progress information
35 .TP 8
36 .B  \-m, \-\-messages
37 Output messages posted on the pipeline's bus
38 .TP 8
39 .B  \-t, \-\-tags
40 Output tags (also known as metadata)
41 .TP 8
42 .B  \-o FILE, \-\-output=FILE
43 Save XML representation of pipeline to FILE and exit
44 .TP 8
45 .B  \-f, \-\-no\-fault
46 Do not install a fault handler
47 .TP 8
48 .B  \-p, \-\-no\-sigusr-handler
49 Do not install signal handlers for SIGUSR1 (play) and SIGUSR2 (stop)
50 .TP 8
51 .B  \-T, \-\-trace
52 Print memory allocation traces. The feature must be enabled at compile time to
53 work.
54 .TP 8
55
56 .
57 .SH "GSTREAMER OPTIONS"
58 .l
59 \fIgst\-launch\fP also accepts the following options that are common
60 to all GStreamer applications:
61 .TP 8
62 .B  \-\-gst\-version
63 Prints the version string of the \fIGStreamer\fP core library.
64 .TP 8
65 .B  \-\-gst\-fatal\-warnings
66 Causes \fIGStreamer\fP to abort if a warning message occurs. This is equivalent
67 to setting the environment variable G_DEBUG to 'fatal_warnings' (see the
68 section \fIenvironment variables\fR below for further information).
69 .TP 8
70 .B  \-\-gst\-debug=STRING
71 A comma separated list of category_name:level pairs to specify debugging levels
72 for each category. Level is in the range 0-5 where 0 will show no messages, and
73 5 will show all messages. The wildcard * can be used to match category names.
74
75 Use \-\-gst\-debug\-help to show category names
76
77 Example:
78 GST_CAT:5,GST_ELEMENT_*:3,oggdemux:5
79
80 .TP 8
81 .B  \-\-gst\-debug\-level=LEVEL
82 Sets the threshold for printing debugging messages.  A higher level
83 will print more messages.  The useful range is 0-5, with the default
84 being 0.
85 .TP 8
86 .B  \-\-gst\-debug\-no\-color
87 \fIGStreamer\fP normally prints debugging messages so that the
88 messages are color-coded when printed to a terminal that handles
89 ANSI escape sequences.  Using this option causes \fIGStreamer\fP
90 to print messages without color. Setting the \fBGST_DEBUG_NO_COLOR\fR
91 environment variable will achieve the same thing.
92 .TP 8
93 .B  \-\-gst\-debug\-disable
94 Disables debugging.
95 .TP 8
96 .B  \-\-gst\-debug\-help
97 Prints a list of available debug categories and their default debugging level.
98 .TP 8
99 .B  \-\-gst\-plugin\-spew
100 \fIGStreamer\fP info flags to set
101 Enable printout of errors while loading \fIGStreamer\fP plugins
102 .TP 8
103 .B  \-\-gst\-plugin\-path=PATH
104 Add directories separated with ':' to the plugin search path
105 .TP 8
106 .B  \-\-gst\-plugin\-load=PLUGINS
107 Preload plugins specified in a comma-separated list. Another way to specify
108 plugins to preload is to use the environment variable GST_PLUGIN_PATH
109
110 .SH "PIPELINE DESCRIPTION"
111
112 A pipeline consists \fIelements\fR and \fIlinks\fR. \fIElements\fR can be put 
113 into \fIbins\fR of different sorts. \fIElements\fR, \fIlinks\fR and \fIbins\fR
114 can be specified in a pipeline description in any order.
115
116 .B Elements
117
118 ELEMENTTYPE \fI[PROPERTY1 ...]\fR
119
120 Creates an element of type ELEMENTTYPE and sets the PROPERTIES.
121
122 .B Properties
123
124 PROPERTY=VALUE ...
125
126 Sets the property to the specified value. You can use \fBgst\-inspect\fR(1) to
127 find out about properties and allowed values of different elements.
128 .br
129 Enumeration properties can be set by name, nick or value.
130
131 .B Bins
132
133 \fI[BINTYPE.]\fR ( \fI[PROPERTY1 ...]\fR PIPELINE-DESCRIPTION )
134 .br
135
136 Specifies that a bin of type BINTYPE is created and the given properties are 
137 set. Every element between the braces is put into the bin. Please note the dot
138 that has to be used after the BINTYPE. You will almost never need this
139 functionality, it is only really useful for applications using the
140 gst_launch_parse() API with 'bin' as bintype. That way it is possible to build
141 partial pipelines instead of a full-fledged top-level pipeline.
142
143 .B Links
144
145 \fI[[SRCELEMENT].[PAD1,...]]\fR ! \fI[[SINKELEMENT].[PAD1,...]]\fR
146 \fI[[SRCELEMENT].[PAD1,...]]\fR ! CAPS ! \fI[[SINKELEMENT].[PAD1,...]]\fR
147
148 Links the element with name SRCELEMENT to the element with name SINKELEMENT,
149 using the caps specified in CAPS as a filter.
150 Names can be set on elements with the name property. If the name is omitted, the
151 element that was specified directly in front of or after the link is used. This
152 works across bins. If a padname is given, the link is done with these pads. If
153 no pad names are given all possibilities are tried and a matching pad is used.
154 If multiple padnames are given, both sides must have the same number of pads
155 specified and multiple links are done in the given order.
156 .br
157 So the simplest link is a simple exclamation mark, that links the element to
158 the left of it to the element right of it.
159 .br
160
161 .B Caps
162
163 MIMETYPE \fI[, PROPERTY[, PROPERTY ...]]]\fR \fI[; CAPS[; CAPS ...]]\fR
164
165 Creates a capability with the given mimetype and optionally with given
166 properties. The mimetype can be escaped using " or '.
167 If you want to chain caps, you can add more caps in the same format afterwards.
168
169 .B Properties
170
171 NAME=\fI[(TYPE)]\fRVALUE
172 .br
173 in lists and ranges: \fI[(TYPE)]\fRVALUE
174
175 Sets the requested property in capabilities. The name is an alphanumeric value
176 and the type can have the following case-insensitive values:
177 .br
178 - \fBi\fR or \fBint\fR for integer values or ranges
179 .br
180 - \fBf\fR or \fBfloat\fR for float values or ranges
181 .br
182 - \fB4\fR or \fBfourcc\fR for FOURCC values
183 .br
184 - \fBb\fR, \fBbool\fR or \fBboolean\fR for boolean values
185 .br
186 - \fBs\fR, \fBstr\fR or \fBstring\fR for strings
187 .br
188 - \fBfraction\fR for fractions (framerate, pixel-aspect-ratio)
189 .br
190 - \fBl\fR or \fBlist\fR for lists
191 .br
192 If no type was given, the following order is tried: integer, float, boolean, 
193 string.
194 .br
195 Integer values must be parsable by \fBstrtol()\fP, floats by \fBstrtod()\fP. FOURCC values may
196 either be integers or strings. Boolean values are (case insensitive) \fIyes\fR, 
197 \fIno\fR, \fItrue\fR or \fIfalse\fR and may like strings be escaped with " or '.
198 .br
199 Ranges are in this format:  [ VALUE, VALUE ]
200 .br
201 Lists use this format:      ( VALUE \fI[, VALUE ...]\fR )
202
203 .SH "PIPELINE CONTROL"
204
205 A pipeline can be controlled by signals. SIGUSR2 will stop the pipeline
206 (GST_STATE_NULL); SIGUSR1 will put it back to play (GST_STATE_PLAYING).
207 By default, the pipeline will start in the playing state.
208 .br
209 There are currently no signals defined to go into the ready or pause
210 (GST_STATE_READY and GST_STATE_PAUSED) state explicitely.
211
212 .SH "PIPELINE EXAMPLES"
213
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 ffmpegcolorspace (for video)
222 in front of the sink to make things work.
223
224 .B Audio playback
225
226 .B
227         gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! audioresample ! osssink
228 .br
229 Play the mp3 music file "music.mp3" using a libmad-based plug-in and
230 output to an OSS device
231
232 .B
233         gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! osssink
234 .br
235 Play an Ogg Vorbis format file
236
237 .B
238         gst\-launch gnomevfssrc location=music.mp3 ! mad ! osssink
239 .br
240 .B
241         gst\-launch gnomevfssrc location=http://domain.com/music.mp3 ! mad ! audioconvert ! audioresample ! osssink
242 .br
243 Play an mp3 file or an http stream using GNOME\-VFS
244
245 .B
246         gst\-launch gnomevfssrc location=smb://computer/music.mp3 ! mad ! audioconvert ! audioresample ! osssink
247 .br
248 Use GNOME\-VFS to play an mp3 file located on an SMB server
249
250 .B Format conversion
251
252 .B
253         gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
254 .br
255 Convert an mp3 music file to an Ogg Vorbis file
256
257 .B
258         gst\-launch filesrc location=music.mp3 ! mad ! audioconvert ! flacenc ! filesink location=test.flac
259 .br
260 Convert to the FLAC format
261
262 .B Other
263
264 .B
265         gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! audioresample ! osssink
266 .br
267 Plays a .WAV file that contains raw audio data (PCM).
268
269 .B
270         gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
271 .br
272 .B
273         gst\-launch filesrc location=music.wav ! wavparse ! audioconvert ! lame ! filesink location=music.mp3
274 .br
275 Convert a .WAV file containing raw audio data into an Ogg Vorbis or mp3 file
276
277 .B
278         gst\-launch cdparanoiasrc mode=continuous ! audioconvert ! lame ! id3v2mux ! filesink location=cd.mp3
279 .br
280 rips all tracks from compact disc and convert them into a single mp3 file
281
282 .B
283         gst\-launch cdparanoiasrc track=5 ! audioconvert ! lame ! id3v2mux ! filesink location=track5.mp3
284 .br
285 rips track 5 from the CD and converts it into a single mp3 file
286
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.:
291 .B
292        gst\-launch cdda://5 ! lame vbr=new vbr-quality=6 ! filesink location=track5.mp3
293
294 .B
295         gst\-launch osssrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=input.ogg
296 .br
297 records sound from your audio input and encodes it into an ogg file
298
299 .B Video
300
301 .B
302         gst\-launch filesrc location=JB_FF9_TheGravityOfLove.mpg ! dvddemux ! mpeg2dec ! xvimagesink
303 .br
304 Display only the video portion of an MPEG-1 video file, outputting to
305 an X display window
306
307 .B
308         gst\-launch filesrc location=/flflfj.vob ! dvddemux ! mpeg2dec ! sdlvideosink
309 .br
310 Display the video portion of a .vob file (used on DVDs), outputting to
311 an SDL window
312
313 .B
314         gst\-launch filesrc location=movie.mpg ! dvddemux name=demuxer  demuxer. ! queue ! mpeg2dec ! sdlvideosink  demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
315 .br
316 Play both video and audio portions of an MPEG movie
317
318 .B
319         gst\-launch filesrc location=movie.mpg ! mpegdemux name=demuxer  demuxer. ! queue ! mpeg2dec ! ffmpegcolorspace ! sdlvideosink   demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
320 .br
321 Play an AVI movie with an external text subtitle stream
322
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.
325
326 .B
327         gst\-launch textoverlay name=overlay ! ffmpegcolorspace ! videoscale ! autovideosink   filesrc location=movie.avi ! decodebin2 ! ffmpegcolorspace ! overlay.video_sink   filesrc location=movie.srt ! subparse ! overlay.text_sink
328
329 .br
330 Play an AVI movie with an external text subtitle stream using playbin2
331
332 .B
333         gst\-launch playbin2 uri=file:///path/to/movie.avi suburi=file:///path/to/movie.srt
334
335 .B Network streaming
336
337 Stream video using RTP and network elements.
338
339 .B
340         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
341 .br
342 Use this command on the receiver
343
344 .B
345         gst\-launch udpsrc port=5000 ! application/x-rtp, clock-rate=90000,payload=96 ! rtph263pdepay queue-delay=0 ! ffdec_h263 ! xvimagesink
346 .br
347 This command would be run on the transmitter
348
349 .B Diagnostic
350
351 .B
352         gst\-launch -v fakesrc num-buffers=16 ! fakesink
353 .br
354 Generate a null stream and ignore it (and print out details).
355
356 .B
357         gst\-launch audiotestsrc ! audioconvert ! audioresample ! osssink
358 .br
359 Generate a pure sine tone to test the audio output
360
361 .B
362         gst\-launch videotestsrc ! xvimagesink
363 .br
364 .B
365         gst\-launch videotestsrc ! ximagesink
366 .br
367 Generate a familiar test pattern to test the video output
368
369 .B Automatic linking
370
371 You can use the decodebin element to automatically select the right elements
372 to get a working pipeline.
373
374 .B
375         gst\-launch filesrc location=musicfile ! decodebin ! audioconvert ! audioresample ! osssink
376 .br
377 Play any supported audio format
378
379 .B
380         gst\-launch filesrc location=videofile ! decodebin name=decoder  decoder. ! queue ! audioconvert ! audioresample ! osssink   decoder. ! ffmpegcolorspace ! xvimagesink
381 .br
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:
384
385 .B
386         gst\-launch playbin uri=file:///home/joe/foo.avi
387 .br
388   
389
390 .B Filtered connections
391
392 These examples show you how to use filtered caps.
393
394 .B
395         gst\-launch videotestsrc ! 'video/x-raw-yuv,format=(fourcc)YUY2;video/x-raw-yuv,format=(fourcc)YV12' ! xvimagesink
396 .br
397 Show a test image and use the YUY2 or YV12 video format for this.
398
399 .B
400         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
401 .br
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.
404
405
406 .SH "ENVIRONMENT VARIABLES"
407 .TP
408 \fBGST_DEBUG\fR
409 Comma-separated list of debug categories and levels, e.g.
410 GST_DEBUG=totem:4,typefind:5
411 .TP
412 \fBGST_DEBUG_NO_COLOR\fR
413 When this environment variable is set, coloured debug output is disabled.
414 .TP
415 \fBGST_DEBUG_DUMP_DOT_DIR\fR
416 When set to a filesystem path, store dot files of pipeline graphs there.
417 .TP
418 \fBGST_REGISTRY\fR
419 Path of the plugin registry file. Default is
420 ~/.gstreamer-GST_MAJORMINOR/registry-CPU.xml where CPU is the machine/cpu type
421 GStreamer was compiled for, e.g. 'i486', 'i686', 'x86-64', 'ppc', etc. (check
422 the output of "uname -i" and "uname -m" for details).
423 .TP
424 \fBGST_REGISTRY_UPDATE\fR
425 Set to "no" to force GStreamer to assume that no plugins have changed,
426 been added or been removed. This will make GStreamer skip the initial check
427 whether a rebuild of the registry cache is required or not. This may be useful
428 in embedded environments where the installed plugins never change. Do not
429 use this option in any other setup.
430 .TP
431 \fBGST_PLUGIN_PATH\fR
432 Specifies a list of directories to scan for additional plugins.
433 These take precedence over the system plugins.
434 .TP
435 \fBGST_PLUGIN_SYSTEM_PATH\fR
436 Specifies a list of plugins that are always loaded by default.  If not set, 
437 this defaults to the system-installed path, and the plugins installed in the
438 user's home directory
439 .TP
440 \fBOIL_CPU_FLAGS\fR
441 Useful liboil environment variable. Set OIL_CPU_FLAGS=0 when valgrind or
442 other debugging tools trip over liboil's CPU detection (quite a few important
443 GStreamer plugins like videotestsrc, audioconvert or audioresample use liboil).
444 .TP
445 \fBG_DEBUG\fR
446 Useful GLib environment variable. Set G_DEBUG=fatal_warnings to make
447 GStreamer programs abort when a critical warning such as an assertion failure
448 occurs. This is useful if you want to find out which part of the code caused
449 that warning to be triggered and under what circumstances. Simply set G_DEBUG
450 as mentioned above and run the program in gdb (or let it core dump). Then get
451 a stack trace in the usual way.
452 .
453 .SH FILES
454 .TP 8
455 ~/.gstreamer-GST_MAJORMINOR/registry-*.xml
456 The xml plugin database; can be deleted at any time, will be re-created
457 automatically when it does not exist yet or plugins change.
458 .
459 .SH "SEE ALSO"
460 .BR gst\-feedback (1),
461 .BR gst\-inspect (1),
462 .BR gst\-typefind (1)
463 .SH "AUTHOR"
464 The GStreamer team at http://gstreamer.freedesktop.org/