[gst-devel] [RFC] invalid buffers

Ted Gould ted at gould.cx
Sat Jun 15 10:15:02 CEST 2002


> Generally speaking, i would expect the seek code to somehow:
> 
> 1. scan backward to the most recent I frame
> 
> 2. decode it
> 
> 3. skip the following P frames until exactly the desired P frame is found

Unfortunately it isn't quite that simple.  If you have a GOP like this:

	I P B B P B B P B B
	0 1 2 3 4 5 6 7 8 9

If you want to seek to frame 8 you need to decode frames: 0,1,4,7,8. 
This is because the P frames reference the last anchor frame, not to the
I frame.  So while it is very possible to do, you'll have to decode more
than a couple of frames.  This gets even more computationally intensive
as your GOP length increases (I've heard that 30 frames/GOP will become
common in the future).  This is also why things like DV and NLEs use I
frame only MPEG - much easier to seek in.

		Have fun,
			Ted

PS - I don't know if GStreamer needs to handle this, but there is also
the issue of 'I-Slice' streams.  MPEG streams where there are no I
frames and instead there are just intracoded blocks on all of the
P-frames so that 10 P-frames make a solid picture.  This adds even
another complexity :)





More information about the gstreamer-devel mailing list