mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
first try at hunting old elements that where renamed like :
Original commit message from CVS: first try at hunting old elements that where renamed like : - parsewav (never existed, should be wavparse) - vorbisfile (now oggdemux ! vorbisdec) - disksink (now filesink)
This commit is contained in:
parent
5715002322
commit
0b3089e537
8 changed files with 30 additions and 22 deletions
|
@ -104,7 +104,7 @@ eos (GstElement *src, gpointer data)
|
|||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstElement *filesrc, *decoder, *audiosink;
|
||||
GstElement *filesrc, *demuxer, *decoder, *audiosink;
|
||||
GstElement *thread;
|
||||
|
||||
if (argc < 2) {
|
||||
|
@ -125,8 +125,12 @@ main (int argc, char *argv[])
|
|||
g_signal_connect (G_OBJECT (filesrc), "eos",
|
||||
G_CALLBACK (eos), thread);
|
||||
|
||||
/* create an ogg decoder */
|
||||
decoder = gst_element_factory_make ("vorbisfile", "decoder");
|
||||
/* create an ogg demuxer */
|
||||
demuxer = gst_element_factory_make ("oggdemux", "demuxer");
|
||||
g_assert (demuxer != NULL);
|
||||
|
||||
/* create a vorbis decoder */
|
||||
decoder = gst_element_factory_make ("vorbisdec", "decoder");
|
||||
g_assert (decoder != NULL);
|
||||
|
||||
/* and an audio sink */
|
||||
|
@ -134,9 +138,9 @@ main (int argc, char *argv[])
|
|||
g_assert (audiosink != NULL);
|
||||
|
||||
/* add objects to the thread */
|
||||
gst_bin_add_many (GST_BIN (thread), filesrc, decoder, audiosink, NULL);
|
||||
gst_bin_add_many (GST_BIN (thread), filesrc, demuxer, decoder, audiosink, NULL);
|
||||
/* link them in the logical order */
|
||||
gst_element_link_many (filesrc, decoder, audiosink, NULL);
|
||||
gst_element_link_many (filesrc, demuxer, decoder, audiosink, NULL);
|
||||
|
||||
/* start playing */
|
||||
gst_element_set_state (thread, GST_STATE_PLAYING);
|
||||
|
|
|
@ -271,7 +271,7 @@ main (int argc, char *argv[])
|
|||
</para>
|
||||
<para>
|
||||
We can also choose to use another type of sink instead of the audiosink.
|
||||
We could use a disksink to write the raw samples to a file, for example.
|
||||
We could use a filesink to write the raw samples to a file, for example.
|
||||
It should also be clear that inserting filters, like a stereo effect,
|
||||
into the pipeline is not that hard to do. The most important thing is
|
||||
that you can reuse already existing elements.
|
||||
|
|
|
@ -271,7 +271,7 @@ main (int argc, char *argv[])
|
|||
</para>
|
||||
<para>
|
||||
We can also choose to use another type of sink instead of the audiosink.
|
||||
We could use a disksink to write the raw samples to a file, for example.
|
||||
We could use a filesink to write the raw samples to a file, for example.
|
||||
It should also be clear that inserting filters, like a stereo effect,
|
||||
into the pipeline is not that hard to do. The most important thing is
|
||||
that you can reuse already existing elements.
|
||||
|
|
|
@ -104,7 +104,7 @@ eos (GstElement *src, gpointer data)
|
|||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GstElement *filesrc, *decoder, *audiosink;
|
||||
GstElement *filesrc, *demuxer, *decoder, *audiosink;
|
||||
GstElement *thread;
|
||||
|
||||
if (argc < 2) {
|
||||
|
@ -125,8 +125,12 @@ main (int argc, char *argv[])
|
|||
g_signal_connect (G_OBJECT (filesrc), "eos",
|
||||
G_CALLBACK (eos), thread);
|
||||
|
||||
/* create an ogg decoder */
|
||||
decoder = gst_element_factory_make ("vorbisfile", "decoder");
|
||||
/* create an ogg demuxer */
|
||||
demuxer = gst_element_factory_make ("oggdemux", "demuxer");
|
||||
g_assert (demuxer != NULL);
|
||||
|
||||
/* create a vorbis decoder */
|
||||
decoder = gst_element_factory_make ("vorbisdec", "decoder");
|
||||
g_assert (decoder != NULL);
|
||||
|
||||
/* and an audio sink */
|
||||
|
@ -134,9 +138,9 @@ main (int argc, char *argv[])
|
|||
g_assert (audiosink != NULL);
|
||||
|
||||
/* add objects to the thread */
|
||||
gst_bin_add_many (GST_BIN (thread), filesrc, decoder, audiosink, NULL);
|
||||
gst_bin_add_many (GST_BIN (thread), filesrc, demuxer, decoder, audiosink, NULL);
|
||||
/* link them in the logical order */
|
||||
gst_element_link_many (filesrc, decoder, audiosink, NULL);
|
||||
gst_element_link_many (filesrc, demuxer, decoder, audiosink, NULL);
|
||||
|
||||
/* start playing */
|
||||
gst_element_set_state (thread, GST_STATE_PLAYING);
|
||||
|
|
|
@ -373,7 +373,7 @@ channels = 1 - MAXINT (INT, number of audio channels)
|
|||
4 - Ogg/Vorbis
|
||||
MIME type: audio/x-vorbis
|
||||
Encoder: vorbisenc
|
||||
Decoder: vorbisfile
|
||||
Decoder: vorbisdec
|
||||
|
||||
5 - Windows Media Audio 1 and 2 (WMA)
|
||||
MIME type: audio/x-wma
|
||||
|
|
|
@ -29,7 +29,7 @@ limit the valid directions an event can travel in? ie. Can EOS only
|
|||
travel downstream (left to right)?
|
||||
|
||||
eg. Seek travels upstream, but it makes sense to also make it travel
|
||||
downstream (the case of a disksink, where we overwrite the header)
|
||||
downstream (the case of a filesink, where we overwrite the header)
|
||||
|
||||
|
||||
Setting an event function
|
||||
|
|
14
tools/README
14
tools/README
|
@ -31,35 +31,35 @@ And too play the same song with gnome-vfs via smb:
|
|||
|
||||
Here we convert a Mp3 file into an Ogg Vorbis file:
|
||||
|
||||
gst-launch filesrc location=music.mp3 ! mad ! vorbisenc ! disksink location=music.ogg
|
||||
gst-launch filesrc location=music.mp3 ! mad ! vorbisenc ! filesink location=music.ogg
|
||||
|
||||
And then we can play that file with:
|
||||
|
||||
gst-launch filesrc location=music.ogg ! vorbisdec ! osssink
|
||||
gst-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! osssink
|
||||
|
||||
Some other useful pipelines are..
|
||||
Plays wav files (currently there are no wav encoders):
|
||||
|
||||
gst-launch filesrc location=music.wav ! parsewav ! osssink
|
||||
gst-launch filesrc location=music.wav ! wavparse ! osssink
|
||||
|
||||
Converts wav files into mp3 and ogg files:
|
||||
|
||||
gst-launch filesrc location=music.wav ! parsewav ! vorbisenc ! disksink location=music.ogg
|
||||
gst-launch filesrc location=music.wav ! parsewav ! mpegaudio ! disksink location=music.mp3
|
||||
gst-launch filesrc location=music.wav ! wavparse ! vorbisenc ! filesink location=music.ogg
|
||||
gst-launch filesrc location=music.wav ! wavparse ! mpegaudio ! filesink location=music.mp3
|
||||
|
||||
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:
|
||||
|
||||
gst-launch cdparanoia ! mpegaudio ! disksink location=cd.mp3
|
||||
gst-launch cdparanoia ! mpegaudio ! filesink location=cd.mp3
|
||||
|
||||
You can toy around with gst-inspect to discover the settings for
|
||||
cdparanoia to rip individual tracks
|
||||
|
||||
Record sound from your sound input and encode it into an ogg file:
|
||||
|
||||
gst-launch osssrc ! vorbisenc ! disksink location=input.ogg
|
||||
gst-launch osssrc ! vorbisenc ! filesink location=input.ogg
|
||||
|
||||
gst-launch not only handles audio but video as well:
|
||||
For mpeg1 files (video and audio streams respectively):
|
||||
|
|
|
@ -224,7 +224,7 @@ Play the mp3 music file "music.mp3" using a libmad-based plug-in and
|
|||
output to an OSS device
|
||||
|
||||
.B
|
||||
gst\-launch filesrc location=music.ogg ! vorbisfile ! osssink
|
||||
gst\-launch filesrc location=music.ogg ! oggdemux ! vorbisdec ! osssink
|
||||
.br
|
||||
Play an Ogg Vorbis format file
|
||||
|
||||
|
|
Loading…
Reference in a new issue