Jump to content

Audio Transcoding from DTS Mono to AAC Surround


Recommended Posts

Posted

I was getting choppy video playback. I set the video stream to 1080p@8m which smoothed it out. What I notice though is that the audio went from Direct Play DTS@768k mono to transcoded AAC@192k 5.1 channel.

Is this normal? Is there some setting I can adjust to correct this? I would prefer that the audio stays in direct play if it can. Alternatively at least AC3 mono Vs switching to AAC and upmixing to 5.1 for no reason.

playback device: roku 3840r software version 14.6
emby server: 4.9.1.80
video info: MKV, 9m video bitrate, DTS@768k audio bitrate

Thanks! 
Michael

Posted

Hi.  I don't believe DTS mono can be passed through when transcoding but please post the ffmpeg log from this playback.

Thanks.

Posted

@ebr

Thanks for the quick response. I know you want the log, and I can provide later if you still want it, but I just want to clarify my question.

Is there somewhere that I can select how the audio transcodes?

I can select the video cap to "1080p FHD - 5Mbps"

Where can I set the audio to "EAC3/DD+ 5.1 640 Kbs?"


I have now plugged my Roku into multiple sources to see the effect. When in my monitor directly it transcodes to "AAC 2 192 Kbs" for every video. When plugged into my AVR it attempts direct playback unless the video exceeds the cap. Only then will audio become transcoded. I want to be able to set the audio to transcode deliberately to a codec I choose. My video isnt a problem for the Roku at all. Bandwidth is not a problem. The problem is exclusively with the Roku struggling with these audio codecs. Is there not somewhere in the emby server that I can amend or adjust which codecs get used and at which bitrates? You dont even need to give me instructions just point me to the file these are in. I can copy the file for easy restore and then edit away!


Reference for test videos:
ET - mkv, 30Mbps, DTS-HD MA 7.1ch 5172k
MC - mkv, 30Mbps, DTS-HD MA 5.1ch 4123k
TH - mkv, 9Mbps, DTS mono 768k


roku (emby app)
ET - direct play. receiver shows Dolby Surr. no sound. video is smooth.
MC - direct play. receiver shows DTS. i have sound. video has stutter.
TH - direct play. receiver shows DTS. i have sound. video has stutter.

roku (emby app w/ playback video quality set to 1080p FHD 5Mbps)
ET - transcodes to "AC3 5.1 384Kbs". receiver shows DD. i have sound. video is smooth.
MC - transcodes to "AC3 5.1 384Kbs". receiver shows DD. i have sound. video is smooth.
TH - transcodes to "AAC 5.1 192Kbs". receiver shows Dolby Surr. i have sound. video is smooth.

miniPC (emby theater)
ET - displays direct play. receiver shows DTS-HD. i have sound. video is smooth.
MC - displays direct play. receiver shows DTS-HD. i have sound. video is smooth.
TH - displays direct play. receiver shows DTS. i have sound. video is smooth.


Please any help on this is appreciated. 

Michael

Posted
Quote

Where can I set the audio to "EAC3/DD+ 5.1 640 Kbs?"

hi, there is no option for this. We really should look at the details of a specific example before we can determine why you're not getting sound. Thanks !

Posted

@luke

Thanks for your reply.

I'm getting sound. Just not what I want or expect. I know you may not have time to read through everyone's posts in detail. I did lay it all out and tried to be very clear and provide examples.

Based on your response there is no option to set audio transcoding preference independent of the video transcoding. So if I want to watch my videos I will have to set the video cap to be just below the stream in order for that to then trip the setting to transcode the audio. And it will transcode the audio to some fixed setting that I cannot adjust anywhere. ie "AC3 5.1 384Kbs" or "AAC 2 192 Kbs." These cannot just be arbitrary. Something is setting these codec and bitrates.

I know its not your fault. I know the real issue is with Roku not being able to process these codecs smoothly. What I was hoping to get from emby support was a way to send an optimal transcode to these devices. They are quite popular.

Thanks,
Michael

Posted
13 hours ago, MichaelK79 said:

I was getting choppy video playback. I set the video stream to 1080p@8m which smoothed it out. What I notice though is that the audio went from Direct Play DTS@768k mono to transcoded AAC@192k 5.1 channel.

