[FFmpeg-soc] Progress seeking

Michael Chinen mchinen at gmail.com
Wed Jun 23 15:41:05 CEST 2010


Hi Baptiste,

I'm cc'ing the soc list because this there's more questions/discussion
that would benefit from having more readers.

This week I got the table stuff working for parallel/background
building and applied a bunch of suggestions by MN including removing
the AVSeekTable structure I added and eliminating a lot of the table
specific calls.  Now for next week I am thinking of these issues:

I want to get accurate seeking for flac/vbr mp3 working in the table.
Some people mentioned they seek using the duration ratio over
filesize, but as flac is vbr this causes some troubles.
I've been debugging why the table doesn't work for flac - as it exists
there is no accurate way to seek using these two because the packet
from av_read_frame doesn't contain anything useful.  It appears we
need to use some decoding to get the info that would be useful for the
table.  I notice there's a decode_frame_header function in flacdec.c
that gets the number of samples in the frame, but it doesn't appear
there's a way around this.  I'm thinking to reuse it somehow but
couldn't find the right place to do this - is it okay to make another
function pointer in the parser/AVInputFormat that can be used with
av_build_index to decode the frame info?  Or does it exist already, or
is there a better way?

I've also been looking at VBR mp3, where table troubles exist, but not
as severe - the duration and timestamps of the index entries seem to
be off because of CBR assumptions.  I guess it will need something
like the frame header decoder function in flac. I will do this after
solving flac which will give us the structure/framework to make it
easier.

As the next step I'm thinking to do the read and write index (to
file,) but this shouldn't be hard once it is clear what the format is.
 If there's no human-redable requirement I'll just write the relevant
size/flag variables and AVIndexEntry array out in bytes with an endian
magic at the top.  I think this is a pretty simple thing to implement
one way, but people will want to discuss exactly how it is done.
av_save_index(FILE*,AVFormatContext*) to write all the streams per
AVFormatContext and a av_save_index_stream(FILE*AVStreamContext*) that
it is dependent on.  Please let me know if there's some example in av*
of file save/load for internal ffmpeg stuff - the reason I use FILE*
is because I saw that the dump functions use it.

Michael


More information about the FFmpeg-soc mailing list