[gst-devel] clocking
David Schleef
ds at schleef.org
Thu Feb 26 15:18:05 CET 2004
On Thu, Feb 26, 2004 at 05:55:19PM +0100, Ronald S. Bultje wrote:
> On Thu, 2004-02-26 at 23:26, Thomas Vander Stichele wrote:
> > If you haven't heard scrubbing, there's no point in speculating if it
> > could be. Listen to what it is.
>
> I know what scrubbing is. And I'm convinced that our seeking *protocol*
> is well able to handle it.
To scrub audio effectively, you need to essentially have random
access[1] to the data stream. Then you need to resample the audio
in a way that takes into account the instantaneous velocity of the
scrub pointer, position, etc., and create an evenly sampled output
stream. This actually has very little to do with clocking, and
simply requires keeping a cache of the samples you may use in the
next N seconds of scrubbing (which may be ahead or behind the
instantaneous scrubbing time), and update this cache (by seeking)
when necessary.
If you're always scrubbing forward in time, no seeking is necessary,
and it's effectively a fancy version of the speed element that has
a dparam for the speed. If you're scrubbing backwards in time, you
have to solve the playing backwards problem -- something that hasn't
been tackled in GStreamer yet, but wouldn't be that hard.
By the way, libaudioresample was designed with this in mind, although
it doesn't currently support it.
Video scrubbing is a lot simpler -- you just push out the nearest
frame to the instantaneous time every 1/rate seconds.
dave...
--
[1] Actually, it's quite deterministic, but outside the concept of
streaming.
More information about the gstreamer-devel
mailing list