Jump to content


Photo

AAC Audio Passthroufh


Best Answer jmccl069 , 05 February 2019 - 11:58 PM

 

  1. In the folder where you made the mpv.conf, make a folder called scripts
  2. Copy the auto-profiles.lua to the scripts folder (delete the .txt)
  3. Copy this profile to your mpv.conf, make it the last entry at the bottom
[AAC to AC3]
profile-desc=cond:p["audio-codec"]==aac
af=lavcac3enc=yes:384:2

Take it for a spin!

 

 

 

 

A little amendment for this. I just discovered that profile will enable AC3 encoding for ANY non-bitstreamed audio, not just aac. I have found a better profile. This will be codec specific. Try this @jmccl069

[AAC to AC3]
profile-desc=cond:p["audio-codec-name"]=="aac"
af=lavcac3enc=yes:384:2

 

Just tried this...

 

Works a treat!!!

 

Thanks again @Doofus

Go to the full post


  • Please log in to reply
58 replies to this topic

#21 JoshuaAJones OFFLINE  

JoshuaAJones

    Advanced Member

  • Members
  • 115 posts
  • Local time: 06:09 AM

Posted 08 November 2018 - 06:20 PM

OK.  See if this makes sense to anyone.  I'm pretty sure that it is an ET bug but...

Currently loaded with 3.5.3.0 and 3.0.3 and my main HTPC runs both on W10 connected to my AVR through HDMI

 

I was having problems playing back videos with AAC audio... it would play all of the surround through L&R but no center, rear, or sides (although you could hear a little voice, if it echoed in the room they were in).

I first noticed it the other night while trying to watch TWD... audio out.  Played directly with MPC-HD... fine.

Checked settings on Windows and 7.1 with the rest of the audio properties looked fine.  Played the little tones with no problems.

Checked all my settings in ET/Audio and I have passthrough activated on all and have it setup for 7.1, as well.

Played Big Bang Theory (which has AC3 audio) and the AVR clicked over into Dolby Digital and played perfectly.

As I'm troubleshooting back and forth, going into and out of settings, back to home page, etc., I get a little tired of listening to the theme songs play over and over and go into Settings/Display and disable them.

Now, the problem has corrected itself.  Everything plays perfectly.  No problems at all.

Thinking the problem fixed itself, I reactivate theme music... L/R only again.  I toggle back and forth and, for some reason, Theme Music is jacking up AAC playback.

I try playback through my laptop (with theme music activated)… plays fine.

I go through my settings, activate all the passthroughs, and change the Audio profile to 7.1 (it was set to AUTO as, even though my laptop obviously only has 2 speakers, I sometimes plug in the surround sound headphones)… L/R only.

Go to 5.1... bad.  Stereo or Auto... good on the laptop.  On the HTPC, everything gets processed through the AVR so most streams get fully expanded no matter what speaker configuration I choose.

 

So, here's where I'm at with my testing.

