How can I add an AAC 2 channel audio track as default

I want to add an AAC 2 channel audio as default as well as copy all the other available audio streams as is into my MKV Normal Quality conversions. Can I do this with MCEBuddy and if so how do I accomplish it.

Thanks

Good question. I know you can add a stereo track and 1 other track using the method described here Creating Multiple Audio Tracks from a Single Audio Track and that you can add all tracks as described here MCEBuddy - Advanced Settings, Commands and Tweaking but I have not tried to do both.

This is what that FAQ shows for ffmpeg:

ffmpeg-audio=-map 0:1 -map 0:1 -c:a:0 aac -ab 192k -ac 2 -c:a:1 ac3 -ab 192k
ffmpeg-audioac3=-map 0:1 -map 0:1 -c:a:0 aac -ab 384k -ac 2 -c:a:1 copy
ffmpeg-AudioOptimized=true

But I don’t understand the individual commands. I want a normalized stereo AAC of the default audio, which is usually 5.1 as the new default with all the original audio streams either copied or compressed. I would l like to experiment. Currently the audio in my profile is set to this:

ffmpeg-audioac3=-c:a copy -map 0:a
ffmpeg-audioac3=-acodec copy -map 0:a

But I would like to try to use this from the original HEVC profile after making the default audio into stereo AAC

ffmpeg-audio=-acodec ac3 -ab 160k -map 0:a
ffmpeg-audioac3=-acodec ac3 -ab 256k -map 0:a

If anyone can give me some insight how to do this it would be much appreciated. At that point I will finally have MCEBuddy set up exactly as I need and I can simply encode for a few months to clear my hard drives of all my TS files.

I’ll take a stab at this and dissect the FAQ strings.

ffmpeg-audio=-map 0:1 -map 0:1 -c:a:0 aac -ab 192k -ac 2 -c:a:1 ac3 -ab 192k

  1. ffmpeg-audio=
    This is for processing non-ac3 audio (unsure if that is on a track by track basis, if I have a file with AAC and AC3 do both lines get used?).

  2. -map 0:1 -map 0:1
    I don’t know why this is needed to be honest

  3. -c:a:0 aac -ab 192k -ac 2
    Make an AAC 192k stereo track of the source audio as audio track 0 in the output file.

  4. -c:a:1 ac3 -ab 192k
    Make an AC3 192k track with the same number of channels as the source audio as audio track 1 in the output file.

ffmpeg-audioac3=-map 0:1 -map 0:1 -c:a:0 aac -ab 384k -ac 2 -c:a:1 copy

  1. ffmpeg-audioac3=
    This is for processing ac3 audio (again unsure if that is on a track by track basis, if I have a file with AAC and AC3 do both lines get used?).

  2. -map 0:1 -map 0:1
    Still don’t know why this is needed

  3. -c:a:0 aac -ab 384k -ac 2
    Make an AAC 384k stereo track of the source audio as audio track 0 in the output file.

  4. -c:a:1 copy
    Make a copy of the source audio track as audio track 1 in the output file.

ffmpeg-AudioOptimized=true

  1. MCEBuddy should not try and modify these values.
    More info: MCEBuddy - Advanced Settings, Commands and Tweaking

I don’t know how to normalize the audio since you will need to have So in order to do what you would like to do I would think you would use the following:

ffmpeg-audio=-map 0:1 -map 0:1 -c:a:0 aac -ab 192k -ac 2 -c:a:1 ac3 -ab 160k
ffmpeg-audioac3=-map 0:1 -map 0:1 -c:a:0 aac -ab 192k -ac 2 -c:a:1 ac3 -ab 256k
ffmpeg-AudioOptimized=true

Hopefully that’s something to help you start experimenting with.

Thank you, I have been experimenting but I am still confused. I made a copy of my current profile in the config file and named it TEST, deleted all the audio entries and simply added:

ffmpeg-audioac3=-map 0:1 -map 0:1 -c:a:0 aac -ab 384k -ac 2 -c:a:1 copy

And the resulting file had the video as expected, the default audio track was AAC Stereo, and the second track was a copy of the original default AC3 6 channel audio.

If I make it:

ffmpeg-audioac3=-map 0:1 -map 0:1 -c:a:0 aac -ab 384k -ac 2 -c:a:1 copy -c:a:2 copy

I get an extra copy of the original AC3 6 channel audio.

The best I can figure is the -map 0:1 has something to do with the audio streams where 0 is the first and 1 is the second but I don’t know if this is pertaining to the input or the output file.

Really at this point I need to know how to copy the second audio stream in the original file as it is a 2 channel Spanish but I don’t know what to do at this point. If I can get some help understanding how to do this then I think I would understand how to convert that audio stream also.

Any insight would really be appreciated. I am anxious to figure out this last piece of my puzzle to have a complete encoding solution for my Emby server.

I assume you need an updated map value for the 3rd audio that tells it which audio track id you want to map.

Here is the ffmpeg help for map.

-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_s set input stream mapping

And here is the wiki page for it that might help.
https://trac.ffmpeg.org/wiki/Map

Thank you so much for all of your help in all of this tweaking of my profile…after reading that page a dozen times thinking I understood the map but could not figure out the order or how to use it in the profile…and at least 30 encodings of a 5 minute clip with the 2 audio streams and subs I was trying to preserve…THIS WORKS:

ffmpeg-audioac3=-map 0:1 -map 0:1 -map 0:2 -c:a:0 aac -ab 384k -ac 2 -c:a:1 copy -c:a:2 copy

I get the default AC3 6 channel audio from the original TS file as AAC stereo as the default in the output, then the original AC3 6 channel audio is copied as the second audio stream in the output file, and finally I get the AC3 2 channel Spanish audio stream from the original copied as the third audio stream into the output file.

I almost gave up several times as I have been trying this when I had time since yesterday afternoon and asking you for advice but my German kicked in and I was determined to understand this and figure it out or at least exhaust all my possibilities before I asked you again.

1 Like

That’s great! I didn’t have a good source file to test with on my side so all I could do was read about it and think that maybe I understood what it was saying. I didn’t want to tell you to try something specific because I didn’t want to lead you down the wrong course. I’m sure glad you were able to figure it out.