[gst-devel] Getting cracked sound when encoding from audiotestsrc -> filesink

Wim Taymans wim.taymans at gmail.com
Wed Apr 29 12:39:30 CEST 2009


On Wed, 2009-04-29 at 07:05 -0300, Guilherme wrote:
> Hi all.
> 
> I am getting a cracked noise when running the following pipeline:
> 
> [audiotestsrc] ! [wavenc] ! [filesrc]
> 
> I fighting 4 weeks and Ive tried everything that I know to solve that... 
> without success ;o(

Someone gave you the answer already a couple of times, you need to
cleanly shutdown the pipeline or else the wav file is invalid/corrupted.
To do this, send EOS to the pipeline and wait for the EOS message before
setting the pipeline to NULL.

Wim

> 
> That's the code:
> 
> #include<gst/gst.h>
> #include<glib.h>
> 
> static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data);
> 
> int main(int argc, char *argv[])
> {
>     GMainLoop *loop;
>    
>     GstElement *pipeline, *source, *audioconvert, *wavenc, *filesink;
>     GstBus *bus;
>    
>     gst_init(&argc, &argv);
>    
>     loop = g_main_loop_new (NULL, FALSE);
>    
>     /*creating elements*/
>     pipeline     = gst_pipeline_new ("audio-player");
>     source       = gst_element_factory_make ("audiotestsrc", "file-source");
>     //audioconvert = gst_element_factory_make ("audioconvert", 
> "audio-conversor");
>     wavenc       = gst_element_factory_make ("wavenc",       "wave-enc");
>     filesink     = gst_element_factory_make ("filesink",     
> "audio-output");
>    
>     if (!pipeline || !source || !audioconvert|| !wavenc || !filesink) {
>         g_printerr ("One element could not be created. Exiting.\n");
>         return -1;
>     }
>    
>     g_object_set (G_OBJECT (filesink), "location", "foo.wav", NULL);
>    
>     /*set-up the pipeline*/
>    
>     /*message handler*/
>     bus =  gst_pipeline_get_bus (GST_PIPELINE (pipeline));
>     gst_bus_add_watch (bus, bus_call, loop);   
>     gst_object_unref (bus);
>    
>     /*colocar todos elementos na pipeline*/
>     gst_bin_add_many (GST_BIN (pipeline), source, wavenc, filesink, NULL);
>                            
>     /*Linkar elementos*/
>     //gst_element_link ();
>     gst_element_link_many (source, wavenc, filesink, NULL);
>     //g_signal_connect (demuxer, "pad-added", G_CALLBACK (on_pad_added), 
> decoder);
>    
>     /* set pipeline playing status */
>     g_print ("Running...\n");
>     gst_element_set_state (pipeline, GST_STATE_PLAYING);
>    
>     /*iterate*/
>     g_print ("Recording\n");
>     g_main_loop_run (loop);
>    
>     /* Out of the main loop, clean up nicely */
>    g_print ("Returned, stopping playback\n");
>    gst_element_set_state (pipeline, GST_STATE_NULL);
> 
>    g_print ("Deleting pipeline\n");
>    gst_object_unref (GST_OBJECT (pipeline));
> 
>   return 0;
> }
> 
> static gboolean bus_call(GstBus *bus, GstMessage *msg, gpointer data) {
> 
>     return TRUE;
> }
> 
> Does anyone could give to me some help??
> 
> Thanks!
> 
> Tks!
> 
> -------------------
> 
> Guilherme Longo
> Dept. Eng. da Computação
> Unaerp
> 
> Linux User - #484927
> 
> *Before Asking
> http://www.istf.com.br/?page=perguntas
> 
> !- I'd rather die on my feet than live on my knees -!
> 
> 
> 
> Jan Schmidt wrote:
> > On Wed, 2009-04-29 at 10:38 +0100, Jan Schmidt wrote:
> >   
> >> Hi all,
> >>
> >> Just to let you all know, the release is currently waiting for these
> >> regressions in gst-plugins-base to be resolved. After the bugs are
> >> fixed, I'll make some new pre-release tarballs, and then the release
> >> itself (hopefully) a few days later.
> >>     
> >
> > For interest's sake, the blocker bugs in question are:
> > http://bugzilla.gnome.org/show_bug.cgi?id=580020 and
> > http://bugzilla.gnome.org/show_bug.cgi?id=580470
> >
> > - Jan
> >
> >   
> >> With luck, that will happen soon, as the slippage means that Good and
> >> Bad are scheduled to freeze for their releases next Monday already...
> >>
> >> J.
> >>
> >> On Tue, 2009-04-21 at 22:45 +0100, Jan Schmidt wrote:
> >>     
> >>> Hi all,
> >>>
> >>> The 2nd pre-release tarballs for each of Core, Base Plugins and the
> >>> Python bindings are now available at:
> >>>
> >>> http://gstreamer.freedesktop.org/src/gstreamer/pre/gstreamer-0.10.22.3.tar.bz2
> >>> http://gstreamer.freedesktop.org/src/gst-plugins-base/pre/gst-plugins-base-0.10.22.3.tar.bz2
> >>> and
> >>> http://gstreamer.freedesktop.org/src/gst-python/pre/gst-python-0.10.14.3.tar.bz2
> >>>
> >>> These fix a variety of small bugs. Please test them, and file any
> >>> bugs/regressions in bugzilla - http://bugzilla.gnome.org/
> >>>
> >>> Expect the release Monday 27th April, unless (for some reason) there's a
> >>> need for more pre-releases before then.
> >>>
> >>> Cheers,
> >>> Jan.
> >>>       
> 
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations 
> Conference from O'Reilly Media. Velocity features a full day of 
> expert-led, hands-on workshops and two days of sessions from industry 
> leaders in dedicated Performance & Operations tracks. Use code vel09scf 
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list