View Single Post
Old 11th May 2002, 05:54   #11  |  Link
kthulhu
Registered User
 
kthulhu's Avatar
 
Join Date: May 2002
Location: Buenos Aires, Argentina
Posts: 9
Open the file with a hexeditor... or herviewer.. or similar tool. Each page in an ogg stream starts with "OggS". The first pages only contain a header packet.

So... You have to look for the first page of the audio stream. Probably the second one in the file. Some bytes after the "OggS" you will see a "video", for video :-) , "vorbis" for audio or "text" for subtitles. You could find other types of streams, but you are looking for the "vorbis" stream.

So... Look for the second "OggS" and look for the word "vorbis" a few bytes after it. You should find this in the first bytes of the file... first 100 bytes more or less.

After the "vorbis" string skip 9 bytes. The you will find 3 double words: max bitrate, nominal bitrate and min bitrate. These values are placed there by the encoder, max and min will be -1 (FFFFFFFF), at least its -1 in all ogms I've seen.

The nominal bitrate is what you are looking for. An aproximation, of course, because you actually placed a Q value in the encoder and the Q value is what it actually used during encoding.
kthulhu is offline   Reply With Quote