Log in

View Full Version : bitrate of a sound ogg in a ogm


chris25fr
7th May 2002, 05:42
i have an ogm file with a ogg sound .

I forgot the bitrate of the sound (ogg)

it is possible to know the bitrate please ?

thinks

mustaneekeri
9th May 2002, 01:02
If u know the difference between filesize (audioless and with audio) and length of the clip u can determine br. but it is anyway variable, or did u use CBR?

chris25fr
9th May 2002, 02:33
it is ogg vorbis ( vbr) and i don't know the size without the sound .
So ,it is difficult.

gnoshi
9th May 2002, 03:15
What happens if you drag the file into winamp and/or equivalent...? If it is capable of playing the audio stream and ignoring the video stream, it should be able to give you the bitrate.

Otherwise, you could use graphedit to demux the vorbis track from the ogm file, and remux it into an ogg file all its own and then open that in winamp. Slow and convoluted, but should do the required task.

Otherwise, no ideas sorry.

gnoshi

chris25fr
10th May 2002, 01:37
it's an *.ogm so winamp can't read it .

It is possible to use graphedit and i know how do it but it's too heavy .


But thinks for your answer .

kthulhu
10th May 2002, 04:08
The vorbis header packet has bitrate data. I'm not sure about this, haven't tested it, but maybe if you render the file in graphedit one of the filters will show that info...

I'm making some tests with libogg. I started building a demux/explore tool for ogg. The "vorbis" stream data and coments on other streams is the only thing it handles now. If you want I can fix it up a bit so you can check that.

Or I can tell you were to look in the file with a hexeditor.

ChristianHJW
10th May 2002, 05:16
Originally posted by chris25fr
it is possible to know the bitrate please ? Vorbis is normally encoded in quality mode with q settings, not bitrate settings ... final bitrate will be depending on source material sound complexity ...

chris25fr
10th May 2002, 16:08
i don't understand very well .

I used HeadAC3he to do the ogg. i wonder if there is a tool to know the Q or the average bitrate of the sound But it seems too early .

thinks

MaTTeR
10th May 2002, 16:30
@chris25fr

You are confusing terms here. Ogg is a container somewhat like AVI is. Vorbis is the audio codec you used.

Christian is right, we don't use bitrate modes with Vorbis like you are use to using with MP3. If you used HeadAC3he to transcode your AC3 to to Vorbis then for a given Q level it will also display the expect bitrate(ie. Q2 will average around 96kbps).

chris25fr
11th May 2002, 00:37
i'm french so excuse me for my english .



ps:i know that ogm is a container . no problem

in fact,i done a ogg vorbis with HeadAC3he .then i mixed it with an avi with graphedit(before oggmux exists) . Now ,i have an ogm file . But i forgot the bitrate or the Q of the sound. So my question,is it possible to know the bitrate or the q of the sound .Without demux with graphedit.

i suppose that q1 ~- something ,etc,etc

bye

kthulhu
11th May 2002, 05:54
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
11th May 2002, 06:19
I just compiled a version of a test I am making. As I just said, its more of a test that an actual tool, but it should be able to get the info you are looking for.

Get it from:

http://www.kadath.com.ar/oggexplore/

chris25fr
11th May 2002, 10:54
think you very much for yours answers. very cool .

i'm going to try your tool and reply after . I'm curious so i will try an hexeditor too .

bye kthulhu

LotionBoy
13th May 2002, 01:52
I'm getting -1 as the bitrate on every audio stream I try. :-(

LotionBoy

QuoVadis
15th May 2002, 10:42
@LotionBoy: You can try a beta download of NBS Catalogue @: www.cip.uni-trier.de/may/Files/Beta-Update.zip

Like kthulhu I used the average bitrate in my parser, the min/max bitrates are ignored. If you encounter problems with sone ogm's, please send me the header data.

@kthulhu: I've got another problem with my parser. I cannot find a fps field nowhere in the header data. The only way I figured out was determining the # of frames by scanning the video-packets (well, atm only the last valid video stream packet) then loading the file into DirectShow and query the length in ms and calculate the fps. Do you know a better way?

QuoVadis

BlackSun
15th May 2002, 11:50
Originally posted by kthulhu
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.

Do you have the specs ? I am interested ;)

QuoVadis
15th May 2002, 11:58
@BlackSun: Maybe this will help you. It only works with ogm's with an audio stream. My ogm parser is mainly based on this source with some improvements.

http://timsara.freeservers.com/ogg/oggparser01.src.zip