Skip to main content

Topic: Is FLAC really lossless? / Do compression settings make a difference? (Read 18205 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
Is FLAC really lossless? / Do compression settings make a difference?
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:


XLD by tstirling7, on Flickr

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?
Reply #1
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.

Your settings are fine. Your FLAC files will be perfect conversions.
  • Last Edit: 19 April, 2012, 08:28:55 PM by RobertoDomenico

Is FLAC really lossless? / Do compression settings make a difference?
Reply #2
Ah, that is wonderful news. You have no idea what a clear confirmation like that means to me. I would be crushed if i learned that i ended up destroying my entire lossless library.

What is an ABX test? Sounds like something i should know about

  • tpijag
  • [*][*][*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #3
  • Last Edit: 19 April, 2012, 08:28:09 PM by tpijag

Is FLAC really lossless? / Do compression settings make a difference?
Reply #4
There is a quick guide here that will be helpful to a beginner XLD Guide

Is FLAC really lossless? / Do compression settings make a difference?
Reply #5
There is a quick guide here that will be helpful to a beginner XLD Guide


Thanks for the link. Handy.

  • 2Bdecided
  • [*][*][*][*][*]
  • Developer
Is FLAC really lossless? / Do compression settings make a difference?
Reply #6
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.

Cheers,
David.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Is FLAC really lossless? / Do compression settings make a difference?
Reply #7
To verify, you just need to compare before and after file to ensure that they are bit-for-bit binary identical.
Compare the PCM streams that result from the two files, that is; don’t compare the raw WAV and compressed files, because that’s just asking for trouble.

  • icstm
  • [*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #8
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.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Is FLAC really lossless? / Do compression settings make a difference?
Reply #9
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?
Reply #10
how can i compare pcm stream? is there a program that can do this?

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Is FLAC really lossless? / Do compression settings make a difference?
Reply #11
foobar2000, load and select two files, right-click, “Bit-compare”.

  • skamp
  • [*][*][*][*][*]
  • Developer
Is FLAC really lossless? / Do compression settings make a difference?
Reply #12
You'll need the binary comparator.
  • Last Edit: 22 April, 2012, 05:27:12 AM by skamp
See my profile for measurements, tools and recommendations.

  • evereux
  • [*][*][*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #13
And a Windows PC or emulator since he is on a Mac.
daefeatures.co.uk

  • Nessuno
  • [*][*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #14
And a Windows PC or emulator since he is on a Mac.


This actually makes things easier: flac -d -c filename.flac | md5

If the computed values for both flac files are the same, so the decoded output streams are! 
... I live by long distance.

  • Chinch
  • [*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #15
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!

Everything you ever cared to know about FLAC files, lossless encoding, proving the process is indeed LOSSLESS, including checksums/hashes (SFV, MD5, SHA-1, etc), bit-level comparison, and many more details that will make you a better person

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...
  • Last Edit: 22 April, 2012, 07:44:24 AM by Chinch

  • Nessuno
  • [*][*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #16
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.
... I live by long distance.

  • Nessuno
  • [*][*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #17
Yes, but if I'm not wrong, the OP wanted to test if different XLD flac encoding options


If instead he wants to compare PCM data between an AIFF or WAV file and a FLAC one on Mac, he can use the compare function of the shntool into xACT application.
  • Last Edit: 22 April, 2012, 09:14:00 AM by Nessuno
... I live by long distance.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Is FLAC really lossless? / Do compression settings make a difference?
Reply #18
This actually makes things easier: flac -d -c filename.flac | md5

metaflac --show-md5sum
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • Nessuno
  • [*][*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #19
This actually makes things easier: flac -d -c filename.flac | md5

metaflac --show-md5sum


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".
... I live by long distance.

Is FLAC really lossless? / Do compression settings make a difference?
Reply #20
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 xact a comparable program? im downloading that right now.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Is FLAC really lossless? / Do compression settings make a difference?
Reply #21
Ok, we both know such a test is useless because FLAC is lossless, period.

Why then is this discussion being fueled with paranoia?
  • Last Edit: 22 April, 2012, 03:28:22 PM by greynol
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Is FLAC really lossless? / Do compression settings make a difference?
Reply #22
ok, a lot of this went over my head. are these tests necessary?
Not really, unless you’re someone who makes a point of always testing/verifying everything for yourself and/or doesn’t trust the concrete mathematics and testimonies of countless other users!

Quote
I just want to make sure that im not screwing up my files.
You’re not. Lossless is lossless. Again: Compression level affects computation and file-size, not quality.

Is FLAC really lossless? / Do compression settings make a difference?
Reply #23
Quote
You’re not. Lossless is lossless. Again: Compression level affects computation and file-size, not quality.

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

  • garym
  • [*][*][*][*][*]
Is FLAC really lossless? / Do compression settings make a difference?
Reply #24
Quote
You’re not. Lossless is lossless. Again: Compression level affects computation and file-size, not quality.

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.