Jump to content

AAC 5.1 bad quality with "Convert Unsupported Audio to Dolby Digital"


MakiXx
Go to solution Solved by ebr,

Recommended Posts

I'm a super happy Emby user. It's one of my most favorite things to use. My family loves it too.

I recently bought a Sonos Arc + One SLs + Sub setup for my Sony with integrated Google TV. I've been really happy with a complete 5.1 sound setup, it's so wonderful.

Unfortunately I've been struggling to get 5.1 channel content through Emby to work with ease. My TV is setup with eARC and to pass through and auto convert to Dolby Digital Plus if necessary (i think?).

When I'm using something like Netflix, I get Dolby Digital Plus 5.1 which works fine. Crunchyroll will give Dolby Digital Plus 2.0, which is also fine.

However, anything I play though Emby gets converted to Dolby Digital Plus 2.0 except for AC3, EAC3, AC4, anything Dolby will passthrough, awesome. The Sonos setup does not support DTS, and whilst it does support Multichannel PCM, Android 9 or higher apparently doesn't, though it will passthrough from other inputs such as my Playstation. My only option is to stick to Dolby codecs.

Searching through the Emby app settings, I find Convert Unsupported Audio to Dolby Digital.

  • When I play DTS 5.1 content, I successfully get Dolby Digital 5.1 and it sounds incredible.
  • But when I play AAC 5.1 content, I also get Dolby Digital 5.1 but the bitrate sounds really low. It's like watching a 144p video on YouTube.

The only solution I've found so far is to play content with an external app, and use the built-in Sony video player which came pre-installed with Google TV. It will convert AAC 5.1 to Dolby Digital Plus 5.1 just fine, but unfortunately it won't play DTS 5.1, so I have to switch to Converting... and disabling external player for that.

 

My reason for posting this is that I'd like to make it aware that AAC 5.1 to AC3 5.1 (Dolby Digital) doesn't sound good on the Android TV app. Unless there's something wrong on my end or my server's end, I hope this gets fixed. I'm also curious why Dolby Digital is used instead of Dolby Digital Plus. Though when DTS correctly converted, it sounded amazing. Maybe's for compatibility Dolby Digital is just fine.

Thank you so much,

Maki

 

Link to comment
Share on other sites

I've been testing different things, and as far as I can tell it has to do with the bitrate of AAC streams.

Down below is a screenshot where the audio sounds terrible when using Convert Unsupported Audio to Dolby Digital setting in the app.

Using low complexity AAC at 224 kbps will cause the issue.
When I increase the bitrate to 384 kbps, it sounds much much better.

Both were encoded using libfdk_aac (ffmpeg wiki) and both play as Dolby Digital 5.1 though the sound system. They both sound perfectly fine on my Mac and Windows machine.

I wish I could look at the source code myself, but this is the closest info I can give.

1817076452_ScreenShot2021-08-21at23_28_08.png.fcd7e9cb78aa6233ff0f442bffb53bb4.png

Link to comment
Share on other sites

Hi. I think you may have found the issue in the source file but can we please see an ffmpeg log from playback of this item?

Link to comment
Share on other sites

Here's the ffprobe output of my test file. It only contains an audio stream.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'aac-224.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.20.100
  Duration: 00:01:00.04, start: 0.000000, bitrate: 225 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 224 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Here's the ffprobe output of one of my movies with the same issue.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '...':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2018-09-04T23:02:40.000000Z
    title           : ...
    encoder         : Lavf57.83.100
    comment         : ...
  Duration: 01:23:48.11, start: 0.000000, bitrate: 2730 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1040 [SAR 1:1 DAR 24:13], 2499 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2018-09-04T23:02:40.000000Z
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 224 kb/s (default)
    Metadata:
      creation_time   : 2018-09-04T23:02:40.000000Z
      handler_name    : SoundHandler

If I run any of those files with ffplay, I get the same output and it plays fine on my laptop.

Link to comment
Share on other sites

Ah sorry, that might not be what you're looking for. Here's the transcode file I found in the server logs. I removed some of the sensitive data found.

I'm running the latest version of Emby through Docker on a machine with 4 x AMD Opteron(tm) Processor 6376 (16 cores, 64 total). There's no hardware encoding available.

 

ffmpeg-transcode-b7344c74-f67e-4b9f-b20b-7bff1ee6288f_1.txt

ffmpeg-transcode-b7344c74-f67e-4b9f-b20b-7bff1ee6288f_1.txt

Edited by MakiXx
Link to comment
Share on other sites

If I run this command to convert my 224 AAC to 224 AC3, which is what the above transcode log does

ffmpeg -i aac-224.mp4 -c:a:0 ac3 -ab:a:0 224284 -ar:a:0 48000 -ac:a:0 6 aac-224-to-ac3.mp4

And play back on my computer, it sounds equally as bad.

I looked around online and I think 384 kbps is the minimum for 5.1 AC3 audio. Take a look here:

http://forum.doom9.org/showthread.php?s=cd3fd79ddc03c32246f707923132f2fc&p=1878474#post1878474

If I convert the audio to 640 kbps, it sounds perfect.

ffmpeg -i aac-224.mp4 -c:a:0 ac3 -ab:a:0 640000 -ar:a:0 48000 -ac:a:0 6 aac-224-to-ac3-640.mp4

I'd love to have the option to force all ac3 transcoding to 640 kbps to get the full bandwidth of the codec.

But the problem here is that the bitrate is reflected, which doesn't make much sense when converting from one lossy codec to another. It should be higher than the original to preserve quality. Dolby Digital is also kind of a weird format I think and probably needs exceptions.

Link to comment
Share on other sites

  • Solution

Okay, so this is an issue with how our transcoding engine converts this particular audio.  Moving over to server section.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...