[vorbis] Average Bitrate Calculation
ross at stationplaylist.com
Mon Oct 1 03:29:35 PDT 2001
I have already managed to calculate the "total number of seconds" or duration (well only assuming one logical stream), however, I can't find any info on where the "length (in bytes) of the logical stream" is located. I'm not very fluent in C. Can you please point in the right direction.
Michael Smith wrote:
>At 01:56 PM 9/30/01 +1200, you wrote:
>>Can someone please provide the method of calculating the average bitrate
>>from an OGG file (not using libraries). I currently have obtained:
>>Channels, Nominal Bitrate, Sample Rate, Total Samples, (Duration).
>Find (through seeking) the final page of the logical stream in the file.
>Note that because you can have multiple logical streams in a file, you'll
>have to do this repeatedly, and it's kinda complex to get right.
>Then, take the granulepos value of this final page. This is the number of
>samples in the stream. Divide by sample rate to get total number of seconds.
>Then use the length (in bytes) of the logical stream (not the entire file)
>to get bitrate in the obvious way.
>Conceptually simple. In practice, difficult to get all cases correct.
>See vorbisfile.c for one way to do it correctly.
>--- >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.
--- >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