[FFmpeg-devel] [RFC] better ogg seeking, keyframes only

Reimar Döffinger Reimar.Doeffinger
Mon Dec 1 10:17:20 CET 2008

On Thu, Nov 06, 2008 at 01:04:16AM +0100, Diego Biurrun wrote:
> On Sun, Mar 23, 2008 at 04:37:05PM +0100, Diego Biurrun wrote:
> > On Wed, Mar 19, 2008 at 01:16:16PM +0100, Reimar D?ffinger wrote:
> > > I admit this is a rather ugly patch, but it improves things a lot, so
> > > maybe you can have a look and get it committable.
> > > There are several issues with seeking: for audio, PKT_FLAG_KEY is never
> > > set, so the patch ignores it there, the data_offset set by the code in
> > > util.c is wrong, so this code overrides it, and the most annoying
> > > thing: a keyframe most likely is split over multiple ogg pages, so
> > > this code just returns the start of the last page read by the last
> > > get_packet as start offset for the keyframe - this means we might
> > > actually end up a few frames before the key frame (in theory up to 255),
> > > if the encoded frames are very small.
> > 
> > Hmm, I still get artifacts when seeking in Theora video, for example
> > with the samples from mphq...
> Update: While this does not help when seeking Theora video, OGM files
> show improved seeking behavior.
> Reimar, are you still working on this issue?

For me this perfectly fixes seeking for
http://mirror.bigbuckbunny.de/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.ogg ,
at least when using "mplayer -demuxer lavf -vc fftheora" (it is very
slow though).
Please be specific about the files that do not work and how you tested

Reimar D?ffinger

More information about the ffmpeg-devel mailing list