Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrTemple

macrumors 6502
Original poster
Jun 11, 2013
474
1,159
Canadian Pacific North Wilderness
I spent some time tracking down the intermittent stuttering issues with Plex, and have figured out that the Plex app does not buffer at all. It doesn't load more than about 10-20mb (if that) at a time. And if you pause the movie, it stops loading the movie at all (no buffering), which is just dumb.

(Aside: Before tvOS 9.1, Homesharing via the Computers app didn't buffer either. Now, it does. You can watch as it pre-loads the whole movie. And now movies that used to stutter under both apps only stutter under Plex, because it is the only one that doesn't buffer.)

I wrote up a detailed analysis on the Plex ATV user forums. It's quoted below. If you're encountering the same issues with Plex, you may want to sign in there, post your problems with the lack of buffering, and request that it try to load the whole movie.

From Plex ATV Forum: Bug: Plex App does not buffer, does not load more than a few megabytes of the video at a time.

This is definitely an issue with Plex. It used to be an issue with both Homesharing via the Computer app in tvOS 9.0 and Plex, but now it is only happening in Plex. I've been tracking it down and think I've got it reproducible. (See below for details on my environment.)


Bug: Plex App Doesn't Buffer

The core problem is that Plex does not buffer the content on the ATV. This was the same problem that used to occur when watching a video via Homesharing, but in tvOS 9.1, you can watch as the whole movie gets buffered.

I'm monitoring network traffic from the Mac my Plex server is on, and while the movie is playing, Plex is intermittently uploading to the ATV. It uploads in small chunks. 1-4mbps for a second or two, then nothing for a while.

If I pause the movie, all uploading stops. That shouldn't be. It should keep uploading. This is the core problem. Plex never tries to buffer the movie, only ever grabbing the next 10-20mb.


Intermittent Stuttering Symptom of the No-Buffering Bug

Really the above is a bug in itself, and should be enough to reproduce and implement a fix, but I'll go further into the details of the symptoms, which are highly variable due to a large number of influences (media location, server state, network latency, etc).

The most commonly reported symptom of this problem is intermittent stuttering. I've been able to track down how to make this occur.

Under my setup, many movies play fine. I generally rip my own media with quality settings very similar to people like YIFY at 1080p. So, I'm playing 2h h264 movies which are under 2GB in size (and thus pretty low bitrate).

However, if it is an exceedingly complex scene in the movie, and the variable bitrate goes above a certain threshold, Plex has to grab its 10-20mb chunks more frequently. When this magic threshold is reached, it can take longer to get the next 'chunk' than the previous chunk takes to play, thus you get stuttering or pausing of the movie while the next chunk loads.

A variety of factors affect how long it takes to grab the next chunk, and depending on the bitrate of the movie at the given moment, there may be stuttering when all of the factors line up, or when just a few of them line up.

In my testing, the stuttering occurs on my movies when the Mac hosting the Plex server is asleep AND the bitrate on the movies I'm watching jumps above a certain threshold. When I wake the Mac, it must shave a second or two off the time to load the media (hosted on a networked drive, see below), and this is typically enough to load the next chunk before the previous finishes playing (even in scenes of high visual complexity). Often, Plex gets through a movie fine, even when the Mac is asleep, but when bitrate climbs above the sleeping Mac's response-latency (which is variable of course), stuttering occurs.

For example, I can reliably reproduce stuttering while watching Star Wars Episode II (Don't judge, I'm rewatching the prequels after reading about Mike Klimo's prequel Ring Theory. Spoiler, I think Klimo is guilty of selection bias, choosing only the myriad references to the OT that fit his theory.).

I've got a ~2.0GB x264 in m4v file, and the film plays well, even with the Mac asleep, but around about the 16min mark, when the speeder chase scene kicks off, it starts to stutter, to stop and try to load every 10-15 seconds (spinning wheel, sometimes with the audio progressing, often not).

If I wake the Mac, this scene progresses without any trouble. However, I have experienced stuttering due to no buffering on other movies, even when I forced my Mac not to sleep (one of the first things I tried, which didn't fix the problem on that movie, likely because the overall bitrate, or perhaps just the bitrate spikes, was still too high).

Also, even if I wait for it to load (which often takes way too long, as if the stuttering confuses the server, causing it to lose its place), and even if I get say a minute of the scene to play, if I rewind and try to watch that minute again, the stuttering still occurs (it's not only not pre-buffering, it's not buffering the content already streamed to the ATV).

So, reproduce away, but really, all that needs to be done is to reproduce the fact that the Plex ATV app is not trying to buffer the content. Once that's fixed, all the stuttering will go away.


Environment

Plex Server: 0.9.15.1
Plex Server OS: 10.11.2
Plex tvOS App: 1.04
(All up to date as of this writing.)

Movies are shared off the network drive connected to my Mac. ATV is connected via ethernet to Airport Extreme. Mac is connected to same AE via 802.11ac, Tx rate is 750-900 Mbps (hold option while clicking the wifi icon on the Mac's menubar). My network is fast and has no interference. It easily sustains dozens and dozens of times the bitrate of the videos I'm trying to play (I'm in a rural setting with no neighbour networks). This setup has worked flawlessly on the ATV1-3, and after tvOS 9.1 now that it buffers, works flawlessly under Homesharing on the ATV4. The only app that's having the issue now is Plex, simply because it doesn't try to buffer the video.).
 

MrTemple

macrumors 6502
Original poster
Jun 11, 2013
474
1,159
Canadian Pacific North Wilderness
Do Netflix or any non-Apple apps buffer? This Plex non-buffering may be an Apple limitation on 3rd party apps.

Both Netflix and Infuse will pre-buffer, and will also continue to download the movie (or a decently large chunk of it), even if it's paused. You can disconnect the ATV network after a sufficient time playing a movie and most apps will continue playing the movie for quite some time.

This is buffering, a basic requirement for streaming video content smoothly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.