Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Absolute best FLAC compression options (Read 34098 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Absolute best FLAC compression options

I'm about to re-rip my entire CD collection to FLAC because my hard drive died and I lost all my existing FLAC rips.

I have quite a lot of music and need to keep hard drive usage down to try and fit as much as possible on my hard drive but from reading the FLAC man page I'm bit confused about the best compression options to use.

Can anyone shed some light on the command line arguments they use to compress their music into FLAC format?

For the record I'm using FLAC 1.3.1 on Linux.

Edit:

I'm currently using:

Code: [Select]
flac -V --replay-gain --best -e


to encode my files. Can I do better than this?

Absolute best FLAC compression options

Reply #1
Hmmm, I always thought 'flac -8' was for best compression.

It isn't?

Absolute best FLAC compression options

Reply #2
Hmmm, I always thought 'flac -8' was for best compression.

It isn't?


I'm already using -8 but there are other options which can be configured as per the man page and I was unsure as to whether they had a greater effect on compression than that already offered by -8.

Absolute best FLAC compression options

Reply #3
to encode my files. Can I do better than this?

Yeah, you can do better than this, but the trade-off isnt worth it. You can add -p (so you get -8ep) but encoding will be terribly slow and gains are usually less than 0.05%. You can add more apodization functions as well, but once again, this slows down encoding a lot with almost no gain.

I would say, just stick with -8. Overall gains for most music collections by adding more options will be less than 0.1%
Music: sounds arranged such that they construct feelings.

Absolute best FLAC compression options

Reply #4
Read the documentation.  It tells you exactly what -8 (incidentally the same as --best) means.  In 1.3.1 it explicitly shows that -8 (or --best) includes -e and three tukey apodisation functions, but not -p.  Since the documentation in the past hasn't always been 100% accurate, you can confirm this with a few tests.

Before 1.3.1, the -p switch didn't work properly, but it should be OK now.

Absolute best FLAC compression options

Reply #5
In 1.3.1 it explicitly shows that -8 (or --best) includes -e and three tukey apodisation functions

Which part of the documentation are you referring to, because that is incorrect. 1.3.1's -8 does not include -e
Music: sounds arranged such that they construct feelings.

Absolute best FLAC compression options

Reply #6
If space is your primary concern, you might want to take a look at TAK instead. Its maximum compression preset shaved off about 12GB off a previosly 254GB flac library. About the only major problem tak has w.r.t. archiving is lack of unicode support for filenames/paths, so it will choke on non-ascii names while ripping. foobar2000 can handle non-ascii named tak files without problems though.

Absolute best FLAC compression options

Reply #7
In 1.3.1 it explicitly shows that -8 (or --best) includes -e and three tukey apodisation functions

Which part of the documentation are you referring to, because that is incorrect. 1.3.1's -8 does not include -e

The manpage says it does, but the HTML doc says not.  Looks like one of them is wrong.  Ask Cromulent what his says.

Absolute best FLAC compression options

Reply #8
The manpage says it does, but the HTML doc says not.  Looks like one of them is wrong.  Ask Cromulent what his says.

Looks like ktf is right. He is one of the people who decided how the compression levels in flac 1.3.1 are structured
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Absolute best FLAC compression options

Reply #9
Not worth it. Even -8 is too slow compared to -5 or -4 with not much improvement.  You need another codec. For linux wavpack is well supported and you may try it with the -h or -hh modes. Its very efficient compression wise and speed . It has an -x mode if you dont care for encoding time . For a bit more compression Tak and Monkeys audio are very efficient speed / compression wise but less supported (may need WINE). Monkeys has a linux port somewhere . Some players like deadbeef, audacious, aqualung may support these.

Absolute best FLAC compression options

Reply #10
i don't think that nowadays compression time still has any relevance, unless you're converting several terabytes of music.
-8 should be the default. what is gained if a track is converted to flac 3 seconds faster?
this is a one time process that suffices for many years. the file never has to be changed after that, it's not like you reencode your library on a weekly basis
what does it matter if you convert 1 tb of music to flac and it takes 18 hours instead of 12 hours?

Absolute best FLAC compression options

Reply #11
Not worth it. Even -8 is too slow compared to -5 or -4 with not much improvement.  You need another codec. For linux wavpack is well supported and you may try it with the -h or -hh modes. Its very efficient compression wise and speed . It has an -x mode if you dont care for encoding time . For a bit more compression Tak and Monkeys audio are very efficient speed / compression wise but less supported (may need WINE). Monkeys has a linux port somewhere . Some players like deadbeef, audacious, aqualung may support these.


I need to use FLAC for reasons I'd rather not go into and encoding time is not an issue.

As I said in my original post I need the absolute best compression that FLAC offers for its files. Even a 5% reduction in file size can save me several 10s of dollars a month in expense.

Absolute best FLAC compression options

Reply #12
The manpage says it does, but the HTML doc says not.  Looks like one of them is wrong.  Ask Cromulent what his says.

Looks like ktf is right. He is one of the people who decided how the compression levels in flac 1.3.1 are structured


http://git.xiph.org/?p=flac.git;a=commitdi...a0e1270b850b0a9

Absolute best FLAC compression options

Reply #13
As I said in my original post I need the absolute best compression that FLAC offers for its files. Even a 5% reduction in file size can save me several 10s of dollars a month in expense.

Why is that?

Yet you had no backup for your collection which (according your first post) fits on a single hard drive. Something doesn't add up.

Absolute best FLAC compression options

Reply #14
Even a 5% reduction in file size can save me several 10s of dollars a month in expense.

Yes, but we're not talking about 5%, we're talking about 0.5% at most. FLAC can't be stretched much further it seems.

If you really need more compression, go for OptimFROG or TAK, but even with them, 5% improvement will probably be all you'll get. If you want something with more device/player support, try WavPack, you can expect about 2% smaller files. If you want FLAC, stick with FLAC, but do not expect any improvements, because they will be small, really.
Music: sounds arranged such that they construct feelings.

Absolute best FLAC compression options

Reply #15
Even a 5% reduction in file size can save me several 10s of dollars a month in expense.


Try SAC instead of FLAC.  It'll get you that 5% better (maybe even 6%), and only take 5-6 hours per CD.  If your CPU is fast enough you might even be able to listen to the files in real time!


Absolute best FLAC compression options

Reply #17
Quote from: shadowking link=msg=0 date=
For a bit more compression Tak and Monkeys audio are very efficient speed / compression wise but less supported (may need WINE). Monkeys has a linux port somewhere . Some players like deadbeef, audacious, aqualung may support these.


Monkey Audio's decoding speed is horrible. And the format is not suitable for streaming.

For high compression. wavpack -hhx2 is probably the best practical & portable solution.

I used Monkey Audio and WavPack in the past. But came back to FLAC -8 as I found it to be the only longterm headache-free choice.

Absolute best FLAC compression options

Reply #18
Another vote for FLAC - 8.
I used Monkey for the excellent compression/acceptable speed, later TAK for it's very good compression and speed, but came back to FLAC  because compression is good enough, speed is great, and I consider it the most future-safe lossless codec.
lame3995o -Q1.7 --lowpass 17

Absolute best FLAC compression options

Reply #19
5% reduction

 

http://www.hydrogenaud.io/forums/index.php?showtopic=97310
Might want to use this link that's further in the same thread, got more encoders and the pretty graphs still load

http://www.hydrogenaud.io/forums/index.php...st&p=812229
Who are you and how did you get in here ?
I'm a locksmith, I'm a locksmith.

Absolute best FLAC compression options

Reply #20
to encode my files. Can I do better than this?

Yeah, you can do better than this, but the trade-off isnt worth it. You can add -p (so you get -8ep) but encoding will be terribly slow and gains are usually less than 0.05%. You can add more apodization functions as well, but once again, this slows down encoding a lot with almost no gain.

I would say, just stick with -8. Overall gains for most music collections by adding more options will be less than 0.1%

This is useful information.

But anyway flaccl provides better ratio (-q -11 --cpu-threads 4 --verify - -o %d) and very fast.

Absolute best FLAC compression options

Reply #21
CUETools from FLACCL 2.1.6 writes:

Quote
-0 .. -11            Compression level, default 8; 9..11 require --lax

So -11 option creates non-Subset files.

Absolute best FLAC compression options

Reply #22
The best standard subset compression atm. is "CUETools.Flake.exe -8" from the recent 2.1.6 package. The CL version with the new apodizing function is not yet done. Grigory Chudov does this work on CUEtools in his sparetime and doesn't have to much of it.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Absolute best FLAC compression options

Reply #23
So -11 option creates non-Subset files.

He means that encoded files are not streamable. (anyway it plays well over dlna service)
Make your conclusions.

Absolute best FLAC compression options

Reply #24
He means that encoded files are not streamable. (anyway it plays well over dlna service)
Make your conclusions.

It is more about there is no guarantee a non subset file plays at all with your hardware player or software.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!