[vorbis] How to fit Oggs in a specific amount of space?

Moritz Grimm gtgbr at gmx.net
Mon Oct 21 23:12:25 PDT 2002



Martin Fontaine wrote:
>         I took 5 albums (Classical music) and converted them to Ogg Vorbis
> at "Full Bitrate" (-q10) and all 5 directories take up about 775 Megs
> which won't fit on a CD.  So I ripped them again in WAV first (And
> give my friend back his CDs) but now I wanna know what quality
> setting should I use to fit them on 1 CD (The highest possible with
> total space used just under 700 Megs)

This is hard to say, since Ogg Vorbis is a true VBR CODEC, it will never
give you any guarantees on bitrates and filesizes. At the expense of
quality (I assume you don't want that, since you're already picking this
IMHO insane quality level -q 10) you can encode the .wav files in
--managed mode and the -b parameters. This allows you to make some
educated guesses on the resulting filesize, because the encoder will
stick closer to the bitrate you pick via -b. Example:

oggenc --managed -b 320 music.wav -o music.ogg

music.wav is 4:30 minutes / 270 seconds long, 320kbps means 320,000 bits
per second, or 40,000 bytes per second. 40,000 * 270 = 10,800,000 bytes,
or 10,546.875 kB, or ca. 10.3 MB.

Note that this is still no absolute value - using --managed mode results
in ABR encoding (Average Bit Rate), so your mileage will still vary.
However, that's something you can work with. --managed -b 320 will sound
roughly the same like -q 9 (i.e. better than -q 9 on easy to encode
music, relatively equal on average music, and it will perform worse on
hard to encode music - that's what you get for restricting the encoder,
you get Variable Quality).

You should be able to figure out the highest bitrate for your music,
which takes n seconds to play, to fit on a CD by yourself. Leave some
headroom to deal with ABR overhead (however, I believe classical music
is among the easy to encode stuff).

Or, you could as well just pick -q 9 ... that might fit well on your CD.
(That is, do you actually hear a difference between -q 9 and -q 10? If
yes, I wouldn't use Ogg Vorbis but something lossless instead.)

> of space.  Is this even consistant?  By that I mean if a certain song
> encoded at q4 (128k nom.) gets an average of 120kbps does that mean
> the same song encoded at q8 (256k nom.) will get an average of
> 250kbps?  Or if it's not linear is there a way to predict the q
> setting to use.

Well, the point of a quality setting is to select the quality *your
ears* need to be happy. While doing so, the encoder picks as many bits
as necessary and as little as possible to maintain the quality you
selected. It depends entirely on the music that you encode, because VBR
doesn't "think bitrate" anywhere. About the linearity - no, it is not.
At least I don't think it is, from what I've seen so far ... ;P

<p>Moritz
--- >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