Seamless playback without playbin

marcin at saepia.net marcin at saepia.net
Sun Sep 1 03:58:37 PDT 2013


Hi,

thanks for quick answer.

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?

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

If such precise joining two tracks is not possible right now, how gnonlin
handles this rather often case in non-linear editing? Could gnonlin's code
be a possible source of inspiration for me?

Thanks,

m.


2013/8/31 Tim-Philipp Müller <t.i.m at zen.co.uk>

> On Sat, 2013-08-31 at 00:36 +0200, marcin at saepia.net wrote:
>
> Hi,
>
> > I have pipeline with two branches, and I need to switch them
> > dynamically without any gaps.
> >
> >
> > Each branch is basically
> >
> >
> > filesrc -> decodebin -> audioresample -> audioconvert -> capsfilter
> >
> >
> > put in a bin where bin's src ghost pad is made out of capsfilter's src
> > pad.
> >
> >
> > I have EVENT_BOTH pad probe on capsfilter's src pad and I listen for
> > EOS.
> >
> > When EOS happens, another branch is always prepared for playback, I
> > mean it is in PLAYING state but bin's src pad is blocked.
> >
> >
> > In callback for EOS I immediately unlink EOSed bin, link another one
> > and remove blocking pad probe for the newly linked branch.
> >
> >
> > Sound plays, but there are tiny gaps between files.
> >
> > What else should I do in order to achieve gapless playback?
>
> What are your input files? Have you tried with .wav files?
>
> Encoded files may introduce coding-related gaps. Sometimes those are
> tagged somewhere, sometimes not. I don't think we handle this yet.
>
> http://wiki.hydrogenaudio.org/index.php?title=Gapless_playback
>
> has some info in case you're interested.
>
> I believe rhythmbox implements cross-fading outside of playbin, which
> might be interesting code to look at for inspiration, if it works.
>
>  Cheers
>   -Tim
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130901/4dd1c929/attachment.html>


More information about the gstreamer-devel mailing list