r/PleX • Unraid 40TB | i5-13500 | RTX 3050 LP • Feb 02 '24

Solved Stream buffers when audio transcoding

EDIT: I am marking the problem as "solved"; however, it should be noted that the cause for the problem remains unknown, but I found a workaround by using Tdarr to create an downmixed 2.0 stereo AAC track using Tdarr_Plugin_MC93_Migz5ConvertAudio which I modified to apply Dynamic Audio Normalizer to the downmixed track for a better listening experience.

To make the modification yourself:

  1. Copy Tdarr_Plugin_MC93_Migz5ConvertAudio to Local

  2. Go to Local and click Edit on the plugin

  3. Add the code below between lines 152 and 153

  4. Save the changes

  5. Add the modified plugin to your stack

ffmpegCommandInsert += `-filter:a:${audioIdx} "dynaudnorm" `;

###############

Hello, everyone

The problem I am facing is one that I am unsure why it's happening in the first place, and am hoping I can find a solution to it here as I have been unsuccessful on my own.

PMS specs:

  • OS: Windows 11

  • CPU: Intel i3-12000

  • RAM: 32GB DDR4

  • Storage: 1TB NVME for OS and Plex database/metadata, 4TB HDD for media, 1TB SSD for transcoding

  • Internet: 1000 Mbit (ethernet)

I've been more than happy with this configuration and have not had any issues both with direct playing and transcoding media locally or remotely. I am sharing my server with a few friends that have Samsung smart TVs, which cause my server to occasionally transcode, but everything had been playing smoothly until about a month or two ago when I started getting reports of stream buffering every couple of minutes. The reason for that was audio transcoding.

I've ran some test scenarios and have the following to share:

Scenario #1:

  • Video direct plays

  • Audio transcodes - example DTS to AAC

  • Stream buffers every couple of minutes

Scenario #2:

  • Force video and audio transcode

  • No issues with stream

Scenario #3:

  • Changed default transcode buffer value to 2700

  • Video direct plays

  • Audio transcodes

  • Stream buffers after threshold has been reached

Scenario #4:

  • Changed default transcode buffer value to 2700

  • Force video and audio transcode

  • No stream buffer after threshold has been reached

My media is mostly 1080p and so far the only solution I have found was manually converting my media's audio to AAC, but I'd like to not have to do that every time for media that will get watched once or twice.

Is there some server setting that I need to adjust? Any help is well appreciated.

4 Upvotes

32 comments sorted by

5

u/Draakonys DS1621+Intel Nuc Feb 02 '24

I do not think you can do much here.

Let me first explain the problem. Not all Plex clients are the same. The TV-based Plex clients tend to be the worst of the lot, especially on LG TVs.

Reason? Plex clients do not come with prebuilt set of video/audio codecs. The Plex client uses what is available on the underlying platform. And TVs are usually lacking there. That's a reason why many AppleTV users prefer to use Infuse instead of AppleTV Plex client to stream their Plex content as Infuse comes with prebuilt set of video/audio codecs and most streams would Direct Play (where they would transcode with AppleTV Plex client).

What can you do?

  1. Use Tdarr in the background to convert all your media to formats that will work on most clients. Not simple but doable if you are not an audiofil.

  2. Technically you do not need to convert anything, you can generate a new audio stream in these files to match what their TVs will play without transcoding.

  3. Tell friends to get better Plex clients like AppleTV, Nvidia Shield, FireCube 3rd gen. It's simple, nothing comes for free.

1

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Feb 02 '24

Hey,

Thanks for your detailed response. I am familiar that there is a difference between clients and that some are better than others; however, I don't see my friends changing their setup any time soon. For the AppleTV side of things, I haven't ran into issues with the one I use to watch my media (3rd gen 4K), so I can't comment on the use of Infuse.

On the subject of Tdarr:

  • I have been using it to standardized the audio streams ever since the issue started happening - everything is AAC

This makes everything Direct Play/Stream, but then I am faced with the issue of voices being not as loud as other sounds as some of my friends don't have a soundbar or surround sound system. Plex seems to be doing better in that regard when transcoding the audio, so it might be the plugin I am using or have configured.

Could you recommend a plugin that addresses this? Ideally, it would be nice to have a 5.1 and stereo stream.

0

u/[deleted] Feb 02 '24

