[flac-dev] "Compression failed" message

Erik de Castro Lopo mle+la at mega-nerd.com
Fri Jan 31 14:18:20 PST 2014

lvqcl wrote:

> Git version of the FLAC encoder prints error message:
> ERROR: Compression failed (ratio 1.xyz, should be < 1.0). Please contact the developers.

Yes, this was added to make sure that during encoding, the flac output
file was smaller than the input file. It may be worth replacing the
"Please contact developers" with a link to a web page with an explanation.

> in the following cases:
> a) recompressing from FLAC 1.2.1 (sometimes)

Yes, if the file was encoded with say -8 in 1.2.1 and you are
re-encoding to something less then the output file is likley
to be bigger.

> b) encoding very short wav files (around 5k samples)

In this case, flac simply isn't given enough data to find redundancy
required to actually make the file smaler.

> c) encoding white noise test signal.

In this case, flac splits the file into blocks, tries to encode each block,
files that each block cannot be compressed (information content is too
high) and adds it to the output as a verbatim block. However each verbatim
block has a block header so the output file is bigger than the input.

Does that explain it?

Erik de Castro Lopo

More information about the flac-dev mailing list