gst-launch - build and run a GStreamer pipeline
gst-launch [--exclude=type,type2,...] [--no-fault] [-messages] [-output=file] [--tags] [--trace] [--verbose] [--version] [gst-std-options] pipeline-description
gst-launch builds and runs basic GStreamer pipelines.
In simple form, a pipeline-description is a list of elements separated by exclamation marks (!). Properties can be appended to elements, in the form property=value.
For a complete description of possible values for pipeline-description, see the section Pipeline Description below or consult the GStreamer documentation.
Please note that gst-launch is primarily a debugging tool for developers and users. You should not build applications on top of it. For applications, use the gst_parse_launch() function of the GStreamer API as an easy way to construct pipelines from pipeline descriptions.
The following options are supported by gst-launch:
-X, --exclude=type1,type2,... Do not output status information of specified type.
-f, --no-fault Do not install a fault handler.
-o, -output-=file Save XML representation of pipeline to file, then exit.
-t, --tags Output tags, also known as metadata.
-T, --trace Print memory allocation trace, if enabled at compile time.
-v, --verbose Output status information and property notifications.
--version Print GStreamer version number.
gst-std-options Standard options available for use with most GStreamer applications. See gst-std-options(5) for more information.
A pipeline consists elements and links. Elements can be put into bins of different sorts. Elements, links and bins can be specified in a pipeline description in any order.
elementtype [property1 ...]Creates an element of type elementtype and sets the properties.
property=value ...Sets the property to the specified value. You can use gst-inspect(1) to find out about properties and allowed values of different elements.
Enumeration properties can be set by name, nick or value.
[bintype.] ( [property1 ...] pipeline-description )Specifies that a bin of type bintype is created and the given properties are set. Every element between the braces is put into the bin. Please note the dot that has to be used after the bintype. You will almost never need this functionality, it is only really useful for applications using the gst_launch_parse() API with bin as bintype. That way it is possible to build partial pipelines instead of a full-fledged top-level pipeline.
[[srcelement].[pad1,...]] ! [[sinkelement].[pad1,...]] [[srcelement].[pad1,...]] ! caps ! [[srcelement].[pad1,...]]Links the element with name srcelement to the element with name sinkelement, using the caps specified in caps as a filter. Names can be set on elements with the name property. If the name is omitted, the element that was specified directly in front of or after the link is used. This works across bins. If a padname is given, the link is done with these pads. If no pad names are given all possibilities are tried and a matching pad is used. If multiple padnames are given, both sides must have the same number of pads specified and multiple links are done in the given order. So the simplest link is a simple exclamation mark, that links the element to the left of it to the element right of it.
mimetype [, property[, property ...]]] [; caps[; caps ...]]Creates a capability with the given mimetype and optionally with given properties. The mimetype can be escaped using " or . If you want to chain caps, you can add more caps in the same format afterwards.
name[:type]=value in lists and ranges: [type=]valueSets the requested property in capabilities. The name is an alphanumeric value and the type can have the following case-insensitive values:
o i or int for integer values or ranges
o f or float for float values or ranges
o 4 or fourcc for FOURCC values
o b, bool, or boolean for boolean values
o s, str, or string for strings
o l or list for lists
If no type was given, the following order is tried: integer, float, boolean, string. Integer values must be parsable by strtol(), floats by strtod(). FOURCC values may either be integers or strings. Boolean values are (case insensitive) yes, no, true or false and may like strings be escaped with " or .
Ranges are in this format: [ property, property ] Lists use this format: ( property [, property ...] )
A pipeline can be controlled by signals. SIGUSR2 will stop the pipeline (GST_STATE_NULL); SIGUSR1 will put it back to play (GST_STATE_PLAYING). By default, the pipeline will start in the playing state. There are currently no signals defined to go into the ready or pause (GST_STATE_READY and GST_STATE_PAUSED) state expli- citely.
The examples below assume that you have the correct plugins available. In general, "sunaudiosink" can be substituted with another audio output plugin such as "esdsink", "alsasink", "osxaudiosink", or "artsdsink". Likewise, "xvimagesink" can be substituted with "ximagesink", "sdlvideosink", "osxvideosink", or "aasink". Keep in mind though that different sinks might accept different formats and even the same sink might accept different formats on different machines, so you might need to add converter elements like audioconvert and audioresample (for audio) or ffmpegcolorspace (for video) in front of the sink to make things work.
Example 1: Audio Playback
Play the WAV music file "music.wav":
example% gst-launch filesrc location=music.wav ! wavparse ! sunaudiosinkPlay the mp3 music file "music.mp3":
example% gst-launch filesrc location=music.mp3 ! flump3dec ! sunaudiosinkPlay the Ogg Vorbis file "music.ogg":
example% gst-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! sunaudiosinkPlay an mp3 file or an http stream using GNOME-VFS:
example% gst-launch gnomevfssrc location=music.mp3 ! flump3dec ! sunaudiosink
example% gst-launch gnomevfssrc location=http://domain.com/music.mp3 ! flump3dec ! sunaudiosinkUse GNOME-VFS to play an mp3 file located on an SMB server:
example% gst-launch gnomevfssrc location=smb://computer/music.mp3 ! flump3dec ! sunaudiosinkExample 2: Video Playback
Play an Ogg video file:
example% gst-launch filesrc location=video.ogg ! oggdemux ! theoradec ! ffmpegcolorspace ! xvimagesinkExample 3: Format Conversion
Convert an mp3 music file to the Ogg Vorbis format:
example% gst-launch filesrc location=music.mp3 ! flump3dec ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.oggConvert an mp3 music file to the FLAC format:
example% gst-launch filesrc location=music.mp3 ! flump3dec ! audioconvert ! flacenc ! filesink location=test.flacConvert a .WAV file to the Ogg Vorbis format:
example% gst-launch filesrc location=music.wav ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.oggExample 4: Recording Audio
Record sound from your audio input and encode it into an Ogg file:
example% gst-launch sunaudiosrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=music.oggExample 5: Compact Disk (CDDA)
Play track number 3 from compact disc:
example% gst-launch cddasrc track=3 ! sunaudiosinkPlay track number 5 from compact disc:
example% gst-launch cdda://5 ! sunaudiosinkExample 6: Diagnostic
Generate a null stream and ignore it:
example% gst-launch fakesrc ! fakesinkGenerate a pure tone to test the audio output:
example% gst-launch audiotestsrc ! sunaudiosinkGenerate a familiar test pattern to test the video output:
example% gst-launch videotestsrc ! xvimagesinkGenerate a familiar test pattern to test the video output:
example% gst-launch videotestsrc ! ximagesinkExample 7: Automatic Linking
You can use the decodebin element to automatically select the right elements to get a working pipeline.
Play any supported audio format:
example% gst-launch filesrc location=musicfile ! decodebin ! sunaudiosinkPlay any supported video format with video and audio output. Threads are used automatically.
example% gst-launch filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! osssink decoder. ! ffmpegcolorspace ! xvimagesinkTo make this even easier, you can use the playbin element:
example% gst-launch playbin uri=file:///home/joe/foo.aviExample 8: Filtered Connections
These examples show how to use filtered capabilities.
Show a test image and use the YUY2 or YV12 video format for this:
example% gst-launch videotestsrc ! video/x-raw-yuv,format=urcc)YUY2;video/x-raw-yuv,format=urcc)YV12 ! xvimagesinkRecord audio and write it to a .wav file. Force usage of signed 16 to 32 bit samples and a sample rate between 32kHz and 64KHz:
example% gst-launch sunaudiosrc ! audio/x-raw-int,rate=[32000,64000],width=[16,32],depth={16,24,32},signed=(boolean)true ! wavenc ! filesink location=recording.wav
The following files are used by this application:
/usr/bin/gst-launch Executable to build and run a GStreamer pipeline
~/gstreamer-0.10 GStreamer registry
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE Availability SUNWgnome-media Interface stability Volatile
gst-feedback(1), gst-inspect(1), gst-typefind(1), gst-xmlinspect(1), gst-xmllaunch(1), gstreamer-properties(1), libgstreamer-0.10(3), gst-std-options(5)
Original man page written by the GStreamer team at http://www.gstreamer.net/.
Updated by Brian Cameron, Sun Microsystems Inc., 2004, 2006.
| SunOS 5.11 | gst-launch (1) | 14 Oct 2004 |