2002-02-04 20:33:14 +00:00
|
|
|
gst-launch
|
2001-02-16 12:15:32 +00:00
|
|
|
================
|
2000-01-30 10:44:33 +00:00
|
|
|
|
|
|
|
This is a tool that will construct pipelines based on a command-line
|
|
|
|
syntax. The syntax is rather complex to enable all the features I want it
|
|
|
|
to have, but should be easy to use for most people. Multi-pathed and
|
|
|
|
feedback pipelines are the most complex.
|
|
|
|
|
|
|
|
A simple commandline looks like:
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=music.mp3 ! mad ! osssink
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2001-06-15 19:46:46 +00:00
|
|
|
This plays an mp3 music file music.mp3 using libmad, and:
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=music.mp3 ! mp3parse ! mpg123 ! osssink
|
2001-06-03 22:30:07 +00:00
|
|
|
|
2001-06-15 19:46:46 +00:00
|
|
|
Plays and mp3 music file using mpg123
|
2001-06-01 13:27:15 +00:00
|
|
|
|
2001-06-15 19:46:46 +00:00
|
|
|
You can also stream files over http:
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch httpsrc location=http://domain.com/music.mp3 ! mad ! osssink
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
And using gnome-vfs you can do the same with:
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch gnomevfssrc location=music.mp3 ! mad ! osssink
|
|
|
|
gst-launch gnomevfssrc location=http://domain.com/music.mp3 ! mad ! osssink
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
And too play the same song with gnome-vfs via smb:
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch gnomevfssrc location=smb://computer/music.mp3 ! mad ! osssink
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
Here we convert a Mp3 file into an Ogg Vorbis file:
|
|
|
|
|
2004-05-02 23:30:31 +00:00
|
|
|
gst-launch filesrc location=music.mp3 ! mad ! vorbisenc ! filesink location=music.ogg
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
And then we can play that file with:
|
|
|
|
|
2004-05-02 23:49:11 +00:00
|
|
|
gst-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! audioconvert ! osssink
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
Some other useful pipelines are..
|
|
|
|
Plays wav files (currently there are no wav encoders):
|
|
|
|
|
2004-05-02 23:30:31 +00:00
|
|
|
gst-launch filesrc location=music.wav ! wavparse ! osssink
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
Converts wav files into mp3 and ogg files:
|
|
|
|
|
2004-05-02 23:30:31 +00:00
|
|
|
gst-launch filesrc location=music.wav ! wavparse ! vorbisenc ! filesink location=music.ogg
|
|
|
|
gst-launch filesrc location=music.wav ! wavparse ! mpegaudio ! filesink location=music.mp3
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
You can also use lame for mp3 encoding if you have it installed, it does a
|
|
|
|
much better job than mpegaudio.
|
|
|
|
|
|
|
|
Rips all songs from cd and saves them into a mp3 file:
|
|
|
|
|
2004-05-02 23:30:31 +00:00
|
|
|
gst-launch cdparanoia ! mpegaudio ! filesink location=cd.mp3
|
2001-06-15 19:46:46 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
You can toy around with gst-inspect to discover the settings for
|
2001-06-15 19:46:46 +00:00
|
|
|
cdparanoia to rip individual tracks
|
|
|
|
|
|
|
|
Record sound from your sound input and encode it into an ogg file:
|
|
|
|
|
2004-05-02 23:30:31 +00:00
|
|
|
gst-launch osssrc ! vorbisenc ! filesink location=input.ogg
|
2001-06-15 19:46:46 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch not only handles audio but video as well:
|
2001-06-15 19:46:46 +00:00
|
|
|
For mpeg1 files (video and audio streams respectively):
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=video.mpg ! mpegdemux video_00! { queue ! mpeg2dec ! sdlvideosink }
|
|
|
|
gst-launch filesrc location=video.mpg ! mpegdemux audio_00! { queue ! mad ! osssink }
|
2001-06-15 19:46:46 +00:00
|
|
|
|
2001-12-29 15:44:43 +00:00
|
|
|
for mpeg1 with both audio and video (for glib2):
|
2001-12-17 14:24:26 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=video.mpg ! mpegdemux name=demux video_00! { queue ! mpeg2dec ! sdlvideosink } demux.audio_00! { queue ! mad ! osssink }
|
2001-12-17 14:24:26 +00:00
|
|
|
|
2001-12-29 15:44:43 +00:00
|
|
|
for mpeg1 with both audio and video (for gtk1.2, the shim doesn't handle the 'name' property yet):
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=video.mpg ! mpegdemux video_00! { queue ! mpeg2dec ! sdlvideosink } mpegdemux0.audio_00! { queue ! mad ! osssink }
|
2001-12-29 15:44:43 +00:00
|
|
|
|
2001-06-15 19:46:46 +00:00
|
|
|
For mpeg2 files (video and audio streams respectively):
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=video.mpeg ! mpegdemux video_00! { queue ! mpeg2dec ! sdlvideosink }
|
|
|
|
gst-launch filesrc location=video.mpeg ! mpegdemux private_stream_1.0! { queue ! a52dec ! osssink }
|
2001-12-17 14:24:26 +00:00
|
|
|
|
2001-12-29 15:44:43 +00:00
|
|
|
for mpeg2 with both audio and video (glib2):
|
2001-12-17 14:24:26 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=video.mpg ! mpegdemux name=demux video_00! { queue ! mpeg2dec ! sdlvideosink } demux.private_stream_1.0! { queue ! a52dec ! osssink }
|
2001-06-15 19:46:46 +00:00
|
|
|
|
|
|
|
Note: The types of audio streams in the mpeg files can vary!
|
2001-12-31 15:55:29 +00:00
|
|
|
|
|
|
|
For an avi file (DivX, mjpeg,...)
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-launch filesrc location=video.avi ! avidecoder video_00! { queue ! sdlvideosink } avidecoder0.audio_00! { queue ! osssink }
|
2001-12-31 15:55:29 +00:00
|
|
|
|
|
|
|
|
2006-01-12 16:31:35 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-complete
|
2001-06-01 13:27:15 +00:00
|
|
|
==================
|
|
|
|
|
|
|
|
This is a simple utility which provides custom bash completion when
|
2002-02-04 20:33:14 +00:00
|
|
|
typing gst-launch commands.
|
2001-06-01 13:27:15 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
Simply run "gst-compprep" as root to build the registry of completions,
|
2001-06-15 19:46:46 +00:00
|
|
|
and then put, in your .bashrc,
|
2002-02-04 20:33:14 +00:00
|
|
|
"complete -C gst-complete gst-launch"
|
|
|
|
(ensuring that gst-complete is on your path).
|
2001-06-01 13:27:15 +00:00
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
You can then enjoy context sensitive tab-completion of gst-launch
|
2001-06-01 13:27:15 +00:00
|
|
|
commands.
|
2001-06-03 22:30:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
gst-inspect
|
2001-06-03 22:30:07 +00:00
|
|
|
=================
|
|
|
|
|
|
|
|
Allows you to check the properties of plugins and elements.
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
./gst-inspect
|
2001-06-03 22:30:07 +00:00
|
|
|
|
|
|
|
will show all the plugins available and the elements they contain.
|
|
|
|
|
2002-02-04 20:33:14 +00:00
|
|
|
./gst-inspect <pluginname/elementname>
|
2001-06-03 22:30:07 +00:00
|
|
|
|
|
|
|
shows more info about the plugin/element.
|
|
|
|
|
2006-01-12 16:31:35 +00:00
|
|
|
|
|
|
|
|
2003-02-21 20:02:08 +00:00
|
|
|
gst-xmlinspect
|
|
|
|
=================
|
|
|
|
|
|
|
|
Dump properties of plugins and elements in an xml format. You can
|
|
|
|
transform the xml to something else with an appropriate stylesheet.
|
|
|
|
|
|
|
|
./gst-xmlinspect <elementname> | xsltproc xml2text.xsl -
|
|
|
|
|
2001-06-03 22:30:07 +00:00
|
|
|
|