[vorbis] Bitrate peeling and/or filesize detection

Michael Smith msmith at labyrinth.net.au
Sun Jul 22 22:59:12 PDT 2001



At 02:18 PM 7/23/01 +1200, you wrote:
>A few questiongs :)
>How can one detect the end of an oggfile, and/or the size of the file from a
>header?
>Is there any way of knowing how big a peeled file will be prior to peeling?
>

You should look for the 'eos' (end of stream) being set in an ogg page.
This indicates the final page of a stream. If by 'size' you mean length,
you can then calculate the length by taking the granulepos value of this
final page, and dividing that by the sample rate (which you can get from
the primary header).

Alternatively, just call ov_time_total(), if you're using vorbisfile. It
does all this for you.

A peeled file will be precisely whatever size you peel it to - you can
choose what this is. Peeling is NOT an 'all-or-nothing' thing.

Michael

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list