[Vorbis-dev] vorbis quality - quality scale vs bitrate

Tuomo Latto djv at iki.fi
Mon Nov 27 00:55:25 UTC 2017


On 27.11.2017 02:00, YIRAN LI wrote:
> I'm using libvorbis in my program and need to encode to target bitrate. I
> know libvorbis prefer to use quality scale but I can't use it.
> 
> I've found something at faq  http://vorbis.com/faq/#quality
> 
> *For now, quality 0 is roughly equivalent to 64kbps average, 5 is roughly
> 160kbps, and 10 gives about 400kbps. Most people seeking
> very-near-CD-quality audio encode at a quality of 5 or, for lossless stereo
> coupling, 6. The default setting is quality 3, which at approximately
> 110kbps gives a smaller filesize and significantly better fidelity than
> .mp3 compression at 128kbps.*
> 
> so 0 == 64kbps
>     3 == 110kbps
>     5 == 160kbps
>     10 == 400kbps
> 
> Could anyone give me a complete mapping from quality to bitrate ?

It doesn't really work that way. Those are about right nominally
(and I know 6 == 192kbps), but in practice they tend to produce
slightly larger bitrates. The bitrates vary quite a bit, since
quality implies VBR or ABR. For example, with q 6 you might
get an average bitrate anywhere from 180 to 220 kbps with
significantly more variation within the encoded file.
(And, of course, quality is not limited to integer values.)

It might be a good idea to start by looking at oggenc command-line
arguments to get an idea of what you need to for CBR encoding.
You at least need to use bitrate management and set the minimum
and maximum bitrates, I think. AFAIK oggenc is essentially just
a fairly straightforward mapping from command-line to libvorbis,
so its source is probably a good place to see how it's done.


-- 
Tuomo

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the Vorbis-dev mailing list