Comparision of lossless vs lossy audio file compression
I'm writing up this quick tutorial, as I did not see one in the past via a ZB search. I've seen a few posts about file conversions, so I figured I'd explain the in's and out's of music conversion, for the uninitiated.
There are two types of audio compression: lossy and lossless. "Lossy" (WMA, MP3, AAC) basically means that data is removed, forever, to decrease the file size. And the bitrate will control just how much of that data is removed. "Lossless", on the other hand, retains all the original data. Lossless can be uncompressed (example: CD-Audio or PCM WAV) or it can be compressed (FLAC, WMA-L, ALAC, APE) similar to how a ZIP file works.
With that in mind, the general rule of thumb is that a lossy file shouldn't be transcoded to another lossy (or even lossless) format, as the data is already lost. Transcoding to lossy again further degrades the data, and transcoding to lossless is just a waste of space - once the data is lost, you cannot get it back.
As for the sound quality of a lossy file vs lossless, that is an endless argument. Some people cannot hear an audible difference, and others claim that they can. I personally can hear differences between 160kbps WMA's / 192kbps MP3's vs. FLAC, but the differences are minute. And with V0 MP3's, it's almost impossible to detect.
What I do right now is archive my CD's into FLAC format, and then transcode them to LAME V1 MP3 for usage in my various devices (a good trade-off of SQ vs file size). As storage sizes increase and prices decrease, I fully expect that I will be using a lossless format eventually.... perhaps in five years, is my best guess.
This is a good explaination. I think the best option for keeping the sound quality the best as possible when converting to lossy while keeping the size reasonable is to transcode the lossless music to 320 kbps. The quality / size tradeoff is well worth it, as few people would ever be able to tell the difference, yet the size of the file is dramatically reduced.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter
My new preference is to use tak for archival purposes, i.e. CD images with the rest of the trimmings thrown into a 7zip then burnt to DVD+R, never have to rip again.
For lossy use, I currently use the Nero AAC 1.3.3.0 codec as one Lame Mp3 developer put it, "AAC-LC is what MP3 should have been", plus it provides homogeneous results at -Q 0.55 VBR.
Not to mention I don't run into the Lame Mp3 problem samples.
EDIT: Might want to look into lossy.wav on HydrogenAudio as it can be combined with some Lossless codecs to produce a Lossy file that can be transcoded without loss (depending on the setting), but it can also be used with the portable setting to produce lossless codec files the size of lossy files, albeit they are not lossless.
I figured that, if anyone had written one up, it would have been you. It didn't come up in the top searches for "lossless" AND "lossy" - it must have been buried, somewhat.
Yes, it was buried 30 May 2008, so I would say that is dead and buried.
Keep in mind, some people will have the information sink in so far before it gets thrown off with a new youtube video with that monkey/kitten/person doing something silly.
Using Lame 3.98.2, I presume?
I was re-encoding my whole library from source files into Lame 3.90.3 --alt-preset standard (alias -V 2), but it was a long needless process. For the time it took me to encode 700~800 files, I encoded 2,000 files with Nero AAC 1.3.3.0, so I begun the process of re-encoding from source files into the new lossy library until that one magical day when I have room for and own 4 x 1tb hard drives to run a Raid 1, or Raid 5.
Yes, it was buried 30 May 2008, so I would say that is dead and buried.
Keep in mind, some people will have the information sink in so far before it gets thrown off with a new youtube video with that monkey/kitten/person doing something silly.
Using Lame 3.98.2, I presume?
I was re-encoding my whole library from source files into Lame 3.90.3 --alt-preset standard (alias -V 2), but it was a long needless process. For the time it took me to encode 700~800 files, I encoded 2,000 files with Nero AAC 1.3.3.0, so I begun the process of re-encoding from source files into the new lossy library until that one magical day when I have room for and own 4 x 1tb hard drives to run a Raid 1, or Raid 5.
I was using the OGG Vorbis aoTuV Beta5.5, for quite a while - but, once I got my Zune 30, I gave up on Vorbis and went back to LAME, for the compatibility (looks like it's 3.98, in Jaunty). AAC is not an option either, for compatibility reasons - not supported on my Cowon D2 or Sansa Clip. My LAME settings are V1, min 64 max 256 - I had considered V0 / max 320, but it seemed like overkill.
I actually use a tool called "gnormalize" to do transcoding and normalization. It all depends on the source files, and how much clipping is present - if the source is bad, I drop the gain a bit or else the transcoded MP3's clipping is even worse.
You might want to look into mp3gain, it will add either albumgain or trackgain losslessly to the files, so at any time you can undo the gain process. Just as long as you don't delete the APE tags.
You might want to look into mp3gain, it will add either albumgain or trackgain losslessly to the files, so at any time you can undo the gain process. Just as long as you don't delete the APE tags.
I had looked into that, as well. But the problem is that the clipping occurs when the file is transcoded - so mp3gain doesn't fix that problem. I normalize at the transcoding process (rip to WAV > normalized and transcoded to MP3) so that the clipping is minimal. It's not the best solution, but I'm not too concerned because I still keep my source files intact.
It's difficult to determine what's a candidate for normalization - I usually take one or two files from the list, check them in Audacity first, and then decide if I need to normalize the album.
Quote:
Originally Posted by Jorvette
What would be a better ripping format, Mp3 at highest bit rate , WMA at highest bit rate, WMA Pro Highest bit rate or WMA lossless?
I use WMP to rip
Depends on your needs. My 2 cents:
- MP3. Best for compatibility, if you don't mind the extra space needed for LAME V0 or V1. This is what I currently use, so I don't have to worry about "device lock in".
- WMA Pro / WMA Lossless. Best sound quality (especially WMA-L), but device compatibility is weak. You are basically locked into Windows and the Zune. I would personally avoid them, but that's just me.
- WMA. Better sound quality than MP3, at the same bitrates. And better compatibility than WMA-P or WMA-L . I think WMA is a good SQ / compatibility tradeoff, assuming you aren't planning to join the Apple ranks anytime, soon.
I had considered using WMA, but decided on MP3 because it's support on Linux is still better than WMA. Plus, if i ever decided to go back down the Apple path again, I wouldn't have to re-transcode.
I'll also add:
- AAC. Better sound quality than MP3, as well. However, I avoid it because of compatibility reasons - the Zune / iPod / Rockbox supports it, but other players may not (Cowon and Sandisk devices, for example).
As for whether AAC or WMA is "better" at the same bitrate is an endless argument.
- MP3. Best for compatibility, if you don't mind the extra space needed for LAME V0 or V1. This is what I currently use, so I don't have to worry about "device lock in".
- WMA Pro / WMA Lossless. Best sound quality (especially WMA-L), but device compatibility is weak. You are basically locked into Windows and the Zune. I would personally avoid them, but that's just me.
- WMA. Better sound quality than MP3, at the same bitrates. And better compatibility than WMA-P or WMA-L . I think WMA is a good SQ / compatibility tradeoff, assuming you aren't planning to join the Apple ranks anytime, soon.
I had considered using WMA, but decided on MP3 because it's support on Linux is still better than WMA. Plus, if i ever decided to go back down the Apple path again, I wouldn't have to re-transcode.
I'll also add:
- AAC. Better sound quality than MP3, as well. However, I avoid it because of compatibility reasons - the Zune / iPod / Rockbox supports it, but other players may not (Cowon and Sandisk devices, for example).
As for whether AAC or WMA is "better" at the same bitrate is an endless argument.
That right there should be a sticky so people know what choices they have.
THe DS only supports AAC. For .mp3 and CD music file, you won't be able to tell depending to the type of music.
This helped me a lot in understanding it.
__________________
Formally SmileDog.
Note: I prefer to have conversations over Skype, not over PM.
You will be bottom priority if I happen to be talking to a friend/relative.
thx Jorvette!
Last edited by BroiledVictory; 07-05-2009 at 10:36 PM.
I wasn't aware that the DSi only supports AAC - that's pretty messed up. I bet the Nintendo community wasn't too happy will that bonehead decision.
From what I have read and heard about the DSi, it seems like Nintendo gave their community a big middle finger: No backwards compatibility, battery life reduced by 5 hours, no MP3 support.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter
Remember MP3 support is more than just putting in the decoder. It is paying for the mp3 license fee, which AAC has no such fee.
AAC is not free (and it's not owned by Apple, believe it or not). There's a license fee that needs to be paid out to a company called VIA - licensing is about around one dollar per unit. But, there are no royalty fees.
MP3 has licensing and royalty fees, in comparison. Still, I suspect this is not the reason why the DSi does not have a MP3 decoder - something else is going on, here.
Not following you... I mentioned no royalty fees, already (which doesn't apply to the Dsi, anyway - Ninendo isn't distributing AAC encoded files or media streams). But, you need a license for the codec itself, which would apply to the Dsi. A 5 year term is still not free.
I honestly don't think this is the reason behind their decision - we're not talking about some small little company trying out a new product. I'm certain that they can afford the licensing fees for both. If they were really that cheap, they could axe both and go with OGG Vorbis, instead (yes, I know that makes no sense - but neither does the lack of MP3 support. Hell, even proprietary-happy MS and Apple support MP3).
btw, to get back on topic, somewhat - I would actually like to see MP3 replaced with something superior. But the major players haven't agreed on a standard, at least not yet. OGG Vorbis / AAC / WMA, I don't really care as long as all vendors supported it.
Ogg Vorbis is open source... big name companies seem to fear open source on portable devices. (Apple and Microsoft) Also, it is the one format that will drain the battery faster than any other lossy codec. Apple avoided FLAC like the plague by creating a half-bastardization of FLAC they call ALAC instead of just supporting FLAC. Not like they sell protected ALAC files anyways. Though that could be another reason they haven't embraced Ogg is due to the "No DRM" part of it.
WMA, can't get anyone else to sign off on that because it is was too proprietary.
AAC would be the way to go, but companies are dealing with an lossy format that has cult status and use regardless of how bogged down and how little the format can advance to fix problems...MP3.
If companies cut out the MP3 and wean people off it with AAC (alias M4A/MP4) or some other codec, it might be a way to move forward.
However, look at the last codec use poll on HydrogenAudio and you can begin to see this trend of "since it is universally compatible I use it" although it is not the best choice available.
I went the OGG Vorbis route for over a year, as I really wanted something superior to MP3 - plus, the file sizes were smaller for similarly sounding music tracks. And all my players supported it, at the time (Cowon D2, and my Rockboxed Sansa E200 & Gigabeat F).
But, once I purchased my Zune 30, the compatibility issues were an annoyance, to say the least. LAME V1 creates much larger files, but at least I can use it on 99% of the players out there (except the DSi, of course). And I really cannot hear the difference, even with my high end cans and amp.
At some point, MP3 will be phased out - like you mentioned, it's not even a free codec to use. It's just a matter of the various DAP manufacturers and music vendors getting together and agreeing to set a new standard that they can all agree on and support. AAC would probably stand the best chance of being that future lossy standard.
Yes roebeet, I meant the DSi.
I almost got a DSi.(I have the original model) But 5 less hours of battery will probably be a turnoff for me.
On topic: .mp3 will be lost in time, the format after will probably get lost then another better one, at least that is my philosophy. Like anyother technology.(As in improvement, then being widespread.)
Glad you had a tut on this!
__________________
Formally SmileDog.
Note: I prefer to have conversations over Skype, not over PM.
You will be bottom priority if I happen to be talking to a friend/relative.
thx Jorvette!