So long story short I'm going to be encoding a bunch of movies and I want their audio to be as good as possible. The source audio is 5.1ch.
Here are the 3 options I'm thinking about.
Size doesn't bother me, but if one setting results in some scenes being noticeable quieter or lower in quality then that's a problem.
+ Reply to Thread
Results 1 to 12 of 12
Last edited by WAusJackBauer; 8th May 2016 at 11:09.
If size doesn't bother you, why lower the default quality setting in VBR mode? Mind you the quality of "82" would probably still be transparent, but I'm just asking.....
If you check out the listening tests over at hydrogenaudio, you'll see it appears AAC starts to become fairly transparent at 128k for stereo music, but a problem with a "one size fits all setting", is audio doesn't always have the same number of channels. You wouldn't want to encode 5.1ch audio at the same bitrate as stereo.
I know true VBR generally gives higher file sizes even if you choose a setting that gets closest to the 320kbit/s Constrained VBR setting.
I just tried a quick test on some 5.1ch audio, 40 minutes duration, and another test after downmixing to stereo (source 5.1ch AC3, 114MB, 384kbps).
CVBR, 320kbps, 5.1ch = 96MB, 325kbps
CVBR, 320kbps, 2ch = 94MB, 314kbps
TVBR, Q91, 5.1ch = 106MB, 357kbps
TVBR, Q91, 2ch = 36MB, 121kbps
Q91 generally results in higher bitrates when encoding stereo music, but it'll be lower for stereo soundtrack audio as it's a lot more sparse. I always use TVBR Q91 myself, but at that quality it's usually not worth re-encoding 2ch/5.1ch AC3 as it doesn't reduce the bitrate enough. DTS and other high bitrate audio types are a different story.
By the way, the "no delay" option is probably not a bad thing. Lossy encoders "pad" the beginning of the audio with silence causing a slight audio delay (it's about 50ms for NeroAAC but I can't remember for QAAC). The "no delay" option gets QAAC to remove it. Apparently it's got the potentail to cause clicks or pops at the beginning of the audio, but I suspect that's when the very beginning isn't silent, whereas for soundtrack audio it usually is. I've been using the "no delay" option for quite a while and not heard anything bad. The "no delay" option has nothing to do with any audio delay that might be present in the source file, just the "extra delay" that's caused by encoder padding.
If you're muxing with MKVMergeGUI (which MeGUI used for MKV muxing) it doesn't matter too much, as it removes the padding when muxing if it's written to the output file (which it should be). I don't think any other muxers do.
The audio bitrate won't have any effect on the audio's volume as such, just the quality.
Last edited by hello_hello; 8th May 2016 at 11:15.
Thank you for such a detailed response but I'm probably more confused now.
I forgot to say, the source files are 5.1ch or higher. Constrained VBR or True VBR for 5.1ch?
Thank you for the no delay tip. Sometimes I mux it to an MP4, should I enable it for MP4s?
True Variable Bitrate gives you a specific quality. The bitrate is free to vary as much as necessary, and generally the more channels, the higher the bitrate, as you're specifying a quality regardless of the channel count. All the other encoding modes let you control the bitrate in some way, but the selected bitrate is not directly related to quality.
In other words for True Variable Bitrate you're picking a quality but you have no control over the bitrate. For the other modes you're picking a bitrate without knowing what the quality will be. I use TVBR Q91 for everything myself, but the quality you choose is up to you. Obviously a higher quality setting will result in a higher bitrate for any given source.
According to Apple, when you choose a Constrained Variable Bitrate you're specifying a minimum average bitrate. The bitrate can increase by a limited amount if necessary, but you're still specifying a bitrate without knowing what bitrate might be needed to achieve a specific quality.
Bit Rate Control Modes for AAC Encoding
When you're encoding audio on it's own the amount of encoder padding (silence at the beginning and end) doesn't matter as it's written to the output m4a/mp4 and audio players/decoders read that info and ignore the extra silence, so the encoded audio will effectively have exactly the same duration as the original. When muxing the audio with video though, that information is likely lost so the encoder padding at the beginning effectively becomes a small audio delay unless the muxing program compensates for it. MKVMergeGUI does. I've no idea if any MP4 muxers do, but I'd use the "no delay" option regardless myself.
Last edited by hello_hello; 8th May 2016 at 22:10.
This is the highest possible quality of QAAC settings
I suggest to use Hybrid for this. This is the CVBR & TVBR settings
If use command line, then you need ffmpeg & QAAC binary files.
Here's the CVBR settings
ffmpeg -y -threads 8 -i "inputfile" -acodec pcm_s32le -f wav - | qaac --no-delay --threading --cvbr 0 --quality 2 --adts - -o "outputfile.aac"
ffmpeg -y -threads 8 -i "inputfile" -acodec pcm_s32le -f wav - | qaac --no-delay --threading --tvbr 127 --quality 2 --adts - -o "outputfile.aac"
Last edited by anana; 9th May 2016 at 12:54.
If I encode something in Constrained bitrate and encode another in True VBR and they're both averaging 320kb/s then aren't they the same quality?
For stereo soundtrack "A" an average bitrate of 96kbps might be perfectly transparent, but stereo soundtrack "B" might require an average bitrate of 160kbps to be transparent. If you specify128kbps for both you'd be wasting bits for "A" while not using enough for "B" and 128kbps wouldn't give you the same quality each time.
Some audio takes more bitrate to encode at a particular quality. It's less sparse, or it's more complex, or there's less in common between the stereo channels, that sort of thing.
For AAC it's kind of academic though, because anything over 128kbps per stereo channels is going to be pretty transparent, but the advantage of TVBR is you're just using the bits required to achieve the quality you selected. No more, no less, and regardless of the number of channels. If you use one of the other encoding methods you'd want to specify a different bitrate for mono than for stereo than for multichannel etc because obviously the same bitrate can't give you the same quality for a different number of audio channels.
Even though MeGUI's QAAC encoder configuration only lets you select a maximum of 320kbps as the bitrate, you can over-ride it and go higher by specifying a bitrate in the custom command line section under the "Extra" tab (anything added to the command line there should take precedence over any setting in the encoder configuration GUI, if they conflict). For example....
-v 768 tells the encoder to use CVBR encoding at 768kbps.
-a 128 tells the encoder to use average bitrate encoding at 128kbps.
-c 256 tells the encoder to use constant bitrate encoding at 256kbps.
-V 91 tells the encoder to use TVBR encoding with a quality of 91.
If you specify more than the maximum bitrate for the number of channels, QAAC will ignore it and give you the maximum, but for every mode except TVBR mode, specifying zero as the bitrate tells the encoder to use the maximum possible bitrate. I think it's 320kbps for stereo and 768kbps for 5.1ch. Don't hold me to those bitrates, but it's why MeGUI's QAAC encoder configuration lets you select 0kbps as the bitrate.
Some other AAC encoders will let you go higher. If memory serves me correctly the maximum bitrate according to the AAC spec is 512kbps for stereo, and NeroAAC will do it, at least in constant bitrate mode, but it's kind of pointless.
QAAC Command Line Options
Last edited by hello_hello; 9th May 2016 at 22:39.
One other thing to add to the confusion.....
QAAC has a quality setting that's independent of the encoding mode. When you open an encoded AAC/mp4/m4a file with MediaInfo you should see something like this (text or html view):
Writing application : qaac 2.58, CoreAudioToolbox 220.127.116.11, AAC-LC Encoder, CVBR 160kbps, Quality 96
Writing application : qaac 2.58, CoreAudioToolbox 18.104.22.168, AAC-LC Encoder, TVBR q91, Quality 96
That last quality setting should always be 96 regardless of the encoding mode used. I think it represents the algorithm used for encoding and QAAC defaults to the maximum quality algorithm.
If you look at the command line options I linked to in my last post, you'll see QAAC has a quality setting with possible values of
0, 1 or 2. QAAC translates those into Apple-speak:
-q 0 = Quality 32
-q 1 = Quality 64
-q 2 = Quality 96
It has nothing to do with the encoding method as such but the quality setting does effect encoding speed. As far as I know QAAC always defaults to -q 2 so it's nothing you need to think about, but I thought I'd mention it in case you wondered how it works, as you can use any combination of quality setting and encoding mode, including TVBR.
Last edited by hello_hello; 9th May 2016 at 22:33.
Again I appreciate you responding but this has become way too complicated now haha.
But what I take from it is that you suggest using True VBR.
I found that the quality setting 73 was the equivalent in bitrate of Constrained VBR 320kb/s but that was only for 10 seconds of audio so might be different for a full length movie's worth.
EDIT: I'm almost feeling like Constrained is the better option for me. I guess size is a little bit important to me and the size is definitely lower using Constrained VBR and I can't hear any difference in quality TVBR. The bitrate increases during noises scenes and decreases to around 250kb/s when it's quiet, which is exactly what I want.
I'm open to using TVBR if you can explain in simple terms why I should use it over Constrained
Last edited by WAusJackBauer; 10th May 2016 at 10:30.
If you're just going with stereo, use TrueVBR -q91 (which I believe is ~192kbps). I like the Fraunhofer FDK AAC codec better which targets perceptual quality rather than target bitrate.
TVBR = true variable biratrate = you choose the quality.
If, on average, you're finding a particular quality setting is producing a higher bitrate than you'd prefer, you can reduce it a little.
CVBR = variable bitrate with constraints = you choose the bitrate.
Every single AAC encoder I've used has a Variable Bitrate mode (except one old, obsolete encoder), a Constant Bitrate mode, and they often have an Average Bitrate mode (the Fraunhofer AAC encoders don't).
QAAC is the only encoder I know of with a Constrained VBR mode.
Bit Rate Control Modes for AAC Encoding
Average Bit Rate (ABR) - Default Mode
-- Recommended for controlling file size --
Variable Bit Rate But Constrained (VBR_Constrained)
-- Recommended as a compromise between VBR and ABR --
Variable Bit Rate (VBR)
-- Recommended for controlling the audio quality --
~192kbps is just a rough average you'll get from q91 when encoding stereo music.
Foobar2000 offers a similar guesstimation for each of the AAC encoders for which it has preconfigured presets.
Mind you for FDKAAC it's probably the least accurate for some reason. I find unless I change the default low pass filtering to something sensible, the bitrate for FDKAAC at the highest quality setting is generally much higher than foobar2000's guess (it's more like 225kbps).
I add "-w 18500" to the command line for the second highest quality setting, which brings the bitrate up a bit from roughly 128kbps to 160kbps), and for the highest quality setting, it reduces it a bit (closer to 200kbps).
For fun, I picked a random flac file ripped from CD (it probably required a slightly higher bitrate than average) and compared VBR quality settings. Just as a comparison. No other reason.
FDKAAC -m 4 = 140kbps
FDKAAC -m 4 -w 18500 = 172kbps
FDKAAC -m 5 -w 18500 = 221kbps
FDKAAC -m 5 = 239kbps
FhGAAC --vbr 4 = 148 kbps
FhGAAC --vbr 5 = 226kbps
FhGAAC --vbr 6 = 281kbps
NeroAAC -q 0.40 = 132kbps
NeroAAC -q 0.50 = 187kbps
NeroAAC -q 0.60 = 234kbps
QAAC -V 63 = 136kbps
QAAC -V 91 = 211kbps
QAAC -V 109 = 285kbps
Last edited by hello_hello; 10th May 2016 at 19:00.
While I was re-encoding a 5.1ch DTS movie file today, 2 hours long, I tried a few different encoder settings to kill some time. The movie wasn't an action movie so the audio might be a little more sparse than average.
FDKAAC -m 4 = 330kbps
FDKAAC -m 4 -w 18500 = 382kbps
FDKAAC -m 5 -w 18500 = 463kbps
FhGAAC --vbr 4 = 262 kbps
FhGAAC --vbr 5 = 427kbps
NeroAAC -q 0.50 = 395kbps
QAAC -V 63 = 288kbps
QAAC -V 91 = 387kbps
It looks like for QAAC's TVBR encoding, a quality setting of 63 would give you somewhere in the vicinity of 320kbps for 5.1ch audio, if that's what you're after.