Optimal OGG to MP3 encoding for quality vs. file size?
October 14, 2013 4:17 PM

I'm preparing to revamp my digital music library, including re-encoding a lot of high-bitrate OGG tracks as MP3 to increase portability and cut down on file size. What are the best LAME encoder settings to maximize appreciable quality for the future without taking up too much space?

Most of my tracks are 320 kbps OGG Vorbis, but I'd like to switch to a more efficient MP3 encoding, both to make the files more interoperable with other programs and to save storage space on my SSD and various iDevices. I'm no audiophile rocking a $10,000 soundsystem here -- I listen to most of my music either on my laptop's JBL speakers, my iPhone (while driving), or through a pair of midrange Sony earbuds. And I suspect it's physically impossible to distinguish quality above a certain bitrate threshold, anyway. But I'd like to retain as much quality as is reasonable in the event I do acquire a decent pair of higher-end headphones in the future.

So, my main question:

Using this standard LAME encoder interface, what are the best settings to maximize quality without going beyond what's possible to hear on decent-but-not-ridiculous equipment? Specifically:

- Encoding engine quality: Fast? Standard? High? I don't care if it takes longer to encode, I just don't want the output to be excessively big.

- Should the "Target" be Quality, or Bitrate? I'm thinking Quality = VBR = better/more efficient -- but can unchecking that "restrict encoder to..." box let you target an average/variable bitrate to shoot for without locking in CBR?

- For Bitrate: what's the highest that would still be noticebly improved on decent pair of headphones? 128 kbps? 192? 256? 320? When do diminishing returns really kick in?

- And if Quality is the better option: Same deal -- 75%? 90%? 100%?

