Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flac settings #184

Closed
suuuehgi opened this issue Aug 27, 2017 · 14 comments
Closed

flac settings #184

suuuehgi opened this issue Aug 27, 2017 · 14 comments
Labels
Support Questions that needs answering with no code changes needed or that only require a one time change

Comments

@suuuehgi
Copy link

Hey,

is there a way to set the compression settings for flac? I would like to go for level 3 but can't find an option.

Btw what's the state of the documentation? I just found whipper and it seems to to do really well -- closes the gap of easy to use but funtional accurate terminal CD rippers for me! But formatting and possible options of the config file remain a mystery to me.

Thanks a lot!

Cheers
Stephan

@JoeLametta
Copy link
Collaborator

is there a way to set the compression settings for flac? I would like to go for level 3 but can't find an option.

That isn't currently supported (rationale in #121). The easier thing to do would be to re-encode whipper's resulting FLAC files with the settings you prefer, otherwise you could directly hack whipper's sources (unsupported scenario):

https:/JoeLametta/whipper/blob/master/whipper/program/flac.py#L15

check_call(['flac', '--silent', '--verify', '-o', outfile,

to

check_call(['flac', '-3', '--silent', '--verify', '-o', outfile,

Btw what's the state of the documentation?
Poor. It's a known issue #9 #73.

But formatting

Until it gets fixed you can check whipper's inbuilt help from the CLI, like this: whipper cd rip -h.

possible options of the config file remain a mystery to me

Currently that's broken #99.

Thanks a lot!

Cheers
Stephan

You're welcome!

@JoeLametta JoeLametta added the Support Questions that needs answering with no code changes needed or that only require a one time change label Aug 29, 2017
@suuuehgi
Copy link
Author

Thanks a lot! What about adding an option? I guess your syntax is ...

self.parser.add_argument('-C', '--compression-level',
                             action="store", dest="compression",                                                                          
                             default=3,
                             help="Compression level for flac encoding")

check_call(['flac', '--compression-level-{}'.format(self.options.compression), '--silent', '--verify', '-o', outfile,

@RecursiveForest
Copy link
Contributor

I don't think we should add an option for this functionality.

@MerlijnWajer
Copy link
Collaborator

Personally, I'm OK with supporting custom compression, as long as the default is the default that FLAC uses, and not the default that we have in our argparser. So I would say default=None, and if not None, pass a custom option.

@RecursiveForest
Copy link
Contributor

If we're going to bother with this at all we should probably just allow users to define a custom flac command in the configuration file as opposed to adding single options for single flac options.

But I'm not sure it's necessary, because you can get the same effect by re-encoding the flac file after running whipper.

@Be-ing
Copy link

Be-ing commented Oct 29, 2017

But I'm not sure it's necessary, because you can get the same effect by re-encoding the flac file after running whipper.

It's not necessary, but it sure would be convenient.

@xmixahlx
Copy link

I just assumed that flac would be compressing with --best, which is common for ripping. I guess I'll patch the flac config until this is default. It does make sense to me to expose the flac encoder settings as an executable option.

@calumchisholm
Copy link
Contributor

calumchisholm commented Feb 11, 2018

My original assumption was also that --best would be preferable, but after having run a quick test, I'm really not convinced that the trade-off is worth it.

I ran the following script over a folder of .wav files (Dark Side of the Moon in this case):

time for i in *.wav ; do flac --best --silent --verify -o "$i".flac --force "$i" ; done
du -c *.flac | tail -1
rm *.flac
sync
time for i in *.wav ; do flac --silent --verify -o "$i".flac --force "$i" ; done
du -c *.flac | tail -1
rm *.flac

Results (cleaned up)

--best

Elapsed: 0m57.741s
Size: 248972

default

Elapsed: 0m26.563s
Size: 251100

Delta

Elapsed: +117%
Size: -0.85%

Of course, this isn't a scientifically rigorous benchmark, but I think the results are quite stark. The --best encoding (at least in this example) resulted in a space saving of less than %1, but more than doubled the wall-clock time.

You could reasonably argue that the bulk of whipper's time is spent reading from disc, so the additional encode time doesn't matter, but (for me at least) this is a case of diminishing returns and really not something to worry about.

@suuuehgi
Copy link
Author

@calumchisholm I just drop here a post I wrote a while ago. It basically covers what you just wrote.

@calumchisholm
Copy link
Contributor

Nice write-up! Glad to see that your (much more comprehensive) findings agree with my own quick-and-dirty test.

@Be-ing
Copy link

Be-ing commented Feb 19, 2018

I have a fast new CPU (Intel Core i7 8550U), so even double the encoding time is trivial. I will encode the files once and listen to them perhaps hundreds or thousands of times over a span of years or decades. Even a 0.5% reduction in storage space is worth the cost of encoding time. In practical terms, 0.5% would mean I could fit a few more albums on the 128 GB microSD card in my phone. If no one else here cares enough to work on this, I understand, but I don't think there would be any reason someone else couldn't make a pull request to add a command line option for this.

@TJFOE
Copy link

TJFOE commented Mar 1, 2018

Sorry, for me it is a no go, using flac at all. Is there a way to rip only as "pure" wav?

@RecursiveForest
Copy link
Contributor

RecursiveForest commented Mar 2, 2018

Sorry, for me it is a no go, using flac at all. Is there a way to rip only as "pure" wav?

No, nor is this a desired feature. Feel free to edit your own copy of whipper to skip the flac encoding step.

@RecursiveForest
Copy link
Contributor

I'm closing this issue due to the creation of issue #244 which addresses the underlying problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Questions that needs answering with no code changes needed or that only require a one time change
Projects
None yet
Development

No branches or pull requests

8 participants