Why does adding ! audiorate screw up audio?

Tom Gibson tom at tomgibsonconsulting.com
Mon Feb 14 22:30:13 CET 2011


I ran the debugger and see something interesting.  Near the very
start, when the second buffer is input to the audiorate element, it
truncates samples.  The behavior continues through the entire stream
playback.  This leads me to think there is an issue with the source
flv file or the code that decodes it.  Anyone have any insight on what
to figure?

More info:

First buffer comes into audiorate element.  Timestamp = 0, 1024 audio
samples (4096 bytes).  Everything seems good.  in_offset gets computed
to 0 inside of gst_audio_rate_chain().

Then, the 2nd buffer comes.  It has a timestamp of 23000000.  The
audio rate is 44,100.  in_offset gets computed to 1014 , which
truncates 10 samples.

Any help is appreciated.

-Tom

On Mon, Feb 14, 2011 at 12:29 PM, Tom Gibson
<tom at tomgibsonconsulting.com> wrote:
> I'm still a bit stuck on this problem.  Could someone help me figure
> out where the problem is and if it's a bug in the audiorate or decode
> elements?
>
> I uploaded my test flv file which demonstrates the problem.  You can
> download it from:
> http://www.4shared.com/video/RekJLrXr/tone-clips.html
>
> The following cmdline should play the audio fine:
>
> gst-launch-0.10 uridecodebin name=d uri=file:///tmp/tone-clips.flv !
> autoaudiosink
>
> Modifying it slightly by adding an audiorate element causes the audio
> to sound bad.  Here is the cmdline that produces a problem:
>
> gst-launch-0.10 uridecodebin name=d uri=file:///tmp/tone-clips.flv !
> audiorate ! autoaudiosink
>
>
> Thanks,
>
> Tom
>
>
> On Mon, Jan 31, 2011 at 12:10 PM, Tom G <tomwg123 at gmail.com> wrote:
>> Hello,
>>
>> I'm fairly new to g-streamer and have been unable to understand why
>> the audio in my pipeline outputs poorly if I add ! audiorate.  I can
>> reproduce with a very simple gst-launch command line.
>>
>> gst-launch filesrc location=/tmp/test.flv ! decodebin ! audiorate !
>> autoaudiosink
>>
>> That produces audio output that has a constant clicking sound in the
>> background.  If I remove the ! audiorate element, then it sounds
>> perfect.
>>
>> I started working with an existing pipeline that somebody else
>> designed and am not even confident I should be using the audiorate
>> element since the normal (non-debug) pipeline outputs to an mpegts.
>> Why would it screw things up though?  I would have expected the input
>> audio to already be like a perfect stream and for it to output looking
>> the same as on input.
>>
>> Any help is appreciated.
>>
>> -Tom
>>
>
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list