[gst-devel] seeking VBR

Joshua N Pritikin vishnu at pobox.com
Tue Nov 19 08:38:03 CET 2002

Since the ffmpeg plugin isn't ready yet ...

In gst_mpeg2dec_convert_sink, i see that the time->byte offset
conversion is done with the byte_rate.  This assumes a CBR. However,
most streams are VBR.  At least, i only care about VBR.  i haven't
found any open-source encoders which aren't VBR (which makes it hard
to create crystal clear VCDs).

How hard would it be to extract the time->byte offset mapping into an
index file and use that (like cinelerra & mpeg3toc)?  It seems like a
matter of:

1. Adding another sink pad (and mode?) to mpeg2dec which outputs the
index at maximum parse speed .. then pipe the index to fdsink.

2. Add an "index-file" property to mpeg2dec.  This file could be
mmap'd in whole .. and that is it.

It sounds easy enough that i'd be willing to code something up.

Is this design the gstreamer way of doing things?  What would be the
_perfect_ way to support this type of index file option?  Can we just
hack it temporarily?

Let's assume that all frames are I-frames.  What the best byte-offset
for a given frame?  Where in mpeg2dec is the "start of frame"
identified?  Is this the correct byte-offset to use for seeking?

Everything else is tested & ready.  i just need accurate seek for VBR.

Victory to the Divine Mother!!         after all,
  http://sahajayoga.org                  http://why-compete.org

More information about the gstreamer-devel mailing list