2002-10-19 09:15:52 +00:00
|
|
|
<sect1 id="chapter-using">
|
|
|
|
<title id="title-using">Using GStreamer</title>
|
|
|
|
<qandaset>
|
|
|
|
|
2002-10-26 15:18:03 +00:00
|
|
|
<qandaentry>
|
|
|
|
<question id="using-getting-started">
|
|
|
|
<para>Ok, I've installed GStreamer. What can I do next ?</para>
|
|
|
|
</question>
|
|
|
|
|
|
|
|
<answer>
|
|
|
|
<para>
|
|
|
|
First of all, verify that you have a working registry and that you can
|
|
|
|
inspect them by typing
|
|
|
|
<programlisting>
|
|
|
|
$ gst-inspect fakesrc
|
|
|
|
</programlisting>
|
|
|
|
This should print out a bunch of information about this particular element.
|
|
|
|
If this tells you that there is "no such element or plugin", you haven't
|
|
|
|
installed GStreamer correctly. Please check
|
|
|
|
<link linkend="chapter-getting">how to get GStreamer</link>
|
|
|
|
If this fails with any other message, we would appreciate a
|
|
|
|
<link linkend="using-bugs-where">bug report</link>.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
It's time to try out a few things. Start with gst-launch and two plug-ins
|
|
|
|
that you really should have : fakesrc and fakesink. They do nothing except
|
|
|
|
pass empty buffers. Type this at the command-line :
|
|
|
|
<programlisting>
|
2005-02-08 16:42:21 +00:00
|
|
|
$ gst-launch -v fakesrc num-buffers=3 ! fakesink
|
2002-10-26 15:18:03 +00:00
|
|
|
</programlisting>
|
|
|
|
This will print out output that looks similar to this :
|
|
|
|
<programlisting>
|
2005-02-08 16:42:21 +00:00
|
|
|
RUNNING pipeline ...
|
2002-10-26 15:18:03 +00:00
|
|
|
fakesrc0: last-message = "get ******* (fakesrc0:src)gt; (0 bytes, 0) 0x8057510"
|
|
|
|
fakesink0: last-message = "chain ******* (fakesink0:sink)lt; (0 bytes, 0) 0x8057510"
|
|
|
|
fakesrc0: last-message = "get ******* (fakesrc0:src)gt; (0 bytes, 1) 0x8057510"
|
|
|
|
fakesink0: last-message = "chain ******* (fakesink0:sink)lt; (0 bytes, 1) 0x8057510"
|
|
|
|
fakesrc0: last-message = "get ******* (fakesrc0:src)gt; (0 bytes, 2) 0x8057510"
|
|
|
|
fakesink0: last-message = "chain ******* (fakesink0:sink)lt; (0 bytes, 2) 0x8057510"
|
|
|
|
execution ended after 5 iterations (sum 301479000 ns, average 60295800 ns, min 3000 ns, max 105482000 ns)
|
|
|
|
</programlisting>
|
|
|
|
(Some parts of output have been removed for clarity) If it looks similar, then
|
|
|
|
GStreamer itself is running correctly.
|
|
|
|
</para>
|
2002-11-29 13:56:23 +00:00
|
|
|
</answer>
|
|
|
|
</qandaentry>
|
|
|
|
|
|
|
|
<qandaentry>
|
|
|
|
<question id="using-sound">
|
|
|
|
<para>Can my system play sound through GStreamer ?</para>
|
|
|
|
</question>
|
|
|
|
|
|
|
|
<answer>
|
2002-10-26 15:18:03 +00:00
|
|
|
<para>
|
2002-11-29 13:56:23 +00:00
|
|
|
You can test this by trying to play a sine tone. For this, you need to
|
2005-11-23 15:49:06 +00:00
|
|
|
link the audiotestsrc element to an output element that matches your hardware.
|
2002-11-29 13:56:23 +00:00
|
|
|
A (non-complete) list of output plug-ins for audio is
|
|
|
|
<itemizedlist>
|
2002-12-12 16:51:45 +00:00
|
|
|
<listitem><para>osssink for OSS output</para></listitem>
|
|
|
|
<listitem><para>esdsink for ESound output</para></listitem>
|
2005-02-09 16:59:35 +00:00
|
|
|
<listitem><para>artsdsink for aRTs output</para></listitem>
|
2002-12-12 16:51:45 +00:00
|
|
|
<listitem><para>alsasink for ALSA output</para></listitem>
|
|
|
|
<listitem><para>jacksink for JACK output</para></listitem>
|
2002-11-29 13:56:23 +00:00
|
|
|
</itemizedlist>
|
|
|
|
First of all, run gst-inspect on the output plug-in you want to use to
|
|
|
|
make sure you have it installed. For example, if you use OSS, run
|
|
|
|
<programlisting>
|
|
|
|
$ gst-inspect osssink
|
|
|
|
</programlisting>
|
|
|
|
and see if that prints out a bunch of properties for the plug-in.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Then try to play the sine tone by running
|
|
|
|
<programlisting>
|
2005-11-23 15:49:06 +00:00
|
|
|
$ gst-launch audiotestsrc ! osssink
|
2002-11-29 13:56:23 +00:00
|
|
|
</programlisting>
|
|
|
|
and see if you hear something. Make sure your volume is turned up,
|
|
|
|
but also make sure it is not too loud and you are not wearing your headphones.
|
2002-10-26 15:18:03 +00:00
|
|
|
</para>
|
2005-04-14 17:17:30 +00:00
|
|
|
<para>
|
|
|
|
In GNOME, you can configure audio output for most applications by running
|
|
|
|
<programlisting>
|
|
|
|
$ gstreamer-properties
|
|
|
|
</programlisting>
|
|
|
|
which can also be found in the start menu (Applications -> Preferences ->
|
|
|
|
Multimedia Systems Selector). In KDE, there is not yet a shared way of
|
|
|
|
setting audio output for all applications; however, applications such
|
|
|
|
as Amarok allow you to specify an audio output in their preferences dialog.
|
|
|
|
</para>
|
2002-10-26 15:18:03 +00:00
|
|
|
</answer>
|
|
|
|
</qandaentry>
|
|
|
|
|
2002-10-19 09:15:52 +00:00
|
|
|
<qandaentry>
|
|
|
|
<question id="using-gst-inspect">
|
2002-10-26 15:18:03 +00:00
|
|
|
<para>How can I see what GStreamer plugins I have on my system ?</para>
|
2002-10-19 09:15:52 +00:00
|
|
|
</question>
|
|
|
|
|
|
|
|
<answer>
|
|
|
|
<para>
|
|
|
|
To do this you use the gst-inspect
|
|
|
|
command-line tool, which comes standard with GStreamer.
|
|
|
|
Invoked without any arguments,
|
|
|
|
<programlisting>
|
|
|
|
$ gst-inspect
|
|
|
|
</programlisting>
|
|
|
|
will print out a listing of installed plugins.
|
|
|
|
To learn more about a particular plugin, pass its name on the command line.
|
|
|
|
For example,
|
|
|
|
<programlisting>
|
|
|
|
$ gst-inspect volume
|
|
|
|
</programlisting>
|
|
|
|
will give you information about the volume plugin.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Also, if you install the gst-editor package, you will have a graphical
|
|
|
|
plugin browser available, gst-inspect-gui.
|
|
|
|
</para>
|
|
|
|
</answer>
|
|
|
|
</qandaentry>
|
|
|
|
|
|
|
|
<qandaentry>
|
2002-10-24 10:48:21 +00:00
|
|
|
<question id="using-bugs-where">
|
2002-10-19 09:15:52 +00:00
|
|
|
<para>Where should I report bugs ?</para>
|
|
|
|
</question>
|
|
|
|
|
|
|
|
<answer>
|
|
|
|
<para>
|
|
|
|
Bug management is now hosted on GNOME's Bugzilla at
|
|
|
|
<ulink url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>,
|
|
|
|
under the product GStreamer.
|
|
|
|
Using bugzilla you can view past bug history, report new bugs, etc.
|
|
|
|
Bugzilla requires you to make an account here, which might seem cumbersome,
|
|
|
|
but allows us to at least have a chance at contacting you for further
|
|
|
|
information, as we will most likely have to.
|
|
|
|
</para>
|
2002-10-24 10:48:21 +00:00
|
|
|
</answer>
|
|
|
|
</qandaentry>
|
|
|
|
|
|
|
|
|
|
|
|
<qandaentry>
|
|
|
|
<question id="using-bugs-how">
|
|
|
|
<para>How should I report bugs ?</para>
|
|
|
|
</question>
|
|
|
|
|
|
|
|
<answer>
|
2002-10-19 09:15:52 +00:00
|
|
|
<para>
|
|
|
|
When doing a bug report, you should at least describe
|
|
|
|
<itemizedlist>
|
2002-12-12 16:51:45 +00:00
|
|
|
<listitem><para>your distribution</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
how you installed GStreamer (from cvs, source, packages, which ?)</para></listitem>
|
|
|
|
<listitem><para>if you installed GStreamer before</para></listitem>
|
2002-10-19 09:15:52 +00:00
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
|
|
|
<para>
|
2002-10-24 10:48:21 +00:00
|
|
|
It also is useful for us if you attach output of
|
2002-10-19 09:15:52 +00:00
|
|
|
the gst-feedback command to your bug report.
|
|
|
|
If you're having problem with a specific application (either one of ours,
|
|
|
|
somebody else's, or your own), please also provide a log of gst-mask by
|
|
|
|
running
|
|
|
|
<programlisting>
|
|
|
|
myapp --gst-mask=-1 > mask.log 2>&1
|
|
|
|
gzip mask.log
|
|
|
|
</programlisting>
|
|
|
|
(interrupting the program if it doesn't stop by itself)
|
2002-10-24 10:48:21 +00:00
|
|
|
and attach mask.log.gz to your bug report.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
If the application you are having problems with is segfaulting, then
|
|
|
|
provide us with the necessary gdb output. See
|
|
|
|
<xref linkend="troubleshooting-segfault" endterm="troubleshooting-segfault"/>
|
2002-10-19 09:15:52 +00:00
|
|
|
</para>
|
|
|
|
</answer>
|
|
|
|
</qandaentry>
|
|
|
|
|
|
|
|
<qandaentry>
|
|
|
|
<question id="using-gst-launch">
|
|
|
|
<para>How do I use the GStreamer command line interface ?</para>
|
|
|
|
</question>
|
|
|
|
<answer>
|
|
|
|
<para>
|
|
|
|
You access the GStreamer command line interface using the command gst-launch.
|
|
|
|
To decode an mp3 and play it through OSS, you could use
|
|
|
|
<programlisting>
|
2005-12-11 11:53:56 +00:00
|
|
|
gst-launch filesrc location=thesong.mp3 ! mad ! audioconvert !
|
|
|
|
audioresample ! osssink
|
2002-10-19 09:15:52 +00:00
|
|
|
</programlisting>.
|
|
|
|
More examples can be found in the gst-launch man page.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
To automatically detect the right codec in a pipeline, try
|
|
|
|
<programlisting>
|
2005-12-11 11:53:56 +00:00
|
|
|
gst-launch filesrc location=my-random-media-file.mpeg ! decodebin !
|
|
|
|
audioconvert ! audioresample ! osssink
|
2002-10-19 09:15:52 +00:00
|
|
|
</programlisting>.
|
2005-12-11 11:53:56 +00:00
|
|
|
or
|
|
|
|
<programlisting>
|
|
|
|
gst-launch filesrc location=my-random-media-file.mpeg ! decodebin !
|
|
|
|
ffmpegcolorspace ! xvimagesink
|
|
|
|
</programlisting>
|
|
|
|
Something more complicated:
|
|
|
|
<programlisting>
|
|
|
|
gst-launch filesrc location=my-random-media-file.mpeg ! decodebin name=decoder
|
|
|
|
decoder. ! ffmpegcolorspace ! xvimagesink
|
|
|
|
decoder. ! audioconvert ! audioresample ! osssink
|
|
|
|
</programlisting>
|
2002-10-19 09:15:52 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2005-12-11 11:53:56 +00:00
|
|
|
We also have a basic media playing plugin that will take care of most things
|
|
|
|
for you. This plugin is called playbin. Try this:
|
2002-10-19 09:15:52 +00:00
|
|
|
<programlisting>
|
2005-12-11 11:53:56 +00:00
|
|
|
gst-launch playbin uri=file:///home/joe/my-random-media-file.mpeg
|
2002-10-19 09:15:52 +00:00
|
|
|
</programlisting>
|
2005-12-11 11:53:56 +00:00
|
|
|
This should play the file if the format is supported, ie. you have all the
|
|
|
|
necessary demuxing and decoding and some output plugins installed.
|
2002-10-19 09:15:52 +00:00
|
|
|
</para>
|
|
|
|
</answer>
|
|
|
|
</qandaentry>
|
|
|
|
</qandaset>
|
|
|
|
</sect1>
|