[theora] Decoding Theora: Number of frames?
Michael Smith
msmith at xiph.org
Tue May 4 09:58:19 PDT 2010
On Tue, May 4, 2010 at 7:27 AM, Stefan Weber <s_weber at blyth.ch> wrote:
> Hi all
>
> I'm currently writing a decoder for Ogg Theora videos.
> Since I'd like to show the progress of the video, I need to know how to
> read the current (with granulepos?) and total number of frames from the
> Theora header.
>
> I didn't find an appropriate field in the header specifications for the
> total number.
Theora is designed as a streaming format; there is no mandatory header
with this information. There is now a specification for an Ogg Index
which has index information that can presumably give you this, but
that isn't commonly found in real-world files yet.
Instead, you'll need to seek to the end of the file, find the final
page of the theora stream, and use the granulepos from this page to
calculate it.
Mike
More information about the theora
mailing list