The app won't transcode to AAC in 5.1. Do you mean AC3? It will do this if the supported device doesn't supported the codec found? How did you set up your Roku audio settings? Have you told the Roku you support DTS pass-through? The Emby app for Roku reads the audio capabilities directly from the Roku device. Whatever settings are set in the Roku settings are inherited into the Emby app and considered when transcoding must occur. Sometimes you can set these to AUTO on the Roku settings and everything works. Other times you must choose CUSTOM and pick which codecs will be supported for pass-through. DTS is a pass-through codec. The Roku may notice this is not available and on-the-device it changes this to AAC. Certain Roku models do convert unsupported codecs into AAC 5.1.

We would need to see logs sent from the Roku app in order to determine what is happening. To send Emby logs from your Roku, first enable "Debug Options" in the app's "Advanced" settings. You may need to restart the app for the "Send Logs" option to appear on the home screen. Then, press the "Send Logs" button, which can be found under the user menu at the top of the home screen. Seeing these logs would help us to know what is really happening.

Note the username logged in and the time you sent the logs. We will need to know that here in order to find your device logs. The device logs only contain debug information. Nothing personal about your content or your identity is sent to us.

 

tedfroop21
Posted

Setup on my ultra boxes looks like this: 

 

PXL_20251026_002217955.RAW-01_edited.jpg

PXL_20251026_002229082.RAW-01_edited.jpg

Posted

@speechles

Thanks for your reply.

I want to provide the clearest picture I can.

Roku Streaming Stick HD model 3840R plugged into a Denon AVR-S970H.

The AVR is fully capable of taking in the audio signal as sent through emby from my miniPC.
This problem is only present when flowing through the Roku stick.
 

14 minutes ago, speechles said:

The app won't transcode to AAC in 5.1. Do you mean AC3?

No. For this one specific video that has DTS mono emby sends the audio as direct play. The AVR shows DTS and the video is stuttering. However since that video stream is over 8Mbps in total, if I set a playback cap at "1080p FHD - 8 Mbs" it will then transcode. When transcoding in the stats for nerds it shows "Throttling. Reducing bitrate due to quality setting." It also shows "DTS mono (Default) > Transcode (AAC 5.1 192 Kbs)." Now the video plays fine, smooth. But that is still a problem. 

I will note one caveat though since I dont know if this might affect the behavior here. The mediainfo for this specific video show the audio channel as mono 1 / 6. That could be a problem but I have no idea. I dont really want to fixate on this one single video. My other videos are also having issue unless I restrict the stream to force an audio transcode. That just seems super off to me.
 

26 minutes ago, speechles said:

How did you set up your Roku audio settings? Have you told the Roku you support DTS pass-through? The Emby app for Roku reads the audio capabilities directly from the Roku device. Whatever settings are set in the Roku settings are inherited into the Emby app and considered when transcoding must occur. Sometimes you can set these to AUTO on the Roku settings and everything works. Other times you must choose CUSTOM and pick which codecs will be supported for pass-through. DTS is a pass-through codec. The Roku may notice this is not available and on-the-device it changes this to AAC. Certain Roku models do convert unsupported codecs into AAC 5.1.

This is a totally valid question/statement. I did in fact check those and tried in all manor of setting. Obviously it was on Auto to begin with. I have since tried every combination of setting to be deliberate. Using the custom settings to select DD or DD+ or allowing DTS etc. Nothing fixes this issue for me.


I will recreate it with debug enabled and see about collecting the log for you now.

Thanks!
Michael

Posted

@tedfroop21

Thanks for trying to help. Neither my Roku Ultra 4670X nor this newer Roku Streaming Stick 3840R have the Passthrough option within the Audio settings menu. I have been through nearly every setting possible at this point.

Thanks,
Michael

 

Posted
58 minutes ago, speechles said:

We would need to see logs sent from the Roku app in order to determine what is happening. To send Emby logs from your Roku, first enable "Debug Options" in the app's "Advanced" settings. You may need to restart the app for the "Send Logs" option to appear on the home screen. Then, press the "Send Logs" button, which can be found under the user menu at the top of the home screen. Seeing these logs would help us to know what is really happening.

