video: Add/fix various annotations
[platform/upstream/gstreamer.git] / subprojects / gstreamer / tools / gst-launch-1.0.1
1 .TH "GStreamer" "1" "May 2007"
2 .SH "NAME"
3 gst\-launch\-1.0 \- build and run a GStreamer pipeline
4 .SH "SYNOPSIS"
5 \fBgst\-launch\-1.0\fR \fI[OPTION...]\fR PIPELINE\-DESCRIPTION
6 .SH "DESCRIPTION"
7 .LP
8 \fIgst\-launch\-1.0\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. A "preset" can also be set using
14 the \fI@preset=<preset name>\fR syntax.
15
16 For a complete description of possible PIPELINE-DESCRIPTIONS see the section
17 \fIpipeline description\fR below or consult the GStreamer documentation.
18
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.
23 .
24 .SH "OPTIONS"
25 .l
26 \fIgst\-launch\-1.0\fP accepts the following options:
27 .TP 8
28 .B  \-\-help
29 Print help synopsis and available FLAGS
30 .TP 8
31 .B  \-v, \-\-verbose
32 Output status information and property notifications
33 .TP 8
34 .B  \-q, \-\-quiet
35 Do not print any progress information
36 .TP 8
37 .B  \-m, \-\-messages
38 Output messages posted on the pipeline's bus
39 .TP 8
40 .B  \-t, \-\-tags
41 Output tags (also known as metadata)
42 .TP 8
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.
47 .TP 8
48 .B  \-i, \-\-index
49 Gather and print index statistics. This is mostly useful for playback or
50 recording pipelines.
51 .TP 8
52 .B  \-f, \-\-no\-fault
53 Do not install a fault handler
54 .TP 8
55 .B  \-T, \-\-trace
56 Print memory allocation traces. The feature must be enabled at compile time to
57 work.
58 .TP 8
59 .B  \-\-no\-position
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.
64 .TP 8
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.
68 .TP 8
69
70 .
71 .SH "GSTREAMER OPTIONS"
72 .l
73 \fIgst\-launch\-1.0\fP also accepts the following options that are common
74 to all GStreamer applications:
75 .TP 8
76 .B  \-\-gst\-version
77 Prints the version string of the \fIGStreamer\fP core library.
78 .TP 8
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).
83 .TP 8
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.
94
95 Use \-\-gst\-debug\-help to show category names
96
97 Example:
98 GST_CAT:5,GST_ELEMENT_*:3,oggdemux:5
99
100 .TP 8
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.
107 .TP 8
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.
114 .TP 8
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.
124 .TP 8
125 .B  \-\-gst\-debug\-disable
126 Disables debugging.
127 .TP 8
128 .B  \-\-gst\-debug\-help
129 Prints a list of available debug categories and their default debugging level.
130 .TP 8
131 .B  \-\-gst\-plugin\-spew
132 \fIGStreamer\fP info flags to set
133 Enable printout of errors while loading \fIGStreamer\fP plugins
134 .TP 8
135 .B  \-\-gst\-plugin\-path=PATH
136 Add directories separated with ':' to the plugin search path
137 .TP 8
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
141
142 .SH "PIPELINE DESCRIPTION"
143
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.
147
148 .B Elements
149
150 ELEMENTTYPE \fI[PROPERTY1 ...]\fR
151
152 Creates an element of type ELEMENTTYPE and sets the PROPERTIES.
153
154 .B Properties
155
156 PROPERTY=VALUE ...
157
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.
160 .br
161 Enumeration properties can be set by name, nick or value.
162
163 .B Presets
164
165 @preset=<preset name> ...
166
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.
169
170 .B Bins
171
172 \fI[BINTYPE.]\fR ( \fI[PROPERTY1 ...]\fR PIPELINE-DESCRIPTION )
173 .br
174
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.
181
182 .B Links
183
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
188
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.
197 .br
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.
200 .br
201 Linking using the : operator attempts to link all possible pads between
202 the elements
203 .br
204
205 .B Caps
206
207 MEDIATYPE \fI[, PROPERTY[, PROPERTY ...]]]\fR \fI[; CAPS[; CAPS ...]]\fR
208
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.
212
213 .B Properties
214
215 NAME=\fI[(TYPE)]\fRVALUE
216 .br
217 in lists and ranges: \fI[(TYPE)]\fRVALUE
218
219 Sets the requested property in capabilities. The name is an alphanumeric value
220 and the type can have the following case-insensitive values:
221 .br
222 - \fBi\fR or \fBint\fR for integer values or ranges
223 .br
224 - \fBf\fR or \fBfloat\fR for float values or ranges
225 .br
226 - \fBb\fR, \fBbool\fR or \fBboolean\fR for boolean values
227 .br
228 - \fBs\fR, \fBstr\fR or \fBstring\fR for strings
229 .br
230 - \fBfraction\fR for fractions (framerate, pixel\-aspect\-ratio)
231 .br
232 - \fBl\fR or \fBlist\fR for lists
233 .br
234 If no type was given, the following order is tried: integer, float, boolean,
235 string.
236 .br
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 '.
240 .br
241 Ranges are in this format:  [ VALUE, VALUE ]
242 .br
243 Lists use this format:      { VALUE \fI[, VALUE ...]\fR }
244
245 .SH "PIPELINE EXAMPLES"
246
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.
256
257 .B Audio playback
258
259 Play the mp3 music file "music.mp3" using a libmpg123-based plug-in and
260 output to an Pulseaudio device
261 .br
262 .B
263         gst\-launch\-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
264
265 Play an Ogg Vorbis format file
266 .br
267 .B
268         gst\-launch\-1.0 filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! pulsesink
269
270 Play an mp3 file or an http stream using GIO
271 .br
272 .B
273         gst\-launch\-1.0 giosrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! pulsesink
274 .br
275 .B
276         gst\-launch\-1.0 giosrc location=http://domain.com/music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
277
278 Use GIO to play an mp3 file located on an SMB server
279 .br
280 .B
281         gst\-launch\-1.0 giosrc location=smb://computer/music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
282
283 .B Format conversion
284
285 Convert an mp3 music file to an Ogg Vorbis file
286 .br
287 .B
288         gst\-launch\-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
289
290 Convert to the FLAC format
291 .br
292 .B
293         gst\-launch\-1.0 filesrc location=music.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! flacenc ! filesink location=test.flac
294
295 .B Other
296
297 Plays a .WAV file that contains raw audio data (PCM).
298 .br
299 .B
300         gst\-launch\-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! audioresample ! pulsesink
301
302 Convert a .WAV file containing raw audio data into an Ogg Vorbis or mp3 file
303 .br
304 .B
305         gst\-launch\-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.ogg
306 .br
307 .B
308         gst\-launch\-1.0 filesrc location=music.wav ! wavparse ! audioconvert ! lamemp3enc ! filesink location=music.mp3
309
310 Rips all tracks from compact disc and convert them into a single mp3 file
311 .br
312 .B
313         gst\-launch\-1.0 cdparanoiasrc mode=continuous ! audioconvert ! lamemp3enc ! mpegaudioparse ! id3v2mux ! filesink location=cd.mp3
314
315 Rips track 5 from the CD and converts it into a single mp3 file
316 .br
317 .B
318         gst\-launch\-1.0 cdparanoiasrc track=5 ! audioconvert ! lamemp3enc ! mpegaudioparse ! id3v2mux ! filesink location=track5.mp3
319
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.:
324 .B
325        gst\-launch\-1.0 cdda://5 ! lamemp3enc vbr=new vbr\-quality=6 ! filesink location=track5.mp3
326
327 Records sound from your audio input and encodes it into an ogg file
328 .br
329 .B
330         gst\-launch\-1.0 pulsesrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=input.ogg
331
332 .B Video
333
334 Display only the video portion of an MPEG-1 video file, outputting to
335 an X display window
336 .br
337 .B
338         gst\-launch\-1.0 filesrc location=JB_FF9_TheGravityOfLove.mpg ! dvddemux ! mpegvideoparse ! mpeg2dec ! xvimagesink
339
340 Display the video portion of a .vob file (used on DVDs), outputting to
341 an SDL window
342 .br
343 .B
344         gst\-launch\-1.0 filesrc location=/flflfj.vob ! dvddemux ! mpegvideoparse ! mpeg2dec ! sdlvideosink
345
346 Play both video and audio portions of an MPEG movie
347 .br
348 .B
349         gst\-launch\-1.0 filesrc location=movie.mpg ! dvddemux name=demuxer  demuxer. ! queue ! mpegvideoparse ! mpeg2dec ! sdlvideosink  demuxer. ! queue ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! pulsesink
350
351 Play an AVI movie with an external text subtitle stream
352 .br
353 .B
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
355
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.
358 .br
359 .B
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
361
362 Play an AVI movie with an external text subtitle stream using playbin
363 .br
364 .B
365         gst\-launch\-1.0 playbin uri=file:///path/to/movie.avi suburi=file:///path/to/movie.srt
366
367 .B Network streaming
368
369 Stream video using RTP and network elements.
370
371 This command would be run on the transmitter
372 .br
373 .B
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
375
376 Use this command on the receiver
377 .br
378 .B
379         gst\-launch\-1.0 udpsrc port=5000 ! application/x\-rtp, clock\-rate=90000,payload=96 ! rtph263pdepay queue\-delay=0 ! ffdec_h263 ! xvimagesink
380
381 .B Diagnostic
382
383 Generate a null stream and ignore it (and print out details).
384 .br
385 .B
386         gst\-launch\-1.0 \-v fakesrc num\-buffers=16 ! fakesink
387
388 Generate a pure sine tone to test the audio output
389 .br
390 .B
391         gst\-launch\-1.0 audiotestsrc ! audioconvert ! audioresample ! pulsesink
392
393 Generate a familiar test pattern to test the video output
394 .br
395 .B
396         gst\-launch\-1.0 videotestsrc ! xvimagesink
397 .br
398 .B
399         gst\-launch\-1.0 videotestsrc ! ximagesink
400
401 .B Automatic linking
402
403 You can use the decodebin element to automatically select the right elements
404 to get a working pipeline.
405
406 Play any supported audio format
407 .br
408 .B
409         gst\-launch\-1.0 filesrc location=musicfile ! decodebin ! audioconvert ! audioresample ! pulsesink
410
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:
413 .br
414 .B
415         gst\-launch\-1.0 filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! pulsesink   decoder. !  videoconvert ! xvimagesink
416 .br
417 .B
418         gst\-launch\-1.0 playbin uri=file:///home/joe/foo.avi
419
420
421 .B Filtered connections
422
423 These examples show you how to use filtered caps.
424
425 Show a test image and use the YUY2 or YV12 video format for this.
426 .br
427 .B
428         gst\-launch\-1.0 videotestsrc ! 'video/x\-raw,format=YUY2;video/x\-raw,format=YV12' ! xvimagesink
429
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.
432 .br
433 .B
434         gst\-launch\-1.0 pulsesrc !  'audio/x\-raw,rate=[32000,64000],format={S16LE,S24LE,S32LE}' ! wavenc ! filesink location=recording.wav
435
436
437 .SH "ENVIRONMENT VARIABLES"
438 .TP
439 \fBGST_DEBUG\fR
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)
445 .TP
446 \fBGST_DEBUG_NO_COLOR\fR
447 When this environment variable is set, coloured debug output is disabled.
448 .TP
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.
455 .br
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.
459 .TP
460 \fBGST_REGISTRY\fR
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).
465 .TP
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.
472 .TP
473 \fBGST_PLUGIN_PATH\fR
474 Specifies a list of directories to scan for additional plugins.
475 These take precedence over the system plugins.
476 .TP
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
481 .TP
482 \fBGST_DEBUG_FILE\fR
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.
486 .TP
487 \fBORC_CODE\fR
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).
493 .TP
494 \fBG_DEBUG\fR
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.
501 .
502 .SH FILES
503 .TP 8
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.
508 .
509 .SH "SEE ALSO"
510 .BR gst\-inspect\-1.0 (1),
511 .BR gst\-launch\-1.0 (1),
512 .SH "AUTHOR"
513 The GStreamer team at http://gstreamer.freedesktop.org/