Server Version#: 1.18.1.1973
Player Version#: 7.26.0.14578 (Android Phone)
Hello all,
I am having an issue with managing my bandwidth. My ISP only provides 2Mbps upload (lame, I know) and if I max it out, it kills my download (12 Mbps). This results in all youtube, Netflix, gaming, etc. coming to a halt if I max out my upload. I have contacted my provider and he claims this is to be expected because downloading requires a return path. Since it is TCP/IP I guess I understand that. Anyway I am trying to get around this limitation by re-encoding and limiting bandwidth consumption.
I have re-encoded my collection to HEVC @ 750Kbps. I am reasonably happy with the quality on my phone screen but cannot seem to get Plex to limit my BW to 1.5Mbps, stay under 2Mbps, and not transcode. I chose 1.5Mbps to accommodate any flux in my encoding.
If I leave the limiter off, Plex will deliver the video using “direct play” (as I want). Unfortunately, it pegs the needle on my bandwidth in spurts approximately every four seconds. Each spurt disrupts my download and ruins game playing, Netflix, youtube, etc.
If I turn on limiting, Plex will transcode to H264 and then spurt exactly as before, apparently ignoring the BW limitation, but now the quality is low in addition to the rest of my family’s downloads suffering.
I am a bit of a loss as to where I should go from here. Is there an option to stream out in a steady flow instead of the spurts? I would like to discover how to keep the flow constant and under a bandwidth limit.
If your router has an adaptive qos option you could use it to set your max upload to say 1.8 leaving some headroom to avoid buffer bloat. Our specifically limit the upload of your pms box.
I’ll need more details (log, wink, wink) to figure out why it’s transcoding, but these pegs as you describe could be due to spikes in the encode. Keep in mind that the bitrate setting you use when encoding is an average so there can be spikes. I don’t know what program you use, but some will allow you to set the maximum these spikes can reach, which could help.
Another possibility is that the audio you have is causing the file to exceed the limit. The limit checks both the video and audio bitrates. You could have a 750kbps video, but if the audio is 1 Mbps, the total would be above your limit so it will transcode.
Dec 25, 2019 17:10:11.398 [0xa55ff450] DEBUG - Streaming Resource: Reached Decision id=17624 codes=(MDE=3001,Not enough bandwidth for direct play of this item. Required bandwidth is 1760kbps and only 1600kbps is available. General=1001,Direct play not available; Conversion OK. Direct Play=3000,This app cannot play this item. The reason is: part.optimizedForStreaming limitation applies: 0 != 1. Transcode=1001,Direct play not available; Conversion OK.) media=(id=28109 part=(id=28180 decision=transcode container=mpegts protocol=hls streams=(Video=(id=74468 decision=transcode bitrate=1061 encoder=libx264 width=720 height=406) Audio=(id=74469 decision=transcode bitrate=135 encoder=aac channels=2 rate=48000))))
But I have triple-checked and the file is No where near 1769Kbps. I have attached a screenshot.
Plex has two bandwidth limiters on the “Remote Access” config screen - one for the total concurrent internet upload speed (which allows you to type in a number in Mbps), and another that limits each individual stream which is a dropdown. Have you experimented with setting both? In your case I think you need to have the total internet upload speed set to have Plex fully respect your limit, not just the per-stream rate.
This Plex article is very useful. Note that in their example a 3.5 Mbps average video spikes up to 10 Mbps in an action scene. It goes on to state that Plex assumes a 2x average bitrate unless a deep analysis has been performed (e.g. a 50% overhead allowance isn’t sufficient.) Particularly pay attention to the very informative “So how does Plex handle it” section. The buffer size of your client can make a big difference in the actual overall bitrate required.
PS Your encoder may allow a constant bitrate instead of variable - but that is going to be at the encoder, not Plex. Constant bitrate will have implications for file size and how it displays.
Plex also does an analysis of your file to see what bitrate is needed to make sure the file will stream properly. This analysis may not match up with the average bitrate in the file. If you can provide the xml from PMS for that video, those analyzed values should be there.
I have learned so much from this one question! Here is my xml file. I see the same numbers as I saw on the VideoSpec snapshot. Is there a particular tag I should be looking at?
MediaInfo can/may provide a more detailed inspection, particularly Bandwidth - that may not be in the XML - I really don’t know, but it’s worth a shot.
The video played very well on my remote. At first everything is great, and my local download is not affected. Then the spurting starts, and finally big spurts that completely destroy my download bandwidth. When the upload looks like the right side of the graph. I cannot do anything involving downloads. The video continues to play fine though.
I did not have any bw controls set on the server for this test.
Thoughts?
I am still looking fir the correct answer, but wanted to update this thread to let you know that I found something that is working.
My router does not have this feature as an upload option, only download. :-/ However, I found WonderShaper (The tutorial on that page is out of date, but the readme is pretty good.). Anyway, I installed it on my Plex server and did some speed tests per the instructions then set the values and it seems to be working. I did not set any BW limitation in Plex.
Here is my new screenshot:
Well I guess I spoke too soon. I think this would work great if I could control all of my network through Wondershaper, but since it only controls the Plex server when I do a speed test (upload) from another machine it saturates the upload part of the network and then Plex starts spurting again. See here:
This then results in the download being completely unusable. I have to stop the video and restart to get the spurting to reset.
Any thoughts anyone?
Thanks!
Ugh. this is interesting from a technical standpoint to learn, but a real pain for you.
Is your Plex server Win or Linux? This thread is tagged Windows, but the WonderShaper link is Linux and you got me researching QoS and shaping.
In general I think what is happening is that you are seeing more level network use while the buffer is filling on the client (which may continue even after playing has started.) Then when the buffer is full it starts transmitting in chunks as needed, so you get spikes when chunks are transmitted and nothing while the client is happy playing from it’s buffer.
Wow, I totally screwed that up. It is linux. I changed the tag. Thank you for catching that. I don’t know what I was thinking. :-/
Ya, that seems very likely. I just cant figure out why it is peaking so high. When I limit to 2.2Mbps, it still peaks over 5, unless the graph in Plex is not accurate. BTW, 2.2 seems to be the sweetest spot.
It’s cool that you are Linux - in this case I feel like you have a better chance of finding a resolution. The link I provided is rather generic and I don’t know what distro you are using, but if you google “(your distro) linux QoS” I think you will find some good material. Microsoft, in their wisdom, decided only corporate network admins could possibly need advanced networking, so they limit certain capabilities to their server OS editions…
The advice of @Dr_Tone to do QoS on your router would be choice #1 since limiting on your Plex server still leaves you vulnerable to saturation if another device on you LAN starts uploading, but since that doesn’t appear to be an option…
Keep in mind that without setting a bandwidth limit in PMS, a client will try to download as fast as your network will allow. So what you are seeing is normal and expected. If you need to limit your throughput, you will need to setup a limit in PMS or control it outside of Plex with your router’s QoS or a 3rd party program like you tried. I’m not sure why it is triggering a transcode. Your XML looks fine. I’ll need to see your PMS logs after recreating the issue. You can PM me the log if you don’t want to share it publicly.