Archive for the ‘Theory’ Category

Theory: What is VBR music part 2: How to convert files to VBR

An amplifier with many knobs and buttons.

You thought the last one was nerdy? THINK TWICE! Here we learn how to encode music.

This is part 2

Part 1 can be read here. I’ll only focus on mp3 VBR converting, because usually, it’s going to be compatible with most stuff. For the best VBR quality, .ogg files should be what to look for.

Additional Information before going on

In the first part of this article, I’ve explained bit rates a bit, which would be enough to convert pieces the way you need it. This is nice if you want to set your parameters manually, but often, when looking for VBR information, you’ll stumble upon things like v0, v1, v2, etc. (the numbers go up to v9). Those are indicators of quality.

The lower the number, the higher the quality. v0 refers to a VBR bit rate going up to 320 kbps, and it’s the highest you can reach. v2 is considered to also be good quality, usually around the equivalent of CBR 192 kbps in terms of file size. In my opinion, you shouldn’t look for anything lower [quality wise] than v2. You should also choose the slowest encoding options for a better quality: 2 passes, slowest settings.

Know that VBR can not enhance quality. It can only reduce it, as with every compressing algorithm you’ll find. Encoding VBR with a max 320 kbps from a CBR 320 kbps file will result in a loss of quality, and so would encoding a VBR from a VBR of the exact same quality. Only encode to lower bit rates, from CDs or lossless formats like flac.

This being said, let’s go for some fast tutorials.

Windows: foobar2k

First thing you’ll need is the LAME pack to encode in Variable bit rate. You can get it here: http://www.rarewares.org/mp3-lame-bundle.php Save it on your desktop or anywhere you might find it when you need it again. The only files of the pack you’ll need are lame.exe and the dll coming with it.

Then, within foobar2k, you need to have enabled the Converter option when installing (’Optional Features -> Tools -> Converter’). I’ve got a custom theme, but so many people do, so sorry if it’s hard to follow. Anyway, here it is, in a simple way. First you need to load the tracks to convert in your playlist. Then, you select the files to convert > right click > Convert > Convert To…

How to get to foobar's converter
A ‘converter setup’ window will pop up. Press the ‘More Settings’ button, then press ‘Add New’. In the new window, you can choose the settings for the VBR files. You can see the presets I used:

foobar2000 vbr settings thumbnail foobar2000 options thumbnail

Then, all you have to do is confirm. Windows will pop a prompt asking you to locate the LAME encoder. Click on the .exe file. The file should start encoding soon.

Windows: Winamp Pro

How to get to the file converter in winamp pro Winamp has got the simplest way to encode to VBR I’ve found so far. It’s also one of the fastest ones in the few I tried. An important point is that only winamp pro will convert to VBR. Free versions will NOT do it. So you can either ‘buy‘ it or buy it.

Winamp is an overall great media player for windows, really easy to use, although you should avoid most of the bundled crap AOL is now shipping it with if you can.

Anyway, once it’s done installing, start winamp and insert your files into the playlist (the media library can also work). Right click on one or many files > send to: > Format converter. You can play with the settings, or take the ones I use (see below). Then just press ok and there you go, files converted! It’s as simple as it gets, really. You can even choose presets if you feel just sliding these things is too complex.
High quality VBR

Windows XP - Linux (WINE): MediaCoder

Mediacoder is one of the best converters all-around. It can convert pretty much anything in audio and video, but sadly won’t work perfectly with anything that is not Windows up to XP. To use it, go grab mediacoder on sourceforge (and use the stable version if possible, my experience with mediacoder in general was filled with bugs). When everything is installed run it and put the files you want to convert in the top of the window.

Luckily, mediacoder is mainly complex with video. What I mean is encoding to VBR is a joke. Just use settings that look like the picture below for something close to the greatest quality. I guess you should have understood how to set high quality everywhere where sliders are by now.

LAME 3.97 VBR settings

The way to put settings vary between each version of mediacoder, but the basics remain the same. Then you just press ‘Start’ on the top of the window, and enjoy the ride.

Ubuntu: Amarok

This one’s going to be done with the amarok player. It usually comes right with the default repository, so you can just get it there. Once everything is set right, Go into Tools > Script manager. Then you go and press Get More Scripts to download the transKode script.

The panel where you add scripts, configure and run themBefore running the script, we’ll need the LAME library. It’s available in the default repo as far as I know. Just go grab it with the synaptic package manager.

You can then run the script. This is done in the script manager described above (and on the picture on the right). Press the configure button. Some default preset should be selected. You can go select whatever you want to convert the file in, but in this case, we’ll stick to mp3 VBR with LAME, thank you good night. Click on the little wrench to configure the script. You should see the settings.

To get the highest VBR quality possible, your settings should look like this:

Amarok transKode optimum VBR quality settings

Options like including CRC checksums [in the advanced tab] are only useful if you plan on streaming the song over the web. Anyway, you can now save your preset to use it again later. Check the ‘place entry in transcode context menu’ checkbox to have a fast access to the preset you just created.

You can also give faster settings by using the following lines (from lowest to best): –preset medium, –preset standard, –preset extreme. These will have neat presets so you don’t have to think too much. To convert a song, just right-click on it in the playlist: If transKode is running correctly, it’ll be in the list; that’s where you can choose to encode it.

VoilĂ , your file is now VBR!

Mac OSX

YOUR OS SUCKS, PLEASE SUFFER! To be honest, I just don’t have a Mac at home to test anything, so no instructions for you guys! good luck!

Conclusion

