2

I would like to know why two .flac files which, allegedly, contain the same data, vary so much in size.

I got two .flac files of the same music album (same songs, same track lengths, etc.), but they differ in 500+ MB, and I don't understand why.

Braiam
  • 35,991

1 Answers1

5

Run MediaInfo on the two files. It will tell you why they differ.

FLAC is always lossless as compared to the input file, but that doesn't mean there aren't good reasons why two FLAC files of the same song could differ in size:

  1. FLAC offers multiple levels of lossless compression. The exact same input file compressed with two different compression settings will almost certainly result in two different file sizes.

    Most forms of lossless compression share this property: PNG, bzip2, etc. It's a CPU time and memory tradeoff: the more resources you throw at the problem during compression, the more tightly you can compress the data.

  2. The two input song files could differ in some key way, so that each is a lossless version of a different file.

    An audio file sampled at 44.1 kHz will result in a smaller FLAC file than an audio file sampled at 96 kHz, even though they are the "same song." This is the nature of a lossless codec: it should preserve differences such as this, which means the file sizes will be different.

  3. The input audio files differ only in bit depths, one 16-bit and the other 24-bit, for example. The difference would be inaudible in all practical cases, but one file would be 50% larger than the other.

Warren Young
  • 72,032
  • But in the case you point out, would they both still be lossless? – Jack Mills Oct 12 '14 at 02:34
  • @JackMills: Edited answer to include more reasons why this could happen. Bottom line, you have to understand that you're asking us to speculate. If you want us to give you a hard answer about why your particular two files differ, you're going to need to post more details in your question. The two MediaInfo outputs would be a big help, as would the sources of the two different files. – Warren Young Oct 12 '14 at 02:51
  • Flac is not always lossless. It is entirely possible that one of the files went through lossy transcoding. – HalosGhost Oct 12 '14 at 03:40
  • 1
    @HalosGhost: Not according to the FLAC codec's own About page. See the second-to-last bullet point on that page. If you mean that you can recompress an MP3 with FLAC and that the result will be "lossy" because the MP3 codec threw away information, that's not an indicator that FLAC is somehow lossy. FLAC losslessly-compressed the output of the MP3 decoder. – Warren Young Oct 12 '14 at 03:48
  • @WarrenYoung, my apologies. Flac is always lossless, but that doesn't mean it hasn't lost some of the information from the source file. – HalosGhost Oct 12 '14 at 04:21
  • @HalosGhost: I think you're confusing the codec proper with other stages in the audio process. It may be that some FLAC implementations give you the option to do a bit depth conversion along with the compression step, for example, but the codec proper is not losing information. The bit depth conversion is a preprocessing step, and that is where the loss occurs. In the case of WAV -> MP3 -> FLAC, the loss is in the MP3 stage, not in FLAC. – Warren Young Oct 12 '14 at 04:33
  • I'm not mixing it up, I'm agreeing with you. I understand that the loss happens in a different stage, but that still means that the final flac file doesn't include all the data that the original file does. In that case, it would not be too shocking if the file size were different. – HalosGhost Oct 12 '14 at 04:43
  • 1
    It's also possible to install something common such as Audacity; load the .flac, then do analyze/plot spectrum. An easy way to validate the presence of a frequency cutoff around 18 000hz or in any case way below 22.1khz when the source was lossy... Such a tool may help figure out if the two files actually contain the "same data". –  Oct 13 '14 at 07:00