Re: How to get the actual bitrate?

Gregory Maxwell <[email protected]>
Newsgroups gmane.comp.multimedia.ogg.vorbis.devel
Message-ID <[email protected]>
On Tue, Jan 26, 2010 at 7:00 AM, Mathias Kunter <[email protected]> wrote:
> Hello,
>
> I've also implemented it the way Silvia said. However, is there a better (or
> faster) way of finding the last Ogg page in a stream than scanning the last
> 64 K (which is the maximum possible page size) of the stream for a page
> header capture pattern?


Um... Scan the last 65050 bytes?  (thats the actual maximum size for
an ogg page, I believe ;))

If you have the data handy, scanning for the sync should be quite
fast. There is no other way, regardless.

You'll need to be somewhat careful here, checking the last page can
fail to get you a usable granpos... the file might be truncated and
end with a continued page (GP = '-1'). If the page you get has a GP of
-1, continue backwards.  You would likely never hit this case except
on a truncated moderate to high bitrate theora file, but you should be
aware of it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.