Home > Free Software, Open Source Software, Tyler B > Vorbis is not Theora

Vorbis is not Theora

Recently I have started to mess around with the Vorbis audio codec, commonly found within the Ogg media container. Unlike Theora, which I had also experimented with but won’t post the results for fear of a backlash, I must say I am rather impressed with Vorbis. I had no idea that the open source community had such a high quality audio codec available to them. Previously I always sort of passed off Vorbis’ reason for being regarded as ‘so great’ within the community as simply a lack of options. However after some comparative tests between Vorbis and MP3 I must say I am a changed man. I would now easily recommend Vorbis as a quality choice if it fits your situation of use.

What is Vorbis?

Like I had mentioned above, Vorbis is the name of a very high quality free and open source audio codec. It is analogous to MP3 in that you can use it to shrink the size of your music collection, but still retain very good sound. Vorbis is unique in that it only offers a VBR mode, which allows it to squeeze the best sound out of the fewest number of bits. This is done by lowering the bitrate during sections of silence or unimportant audio. Additionally, unlike other audio codecs, Vorbis audio is generally encoded at a supplied ‘quality’ level. Currently the bitrate for quality level 4 is 128kbit/s, however as the encoders mature they may be able to squeeze out the same quality at a lower bitrate. This will potentially allow a modern iteration of the encoder to achieve the same quality level but by using a lower bitrate, saving you storage space/bandwidth/etc.

So Vorbis is better than MP3?

Obviously when it comes to comparing the relative quality of competing audio codecs it must always be up to the listener to decide. That being said I firmly believe that Vorbis is far better than MP3 at low bitrates and is, at the very least, very comparable to MP3 as you increase the bitrate.

The Tests

I began by grabbing a FLAC copy of the Creative Commons album The Slip by Nine Inch Nails here. I chose FLAC because it provided me with the highest quality possible (lossless CD quality) from which to encode the samples with. Then, looking around at some Internet radio websites, I decided that I should test the following bitrates: 45kbit/s, 64kbit/s, 96kbit/s, and finally 128kbit/s (for good measure). I encoded them using only the default encoder settings and the following terminal commands:

For MP3 I used LAME and the following command. I chose average bitrate (ABR) which is really just VBR with a target, similar to Vorbis:

flac -cd {input file goes here}.flac | lame –abr {target bitrate} – {output file goes here}.mp3

For Vorbis I used OggEnc and the following command:

oggenc -b {target bitrate} {input file goes here}.flac -o {output file goes here}.ogg

Results

I think I would be a hypocrite if I didn’t tell you to just listen for yourself… The song in question is track #4, Discipline.

Note: if you are using Mozilla Firefox, Google Chrome, or anything else that supports HTML5/Vorbis, you should be able to play the Vorbis file right in your browser.

45kbit/s MP3(1.4MB) Vorbis(1.3MB)

64kbit/s MP3(2.0MB) Vorbis(1.9MB)

96kbit/s MP3(2.9MB) Vorbis(2.8MB)

128kbit/s MP3(3.8MB) Vorbis(3.6MB)




