getmusicbee.com

Support => Questions => Topic started by: cynflux on April 11, 2018, 02:07:31 AM

Title: FLAC compression
Post by: cynflux on April 11, 2018, 02:07:31 AM
Hello,
I recently discovered the FLAC format and I am curious to know which compression level everyone uses and why.
Thank you in advance.
Title: Re: FLAC compression
Post by: CritterMan on April 11, 2018, 02:36:36 AM
Max it out. The only difference it makes is how long it takes to encode the file. In an extremely simplistic way, the encoder is trying multiple methods to make each chunk of data as small as possible. The higher the level of compression, the more tries it makes. This results in a smaller file, but the decoding time is not affected at all so there is no downside other than a slightly longer encoding time when the file is created.
Title: Re: FLAC compression
Post by: cynflux on April 11, 2018, 02:40:45 AM
This format is awesome. It's a shame that the audio player in my car doesn't support the format.
Title: Re: FLAC compression
Post by: CritterMan on April 11, 2018, 03:19:15 AM
I think you need a new audio player in your car. Or, if it has a 3.5mm input or Bluetooth, a portable audio player that does support FLAC.
Title: Re: FLAC compression
Post by: cynflux on April 11, 2018, 03:45:28 AM
In a pinch, I could use an android device with Poweramp Music Player app installed on it.
It supports FLAC.
Title: Re: FLAC compression
Post by: redwing on April 11, 2018, 04:00:25 AM
which compression level everyone uses and why.

That would be a personal choice, but there's no reason to go beyond the default level 5.
You get only marginal improvement in space saving with enormous increase in encoding time. Generally with an 1 GB album, using level 8 instead of level 5 saves only about 2 MB with 3 times longer encoding time. Of course there's no differences in audio quality and decoding time.
Title: Re: FLAC compression
Post by: frankz on April 11, 2018, 04:35:54 AM
redwing is right that 8 isn't needed and is a technical waste of time.

That said, IMO, the levels are from back when computers were much less powerful as an encode time / space savings trade-off.  With today's computers the real-world difference in times is so minimal (3 or 4 seconds per "song") I always go for 8 just to simplify.  If it takes me an extra 30 seconds to encode a CD, I'll live. That way I know I got it as small as it's going to get, and that's a peace of mind thing. (Same reason I use V0 mp3 instead of V1 although I would probably never hear the difference in almost every case)

This site (http://z-issue.com/wp/flac-compression-level-comparison/) makes a pretty compelling case that 3 is the "right level" though.
Title: Re: FLAC compression
Post by: captain_paranoia on April 11, 2018, 06:56:10 PM
> You get only marginal improvement in space saving with enormous increase in encoding time.

It takes about 3 seconds to encode a track to FLAC on my desktop (which is about seven years old, and not particularly powerful: Athlon II X3 450 3.2 GHz). Much less than it takes to rip, even at 30x avg CD rip speed.

If the compression is launched in parallel, using a second core, it doesn't increase the rip time.
Title: Re: FLAC compression
Post by: Steven on April 11, 2018, 06:58:27 PM
i recall reading on hydrogenaud.io that there is more processing power required to decode highly compressed flac files which may be a consideration when using on portable devices
Title: Re: FLAC compression
Post by: frankz on April 11, 2018, 09:03:00 PM
i recall reading on hydrogenaud.io that there is more processing power required to decode highly compressed flac files which may be a consideration when using on portable devices
This is what I always thought, too, but apparently the difference is very negligible (https://xiph.org/flac/comparison.html).  0 decodes at 141x and 8 decodes at 125x (https://en.wikipedia.org/wiki/FLAC#Compression_levels).

The cost on the encoding side is that the levels reflect the amount of different compression methods tried to find the one with the best (smallest) compression for the content.  0 will try very few methods and select the most efficient one among them, 8 will try them all.   So there is great (relative) cost to using 8 vs 0 on the encoding side (8 encodes at 12X, 0 at 134x)

There is no such decision making on the decoding side, so there's very little impact either way in decoding.