I used the following files to test:  TWD (AAC 5.1) and GotG2 (AAC 7.1)  [NOTE: GotG2 did not have a theme song so I copied TWD theme into it's folder]

Theme/Auto - TWD (5.1) / GotG2 (7.1)

Theme/Stereo- TWD (5.1) / GotG2 (7.1)

Theme/5.1- TWD (L/R) / GotG2 (L/R)

Theme/7.1- TWD (L/R) / GotG2 (L/R)

No Theme/Auto- TWD (5.1) / GotG2 (7.1)

No Theme/Stereo- TWD (5.1) / GotG2 (7.1)

No Theme/5.1- TWD (5.1) / GotG2 (7.1)

No Theme/7.1- TWD (5.1) / GotG2 (7.1)

 

My conclusions are:

Theme music is, for some reason, bugging my AAC playback, if set up to output in 5.1 or 7.1 BUT ONLY if the folder contains a theme song (before adding the theme to GotG2 folder, everything played perfectly).

Disabling Theme Music or going with Auto (or Stereo) corrects (bypasses) the problem... as does deleting the theme music completely.  If it doesn't play, there is no problem.

Somewhere between playing the MP3 and playing the AAC, a problem occurs.

Also of note... this just started happening.

 

Thoughts?



#22 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 08 November 2018 - 09:35 PM

Have you configured windows audio for 7.1? If not, mpv will downmix to whatever windows audio is configured. AAC isn't bitstreamed, there is no setting for that in the UI. So mpv will just decode it to raw audio (PCM) and at that point, it will apply it to the windows audio config. If you don't want to do that, you can use the ac3enc mpv config, to encode to AC3 and then it will be bitstreamed as AC3.



#23 JoshuaAJones OFFLINE  

JoshuaAJones

    Advanced Member

  • Members
  • 115 posts
  • Local time: 06:09 AM

Posted 09 November 2018 - 01:13 AM

Windows is configured correctly.
The problem only recently started and, in my opinion, it has to be the latest version of ET.
As for now, I've disabled theme music and everything is working fine.

#24 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 09 November 2018 - 01:46 AM

Can you attach an mpv log?



#25 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 129329 posts
  • Local time: 06:09 AM

Posted 09 November 2018 - 01:55 AM

Strange that it matters if a theme song was played or not.



#26 JoshuaAJones OFFLINE  

JoshuaAJones

    Advanced Member

  • Members
  • 115 posts
  • Local time: 06:09 AM

Posted 09 November 2018 - 10:05 AM

mpv file with Theme/7.1 activated

 

Attached Files



#27 JoshuaAJones OFFLINE  

JoshuaAJones

    Advanced Member

  • Members
  • 115 posts
  • Local time: 06:09 AM

Posted 09 November 2018 - 10:07 AM

Theme song deactivated/7.1

 

Attached Files



#28 JoshuaAJones OFFLINE  

JoshuaAJones

    Advanced Member

  • Members
  • 115 posts
  • Local time: 06:09 AM

Posted 09 November 2018 - 10:10 AM

Theme song Activated/Auto

 

Attached Files



#29 JoshuaAJones OFFLINE  

JoshuaAJones

    Advanced Member

  • Members
  • 115 posts
  • Local time: 06:09 AM

Posted 18 November 2018 - 09:49 PM

Any theories on this, as it still happens?

Currently, I have disabled theme songs to clear the error.



#30 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 129329 posts
  • Local time: 06:09 AM

Posted 18 November 2018 - 09:51 PM

Not yet, but you could try the newest theater version which has an updated mpv.



#31 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 18 November 2018 - 09:55 PM

Do you have upmix for music, enabled?



#32 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 18 November 2018 - 09:56 PM

Because I'm seeing this, and it shouldn't be happening.

  0.045][d][lavfi] Filter graph:
[   0.045][d][lavfi]                                                    +--------------+
[   0.045][d][lavfi] mpv_src_in0:default--[44100Hz fltp:stereo]--default| Parsed_pan_0 |default--[44100Hz fltp:7.1]--mpv_sink_out0:default
[   0.045][d][lavfi]                                                    |    (pan)     |
[   0.045][d][lavfi]                                                    +--------------+
[   0.045][d][lavfi] 
[   0.045][d][lavfi]                                                  +---------------+
[   0.045][d][lavfi] Parsed_pan_0:default--[44100Hz fltp:7.1]--default| mpv_sink_out0 |
[   0.045][d][lavfi]                                                  | (abuffersink) |
[   0.045][d][lavfi]                                                  +---------------+
[   0.045][d][lavfi] 
[   0.045][d][lavfi] +-------------+
[   0.045][d][lavfi] | mpv_src_in0 |default--[44100Hz fltp:stereo]--Parsed_pan_0:default
[   0.045][d][lavfi] |  (abuffer)  |
[   0.045][d][lavfi] +-------------+
[   0.045][d][lavfi] 
[   0.045][d][lavfi] 
[   0.045][v][af] [userspeed] 44100Hz 7.1 8ch floatp
[   0.045][v][af] [userspeed] (disabled)
[   0.045][v][af] [convert] 44100Hz 7.1 8ch floatp


#33 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 18 November 2018 - 10:00 PM

Yup! There it is. That shouldn't be being used in this case.

