How to default to AC3 audio track? (Mac, Handbrake, MP4, AC3)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
optics Offline
Junior Member
Posts: 10
Joined: Jan 2011
Reputation: 0
Post: #1
I am using Handbrake 0.95 to create MP4 files using the High Profile setting. By default, this creates an MP4 container with a h.264 file video track and a AAC (Dolby Pro Logic II) audio track and a AC3 passthrough audio track (in that order).

I am also using XBMC (Dharma) on a Mac Mini with HDMI output enabled.

When I play a file created in Handbrake, Dharma selects the first--lower--quality audio track (the AAC Dolby Pro Logic II track). I can, of course, manually select the AC3 passthrough on a per video basis. But this gets old quickly.

Is there an way to configure XBMC to select the AC3 passthrough where available and, otherwise, default to AAC?

If not, is there a way to create an add-on to do the same?
find quote
darkscout Offline
Posting Freak
Posts: 2,145
Joined: Jul 2008
Reputation: 12
Post: #2
What does the "Save as default" button do?

[Image: aeKO.jpeg]
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
find quote
optics Offline
Junior Member
Posts: 10
Joined: Jan 2011
Reputation: 0
Post: #3
Whatever it may do, it doesn't do what I am requesting...

For example, go to audio. "Undetermined stereo (1/2)" is listed. In other words, the AAC track. Disregard why the number of channels is "undetermined".

Choose the second (AC3) track, listed as "Undetermined stereo (2/2)". Now save as default for all movies.

Select and play another MP4 video within XBMC. Go to menu, then audio and note that it is back on "Undetermined stereo (1/2)".

Manually select "Undetermined stereo (2/2)" to confirm desired (AC3) audio track.
find quote
jerndl Offline
Junior Member
Posts: 45
Joined: Oct 2009
Reputation: 0
Post: #4
Although not exactly what you asked, you can configure Handbrake to put the AC3 track as the 1st track and then XBMC will play it by default. Good luck.

Jay
find quote
Elfgoat Offline
Junior Member
Posts: 2
Joined: Jan 2011
Reputation: 0
Post: #5
I think I found a solution to this, trying to accomplish the same thing you are on my lunch break.

Watch a movie and set the audio to AC3. On the same page you'll see, "Set to default for all movies", click that.

I just tested it on a new movie and XBMC chose AC3 instead of the downmixed track.
find quote
darkscout Offline
Posting Freak
Posts: 2,145
Joined: Jul 2008
Reputation: 12
Post: #6
Elfgoat Wrote:I think I found a solution to this, trying to accomplish the same thing you are on my lunch break.

Watch a movie and set the audio to AC3. On the same page you'll see, "Set to default for all movies", click that.

I just tested it on a new movie and XBMC chose AC3 instead of the downmixed track.

So... my comment.

[Image: aeKO.jpeg]
Code:
GRANT ALL PRIVILEGES ON `xbmc_%`.* TO 'xbmc'@'%';
IF you have a mysql problem, find one of the 4 dozen threads already open.
find quote
Elfgoat Offline
Junior Member
Posts: 2
Joined: Jan 2011
Reputation: 0
Post: #7
darkscout Wrote:So... my comment.

Answers don't usually come in the form of questions?
find quote
zkyd Offline
Junior Member
Posts: 2
Joined: Jan 2011
Reputation: 0
Post: #8
I havea similar issue. Mp4 h.264 w/aac on first track and AC3 passthrough on second track. Both tracks play fine in XBMC, and w/track 2 selected (ac3 passthrough) then pressing the "Set as default for all movies" in the audio setting prompts if I'm sure, and pressing "yes" appears to take effect. The audio is 5.1 and playing correctly for the current mp4 file.

However when I navigated to another mp4 w/the same audio track layout, XBMC will default to the first (aac) track again. It seems theres something wrong with XBMC's ability to save the audio track preference and/or select the highest quality audio available.

Going to System> System > Audio, my Audio output is set to Optical/coax, Speaker config to 5.1, with the AC3 and DTS capable options selected and the Audio output device set to WASAPI: Realtek Digital Output.

It's easily reproducible, and the suggested "Set as default for all movies" does not seem to work for Audio settings in XBMC version 10.0 on mp4 files with a stereo on track 1 and AC3 on track 2.
find quote
zkyd Offline
Junior Member
Posts: 2
Joined: Jan 2011
Reputation: 0
Post: #9
Just took a look at the most recent source, it seems this was hard coded for some reason:

/xbmc/GUIDialogAudioSubtitleSettings.cpp starting at line 331:
Quote: // prompt user if they are sure
if (CGUIDialogYesNo::ShowAndGetInput(12376, 750, 0, 12377))
{ // reset the settings
CVideoDatabase db;
db.Open();
db.EraseVideoSettings();
db.Close();
g_settings.m_defaultVideoSettings = g_settings.m_currentVideoSettings;
g_settings.m_defaultVideoSettings.m_SubtitleStream = -1;
g_settings.m_defaultVideoSettings.m_AudioStream = -1;
g_settings.Save();
}

The m_AudioStream variable appears to be the one that tells XBMC which stream to play, but it is essentially ignored and overwritten whenever you press "Set as default for all movies". But this was obviously a conscience decision by whomever put that in there, I don't have a clue as to why though.

Even if we figure out why m_AudioStream is hardcoded to -1 (which I'm thinking was a bad copy/paste job from the GUIDialogVideoSettings.cpp method), the g_settings.Save() method doesn't even look for that variable. Check out \xbmc\Settings.cpp around line 772 at the beginning of the SaveSettings method (Save is simply a wrapper for SaveSettings). Starting around line 862 is where it starts to save the m_defaultVideoSettings variables, and you'll notice that m_AudioStream is nowhere to be found. So it appears "Set as default for all movies", doesn't apply to AudioStream or SubtitleStream, which is why it doesn't apply to all videos after pressing this button.

Not sure if that's by design (as not every video will have multiple streams, so XBMC shouldn't default to a hard value), or if it's just something that they overlooked and is a new product defect?

Regardless, one would assume that the player would find the optimal stream to plan. In my case, XBMC is defaulting to the 'dvdplayer'. Whenever I find some time, I might try to find the 'player' and dig a little deeper into how it selects the audio stream to determine why it's not automatically selecting the highest stream it's capable of playing. Unless someone else already knows the answer to that?
(This post was last modified: 2011-01-11 22:11 by zkyd.)
find quote
nervekeg Offline
Junior Member
Posts: 21
Joined: Dec 2009
Reputation: 0
Post: #10
Hi guys,

Just been following this as I too would like an option for this.

I have come from Front Row -> Plex -> XBMC as Front Row is too broken now, and although a LOVE Plex, I'm looking to replace my mac mini media centre for a Linux-based one.

Just to let you know: Plex had the option to auto-select the AC3 track in m4v/mp4 videos so I'm assuming it's possible in XBMC.

It's such a small yet infuriating 'bug'.
find quote
dynaflash Offline
Senior Member
Posts: 167
Joined: Nov 2010
Reputation: 0
Post: #11
Same here as well, I might also add that adding the ac3 track before the aac track in hb will cause some issues with other iDevices including the atv's using stock atv software. Hence why the HB presets for apple use the aac + ac3 audio track layout (which btw mirrors iTunes HD content). I am having the same conundrum as far as the "Set for All Movies" doing ... nothing in xbmc.

Atv1 running xbmc 10.0(linux) +chd.

There as a trac ticket with a "best audio" patch included in it but afaik the patch was A. never accepted and B. was broken by svn updates pre-dharma. Will take a look and see if I can find it.

I do agree though that if the "Set for all Movies" actually worked it would make it less painful by far. If the track specified was not available in the source then it could just pick the first one as it does now.
find quote
D-tyme Offline
Senior Member
Posts: 267
Joined: Jan 2010
Reputation: 0
Post: #12
dynaflash Wrote:Same here as well, I might also add that adding the ac3 track before the aac track in hb will cause some issues with other iDevices including the atv's using stock atv software. Hence why the HB presets for apple use the aac + ac3 audio track layout (which btw mirrors iTunes HD content). I am having the same conundrum as far as the "Set for All Movies" doing ... nothing in xbmc.

Atv1 running xbmc 10.0(linux) +chd.

There as a trac ticket with a "best audio" patch included in it but afaik the patch was A. never accepted and B. was broken by svn updates pre-dharma. Will take a look and see if I can find it.

I do agree though that if the "Set for all Movies" actually worked it would make it less painful by far. If the track specified was not available in the source then it could just pick the first one as it does now.

Hey! We have a celebrity in the house! (It's Cav btw).
find quote
dynaflash Offline
Senior Member
Posts: 167
Joined: Nov 2010
Reputation: 0
Post: #13
D-tyme Wrote:Hey! We have a celebrity in the house! (It's Cav btw).

Hey! Personally I liked the Cavalicious nick better. But oh well!
find quote
D-tyme Offline
Senior Member
Posts: 267
Joined: Jan 2010
Reputation: 0
Post: #14
Shhh...that was suppose to be a secret (you know I have internet warrants!) LOL
find quote
dynaflash Offline
Senior Member
Posts: 167
Joined: Nov 2010
Reputation: 0
Post: #15
* dynaflash was wondering about the change Wink
find quote
Post Reply