Can't encode and decode live audio in a single gstreamer pipeline

Ezequiel Garcia ezequiel at vanguardiasur.com.ar
Fri Dec 11 07:25:57 PST 2015


On 7 December 2015 at 17:50, Ezequiel Garcia
<ezequiel at vanguardiasur.com.ar> wrote:
> (This is a repost of a question on stack overflow:
> http://stackoverflow.com/questions/34138451/how-to-encode-decode-live-audio-in-a-single-gstreamer-pipeline)
>
> For the sake of testing, I'd like to construct a pipeline that encodes
> and then decodes live audio. I have tried with mp3 or aac encoding,
> and I can certainly do it if the source is non-live:
>
>     $ gst-launch-1.0 audiotestsrc ! lamemp3enc ! mad ! alsasink
>     $ gst-launch-1.0 audiotestsrc ! faac ! audio/mpeg,
> stream-format=raw ! faad ! alsasink
>
> In the above cases, the pipeline is constructed and I can hear the
> audio playing back. However, if the source is live (e.g.
> is-live=TRUE), the pipeline doesn't fail to play, but there's no audio
> played back.
>
> Moreover, when the source is live, the pipeline is not blocked (using
> log debug level shows the frames are making progress).
>
> This same behavior is found on other live sources, such as alsasrc
> from an alsa capture card.
>
> I'm sure I'm missing some key concept, but can't see what!

After some research, I believe the problem is that playing a
high-latency pipeline
requires some work.

Using a queue with a large min-threshold-time, or playng with
latency-time and buffer-time values in the alsasink
sink might work (guess your mileage may vary):

gst-launch-1.0 audiotestsrc is-live=TRUE ! faac ! aacparse ! faad !
alsasink buffer-time=10000000 latency-time=1000000
-- 
Ezequiel GarcĂ­a, VanguardiaSur
www.vanguardiasur.com.ar


More information about the gstreamer-devel mailing list