[   4.094][v][vf] User filter list:
[   4.094][v][vf]   (empty)
[   4.095][v][ad] Codec list:
[   4.095][v][ad]     aac - AAC (Advanced Audio Coding)
[   4.095][v][ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[   4.095][v][ad] Opening decoder aac
[   4.095][v][ad] Requesting 1 threads for decoding.
[   4.099][v][ad] Selected codec: aac (AAC (Advanced Audio Coding))
[   4.099][d][user_filter_wrapper] Setting option 'graph' = 'pan=7.1|FL=FL|SL=FL|BL=FL|FR=FR|SR=FR|BR=FR|FC<0.5*FL + 0.5*FR' (flags = 0)
[   4.100][v][af] User filter list:
[   4.100][v][af]   lavfi (lavfi.00)
[   4.100][v][cplayer] Starting playback...
[   4.101][v][af] [in] 48000Hz 5.1 6ch floatp
[   4.101][v][af] [lavfi] 48000Hz 5.1 6ch floatp
[   4.102][d][ffmpeg] mpv_src_in0: tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:(null)
[   4.102][d][ffmpeg] Parsed_pan_0: o0 = 1 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][ffmpeg] Parsed_pan_0: o1 = 0 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][ffmpeg] Parsed_pan_0: o2 = 0.5 i0 + 0.5 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][ffmpeg] Parsed_pan_0: o3 = 0 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][ffmpeg] Parsed_pan_0: o4 = 1 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][ffmpeg] Parsed_pan_0: o5 = 0 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][ffmpeg] Parsed_pan_0: o6 = 1 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][ffmpeg] Parsed_pan_0: o7 = 0 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   4.102][d][lavfi] Filter graph:
[   4.102][d][lavfi]                                                 +--------------+
[   4.102][d][lavfi] mpv_src_in0:default--[48000Hz fltp:5.1]--default| Parsed_pan_0 |default--[48000Hz fltp:7.1]--mpv_sink_out0:default
[   4.102][d][lavfi]                                                 |    (pan)     |
[   4.102][d][lavfi]                                                 +--------------+
[   4.102][d][lavfi] 
[   4.102][d][lavfi]                                                  +---------------+
[   4.102][d][lavfi] Parsed_pan_0:default--[48000Hz fltp:7.1]--default| mpv_sink_out0 |
[   4.102][d][lavfi]                                                  | (abuffersink) |
[   4.102][d][lavfi]                                                  +---------------+
[   4.102][d][lavfi] 
[   4.102][d][lavfi] +-------------+
[   4.102][d][lavfi] | mpv_src_in0 |default--[48000Hz fltp:5.1]--Parsed_pan_0:default
[   4.102][d][lavfi] |  (abuffer)  |
[   4.102][d][lavfi] +-------------+
[   4.102][d][lavfi] 
[   4.102][d][lavfi] 
[   4.102][v][af] [userspeed] 48000Hz 7.1 8ch floatp
[   4.102][v][af] [userspeed] (disabled)
[   4.102][v][af] [convert] 48000Hz 7.1 8ch floatp

Edited by Doofus, 18 November 2018 - 10:13 PM.


#34 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 18 November 2018 - 10:06 PM

It's kicking off with the theme music, and not switching back. But It shouldn't be working at all in that environment. It should just play directly, as stereo.


Edited by Doofus, 18 November 2018 - 10:07 PM.


#35 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 129329 posts
  • Local time: 06:09 AM

Posted 18 November 2018 - 10:26 PM

So it's only when upmix is enabled?



#36 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 18 November 2018 - 10:56 PM

I haven't tested it. That's what's in his log. But that's definitely what's happening. Here it is in the beginning of the log when it plays the mp3 theme song

