I made a little discovery that “may” help a few people:
I was having an issue where on a few videos I would get a rebuffer about every 30-45 minutes on some video during playback. It was always on videos that were pretty large and seemed to have a fairly high bit-rate. The video would suddenly stop and a buffering icon would appear and then, shortly, the video would restart and play fine. Some times I would get a second rebuffer a few seconds layer and then the video would always restart and play fine to the end or at least for another 30-45 minutes.
I looked at my setup and made sure that there was nothing that should cause any problems and found nothing. My setup is 100% wired. I ran into this using my Rokus but verified that it happened on all my Rokus but I did not test on My Fire or my Shield but I doubt those would have had a problem because they direct play the problem videos.
I then took a look at the settings on my server to see if anything “might” be adjustable that could cause the problem.
I did not see much but the “Transcoder default throttle buffer” caught my eye. It was set at “60” which meant that the buffer held 60 seconds of transcoded video. I thought that, maybe, the buffer would at times run out and then Plex would rebuffer to get a bit ahead again.
I increased the buffer to “600” giving a 10 minuted buffer for the transcoder to use. A then I tested and the videos that would rebuffer played perfectly.
I changed it back and the videos again failed.
I again set it to “600” and no problems.
That was all two days ago and I have not had even one rebuffer since.
I thought I would share this just in case it would help a few people.
600 is pretty high. You’ll probably find that it takes a lot longer for videos to start then it would at the default settings.
I run my server with a setting of 120 which seems to work just fine. If 60 isn’t cutting it I’d add 60 and try again until the buffering stops. 2 to 3 minutes should do it.
@cayars said:
600 is pretty high. You’ll probably find that it takes a lot longer for videos to start then it would at the default settings.
I run my server with a setting of 120 which seems to work just fine. If 60 isn’t cutting it I’d add 60 and try again until the buffering stops. 2 to 3 minutes should do it.
Well I have been running with 600 since mid December and have not see any “slow start” at all. My videos start right up and never rebuffer. I thank you for your suggestion but I will stick with 600 on the “if it ain’t broke don’t fix it” formula. I think it load the buffer only partially before it starts playing the content then it plays from what it has while it continues to fill the buffer. That is I think in is like a bucket with a small hole in it where you start filling it and water starts running out right away but you can continue putting water in and as long as input rate exceeds output rate the bucket will continue to fill. The buffer works by allowing the input to have glitches without slowing the input. The buffer does not need to be full before the output starts. As long as you have the disk space I would think a buffer of 10,000 or 50,000 or 50,000,000 would not slow down the start of the playback.
For me I will just stick with 600 as it does not seem to need to be bigger.
Good to know @Elijah_Baley. I remember playing with this before and could have swore it did effect how long it took to start the stream. Maybe this has changed?
One thing I will mention that might be worth investigating is what happens when you try and transcode say 4 different files at the same time. Each of these will try to buffer 10 minutes before letting off. This could be to much for the CPU and one or two streams might get behind.
With a smaller buffer of say 120 each of these 4 streams will have an easier time finishing the topping off of the buffer before letting the next stream fill the buffer and so on.
Also something worth checking is to see how Plex handles the transcoding when you start a movie and exit. Does plex keep transcoding until it’s done the 10 minute segment? What if one user is just looking at a few movies and keeps starting/stopping them? If I remember correctly from previous playing this cause a problem with bigger buffers.
@cayars and @Elijah_Baley
I’m not sure when I increased this magical number, but I have had mine set at 120 for at least a year when one user claimed he was having buffering problems. Since then, I haven’t heard any complaints.
That will have to be tested by someone else. I almost never have more than one stream running on my server. I don’t share and my granddaughters don’t visit often (they won’t be back in the States until summer) and my dog is not allowed to use Plex on his own.
All I can really say is what is working for me and what I can test. If I were a developer I could easily setup several streams but that is beyond what I want or need to do at this time as I can only watch one at a time.
Maybe I can explain what that setting does. When transcoding, PMS generates file chucks, 1-10 seconds per file, these can be seen in the transcoder cache folder. That setting tells PMS how many files to make before idling. The clients will then request these chunks 1 at a time. As the file plays, the transcoder will kick on and off to generate enough chunks to stay ahead. You can see this in the PMS logs. It is possible that if you have many streams going at once, 1 or more streams could end up running out of chucks to send to the client. Setting a larger buffer setting will allow more chunks to be made ahead of time so slight glitches wouldn’t prevent the transcoders from being able to keep up.
However, if you are seeing buffering due to this, then either your CPU is not able to keep up (speeds near 1.0) or there is some other I/O bottleneck in your system so the transcoder can’t get the resource it needs within that 60s timeframe to generate more data.
Just to be clear, will Plex initially wait until it has generated enough files for (for example) 60 or 600 seconds before it returns the first part to the client? Or will it send the first file as soon as it has been generated, under the assumption that the server will be able to keep up? I’m assuming the latter, since otherwise someone with a transcode speed of 1.5 would have to wait 40-400 seconds before a video would start…
Yes it is the latter, you can see the file start to play pretty much straight away, and you can see the files building up in the transcoder cache folders, until it backs off when it is as far ahead as the buffer setting.