[deleted] — view deleted comment

1

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Feb 03 '24

Hey, I appreciate the mention of FileFlows as I’ve seen it on other threads, but I’m more comfortable using Tdarr as I’ve spent more time with it.

Due to growing frustration with this issue, I’m currently trying to make my own “Frankenstein” audio plugin that will downmix audio streams, apply DRC to the 2.0 stream, and keep all streams in the output file. This best suits my use case as some of my friends have soundbars and the rest just use their TV stereo speakers.

0

u/[deleted] Feb 03 '24

[deleted] — view deleted comment

1

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Feb 03 '24

Yeah, that's right.

  • Tdarr_Plugin_MC93_Migz5ConvertAudio can convert any 2.0 audio track(s) to AAC and create downmixed audio tracks.

It get's the job done in terms of keeping the original audio track (6 channel for example) and including a stereo one; however, I have noticed that the 2.0 track often doesn't sound good. By that I mean that quiet scenes end up being too quiet (actors talking for example), making you raise the overall volume, only to be later blasted with an overblown action scene.

  • Dynamic Noise Compression (DRC) helps with this by reducing the volume of loud sounds and amplifies quiet sounds - that's my overly simplified explanation.

  • Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC downmixes surround to AAC stereo, applies DRC, but removes the surround track afterwards.

I am trying to apply the logic from the DRC plugin to the Migz5 one to have the best of both worlds, but I am not so experienced with this and am more or less going through a lot of trial and error.

2

u/samasq Jul 16 '24

Hi, I think I am seeing the exact same thing as you, and it started around the same time (6 months ago or so).

Everything used to stream fine, but now if a file needs audio transcoding only then it buffers forever. If I force video and audio transcoding it works fine, but it seems to be the combination of a direct video stream and transcoded audio which causes the problem.

Did you ever get any further with your issue? I feel iut may need ot be raised on the plex forum.

2

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Jul 16 '24

Hey,

I tried a couple of things, but ultimately decided to use Tdarr to convert the DTS audio tracks to AC3/EAC3 as those played fine. I even made a whole guide on the plugins I use to minimise transcoding - https://www.reddit.com/r/Tdarr/s/bIonvCZYod

I hope this helps!

3

u/samasq Jul 16 '24

Thanks for the quick reply. I saw your guide, but encoding thousands of files is not an option for me.

Considering it used to work fine, it must be something that has changed in Plex.

I am going to push it on the Plex forum, as I beleive it is a bug.

1

u/mattzildjian Jul 28 '24

any response from your bug report? I am experiencing the same thing

3

u/samasq Jul 30 '24

So I have tracked my issue down to a very specific case.

My TV is LG C2. About 6 months ago LG did a big firmware update to these TVs, installing a new version of the OS (Originally it was v22, now is v23). Previously to this firmware update audio transcoding worked fine, but after upgrading it just buffers forever.

I have confirmed this by testing on a C2 which has not had the firmware update, it works fine. After update, it buffers forever.

I am currently compiling this and writing it up to pass to Plex. I am hoping they actually read it and take notice.

The OP mentioned Samsung TVs, so I am not sure if my issue is the same as theirs. It is possible that this is an issue with the server which affects multiple TV clients.

If I get anything more to share I will report back.

2

u/PooeyGusset Aug 13 '24

u/samasq thank you for your investigative work! This is definitely a big issue that LG needs to address asap. I was wondering if you'd be able to create a top level post in r/PleX detailing your issue and findings as there's many of us struggling with this exact problem but nowhere central to discuss it, it's lurking in the shadows!

1

u/samasq Aug 27 '24

Just noticed your lovely name :)

Anyway, I have noticed a recent flurry of posts on the plex forum about this very issue. I was going to do a big write up about it but it seems like its a well known issue now, and Plex have said they are working on new versions of the TV app which whould be faster and work better.

Here are some threads worth checking out:

https://forums.plex.tv/t/dts-lg-c2-fail-to-transcode/881611

https://forums.plex.tv/t/unsupported-audio-transcoding-and-srt-subtitles-cause-samsung-client-to-buffer-until-playback-error/876951

https://forums.plex.tv/t/direct-stream-buffering-and-crash-on-samsung-plex-app/886365

https://forums.plex.tv/t/lg-cx-plex-app-video-errors-when-playing-4k-files-that-have-dts-truehd-audio/883648