That should cover the basics to start encoding and transcoding your own files. If you have any question, just leave me a comment, I’ll be glad to answer. If I have enough questions, I may do a 3rd part to cover more, but right now, this is the end of the article. I hope I have helped some people.

Theory: What is VBR music part 1

An amplifier with many knobs and buttons.

Welcome to the nerdy side of music!

Let there be an intro

This post will be part of a series of articles. Stay tuned for updates.
PART 2 IS NOW HERE

When I was younger and more inexperienced with the Internet and music as a whole, I’d often end up on many p2p clients to find new content to explore. I’ve seen Napster, WinMx, Audiogalaxy, gNutella, eMule, Kazaa (lite, lite++, etc), iMesh, Morpheus, etc. I tried them all through the years, with connections ranging from 56k to DSL, ADSL and cable.

One thing that I did a lot was trying to find the smallest files possible, because it meant faster download, and I could keep more inside my computer. It took me a few years and speakers worth more than $15 to realize that music at 96kbps or even 128kbps was not that great, after all.

First of all, for those who aren’t too tech savvy, let’s define what the bit rate is. To make things simple, a bit rate can tell how much information is read by the computer every second. The higher it is, the best the quality of the song will be. Also, the higher the bit rate, the bigger the file’s size. With this in mind, you know the basics to understand why choosing VBR (Variable bit rate) may be better than CBR (Constant bit rate).

Choosing a bit rate

bitrates from Phish songs, taken in foobar2kWhen downloading music (may it be legal or not), you’re likely to encounter various formats. The most common formats I can get from the top of my head are .mp3, .flac, .aac, .wma, .m4a/.m4p (you crazy iTunes users), .aiff, .wav, .ogg, and sometimes .ape. While they can guide you on the quality of the songs, it’s not everything: mp3 files can go from extremely shitty to high quality, both in CBR and VBR, while formats like .aiff, .flac and .wav are considered lossless and usually present the best quality of all. However, they’re quite heavy files, and a 40 minutes album can easily weight over 250mb.

So what bit rates should be deemed acceptable, or a good compromise between quality and file size? It’s quite hard to say, because it often depends on people’s ears and their audio equipment. It’s evident that low-end speakers and/or a cheap amplifier won’t make high bit rates sound better than others. So just to compare, here are a few real-life references that could help:

  • Human voices can usually be understood at under 1kbps, although it can be hard;
  • Telephones have a bit rate from 8kbps to 64kbps depending on the technology and model;
  • AM radio has an overall bit rate of 32kbps;
  • FM radio stands at 96kbps;
  • Compact Discs use bit rates ranging up to 1411kbps (1.4mbps).

Voice is usually easier to understand as it is an evolutive trait: it was a good tool for survival to be able to recognize one’s peers, so this can explain why media centered around the voice usually use lower bit rates (ie.: phones and AM radio). When it comes to music, though, sound quality becomes a lot more important due to our training and how music often acts like candy for the brain. The easier, the better.

So to decide what you likely need in music, a few questions and facts can be useful. As an example, if listening to the radio tires your ears after a while, it’s likely too low quality for you. Otherwise, if you can’t find anything to say against it, then you lose nothing by going in lower qualities.

Usually, people will not be too picky about music at 128kbps, although heavier music like Metal will sound more distorted than it was before. 160 kbps is usually enough for most users, but with the advances in mass storage and file transfers, 192kbps has now become the standard for .mp3 files. If 192kbps is not enough, usually, 256kbps or 320kbps will please you, but at the cost of place. There’s even music compressed at 500kbps-1mbps, with the lossless formats mentioned earlier.

So why would I go for VBR if these are fine?

VBR is like eating all the cake and leaving the pork liver on the side of the dish: VBR will usually encompass rates set by the user over a given range. As an example, a VBR file can have bit rates varying through a single song from 96kbps to 320kbps, depending on how much information is going through.

The Principal character from the movie The Wall, by Pink FloydSo say I’m listening to The Wall by Pink Floyd. The Happiest Days of our lives (the song with the helicopter coming close) is the intro. When the song starts, the volume is low, there’s not too much instrumentation. No need to have much bits coming through, right? Well indeed, no need. VBR could then reduce the bit rate there to 128kbps (random number).

Then, when The Wall begins, it starts with someone yelling at the top of their lungs, with heavy percussions, bass kicks in. There, a VBR file might have its quality raised up to 256 kbps, so there’s no loss of quality when more is needed. The rest of the song is more or less guitar solos, singing, so you can assume the quality would hover between 168kbps and 320kbps. The last 30 seconds of the song are nothing but the school principal and kids yelling outside. At this part, the quality could drop to the minimum needed, around 96kbps or even 32kbps if you let the file go this low.

That’s not really interesting, until you compare with CBR music: if I want the 256kbps bit rate I need to have no low quality parts during the song, I’d have to have every single part at 256kbps, taking more place than ever needed. Apply this to any song, really.

This is why VBR is pretty much the best format for music around: it’s the best compromise between quality and size.

What are the downsides?

There’s not a lot, really. The most common cases would be compatibility, but mp3 players that can not support VBR music are getting rarer and rarer (unless you’re a fan of .ogg files). It’s also harder to have a live stream of VBR audio over the Internet, due to the nature of changing bit rates. It also takes longer to compress files to a variable bit rate than a constant one. That’s pretty much it.

Conclusion

There’s more to come. I’m going to write more about other aspects of VBR music in following articles (possibly next week). I’m planning on explaining more detailed stuff like VBR v0, VBR v1, VBR v2, etc., how to compress your own VBR files, etc. You can already read more on these sites, if you’re interested:

Part 2.