I have done the debug and sent logs as you requested.

Username is Michael and I played the ET video mentioned earlier which has a DTS-HD MA 7.1ch 5172k

5:57pm PT - played it with the cap enabled first. Audio came out as "AC3 5.1 384Kbs"
6:00pm PT - played it with no cap and the audio shows direct play in the "stats for nerds" while my AVR shows "Dolby Surr" meaning its not getting the memo. There is no sound at all.

I sent the logs within the next couple of minutes.

Posted

I need to clarify one thing after further testing.
 

2 hours ago, speechles said:

How did you set up your Roku audio settings? Have you told the Roku you support DTS pass-through? The Emby app for Roku reads the audio capabilities directly from the Roku device. Whatever settings are set in the Roku settings are inherited into the Emby app and considered when transcoding must occur. Sometimes you can set these to AUTO on the Roku settings and everything works. Other times you must choose CUSTOM and pick which codecs will be supported for pass-through. DTS is a pass-through codec. The Roku may notice this is not available and on-the-device it changes this to AAC. Certain Roku models do convert unsupported codecs into AAC 5.1.

This snippet was particularly helpful.

My current audio settings in Roku:
Settings > Audio > Preferred streaming format = Dolby
Settings > Audio > Digital output format > Custom > Dolby = Dolby Digital Plus
Settings > Audio > Digital output format > Custom > DTS = Off

With these deliberate settings I don't have to restrict the video playback at all. I can leave that setting on Auto within emby.

This does not fix anything. It just forces the audio to transcode without me having to lower the video bitrate to trick it into transcoding. I just wanted to make that transparent.

Sidenote: If the video I stream has an audio encoded in AC3@640k or EAC3@768k those play with no issue directly, and at those bitrates. What bothers me is I have a video that has an audio stream of 5000k and it gets reduced down to 384k by emby. That is on you guys, not the Roku. Can you just tell me, is this something you guys set as a fixed bitrate for AC3 on the fly transcode? If so, there is nothing left to "fix" here. I just need you to confirm if that is the case. As for that one-off video you have already stated "Certain Roku models do convert unsupported codecs into AAC 5.1." I really don't care about that one-off video. I can re-encode that one myself.

Let me know! Thanks again for all the help so far!
Michael

Posted (edited)
17 minutes ago, MichaelK79 said:

Sidenote: If the video I stream has an audio encoded in AC3@640k or EAC3@768k those play with no issue directly, and at those bitrates. What bothers me is I have a video that has an audio stream of 5000k and it gets reduced down to 384k by emby. That is on you guys, not the Roku. Can you just tell me, is this something you guys set as a fixed bitrate for AC3 on the fly transcode?

Short Answer: Yes. It is coded into the app. We are capping at 384k if we transcode audio.

Long Answer: We error on the side of supporting the widest amount of devices. Some TV can support bitrates over 384k while some cannot. Roku suggests for best compatibility to stick to 384k as the ceiling. If luke or ebr want to raise this by offering a setting for the Roku we can do that. But it has to be something where we understand the reason for doing so and how users might mess this up and raise it then get silence on their device. It could raise support questions on the forum related to just that one change. But knowing that caveat we could just offer an option for people to raise this via the setting. But the okay must come from higher than just myself. Knowing all that I believe eventually we can get better support for this with just a simple setting. But it must go through the same process as all things go through.

@Luke@ebrWhat are your thoughts or concerns?

Edited by speechles
Posted
14 hours ago, speechles said:

The app won't transcode to AAC in 5.1

In this instance, the app is not doing the conversion.  The server is because the video is being transcoded.  Our transcoder is not going to pass through mono DTS in HLS.

An ffmpeg log would clear all this up.

Posted (edited)

@speechles
Really appreciate that insight. Thank you!

@ebr
I have attached a log for the initial video in question that pertains to this posts title.

Within the log it shows its converting DTS to AAC. It also looks like it shows mono for both. However that does not match what I see in "stats for nerds" nor what is shown on the server GUI under current stream. Those both clearly show AAC 5.1.

Once again thanks for all your help so far on this.


ffmpeg-remux-ee0f4c28-566b-43ae-ae0e-6be575ba8183_1.txt

