Is FLAC really lossless? / Do compression settings make a difference?

2012-04-20 00:41:35

Hello everyone, i have recently started converting all of my WAV/AIFF files to FLAC to save space, as i have read from various sources that FLAC is indeed true lossless. I am using XLD on Mac, with the settings seen here in this image:

Will these settings yield a true lossless conversion? I need to confirm because at some point i am going to be deleting my WAV/AIFF files, and i want to be completely sure that i am not making a mistake when i do this. I was listening to both the AIFF and FLAC of a track today, and i could've sworn the AIFF sounded a little bit louder and punchier, but i can be a bit paranoid (for lack of a better word) at times about things like this so i could've been hearing things.

Also, i have a second question. I read on a forum somewhere that audio conversion programs aren't perfect so with each conversion comes a small (possibly inaudible) loss in quality. This made sense to me. but my question is, How much does this loss in quality really matter? Is this even true with a program like XLD? thank you for your time.

Is FLAC really lossless? / Do compression settings make a difference?

If comparing AIFF and FLAC you must perform a ABX test otherwise you're falling to the placebo effect. Unless something went wrong with the conversion there is no way you'll be able to hear any different between lossless formats.

Is FLAC really lossless? / Do compression settings make a difference?

You don't need to ABX lossless files - the process should be mathematically lossless. To verify, you just need to compare before and after file to ensure that they are bit-for-bit binary identical. No need to even listen to them.

Is FLAC really lossless? / Do compression settings make a difference?

Yes compare the PCM streams and realise that all this formats are is clever long-word algorithm compression techniques. Think ZIP for music. Even in ZIP you have compression factors that are to do with how much computation should be done, but how much of the original data should be lost.

Is FLAC really lossless? / Do compression settings make a difference?

but not how much of the original data should be lost (because none ever is).

Fixed?

In which case, yes, and it provides a further opportunity to reassure xdesirex22 that the compression level solely affects the computational power and techniques used during compression; this may create a different FLAC file, but the stream that you would get from decoding it (note: some formats decode more slowly files that were compressed to a higher degree) would be exactly the same as that from any other FLAC file and, by definition, exactly the same as the original uncompressed stream.

Is FLAC really lossless? / Do compression settings make a difference?

First, to answer every question you have about this, reference my very detailed post regarding these very questions (including real life examples, results and even screenshots)-- I went into a lot of technical (well, technical to those needing to learn this stuff) points of the concept/process, but I like to think that I did it in a very easy to follow, elementary way. So I strongly urge you to read it, it may help you out tremendously; and who doesn't want to learn more about this stuff? Non-technophiles, but screw them!

Yes, agreed with the few above -- FLAC files have an internal MD5 signature that ONLY considers the AUDIO STREAM block of the file, and hashes on it. It discards any artwork, vorbis comments, cuesheets... so when comparing two FLAC files, and viewing the MD5 values, if they match, then you will have an equivalently reliable result to using the binary comparator (which, I use all the time just because it's quicker at times, nothing wrong with the plugin!)

Alternative way to the above post, just for knowledge... -d switch decodes the file and -c decodes it to stdout (standard output) then the output is piped, but you (speak up if I'm somehow wrong) could just as easily use the -t (test) parameter:

-t, --test Same as -d except no decoded file is written

Here's a test I did on a randomly picked album:

>flac -t Deftones - Diamond Eyes - 2010.flac

Deftones - Diamond Eyes - 2010.flac: ok

or for more information, if you want an output file, then you can use the -a switch, but I do not recommend it, because a) you're not going to understand it anyway b) the output will be a .ANA file, and it's gonna be huge:

-a, --analyze Same as -d except an analysis file is written

Do not forget, if you want to check that the file is encoded and written to disk properly during ENCODE, simply use the -V (verify) switch, which will encode a block, write to disk, then turn right around and decode that block and compare that value to the other value still in memory of the unencoded original content. If you're using any decent computer made within the last 10 years, just use -8 for compression... your encoding time is going to probably be the same, but you'll save several megs of HD space per file depending on size. Either way, it's the old storage vs. CPU/processing trade-off law. Except in this case, with the CPU time "sacrifice" being so negligible, your best interest is to save hard drive space, which yields you a greater value in the end. That's my reasoning for using maximum compression always. I always use -V -8 to verify the encode and compress it to the max. Again, don't forget to read the post in the link at the top. You'll see exactly how and why LOSSLESS is LOSSLESS. Compression does NOT mean loss of any original data, by very definition, lossless means NO LOSS of the original content. Same as a ZIP file or RAR archive. The files shrink in size, but you don't have corrupted files extracting always because it removed data from what was originally there...

Is FLAC really lossless? / Do compression settings make a difference?

Alternative way to the above post, just for knowledge... -d switch decodes the file and -c decodes it to stdout (standard output) then the output is piped, but you (speak up if I'm somehow wrong) could just as easily use the -t (test) parameter:

Yes, but if I'm not wrong, the OP wanted to test if different XLD flac encoding options (so different flac files from the same source) have any result on decoded stream, so my test involves an actual decoding to PCM phase.

Ok, we both know such a test is useless because FLAC is lossless, period.

The one showed by metaflac is a value computed at compress time, possibly from the input stream itself, and stored into the file, so stricto sensu not a fingerprint of the resulting stream after the decode process, as seen by an "external observer".

Is FLAC really lossless? / Do compression settings make a difference?

ok, a lot of this went over my head. are these tests necessary? I just want to make sure that im not screwing up my files. Im literally just opening them in XLD with the conversion options shown in the original post. I can't download Foobar because i am on a mac.

Is FLAC really lossless? / Do compression settings make a difference?

i see. so if that's the case, then why wouldn't one always opt for the highest compression level?

probably no reason not to these days. But in the not so distant past, there were a few players that would choke a bit on the processing required to decode the -8 compressed FLAC file. For example, Some Squeezebox players used to choke a bit on 24/96 FLAC files if they were maximum compression, but not at -5 compression. Nothing to do with lossless, just the processing power within the Squeezebox players. Since then, a firmware update has solved this problem.