VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Hello.

    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.

    Click image for larger version

Name:	qaac 2.png
Views:	2903
Size:	34.0 KB
ID:	36922Click image for larger version

Name:	qaac 1.png
Views:	2791
Size:	34.5 KB
ID:	36923Click image for larger version

Name:	qaac 3.png
Views:	3164
Size:	33.9 KB
ID:	36924

    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.
    Last edited by WAusJackBauer; 8th May 2016 at 11:09.
    Quote Quote  
  2. 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.
    It very well could when encoding multi-channel audio because it's not constrained (CVBR = Constrained VBR, TVBR = True VBR). Try re-encoding some 5.1ch audio as 5.1ch, then again mixing it down to stereo. CVBR will give you roughly the same bitrate each time, and I assume CBR will give you the same bitrate each time. For TVBR, the bitrates will be a lot different.... more as you'd expect when encoding a different number of channels.

    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.
    Quote Quote  
  3. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    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?
    Quote Quote  
  4. 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.
    Quote Quote  
  5. 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
    Code:
    ffmpeg -y -threads 8 -i "inputfile" -acodec pcm_s32le -f wav - | qaac --no-delay --threading --cvbr 0 --quality 2 --adts - -o "outputfile.aac"
    Here's the TVBR settings
    Code:
    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.
    Quote Quote  
  6. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Originally Posted by hello_hello View Post
    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.
    I think I get you but why does picking a bitrate in Constrained bitrate not equal picking a quality? Doesn't bitrate equal quality?

    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?
    Quote Quote  
  7. Originally Posted by WAusJackBauer View Post
    I think I get you but why does picking a bitrate in Constrained bitrate not equal picking a quality? Doesn't bitrate equal quality?
    It does equal quality, but you don't necessarily know what the quality will be.
    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.

    Originally Posted by WAusJackBauer View Post
    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?
    Probably not exactly the same because the bitrate for the CVBR encode isn't free to vary as much as TVBR. That aside though, you can't know what CVBR bitrate will be required to match the same quality as (for example) TVBR Q91, because you don't know what bitrate will result from Q91 until the source is encoded that way.

    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.

    Click image for larger version

Name:	qaac.gif
Views:	2315
Size:	17.7 KB
ID:	36934

    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.
    Quote Quote  
  8. 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 7.10.5.0, AAC-LC Encoder, CVBR 160kbps, Quality 96
    or
    Writing application : qaac 2.58, CoreAudioToolbox 7.10.5.0, AAC-LC Encoder, TVBR q91, Quality 96
    etc.

    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.
    Quote Quote  
  9. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    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.
    Quote Quote  
  10. 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.
    Quote Quote  
  11. Originally Posted by WAusJackBauer View Post
    But what I take from it is that you suggest using True VBR.
    That's what I use, so feel free to take it as a suggestion.

    Originally Posted by WAusJackBauer View Post
    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.
    I assume that was for 5.1ch audio? If so, try the same again except with a stereo audio source. Even TVBR Q91 will give you a much lower bitrate than Constrained VBR 320kb/s for stereo, because for CVBR you're specifying the same bitrate regardless of the number of channels. For TVBR you're specifying a quality, therefore the fewer channels, the lower the bitrate.

    Originally Posted by WAusJackBauer View Post
    I'm open to using TVBR if you can explain in simple terms why I should use it over Constrained
    I honestly don't know how to explain it any better.
    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.

    From Apple:
    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 --
    There's no rule. Use whichever mode you prefer.

    Originally Posted by hogger129 View Post
    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.
    As far as I know, QAAC's TrueVBR mode targets perceptual quality just as every other encoder's VBR mode does.
    ~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.

    Click image for larger version

Name:	QAAC.gif
Views:	2305
Size:	10.7 KB
ID:	36957

    Click image for larger version

Name:	FDKAAC.gif
Views:	2466
Size:	12.1 KB
ID:	36958

    Click image for larger version

Name:	FhGAAC.gif
Views:	2247
Size:	13.6 KB
ID:	36959

    Click image for larger version

Name:	NeroAAC.gif
Views:	2081
Size:	10.6 KB
ID:	36960

    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).
    http://wiki.hydrogenaud.io/index.php?title=Fraunhofer_FDK_AAC#Bandwidth

    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.
    Quote Quote  
  12. 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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!