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: QAAC settings to achieve highest quality (Read 14043 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

QAAC settings to achieve highest quality

Hi, I'm new to this forum, so excuse me if I inadvertently fail to follow any forum rule(s).

Here's what I want to do...
I have some CD rips stored in FLAC files, and I cannot ABX them from 256 Kbps iTunes Plus or encoded TVBR AAC files, which means storing FLAC files is a waste of space for me. So I've decided to encode them all to AAC and delete the FLACs to free up some space.

I've gone through QAAC's command-line documentation here, and configured it with LameXP, but I have some doubts whether I'll get the best possible quality encode (for ~256 Kbps) out of this command...

--tvbr 109 --quality 2 --rate 44100 --native-resampler=bats,127 --limiter --ignorelength

My confusions are...
1) Bit Depth when converting a 24-bit FLAC to AAC - AFAIK, bit depth is only relevant to lossless files, lossy files have them fluctuating all over the place, correct me if I'm wrong. This means it might go below 18, or even 16 at some point. I don't care about that, but QAAC's documentation says that if bit depth goes below 18, QAAC applies TPDF dither by default. I don't know if it applies to AAC encodes too where theoretically bit depth is irrelevant, or is it just for lossless PCM/ALAC/WAV encodes. But if it does apply dithering, will it reduce artifacts or "dumb" the sound? Will I be better off using --no-dither?

2) I've also read somewhere on hydrogenaud.io that --ignorelength should almost always be used, especially when converting from FLAC to get accurate length, so am I right to use it or should I only use it in certain scenarios, and/or in combination with other command option(s)? Also, what if I'm converting from APE/ALAC files instead of FLAC, should it be used for those too?

3) And what about --limiter? Documentation says that it allows soft clipping and hence less artifacts, but is it applicable to my case, or should it only be used in certain circumstances, and/or with other command option(s)?

4) Finally, from here, I've discerned that --native-resampler=bats,127 will use QuickTime's CoreAudio sample rate converter instead of SoX, and at the highest quality. I'm assuming QT's resampling algorithms to be better than SoX, am I right to go this route?

I know it's a lot, but I'm new to encoding AAC files (been using MP3 for ages), so any help would be greatly appreciated.
Rap is NOT music

Re: QAAC settings to achieve highest quality

Reply #1
1) Bit Depth when converting a 24-bit FLAC to AAC
AAC encoder eats 32bit float. So you don't have to care about bit-depth down conversion.

2) I've also read somewhere on hydrogenaud.io that --ignorelength should almost always be used, especially when converting from FLAC to get accurate length
As long as you feed FLAC files or something directly to qaac command line, you don't need --ignorelength.
It is an option for piping from a WAV file.
Since GUI frontends such as fb2k will first decode FLAC file to WAV and pipe it to qaac, --ignorelength can be useful when you are using qaac from GUI frontends. In many cases, qaac can automatically detect it and fallback to ignorelength mode.
When something goes wrong, it should be obvious by looking at duration of the resulting file.

3) And what about --limiter?
Forget about it. It is only useful when you are converting floating point input to integer PCM, which is irrelevant on AAC encoding.

4) Finally, from here, I've discerned that --native-resampler=bats,127 will use QuickTime's CoreAudio sample rate converter instead of SoX, and at the highest quality. I'm assuming QT's resampling algorithms to be better than SoX, am I right to go this route?
No, forget about it. SoX is flawless and far more efficient (fast) than CoreAudio bats. Hence the default.

Re: QAAC settings to achieve highest quality

Reply #2
Samplerate of all CDs is 44100 Hz anyway, so there's no reason to resample 44100 -> 44100.
(I suspect that qaac doesn't use resampler if output samplerate is the same as input).

Re: QAAC settings to achieve highest quality

Reply #3
1) Bit Depth when converting a 24-bit FLAC to AAC
AAC encoder eats 32bit float. So you don't have to care about bit-depth down conversion.