(If it makes any difference, the music I'm dealing with is mostly layered, electronic-tinged modern alt/rock -- Radiohead, LCD Soundsystem, Explosions in the Sky, etc. Not a lot of classical/jazz/opera/spoken word.)
posted by Rhaomi to Technology (14 answers total) 3 users marked this as a favorite
You might already know this, but going from one lossy format to another is known as 'transcoding,' and produces poor sound quality. If it's possible to start with lossless files like .wav, .flac, original CDs, etc, that would be preferable, sound-quality-wise.

That said: VBR (aka Quality) is the way to go unless you have devices that don't support it (extremely unlikely these days). V0 (aka alt-preset-extreme) is a very, very popular choice. I have mediocre ears and budget-audiophile headphones, and V2 is about as low as I can go before I start to notice file quality.
posted by box at 4:33 PM on October 14, 2013


LAME produces the best general results when using VBR and using its numbered -V preset system, and leaving everything else alone. What you're referring to as the point when it is "physically impossible to distinguish quality above a certain bitrate threshold" is when a codec achieves transparency (though there are exceptions for people with golden ears and for so-called "killer samples" that produce artifacts at even high bitrates). The -V3 preset is when LAME starts achieving transparency for many people, but -V0 is probably the best unless disk space is of concern.

Look at Hydrogenaudio's wiki page on LAME encoder settings for more information.

I think that screenshot example you linked to is from an old version of LAME before they came out with the current preset scheme. Hopefully whatever you end up using just lets you use the V numbers.
posted by zsazsa at 4:38 PM on October 14, 2013


Why do it at all? This time 2 years from now, you'll have 3 or 4 times as much space.
posted by dmd at 4:44 PM on October 14, 2013


I've found that the various online music services that match your library will provide you an MP3 when you download it back. So sync your library with Google or Amazon and then download the MP3's that they've encoded rather than transcoding it from one lossy format to another.
posted by Runes at 5:53 PM on October 14, 2013


Seconding box and zsazsa's replies regarding transcoding and LAME presets. Like dmd, I also think it would be a good idea to at least keep your original Vorbis files backed up somewhere, as in the future you may switch to more compatible playback devices with fewer space constraints.

what are the best settings to maximize quality without going beyond what's possible to hear on decent-but-not-ridiculous equipment?

Only you can figure this out by conducting a series of ABX tests with various samples. My advice is to not bother with that step at all and just stick with LAME V0.

Also, ignore that outdated UI and instead use foobar2000 for mass conversion of your library, as it lets you will not only convert your files but also keep all metadata, sort the resulting files into whatever directory structure you prefer and ReplayGain scan them.
posted by Bangaioh at 5:22 AM on October 15, 2013


The LAME V0 preset is pretty much the "standard" for high-quality MP3 encoding. If you think this is overkill, maybe bump it down to V1 or V2. Ignore all the other options.

For encoding all this stuff, I'd recommend dBPowerAmp paired with the (free) Command Line Encoder plugin, and just use the CLI version.
posted by neckro23 at 7:53 AM on October 15, 2013


Sorry, I answered in a hurry. I take back the dbPowerAmp recommendation; I forgot that my workflow involves a horrible batch file that moves the transcoded files out of the source directory afterwards. Foobar would probably work better.
posted by neckro23 at 8:49 AM on October 15, 2013


zsazsa: Look at Hydrogenaudio's wiki page on LAME encoder settings for more information.

From this, V0 through V3 (~245 kbps to ~175 kbps) are recommended. I'd say V2 is perfectly fine for your purposes. Lower down in this section, it is noted that "-V4 should be close to perceptual transparency."

V0 is the current web-standard for many sources, including Amazon and eMusic, though both continue with some weird outliers (Amazon sometimes has ABR 256 files, while eMusic sometimes offers new music in V2, and I've found some V4 files). But honestly, I think V0 is overkill. Here's a graph of file size vs quality. It's up to you to find your own sweet spot.
posted by filthy light thief at 12:03 PM on October 15, 2013


For listening while driving, V0 would certainly be overkill in normal circumstances but in this case I'd still recommend it just because the source files are already lossy.

Having said that, the V0 suggestion is a conservative one (disclaimer: I never experimented with lossy transcoding) and I wouldn't be surprised if Vorbis > LAME V2 transcodes turned out transparent in all cases.
posted by Bangaioh at 2:35 PM on October 15, 2013


Thanks for the answers, all. I think I'll go with V2/~192 kbps as the happy medium -- not too bulky, safely above the transparency threshold for most, but still nice enough to really enjoy if I do eventually get a nice sound system/develop mutant cochlear powers.

(I'll definitely hold on to the source files, too, but I think a more compact MP3 version makes sense for carrying around on a mobile device, not to mention more compatible if I want to quickly drop a file into Audacity or what have you for some quick noodling around.)
posted by Rhaomi at 7:32 PM on October 15, 2013


The exact settings for future reference, after doing a little more reading:

Encoding Engine Quality: Standard
Target: Quality (and leave the "restrict encoder..." box unchecked)
Bitrate: 192
Quality: Had to eyeball it, but about 80%

And the graph filthy light thief linked to of size vs. quality was very helpful!
posted by Rhaomi at 8:33 PM on October 15, 2013


...so helpful that I think I'll bump my standards down a notch, to v3/~175kbps. Shaves off a decent amount of file size for only a small sliver of sacrifice in quality.
posted by Rhaomi at 8:42 PM on October 15, 2013


That UI is weird. What is the output file encoding information? If you're playing the audio in Foobar, you can check the properties, and it will tell you the codec profile. I ask only because you selected a set bitrate, and I'm not sure if that's a target or a constant. VBR can save additional space, and can retain some of the audio quality lost with a CBR encoding.
posted by filthy light thief at 1:54 PM on October 16, 2013


filthy light thief is right, make sure you're not creating ABR or CBR files instead of VBR, for modern LAME versions all you need to specify is your -V switch of choice.
posted by Bangaioh at 4:06 PM on October 16, 2013


« Older Clever solutions to sharing EV chargers in the...   |   Should I reply to this email? Newer »
This thread is closed to new comments.