[   0.042][v][lavf] select track 0
[   0.042][i][cplayer]  (+) Audio --aid=1 (mp3 2ch 44100Hz)
[   0.043][v][ad] Codec list:
[   0.043][v][ad]     mp3float (mp3) - MP3 (MPEG audio layer 3)
[   0.043][v][ad]     mp3 - MP3 (MPEG audio layer 3)
[   0.043][v][ad] Opening decoder mp3float
[   0.043][v][ad] Requesting 1 threads for decoding.
[   0.043][v][ad] Selected codec: mp3float (MP3 (MPEG audio layer 3))
[   0.043][d][user_filter_wrapper] Setting option 'graph' = 'pan=7.1|FL=FL|SL=FL|BL=FL|FR=FR|SR=FR|BR=FR|FC<0.5*FL + 0.5*FR' (flags = 0)
[   0.044][v][af] User filter list:
[   0.044][v][af]   lavfi (lavfi.00)
[   0.044][v][cplayer] Starting playback...
[   0.045][v][af] [in] 44100Hz stereo 2ch floatp
[   0.045][v][af] [lavfi] 44100Hz stereo 2ch floatp
[   0.045][d][ffmpeg] mpv_src_in0: tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:(null)
[   0.045][d][ffmpeg] Parsed_pan_0: o0 = 1 i0 + 0 i1
[   0.045][d][ffmpeg] Parsed_pan_0: o1 = 0 i0 + 1 i1
[   0.045][d][ffmpeg] Parsed_pan_0: o2 = 0.5 i0 + 0.5 i1
[   0.045][d][ffmpeg] Parsed_pan_0: o3 = 0 i0 + 0 i1
[   0.045][d][ffmpeg] Parsed_pan_0: o4 = 1 i0 + 0 i1
[   0.045][d][ffmpeg] Parsed_pan_0: o5 = 0 i0 + 1 i1
[   0.045][d][ffmpeg] Parsed_pan_0: o6 = 1 i0 + 0 i1
[   0.045][d][ffmpeg] Parsed_pan_0: o7 = 0 i0 + 1 i1
[   0.045][d][lavfi] Filter graph:
[   0.045][d][lavfi]                                                    +--------------+
[   0.045][d][lavfi] mpv_src_in0:default--[44100Hz fltp:stereo]--default| Parsed_pan_0 |default--[44100Hz fltp:7.1]--mpv_sink_out0:default
[   0.045][d][lavfi]                                                    |    (pan)     |
[   0.045][d][lavfi]                                                    +--------------+
[   0.045][d][lavfi] 
[   0.045][d][lavfi]                                                  +---------------+
[   0.045][d][lavfi] Parsed_pan_0:default--[44100Hz fltp:7.1]--default| mpv_sink_out0 |
[   0.045][d][lavfi]                                                  | (abuffersink) |
[   0.045][d][lavfi]                                                  +---------------+
[   0.045][d][lavfi] 
[   0.045][d][lavfi] +-------------+
[   0.045][d][lavfi] | mpv_src_in0 |default--[44100Hz fltp:stereo]--Parsed_pan_0:default
[   0.045][d][lavfi] |  (abuffer)  |
[   0.045][d][lavfi] +-------------+
[   0.045][d][lavfi] 
[   0.045][d][lavfi] 
[   0.045][v][af] [userspeed] 44100Hz 7.1 8ch floatp
[   0.045][v][af] [userspeed] (disabled)
[   0.045][v][af] [convert] 44100Hz 7.1 8ch floatp


#37 JoshuaAJones OFFLINE  

JoshuaAJones

    Advanced Member

  • Members
  • 115 posts
  • Local time: 06:09 AM

Posted 25 November 2018 - 01:29 AM

Sorry... I've been busy the last week.

3.0.5 has the same problems.

Disabling Upmix did solve the problem, too.

 

Theme Music/7.1 w/Upmix Disabled

Attached Files



#38 jmccl069 OFFLINE  

jmccl069

    Member

  • Members
  • 29 posts
  • Local time: 10:09 AM

Posted 29 November 2018 - 06:40 PM

Ok, so there're two ways you can go. I can show you how to bitstream AAC, or I can show you how to have it converted to AC3, and be bitstreamed that way. 

 

Here's the difference. If you bitstream AAC, that means all AAC will be bitstreamed. 2 channel AAC, too. If you choose AC3 encoding, it can be configured to only encode a set number of channels. For instance. It can be configured to only encode audio streams with 3 or more channels, and not encode stereo. The AC3 encoding can be applied globally, meaning all non-bitstreamed audio (not just AAC) with that many channels will be encoded. It can also be applied as a profile, and be specific to the codecs that you choose.

 

I may be over-explaining this :)

 

I still can't get AAC to bitstream... Don't know what's going on there... I've adjusted all of the settings I can think of but still no joy...

 

Would you mind explaining how to convert it to AC3 on the fly? Or at least point me in the right direction...

 

Thanks



#39 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 11371 posts
  • Local time: 03:09 AM

Posted 29 November 2018 - 06:52 PM

I still can't get AAC to bitstream... Don't know what's going on there... I've adjusted all of the settings I can think of but still no joy...

Would you mind explaining how to convert it to AC3 on the fly? Or at least point me in the right direction...

Thanks

Bitstreaming AAC can't be done through the settings. You need to use an mpv.conf. I'm assuming you haven't tried that? Can I ask why you want to bitstream AAC? What is your goal?

Edited by Doofus, 29 November 2018 - 06:53 PM.


#40 jmccl069 OFFLINE  

jmccl069

    Member

  • Members
  • 29 posts
  • Local time: 10:09 AM

Posted 29 November 2018 - 09:08 PM

Bitstreaming AAC can't be done through the settings. You need to use an mpv.conf. I'm assuming you haven't tried that? Can I ask why you want to bitstream AAC? What is your goal?

 

I followed your instructions on post #12 however can't get it to bitstream. My receiver decodes AAC natively so I thought the easiest way to get surround sound would be to bitstream.

 

Since I can't get that to work I thought I may as well go the AC3 route...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users