Seamless playback without playbin

Tim-Philipp Müller t.i.m at zen.co.uk
Wed Sep 4 09:50:29 PDT 2013


On Sun, 2013-09-01 at 12:58 +0200, marcin at saepia.net wrote:

Hi,

> Is there any way to buffer this gap?
> 
> 
> I mean that if I have filesrc + decoder it can read/decode data much
> faster than they are played back by the soundcard. So if I understand
> GStreamer logic correctly, it should be possible to have buffer that
> plays back audio at constant pace, and even if these two decoders
> switch and have gap for a few milliseconds, queue will continue
> sending buffered data without gap, and the gap itself will be filled
> when new branch is finally attached and decoder will pass through the
> delays introduced by codec, shouldn't it?

When I say there's a codec-related delay, I mean that data output has a
few silence samples at the beginning or end, not an actual delay in
getting the data ready. (Did you read the page I linked?)

> I tried to achieve something like this, with no sucess, so I am not
> sure if it is entirely possible with GStreamer?

Of course it's possible. But if there are silence samples, GStreamer
will play the silence samples.

If you just switch streams like you describe, you will have to make sure
you move the segment along for the second stream btw, or use
streamsynchronizer, which is exposed as an element now.

If I split an audio file into multiple .wav or .flac files, and then do:

 $ gst-play-1.0 --gapless /tmp/chunk-*

that plays perfectly fine and without any gap whatsoever for me, btw.

(Both in git master, but also with 1.0 branch)

(Though I seem to remember a bug about using the gapless feature with
http or other slow to preroll sources.)

Cheers
 -Tim




More information about the gstreamer-devel mailing list