[theora] Liboggplay seeking artifacts

Chris Pearce chris at pearce.org.nz
Thu Jul 23 20:27:22 PDT 2009

To seek to the frame at time t without artifacts, you can use this basic 
approach with liboggplay:

1. Determine the maximum time between keyframes. This is the maximum of 
all streams':
	(max number of frames between keyframes) * (frame duration)
(number of frames between keyframes) = ((1 << granuleshift) - 1)
You only really need to calculate this for streams with have a 
granuleshift (e.g. not vorbis streams).

2. Seek to t - (maximum time between keyframes) (using oggplay_seek()).

3. Decode forward (using oggplay_step_decode()) until the frame you get 
back has time t.

This is the approach I propose in mozilla bug 501031:

There's a patch in that bug which make these changes, and a few speed 
ups to liboggz (which liboggplay uses).

 > Is there a more appropriate list to post to regarding liboggplay?

Maybe ogg-dev?

All the best,
Chris Pearce

On 21/07/2009 3:44 a.m., Shayne Wissler wrote:
> Is anyone working on liboggplay, and if so, is there any plan to support
> keyframe-based seeking? I found this, but seems to me that the feature
> ought to be part of liboggplay:
> http://pearce.org.nz/2009/05/video-seeking-improvements.html
> Is there a more appropriate list to post to regarding liboggplay?
> Shayne Wissler
> ------------------------------------------------------------------------
> _______________________________________________
> theora mailing list
> theora at xiph.org
> http://lists.xiph.org/mailman/listinfo/theora

More information about the theora mailing list