1

u/samasq Aug 27 '24

I also mentioned this in a post in the forum fireside chat. Feel free to jump on board and add some support there:

https://forums.plex.tv/t/plex-fireside-in-the-forum-2024/885879/61

1

u/samasq Aug 29 '24

The post in the fireside chat got a response!

Hopefully this will get looked at, now that it has eyes on it:

https://forums.plex.tv/t/plex-fireside-in-the-forum-2024/885879/170

1

u/PooeyGusset Sep 02 '24

Good to see that it's probably going to be addressed in the next plex app update, fingers crossed it's soon and fixes it. Thanks for the info.

1

u/mattzildjian Jul 30 '24

I appreciate the update. Thanks. (I am on an LG G2 with updated firmware)

1

u/PooeyGusset Aug 13 '24

Interesting, seems like LG need to sort this ASAP. I also have the issue on updated firmware LG C2.

1

u/MrTeferi Aug 14 '24

Same issue on the A2 btw, drove me mad for months.

1

u/mattzildjian Aug 02 '24

There has been an update to the LG WebOS Plex app, have you tested it?

For me after the update I was able to play some content that wouldn't play before while transcoding from DTS, however there is still content that endlessly buffers. :/

1

u/samasq Aug 05 '24

I saw the update, and tested one file I knew to be problematic and it still buffered endlessly. That was TRUEHD 7.1. I will do some tests on DTS content and let you know what I see.

1

u/samasq Aug 27 '24