I am currently running a variety of distributions, primarily Linux Mint Debian Edition.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.
  1. tinytim
    April 21st, 2010 at 06:03 | #1

    It’s fairly well established that Vorbis is better than mp3, even when using the excellent lame encoder. You can find relatively scientific listening tests from the HydrogenAudio forum via google to support this assertion. One basic technical flaw that mp3 has that Vorbis doesn’t is the ability to create gapless transitions between songs (or for loops).

    It also matches the more recent AAC in quality with at least two notable benefits. 1) For low bitrates you need to use AAC-HE to match Vorbis, but AAC-HE is a separate codec, not always supported where standard AAC is. 2) Unlike lame and x264 the open source AAC encoder is not the best quality available, so to match Vorbis you need to use proprietary code, which can be awkward at times. I believe this is the reason you sometimes see pirate movies in MKV containers matching H.264 with Vorbis. The recent multi-channel work in Vorbis probably makes this more likely going forward.

    (Note there is a fork of Vorbis tuned for low bitrates called Aotuv, some but not yet all of the improvements have been folded back into the main Vorbis. The rest are due in the next Vorbis revision, getting put back from this one due to the multi-channel work.)

    Of course at higher bitrates, it’s a bit of a wash and mp3 probably makes most sense for your music collection for compatibility if you keep it in a lossy format (and don’t just transcode from FLAC, in which case low bitrate vorbis is your best bet when supported).

  2. Zeist
    April 22nd, 2010 at 02:14 | #2

    I would recommend testing the vorbis -Q switch vs lame’s -V switch as those tend to be the most efficient VBR compressions.

  3. u
    April 22nd, 2010 at 07:12 | #3

    The only thing ogg cant do is give us that
    128kbps mp3 low-quality sound of the 90s. hehe

    Only thing still keeping mp3 alive is compatibility.

    And, ehm, the simple fact people still think
    mp3 = music

  4. johnH
    April 22nd, 2010 at 08:56 | #4

    Well I don’t know what happened but your second MP3 file broke my computer. I got the 45kbit/s MP3 to play through my headphones and I got the 45kbit/s vorbis to play in my headphones, but when I tried the 64kbit/s MP3 it broke my system. Firefox hung up and the screen went grey and continued until I forced it to quit. I tried playing one of my mp3 files no luck, then I tried an online radio stream, still no headphones. In all of the cases I did have sound through my laptop speakers. I still cannot get the headphones to work, even with the headphones switch on the volume control.

    Back to your article, at least on the 45kbit/s I could discern a better quality sound in the vorbis over the mp3 track.

  5. Tyler B
    April 22nd, 2010 at 11:10 | #5

    johnH :
    Well I don’t know what happened but your second MP3 file broke my computer. I got the 45kbit/s MP3 to play through my headphones and I got the 45kbit/s vorbis to play in my headphones, but when I tried the 64kbit/s MP3 it broke my system. Firefox hung up and the screen went grey and continued until I forced it to quit. I tried playing one of my mp3 files no luck, then I tried an online radio stream, still no headphones. In all of the cases I did have sound through my laptop speakers. I still cannot get the headphones to work, even with the headphones switch on the volume control.

    I’m sorry to hear that. I have no idea what would have caused that problem for you.

  6. Tyler B
    April 22nd, 2010 at 11:12 | #6

    Zeist :
    I would recommend testing the vorbis -Q switch vs lame’s -V switch as those tend to be the most efficient VBR compressions.

    That’s for the tip! If I ever find myself ripping my music using the command line I would definitely apply those. As for the comparisons above, I just wanted to keep them as simple as possible.

  7. April 22nd, 2010 at 13:11 | #7

    “Vorbis is unique in that it only offers a VBR mode, ” IS WRONG!!!!,

    Vorbis actually has a mode where you can encode for a constant bit rate, I highly suggest you check out the command line options( Yes, oh horror, you have to type and think) in the vorbis software. I have performed my own encoding tests and concluded that at around 96kbits, vorbis sounds “decent” to me, this is about the same quality i get at 128kbits with lame.

  8. Tyler B
    April 22nd, 2010 at 14:56 | #8

    nixkid :
    “Vorbis is unique in that it only offers a VBR mode, ” IS WRONG!!!!,
    Vorbis actually has a mode where you can encode for a constant bit rate, I highly suggest you check out the command line options( Yes, oh horror, you have to type and think) in the vorbis software. I have performed my own encoding tests and concluded that at around 96kbits, vorbis sounds “decent” to me, this is about the same quality i get at 128kbits with lame.

    Actually no. The bitrate that you can specify (did you read my command line above?) is only the target for VBR.

    http://en.wikipedia.org/wiki/Vorbis#Technical_details

    “The bit rates mentioned above are only approximate; Vorbis is inherently variable-bitrate (VBR), so bitrate may vary considerably from sample to sample.”

  9. Unknown
    April 22nd, 2010 at 19:18 | #9

    @Tyler B
    > As for the comparisons above, I just wanted to keep them as simple as possible.

    I don’t know if someone already suggested that, but one interesting approach would be plotting the errors (or even doing some least squares) of flac x mp3 and flac x ogg — and then comparing the residues or even the curves themselves.

    Even the original curves could take the bit rate as one dimension and so depict mp3 (or ogg) quality approaching flac’s as the bit rate increases. That would give a reasonable parameter to show at what rate the compressed formats attain a given target quality (e.g., 10% error from the flac recording).

    Also, these tests might matter more for online music services and pages with media content which need to be served repeatedly.

    On a personal note, I may be able to cram more music into my 1GB portable ogg player (that’s the name my daughter gave it).

    Thanks.

  10. Tyler B
    April 22nd, 2010 at 19:40 | #10

    Unknown :
    @Tyler B
    > As for the comparisons above, I just wanted to keep them as simple as possible.
    I don’t know if someone already suggested that, but one interesting approach would be plotting the errors (or even doing some least squares) of flac x mp3 and flac x ogg — and then comparing the residues or even the curves themselves.
    Even the original curves could take the bit rate as one dimension and so depict mp3 (or ogg) quality approaching flac’s as the bit rate increases. That would give a reasonable parameter to show at what rate the compressed formats attain a given target quality (e.g., 10% error from the flac recording).
    Also, these tests might matter more for online music services and pages with media content which need to be served repeatedly.
    On a personal note, I may be able to cram more music into my 1GB portable ogg player (that’s the name my daughter gave it).
    Thanks.

    That’s an interesting idea although I’m not sure what use it would really be. I say this only because it has been well documented that the wave form isn’t the only indicator of the quality of sound. What do I mean by this? Well MP3 for example uses high and low pass filters to compress the wave forms in those areas. Just one example where the wave might not match the perception of sound quality.

  11. Unknown
    April 22nd, 2010 at 22:47 | #11

    > That’s an interesting idea although I’m not sure what use it would really be. I say this only because it has been well documented that the wave form isn’t the only indicator of the quality of sound. What do I mean by this? Well MP3 for example uses high and low pass filters to compress the wave forms in those areas. Just one example where the wave might not match the perception of sound quality.

    You’re probably right, and I’m no musician nor have genetic abilities to discern bad from good. I should perhaps have used the word fidelity instead of quality.

    mp3 or ogg can have some misterious (to me) attribute by which they can preserve quality (for instance taking into account human characteristics). But I’m restricting my approach to reproduction quality. That is, if the flac recording sounds awful, the mp3 or ogg should IMHO sound equally bad with few deviations.

    That’s the point of any compression method: to minimize loss…

    Also, by “curves” I don’t mean the sound waves, but instead a continuous function which should approach (I don’t know the shape without doing: might be a sigmoid or an exponential one) an horizontal line, representing 100% quality (supposedly coming close to 100% at a given bitrate, where further increases would be diseconomies of scale).

    I’m just trying to devise a methodology to take subjective perception out of the equation, since that would provide a more impartial way to compare compression techniques/algorithms.

    For instance, speex might suck for music, but probably is very good for human talk. Actually, many factors are at play here and even the music data itself can lead to a bias towards mp3 or ogg. So, this is all too empirical and lacking a sound theoretical basis (hehe!).

    Well, all that I’m saying is not that original, so maybe a little googling could help us. I found a Gnome Wave Cleaner, which uses “least squares” to reconstruct bad wavs.

    Besides my portable ogg player, I also have an ogg playing car radio — so I hear a lot of mp3 and ogg everyday. Downloaded mp3 usually sound like a mess when lots of instruments and voices come together; encoded oggs, differences in bitrate aside, seems better suited for e.g. females singing a capella.

    I’m particularly interested in the minimum bit rate leading to an acceptable quality.

    These articles may add some other angles:

    http://bambukawiki.net/?p=193

    http://en.wikipedia.org/wiki/Vorbis

  12. April 22nd, 2010 at 23:25 | #12

    @Tyler B
    > As for the comparisons above, I just wanted to keep them as simple as possible.

    I don’t know if someone already suggested that, but one interesting approach would be plotting the errors (or even doing some least squares) of flac x mp3 and flac x ogg — and then comparing the residues or even the curves themselves.

    Even the original curves could take the bit rate as one dimension and so depict mp3 (or ogg) quality approaching flac’s as the bit rate increases. That would give a reasonable parameter to show at what rate the compressed formats attain a given target quality (e.g., 10% error from the flac recording).

    Also, these tests might matter more for online music services and pages with media content which need to be served repeatedly.

    On a personal note, I may be able to cram more music into my 1GB portable ogg player (that’s the name my daughter gave it).

    Thanks.

  13. April 27th, 2010 at 09:11 | #13

    nixkid :
    “Vorbis is unique in that it only offers a VBR mode, ” IS WRONG!!!!,
    Vorbis actually has a mode where you can encode for a constant bit rate, I highly suggest you check out the command line options( Yes, oh horror, you have to type and think) in the vorbis software. I have performed my own encoding tests and concluded that at around 96kbits, vorbis sounds “decent” to me, this is about the same quality i get at 128kbits with lame.

    Actually no. The bitrate that you can specify (did you read my command line above?) is only the target for VBR.

    http://en.wikipedia.org/wiki/Vorbis#Technical_details

    “The bit rates mentioned above are only approximate; Vorbis is inherently variable-bitrate (VBR), so bitrate may vary considerably from sample to sample.”

  14. September 8th, 2010 at 13:00 | #14

    @u
    Not only does it frustrate me that you are entirely correct about how many people think

    “MP3 = Music”

    but also that most of those same folks think

    “Blue E on my desktop = The Internet”.

    ;)

  15. September 8th, 2010 at 13:09 | #15

    @Silver Knight

    My apologies to @johnH. The previous comment I made was actually intended as a reply to comment #3 directly above him (u) but I somehow accidentally clicked the wrong reply link by mistake and submitted before looking. I would appreciate it if the moderator could either fix that for me, or delete my comments please. :)

  16. Tyler B
    September 8th, 2010 at 14:08 | #16

    Silver Knight :

    I would appreciate it if the moderator could either fix that for me, or delete my comments please. :)

    Fixed

  17. September 9th, 2010 at 03:33 | #17

    @Tyler B
    Thanks muchly, sir! :)

    On-topic comment re: original post, I also have found Vorbis to be overall superior to MP3 in all except device compatibility, but since all my devices happen to be running Linux or something similar to Linux these days (including my iPod which dual-boots RockBox and iPod Linux), I’m able to play Vorbis encoded OGG files just fine.

    For those of you out there who prefer Vorbis over MP3, I highly recommend running some variety of free (as in Freedom) software alternative on all your devices that can support it, and purchasing devices in the future which also give you this option to own full control over your own devices in this way. This way you get easy access to those superior audio formats like Vorbis. ;)

  1. April 21st, 2010 at 00:54 | #1
  2. April 24th, 2010 at 07:54 | #2