Edited by MichaelK79
Posted

Yea it looks like your source track is actually dts mono.

Posted
3 hours ago, MichaelK79 said:

@ebrany news or insight? 

What would you like to happen?

Posted

He wants the DTS mono to be passed through but I don't think we can do that when transcoding.

Posted (edited)

@ebr
I dont want DTS mono to be passed through. My post, originally, was that the DTS mono is being transcoded to AAC 5.1.

You asked me for the ffmpeg log. I've provided it. Do you have any insight?

Edited by MichaelK79
Posted
2 hours ago, MichaelK79 said:

@ebr
I dont want DTS mono to be passed through. My post, originally, was that the DTS mono is being transcoded to AAC 5.1.

You asked me for the ffmpeg log. I've provided it. Do you have any insight?

What are you asking for insight on, meaning, is something wrong?

Posted
11 hours ago, MichaelK79 said:

I dont want DTS mono to be passed through

Okay, sorry, I was going by your original post:

On 10/25/2025 at 4:13 AM, MichaelK79 said:

I would prefer that the audio stays in direct play

What is it then, that you do want?

Posted

I've asked this several times, including in my original post. I’ll try one more time:
Why does emby upmix a mono DTS track to AAC 5.1 rather than keeping it as EAC3/AC3 mono?
My Roku is set to prefer DD+ and is connected to an AVR.

Posted (edited)

What I suspect is the Roku isn't properly detecting DD support through the HDMI chain. This would cause the AAC codec to wind up in the front of the available audio codecs. If DD support is found it winds up in front of the available audio codecs. The codec listed first is the preferred streaming codec. When you use AUTO on the Roku Audio settings it will detect support through the HDMI chain. 

You have to use the Pass-Through or Custom option to force DD support without detection. This should then work if you have proper support for DD even though the Roku doesn't detect it with Auto. You might be able to fix this by leaving your TV and/or AVR turned on and then restart the Roku either by using the option in the Roku menu or pulling its power briefly. 

When the Roku boots back up and the TV and/or AVR is already on the AUTO feature of the Roku audio settings will properly detect everything. But if your TV powers on your AVR and the Roku is always on there is a chance the Roku may not detect the TV or AVR as it might reboot for a software update. The Roku is always on but your TV/AVR are not. That is why we suggest if you always want your pass-through codecs to work correctly to never use AUTO.

tl;dr - never use Auto on the Roku audio settings, choose pass-through or custom if you expect surround sound. The internet will thank you.

@MichaelK79Is there an ffmpeg log created? In the ffmpeg log it will show what the order of the detected codecs were and why it is transcoding. It would explain everything. Do you see any ffmpeg log created for that item?

NOTE: HLS cannot be used to package the DTS codec. This means we cannot use that codec when transcoding. The DTS codec is also incompatible with the Roku when used with single channel mono. The Roku will actively refuse to play the item and cause a playback error if played directly. So even if you could direct play it would actively get rejected and transcoded in playback recovery anyways.

NOTE2: Emby is not expecting single channel DTS. My guess is it is doing this expanding to AAC 5.1 as a favor (feature not a bug) as DTS is usually a surround sound codec.

Edited by speechles
Posted
1 hour ago, MichaelK79 said:

Why does emby upmix a mono DTS track to AAC 5.1 rather than keeping it as EAC3/AC3 mono?

Hi.  DTS and EAC3/AC3 are two completely different formats from different companies...

In order to pass via HLS, we are converting the DTS to AAC and maintaining it as mono:

Stream #0:1(eng): Audio: aac (LC), 48000 Hz, mono, fltp, 192 kb/s (default)

Something downstream must be breaking that out to 5.1

Is there a problem with the sound?

Posted
2 hours ago, MichaelK79 said:

I've asked this several times, including in my original post. I’ll try one more time:
Why does emby upmix a mono DTS track to AAC 5.1 rather than keeping it as EAC3/AC3 mono?
My Roku is set to prefer DD+ and is connected to an AVR.

Hi, what makes you think the server is up mixing it? In your log example we are converting the audio to single channel AAC:

 -c:a:0 aac -ab:a:0 192000 -ac:a:0 1

 

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...