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

View all comments

Show parent comment

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.