Slashdot Mirror


Which Lossless Audio Codec, and Why?

deadsquid puts forth a worthy follow up question to last week's query on audio codecs: "I'm about to re-rip my entire CD collection for the fourth time. I don't want to do it again, so have decided to invest in a small(ish) array and use a lossless codec to create a reference set of my music. From the reference, I plan on transcoding to a variety of bitrates (depending on where the final product will end up) and whichever format of the week suits the device(s) the transcoded content will ultimately sit on. I don't particularly care about encoding time, but would like something that transcodes nicely to MP3, WMA, OGG, and other formats in a reasonable length of time. I would like to ensure that track metadata is maintained in the reference, and is easily transferable when transcoded. I also want something that's not proprietary to an individual's or small group's whims. I'm thinking FLAC, but was wondering if other people had better experiences with other codecs. If you were to use a lossless encoding format, which would you use, and why?"

13 of 131 comments (clear)

  1. Flac for sure by LiENUS · · Score: 2, Informative

    Flac would probably be the best to use for one reason. It's open source, no fuss no mess just open source. Plus I believe there are now portable music players that support flac.

    1. Re:Flac for sure by booch · · Score: 3, Informative
      uh...why not create wave files and then compress the hell out of it with a separate data compression program
      That's pretty much what FLAC is -- it's a specialized data compression program. To a "normal" data compression program (ZIP, gzip, etc.), audio data looks pretty random, so it wouldn't do a very good job. The important lesson here: knowing more about your data allows you to compress it better.
      --
      Software sucks. Open Source sucks less.
  2. Definitely FLAC by Punboy · · Score: 3, Informative

    I would definitely go with FLAC. No patent/IP worries, no licensing... its opensource... and it transcodes very nicely. I use it personally for my entire collection except what I switch over to my iPod, which is when I transcode it to 192Kbps AAC. Don't use Apple's Lossless, it has licensing issues and Linux decoders are buggy at best. Don't use RAW or WAV cause um... they're too big.

    --
    If you like what I've said here, and want to read more, go to http://www.krillrblog.com
  3. Use Flac by JFitzsimmons · · Score: 2, Informative

    Flac: Opensource, nonproprietary, cross platform, and has very good integration with ogg/vorbis.

    As for metadata retention, that depends entirely on your encoder. I highly doubt you will ever find a WMA encoder that can retain the tags from a FLAC file, or mp3 for that matter. Oggenc (the vorbis encoder) does it by default:

    $ oggenc -q7 *.flac

    This will create ogg/vorbis files with the same filenames and will retain all FLAC tags.

    I have no idea about mp3 encoders, becuase I almost never use them. I can say that I would doubt that they can directly open a FLAC file, and I would also doubt they can retain the tags - to achieve this you would probably need some sort of intermediary script or program to handle the FLAC -> WAV -> MP3, as well as tag transiton. That being said, most of the good mp3 encoders are open source, so it could be possible that FLAC support could be hacked into them.

    Another solution would be to rip to every format at once. abcde (a better cd encoder) has support for several types of output, while only ripping the CD once. In fact, I would reccomend abcde regardless of what you choose, because it is great for batch rips.

    Just as a last note, why in hell would you want to use WMA? I can understand vorbis and I can understand MP3, but why WMA?

    --
    Beware he who would deny you access to information, for in his heart he dreams himself your master. -Anonymous
  4. comparisons of lossless compression by belmolis · · Score: 5, Informative

    I made some comparisons of lossless compression techniques a while back. This web page contains the results of my own tests (for speech data) and links to the tests I found (for music). I use FLAC.

  5. Re:Again? by Nasarius · · Score: 2, Informative

    128kbps MP3s? Ouch. I guess you just don't have decent audio equipment? A ~$90 pair of Sennheiser headphones is more than enough to tell the difference between 128 and 192 if you appreciate the music at all.

    --
    LOAD "SIG",8,1
  6. Re:It's only Math by LSD-OBS · · Score: 2, Informative

    Considering he wants to back up his music in lossless form from a digital media source, Nyquist's theorem has nothing to do with it unless he's having to resample the CD through his audio card's input (an extra ADC->DAC step), which I would strongly advise against.

    All he wants is a lossless audio codec which will take 44100Hz 16bit stereo as input, and encode it that way. FLAC sounds perfect for the job.

    --
    Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
  7. Re:Consider longevity of the codec by Vaevictis666 · · Score: 2, Informative
    This isn't really an issue - the reason WAV has been around for so long is that it's just doing a direct read of the bits on the audio CD, and dumping them to a file.

    FLAC is a free method to losslessly compress those WAV files, so should be as good as any, really. The point behind ripping lossless is so that you can just transcode when something new comes along - if someone comes up with a lossless encoder that makes 10% smaller files than FLAC, then it's a simple job to write up a script that traverses the drive array, re-encodes lossless to lossless, and deletes the old flac file.

    All in all, I would suggest that the longevity of the codec is a pointless metric to use - it's useful until something else comes along, but that New Thing will probably invalidate any other contender as well. The big question is how well supported FLAC is as an input source for transcoding from, which from what I understand is pretty good as far as linux commandline tools go.

  8. Re:Again? by mellon · · Score: 4, Informative

    You can't edit mp3s. Well, you can, but the results aren't good. You have to decompress the mp3, do your editing, and recompress, and chances are that you're going to get artifacts when you do this. So if you ever intend to use an audio file for any kind of editing, you really want it stored losslessly.

    At Diamond Mountain University, we typically record all our classes, at 16bit 44khz mono, which consumes a substantial amount of disk space. When people record directly to MP3 it's a huge hassle because I can't take the audio and do dynamic range compression on it without creating artifacts, which means that you can't listen to it on your car stereo unless you have a luxo-mobile with really good sound baffling.

    Right now I store all this stuff as AIFF files, but the idea of converting them to FLAC files is definitely attractive.

  9. Re:Consider longevity of the codec by belmolis · · Score: 5, Informative
    the reason WAV has been around for so long is that it's just doing a direct read of the bits on the audio CD, and dumping them to a file.

    Not exactly. WAV is a FILE format, not an audio representation format. The audio data can be in any of dozens of formats, many of them involving lossy compression. One of the registered audio data formats (with ID 1) is straight PCM data, that is, uncompressed audio in the usual format. WAV files often contain straight PCM data, but they don't have to. (I've got some lecture notes on audio data and file formats here.)

  10. Monkey's Audio (APE) by fmaxwell · · Score: 2, Informative

    Monkey's Audio (APE) is open-source and multi-platform. It compresses better than FLAC or Shorten (SHN). Easy choice.

  11. Re:We Need a Listening Test by Anonymous Coward · · Score: 1, Informative

    Remember that "Funny" doesn't give you karma. Being that only one guy modded him "Insightful", that guy probrably felt that he deserved karma, even though he was being funny.

  12. Comparison of lossless codecs by Compact+Dick · · Score: 2, Informative

    Refer to the lossless codecs comparison on Hydrogen Audio.

    Personally, I'd go for Wavpack due to its excellent compression, non cpu-intensive decoding, cross-platform support, active development and open license. If the Rockbox project succeeds, I'll be able to play them on my iRiver.