Page 1 of 1

AAC Profile for 5.1

Posted: Tue Feb 24, 2015 4:39 am
by ramzman
I am trying to use the AAC profile but if I want to convert DTS-MA to 5.1 AAC not Stereo-2 Channel. Every time I change the mix settings the xml fails to load or I get an error with 5.1(Side) not supported. Can anyone suggest an approach to this?

Re: AAC Profile for 5.1

Posted: Tue Feb 24, 2015 7:32 am
by ndjamena
EAC3To and NeroAACEnc/Qaac

Re: AAC Profile for 5.1

Posted: Tue Feb 24, 2015 8:16 am
by ndjamena
"aac-gpl" seems to work with 5.1 but it uses FFMPEG AAC so you'd probably be better of with Nero.

Re: AAC Profile for 5.1

Posted: Tue Feb 24, 2015 3:14 pm
by Romansh
I thought MakeMKV used libfdk? It definitely supports 5.1 encoding, though you might need to ask for 5.1(back) rather than 5.1(side) in FFmpeg?

Re: AAC Profile for 5.1

Posted: Tue Feb 24, 2015 3:24 pm
by ndjamena
channel_layout=5.1[FL][FR][FC][LFE][SL][SR]

or

:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE


Would be the FFMPEG commands that determine these things, if you can figure out how to add either of them, or even if you can.

Re: AAC Profile for 5.1

Posted: Thu Feb 26, 2015 2:20 pm
by Romansh
That's 5.1 side though, 5.1 back would have BL and BR in place of SL and SR.

Re: AAC Profile for 5.1

Posted: Fri Feb 27, 2015 3:37 am
by ramzman
Thank you all for your fast response. I have just started working with the profiles. The current AAC stereo profile reads:
<outputSettings name="aac" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 AAC-LC</description>
<extraArgs>codec=libfdk_aac profile=LC</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<outputSettings name="he-aac" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 HE-AAC</description>
<extraArgs>codec=libfdk_aac profile=HE-AAC signaling=explicit_sbr</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<outputSettings name="aac-gpl" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 AAC-LC (ffmpeg encoder)</description>
<extraArgs>codec=aac -strict -2</extraArgs>
<extraArgs>aac_coder=twoloop</extraArgs>
</outputSettings>

How would I incorporate the commands described above into the XML?

Re: AAC Profile for 5.1

Posted: Wed Aug 26, 2015 10:25 pm
by rs182
I have also been working on an AAC-LC multichannel conversion profile.

Does anyone know of a resource that details the basic syntax for the libfdk_aac codec as used within the XML conversion profile?

The codec is definitely able to encode in multichannel, it's just a matter of figuring out how to tell it to do so within the mmcp.xml file.

Re: AAC Profile for 5.1

Posted: Mon Mar 06, 2017 1:12 pm
by ant75
I have also wanted multi channel AAC encoding and have succeeded in getting it to work for 5.1 channels. 7.1 channel is available in the MakeMKV GUI also and it will try to do it, but then returns with an error stating unsupported in ffmpeg. Do we need a new ffmpeg update? How can this be done?

Here is the xml file code I used to get AAC 5.1 encoding to work. It was modified from the current stereo AAC.



<?xml version="1.0" encoding="utf-8"?>
<profile>
<!-- profile name -->
<name lang="eng">AAC</name>

<!-- Common MKV flags -->
<mkvSettings
ignoreForcedSubtitlesFlag="false"
useISO639Type2T="false"
setFirstAudioTrackAsDefault="true"
setFirstSubtitleTrackAsDefault="true"
setFirstForcedSubtitleTrackAsDefault="true"
insertFirstChapter00IfMissing="true"
/>

<!-- Settings overridable in preferences -->
<profileSettings
app_DefaultSelectionString="-sel:all,+sel:(mvcvideo),-sel:(lossless),+sel:(favlang|nolang),-sel:(havemulti|havecore),+sel:(lossy),+sel:(attachment),=100:all,=90:rus,=80:ara,=70:chi,=60:spa,=50:eng"
/>

<!-- Output formats -->
<outputSettings name="copy" outputFormat="directCopy">
<description lang="eng">Copy track as is</description>
<description lang="ger">Track 1:1 kopieren</description>
</outputSettings>

<outputSettings name="aac" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 AAC-LC</description>
<extraArgs>codec=libfdk_aac profile=LC</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<outputSettings name="he-aac" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 HE-AAC</description>
<extraArgs>codec=libfdk_aac profile=HE-AAC signaling=explicit_sbr</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<!-- HE-AACv2 - stereo inputs only -->
<outputSettings name="he-aacv2" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 HE-AACv2</description>
<extraArgs>codec=libfdk_aac profile=HE-AACv2 signaling=explicit_hierarchical</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<outputSettings name="aac-gpl" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 AAC-LC (ffmpeg encoder)</description>
<extraArgs>codec=aac -strict -2</extraArgs>
<extraArgs>aac_coder=twoloop</extraArgs>
</outputSettings>

<!-- Audio downmix settings -->

<audioMixSettings name="stereo16"
outputBPS="16"
outputChannelLayout="stereo"
mix="DolbyPrologic2">
<description lang="eng">Stereo 16-bit Dolby PrologicII downmix</description>
</audioMixSettings>

<audioMixSettings name="stereo16raw"
outputBPS="16"
outputChannelLayout="stereo"
centerMixLevel="-3dB"
surroundMixLevel="-6dB"
lfeMixLevel="0">
<description lang="eng">Stereo 16-bit downmix</description>
</audioMixSettings>

<!-- Default rule - copy as is -->
<trackSettings input="default">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>

<!-- For all audio tracks don't keep the original track and
produce additional AAC Track if Multi channel source -->

<trackSettings input="LPCM-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="LPCM-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>