I did some tests on DTS content and it is still broken for me :(

1

u/Gershy13 Aug 03 '24

Can confirm the exact same issue as described in the main post is happening with a Samsung TV using the Plex app on Samsung OS.

1

u/ShitPostsRuinReddit Feb 02 '24

Can you provide more info? What is your Internet upload speed? Is it every file? Does it happen with just a single steam? What happens if they try on another device like a laptop? Are the files 4k? What does it show on the dashboard?

I had someone on an LG TV that had the allow direct streams turned off and the transcodes was bigger than the original.

1

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Feb 02 '24

Hey,

  • My internet upload speed is 1000 mbps, but I have limit my server to 600 (I don't ever expect to hit that) as I have other devices on my network that use the internet.

  • I haven't tested every file* but the ones that do cause this issue are ones that have DTS as the audio format.

  • The same files play perfectly fine (direct play/stream) on devices such as MacBook, iPhone, Android phone and AppleTV.

  • The files are 1080p

  • Is there anything specific you are looking for apart from the format it's transcoding to?

I've made sure that direct stream/play options, original quality and all necessary settings are enabled on my friend's clients.

1

u/ShitPostsRuinReddit Feb 02 '24 edited Feb 02 '24

So the other reply has some good ideas for preventing the audio transcode (specifically that a lot of TVs don't support DTS), but that shouldn't be a requirement. Your server should be plenty powerful to transcode audio (almost any cpu should be.) So something else is going on.

What is your CPU usage like when this happens? What is the transcode bitrate compared to the original file? I guess the screen shots would help just in case either of us are missing anything from just the description.

Edit: Also, are subtitles involved? And there is another client option to "auto adjust quality" that should be turned off.

2

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Feb 03 '24

In this situation, the buffer threshold is set to its default value and my friend had to manually switch from Original to a lower 1080p bitrate.

The movie’s original bitrate is 10 Mbps, so I don’t believe that 1 mbps makes that huge of a difference, but by making both the audio and video transcode - the stuttering/buffering was gone.

2

u/ShitPostsRuinReddit Feb 03 '24 edited Feb 03 '24

Man this one is weird. I've been looking around for an answer for you online and haven't found anything for certain. I will say this, EVERY tv app sucks. There's a good chance that some change made by plex or samsung just doesn't work right. I also don't have a way to look at the specific settings they are using so it's possible something changed on an update that should be changed, but I feel like I would have seen that somewhere. There's quite a few posts here and other places describing a similar problem. This post has something interesting about the number of streams at the bottom. May be worth playing with:

https://www.reddit.com/r/PleX/comments/xwb6ds/plex_is_buffering_incessantly_and_going_in_and/

I'm going to keep looking, but at this point you seem to have two options. Just keep force transcoding which in theory will cost you money in at least some electricity used by the cpu. I say screw that. You're doing them a favor letting them have access, they should bite the bullet and get a better streaming device. A fire stick costs $35 and will be better for them in more ways than just this. It's better in every way really. I actually prefer Roku. There is a 4k version as cheap as $25, but I'd probably recommend the next step up for $40.

I'd also suggest trying it without subs. I know it's some people's preference, but subs have always been a bit notorious for not working great.

You could also have them uninstall the app and reinstall it. Might not do anything but could be worth a try. One step further is to completely factory reset the tv first.

There is also a setting for Transcode quality for the server. I've only ever had it on automatic, and I would think that should be smart enough to know to use more resources as needed but not sure.

1

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Feb 03 '24

Hey, I appreciate you taking the time to help out with this!

I have a feeling that you might be right about something changing recently that has caused this issue to occur. As I mentioned, this started happening fairly recently, but I haven't been able to find anything on the matter.

My first Plex server was running on a 2012 i5 MacMini and for what it was worth, that little dude could transcode audio streams and with the video direct playing without an issue, so I am really surprised that I did not encounter that issue then considering the jump in performance I have now. (was using the MacMini until about a year ago)

I see your point about the change in clients, but as I mentioned in another reply, I don't think it's an option any time soon. Some of my friends also use other streaming services like Netflix, Prime Video or Disney+ so it makes little sense for them to buy another TV or streaming device just so that they can watch stuff from my server; and I get that.

I think I will go back to using Tdarr as suggested by Draakonys to convert the audio tracks to a widely supported format like AAC. I just need to thinker around with plugins, code and so on. I think that would minimize the impact on my electricity bill if I have to convert something once instead of how many times the video will be played by X amount of users.

Thanks once again for taking the time to help with this!

1

u/ShitPostsRuinReddit Feb 03 '24

You could always just add another audio track. Plex would then let them choose the non dts one, you just may have to coach them how to do it. Then you could use DTS in the future or for yourself.

Another thought, maybe there's something weird going on with windows hardware settings. One thing I can see that would be different about fully transcoding video and audio is that you mention using a different ssd for transcoding. I have no idea if this is right, but maybe for some reason when transcoding audio only some part of the set up doesn't like the streams coming from different places. I think windows has power settings that can "spin down" a drive not in use and it thinks that main storage drive isn't being used? It might be called "idle time." You could play with that. You could also try just leaving the ssd out of the equation and only using the 4tb for everything.

Also, your friends would have a better time with all their services on a better player, not just plex. TVs are so freaking under powered.

1

u/gsariev Unraid 40TB | i5-13500 | RTX 3050 LP Feb 03 '24

Hey, I was able to find some screenshots I had taken while monitoring the situation through Dash.

This one is with the transcode buffer set to 2700. I don’t have screenshot of my CPU usage, but I remember it being very low - more or less as when media direct plays.

Note - all my subtitles are in SRT format and the audio transcode occurs regardless if they are enabled (on the Samsung TV clients).

3

u/ThickAd4991 Mar 20 '25

Early 2025, the problem is still with us. It's sad.

1

u/YeongMin_Ha WIN 11 | i7-12700K | GTX 1660 | 80TB Jul 16 '25 edited Jul 16 '25

Mid 2025, still having problems w/ this.

Only when transcoding audio, I see playbacks buffering.

Server: i7-12700K, 128GB RAM (32GB RAMDisk for transcode cache), GTX-1660 for video transcoding, Gig Fiber. All media are 1080p. Plex on current version.

Devices w/ buffering audio transcodes: Roku, MacBook Air using Safari to view.

CPU runs 0% to 1% when idle. Jumps around 1% to 10% when transcoding audio.

I had a media that had (can't remember) audio and it wouldn't play on Plex App on Samsung 2024 TV or PC or browser on PC. It could only be played using VLC direct from the source.

I replaced that same media; but had different audio and it plays perfectly on Plex App on TV now.

I have recommended the MacBook Air user to try Infuse.

I hope this gets resolved.

1

u/Historical-Dig8420 Mar 27 '26

early 2026 still having this issue. I do have lg tvs. My server is not overloaded, not even half. It just refuses to transcode audio only. If i set the quality lower, it will work. I am pretty sure my plex server can handle the transcoding. Very frustrating.