2) I've also read somewhere on hydrogenaud.io that --ignorelength should almost always be used, especially when converting from FLAC to get accurate length
As long as you feed FLAC files or something directly to qaac command line, you don't need --ignorelength.
It is an option for piping from a WAV file.
Since GUI frontends such as fb2k will first decode FLAC file to WAV and pipe it to qaac, --ignorelength can be useful when you are using qaac from GUI frontends. In many cases, qaac can automatically detect it and fallback to ignorelength mode.
When something goes wrong, it should be obvious by looking at duration of the resulting file.

3) And what about --limiter?
Forget about it. It is only useful when you are converting floating point input to integer PCM, which is irrelevant on AAC encoding.

4) Finally, from here, I've discerned that --native-resampler=bats,127 will use QuickTime's CoreAudio sample rate converter instead of SoX, and at the highest quality. I'm assuming QT's resampling algorithms to be better than SoX, am I right to go this route?
No, forget about it. SoX is flawless and far more efficient (fast) than CoreAudio bats. Hence the default.
@nu774 Huge thanks, cheers!

EDIT: About --ignorelength, I'll be using a GUI frontend - LameXP, and I'll be encoding a few thousand files, therefore it's not quite convenient to check the duration of every single one. So will it hurt if I just use it all the time, or will using it unnecessarily do any harm?
Rap is NOT music

Re: QAAC settings to achieve highest quality

Reply #4
Samplerate of all CDs is 44100 Hz anyway, so there's no reason to resample 44100 -> 44100.
(I suspect that qaac doesn't use resampler if output samplerate is the same as input).
You are right, I asked this just for knowledge, for when I'm converting from 24-bit 96 kHz sources because I have a few vinyl rips too. I'm sorry, my bad I only mentioned CD earlier. Thanks for the response anyway.
Rap is NOT music

Re: QAAC settings to achieve highest quality

Reply #5
@nu774 One more question :) If I use --rate 44100 on a mix of 44.1/96 kHz files, will the 44.1 kHz files get ignored for having the same frequency or get "resampled", just curious...
Rap is NOT music

Re: QAAC settings to achieve highest quality

Reply #6
--rate 44100 on 44.1kHz input is the same as specifying --rate keep (default), and doesn't cause sample rate conversion.

Re: QAAC settings to achieve highest quality

Reply #7
--rate 44100 on 44.1kHz input is the same as specifying --rate keep (default), and doesn't cause sample rate conversion.

That's great, makes encoding a mixbag collection like mine much convenient, thanks.

@nu774 you missed my previous question about --ignorelength...

As you've said earlier about this option being relevant to GUI frontends, I'll actually be using one - LameXP to encode a few thousand files, therefore it's not quite convenient to check the duration of every single one. So if I use --ignorelength all the time, even if I'm not piping from a WAV file, will its unnecessary use do any harm or will it be fine?

My apologies for being too nit-picky about this. It's just that I'll be deleting the lossless files after encoding, so I want to be sure that the encodes are top notch. Thanks.
Rap is NOT music

Re: QAAC settings to achieve highest quality

Reply #8
--ignorelength is not specific to qaac. Similar option is offered by many other CLI encoders.

--ignorelength is simply ignored if you feed other formats than WAV, so it does no harm as long as you directly feed FLAC file or something.  However, blindly specifying --ignorelength for WAV file is not a good idea.
This option forces qaac to ignore the duration written in the WAV header. However, WAV file can have other chunks (metadata or something) AFTER the data chunk that contains PCM. --ignorelength will let qaac treat those metadata as PCM (it can turn into loud glitches or something). You shouldn't.

On the other hand, when piping WAV file, sender can not always write correct duration in the header (header has to be written before data, but length of data is not always predictable). Some software (such as ffmpeg or fb2k) just puts placeholder value such as zero or very large integer. --ignorelength is useful for such cases.

As for LameXP, I don't know what it does. I guess it decodes input and pipes WAV to qaac like many other GUI front ends.

Re: QAAC settings to achieve highest quality

Reply #9
@nu774 thanks for everything, learnt A LOT
Rap is NOT music