<trackSettings input="TRUEHD-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="TRUEHD-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>
<trackSettings input="MLP-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="MLP-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>

<trackSettings input="DTSHDMA-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="DTSHDMA-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>

<!-- Save DTS-HD LBR (low quality) as AAC (just to decode),
do not keep original track -->
<trackSettings input="DTSHDLBR-stereo">
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="DTSHDLBR-multi">
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>

<trackSettings input="DTS-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="DTS-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>

<trackSettings input="AC3-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="AC3-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>
<trackSettings input="EAC3-core-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="EAC3-core-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>
<trackSettings input="EAC3-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="EAC3-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac-gpl"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>

<!-- Keep AAC unchanged -->
<trackSettings input="AAC-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="AAC-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>
</profile>

Re: AAC Profile for 5.1

Posted: Mon Mar 06, 2017 3:31 pm
by ndjamena
If you set the "outputChannelLayout" in an "audioMixSettings" to "5.1b" and add that to your "-multi" profile entries you can use the default AAC encoder (libfdk_aac) which has better compression than aac-gpl. It will also downmix 7.1 to 5.1. As to what it will do to 4.0 or 5.0... you'd have to deal with those kind of occurrences manually (there's "5.0b", but there are no named channel layouts for anything else, 6.1 and 7.1 included.)

Re: AAC Profile for 5.1

Posted: Tue Mar 07, 2017 12:16 am
by ant75
Thank you for the help with the channel mapping. I have added the multi audio mix with 5.1b channel mapping. (Rear not side speakers) I confirm that 7.1 channels are not working. A shame as this is what I originally wanted to get happening.

Here is the modified xml file:


<?xml version="1.0" encoding="utf-8"?>
<profile>
<!-- profile name -->
<name lang="eng">AAC</name>

<!-- Common MKV flags -->
<mkvSettings
ignoreForcedSubtitlesFlag="false"
useISO639Type2T="false"
setFirstAudioTrackAsDefault="true"
setFirstSubtitleTrackAsDefault="true"
setFirstForcedSubtitleTrackAsDefault="true"
insertFirstChapter00IfMissing="true"
/>

<!-- Settings overridable in preferences -->
<profileSettings
app_DefaultSelectionString="-sel:all,+sel:(mvcvideo),-sel:(lossless),+sel:(favlang|nolang),-sel:(havemulti|havecore),+sel:(lossy),+sel:(attachment),=100:all,=90:rus,=80:ara,=70:chi,=60:spa,=50:eng"
/>

<!-- Output formats -->
<outputSettings name="copy" outputFormat="directCopy">
<description lang="eng">Copy track as is</description>
<description lang="ger">Track 1:1 kopieren</description>
</outputSettings>

<outputSettings name="aac" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 AAC-LC</description>
<extraArgs>codec=libfdk_aac profile=LC</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<outputSettings name="he-aac" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 HE-AAC</description>
<extraArgs>codec=libfdk_aac profile=HE-AAC signaling=explicit_sbr</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<!-- HE-AACv2 - stereo inputs only -->
<outputSettings name="he-aacv2" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 HE-AACv2</description>
<extraArgs>codec=libfdk_aac profile=HE-AACv2 signaling=explicit_hierarchical</extraArgs>
<extraArgs>afterburner=1</extraArgs>
</outputSettings>

<outputSettings name="aac-gpl" outputFormat="AAC">
<description lang="eng">Save as Mpeg-4 AAC-LC (ffmpeg encoder)</description>
<extraArgs>codec=aac -strict -2</extraArgs>
<extraArgs>aac_coder=twoloop</extraArgs>
</outputSettings>

<!-- Audio downmix settings -->

<audioMixSettings name="multi"
outputBPS="16"
outputChannelLayout="5.1b"
mix="DolbyPrologic2">
<description lang="eng">Multi Channel Encoding to AAC</description>
</audioMixSettings>

<audioMixSettings name="stereo16"
outputBPS="16"
outputChannelLayout="stereo"
mix="DolbyPrologic2">
<description lang="eng">Stereo 16-bit Dolby PrologicII downmix</description>
</audioMixSettings>

<audioMixSettings name="stereo16raw"
outputBPS="16"
outputChannelLayout="stereo"
centerMixLevel="-3dB"
surroundMixLevel="-6dB"
lfeMixLevel="0">
<description lang="eng">Stereo 16-bit downmix</description>
</audioMixSettings>

<!-- Default rule - copy as is -->
<trackSettings input="default">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>

<!-- For all audio tracks don't keep the original track and
produce additional AAC Track if Multi channel source -->

<trackSettings input="LPCM-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="LPCM-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>

<trackSettings input="TRUEHD-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="TRUEHD-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>
<trackSettings input="MLP-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="MLP-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>

<trackSettings input="DTSHDMA-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="DTSHDMA-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>

<!-- Save DTS-HD LBR (low quality) as AAC (just to decode),
do not keep original track -->
<trackSettings input="DTSHDLBR-stereo">
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="DTSHDLBR-multi">
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString"
audioMix="multi">
</output>
</trackSettings>

<trackSettings input="DTS-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="DTS-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>

<trackSettings input="AC3-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="AC3-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>
<trackSettings input="EAC3-core-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="EAC3-core-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>
<trackSettings input="EAC3-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="EAC3-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
<output outputSettingsName="aac"
defaultSelection="$app_DefaultSelectionString,-sel:all"
audioMix="multi">
</output>
</trackSettings>

<!-- Keep AAC unchanged -->
<trackSettings input="AAC-stereo">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString">
</output>
</trackSettings>
<trackSettings input="AAC-multi">
<output outputSettingsName="copy"
defaultSelection="$app_DefaultSelectionString,-sel:all">
</output>
</trackSettings>
</profile>