[gst-devel] oggdemux push seek support
Jay L. T. Cornwall
jay at jcornwall.me.uk
Sat Jan 16 18:34:19 CET 2010
Hi,
I am interested in putting together a patch to enable seeking in the
oggdemux element when configured in push mode. My use case is for .ogg
files streamed over the DAAP protocol, which takes place over HTTP. The
Rhythmbox audio player implements this with a GStreamer chain beginning
with souphttpsrc (in push mode).
The Ogg format is inherently difficult to seek because the stream
headers (intentionally, by virtue of its streaming-oriented design) do
not provide enough information to do this and its codecs are typically
VBR. In pull mode, oggdemux performs a bisection search of the stream to
identify chains (Ogg files concatenated together) and to compute the
total stream length, among other things. This process is too seek
intensive for push mode and so the demuxer currently has no seek support
in push mode.
Going on a FIXME suggestion in gstoggdemux.c I wondered if it might be
possible to add support for a less accurate seek via GST_FORMAT_PERCENT.
A single seek request could be issued to a location, in bytes,
proportional to the file length. libogg would then resync the stream and
playback could continue from the approximated position.
A DAAP server typically scans media files for stream length and presents
the total time to the client. Patching Rhythmbox to issue
GST_FORMAT_PERCENT seek requests when GST_FORMAT_TIME is unavailable was
quite easy and makes sense in the UI.
The main challenge I see is:
* Chained files could drop you into a part of the stream without having
read the page headers first. This is bad and, worse, even undetectable
if the same Ogg page serial numbers are used by different chains.
This seems like a showstopper for such an idea and I can't see a way
around it. VLC does a similar thing and simply crashes if you seek too
far into a chained file streamed over HTTP. Since chained files are an
intentional design feature of the Ogg format I am loathe to consider
them outliers and implement this anyway.
What do you think?
--
Jay L. T. Cornwall
http://www.jcornwall.me.uk/
More information about the gstreamer-devel
mailing list