Stuttered Playback / Error: Failed to stream media, client probably disconnected…

I have a library for some YouTube videos. I am having an issue with stuttered playback on any videos that have been added in the past month. This is what I have found while troubleshooting:

  1. It seems to be ONLY on videos uploaded to Plex in the last month. Plex continues to play files uploaded prior to December just fine.
  2. The videos play fine up until it gets to about half way through the video. At about the half way point, I start to receive messages that the connection to the server is not fast enough, and I will get the spinning progress indicator, stuttered video, etc.
  3. The behavior is the same across all platforms. I have tried Plex Web, Plex for Windows, Roku, AppleTV, iPad IOS, etc. All clients do the same thing. They work fine on files uploaded before December, and they fail at about the same point on files recently uploaded.
  4. ALL video files play fine using any player outside of Plex (VLC, Windows Media Player).
  5. I have compared the media information (resolution, video, audio codecs) for files that work versus those that don’t work. They have identical properties.
  6. I see the following line repeatedly in the Plex logs "Failed to stream media, client probably disconnected after xxxxxx bytes: 104 - Connection reset by peer
  7. The files are not particularly large and the wifi network is working fine. Everything is on my local LAN.
  8. I have the latest version of PMS and clients.

Any help or suggestions would be appreciated.

This continues to be a problem even after the latest PMS update.

Need DEBUG logs ZIP file please which capture the first minute of playback in order to see what PMS is doing.

Thanks @ChuckPa, I started playing a file that has this issue at about “Jan 18, 2023 14:06:30” in the logs.

@gcan

That is unfortunately 100% the player freaking out on you.

Jan 18, 2023 14:06:30.505 [0x7fcc47dc1b38] DEBUG - Content-Length of /volume1/MEDIA/MISC/YouTube/YouTube-StutteredVideo-2.mp4 is 191232670 (of total: 191232718).
Jan 18, 2023 14:06:30.603 [0x7fcc492efb38] DEBUG - Request: [10.1.1.50:53414 (Allowed Network (Subnet))] GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) #29a TLS Signed-in Token (gcan) (OFFICE-1) (range: bytes=78292022-) 
Jan 18, 2023 14:06:30.605 [0x7fcc492efb38] DEBUG - Content-Length of /volume1/MEDIA/MISC/YouTube/YouTube-StutteredVideo-2.mp4 is 112940696 (of total: 191232718).
Jan 18, 2023 14:06:30.612 [0x7fcc4a2beb38] DEBUG - Failed to stream media, client probably disconnected after 409600 bytes: 104 - Connection reset by peer
Jan 18, 2023 14:06:30.613 [0x7fcc4a2beb38] DEBUG - Completed after connection close: [10.1.1.50:53413] 206 GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) TLS 109ms 409600 bytes (range: bytes=48-) 
Jan 18, 2023 14:06:30.698 [0x7fcc47465b38] DEBUG - Request: [10.1.1.50:53415 (Allowed Network (Subnet))] GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) #29c TLS Signed-in Token (gcan) (OFFICE-1) (range: bytes=144032413-) 
Jan 18, 2023 14:06:30.701 [0x7fcc47465b38] DEBUG - Content-Length of /volume1/MEDIA/MISC/YouTube/YouTube-StutteredVideo-2.mp4 is 47200305 (of total: 191232718).
Jan 18, 2023 14:06:30.711 [0x7fcc4a2beb38] DEBUG - Failed to stream media, client probably disconnected after 425984 bytes: 104 - Connection reset by peer
Jan 18, 2023 14:06:30.711 [0x7fcc4a2beb38] DEBUG - Completed after connection close: [10.1.1.50:53414] 206 GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) TLS 108ms 425984 bytes (range: bytes=78292022-) 
Jan 18, 2023 14:06:30.790 [0x7fcc490d4b38] DEBUG - Request: [10.1.1.50:53416 (Allowed Network (Subnet))] GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) #29e TLS Signed-in Token (gcan) (OFFICE-1) (range: bytes=78310537-) 
Jan 18, 2023 14:06:30.792 [0x7fcc490d4b38] DEBUG - Content-Length of /volume1/MEDIA/MISC/YouTube/YouTube-StutteredVideo-2.mp4 is 112922181 (of total: 191232718).
Jan 18, 2023 14:06:30.799 [0x7fcc4a0bbb38] DEBUG - Failed to stream media, client probably disconnected after 393216 bytes: 104 - Connection reset by peer
Jan 18, 2023 14:06:30.799 [0x7fcc4a0bbb38] DEBUG - Completed after connection close: [10.1.1.50:53415] 206 GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) TLS 100ms 393216 bytes (range: bytes=144032413-) 
Jan 18, 2023 14:06:30.869 [0x7fcc47dc1b38] DEBUG - Request: [10.1.1.50:53418 (Allowed Network (Subnet))] GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) #2a0 TLS Signed-in Token (gcan) (OFFICE-1) (range: bytes=144076591-) 
Jan 18, 2023 14:06:30.871 [0x7fcc47dc1b38] DEBUG - Content-Length of /volume1/MEDIA/MISC/YouTube/YouTube-StutteredVideo-2.mp4 is 47156127 (of total: 191232718).
Jan 18, 2023 14:06:30.878 [0x7fcc4a2beb38] DEBUG - Failed to stream media, client probably disconnected after 360448 bytes: 104 - Connection reset by peer
Jan 18, 2023 14:06:30.878 [0x7fcc4a2beb38] DEBUG - Completed after connection close: [10.1.1.50:53416] 206 GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) TLS 87ms 360448 bytes (range: bytes=78310537-) 
Jan 18, 2023 14:06:30.962 [0x7fcc492efb38] DEBUG - Request: [10.1.1.50:53419 (Allowed Network (Subnet))] GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) #2a2 TLS Signed-in Token (gcan) (OFFICE-1) (range: bytes=78311000-) 
Jan 18, 2023 14:06:30.965 [0x7fcc492efb38] DEBUG - Content-Length of /volume1/MEDIA/MISC/YouTube/YouTube-StutteredVideo-2.mp4 is 112921718 (of total: 191232718).
Jan 18, 2023 14:06:30.970 [0x7fcc4a2beb38] DEBUG - Failed to stream media, client probably disconnected after 442368 bytes: 104 - Connection reset by peer
Jan 18, 2023 14:06:30.970 [0x7fcc4a2beb38] DEBUG - Completed after connection close: [10.1.1.50:53418] 206 GET /library/parts/185509/1673755760/file.mp4?Accept-Language=en (11 live) TLS 101ms 442368 bytes (range: bytes=144076591-) 

On your network, is MTU set at the default 1500 or did you change it?
(Check all devices – Syno , switch/router, player)

Thanks @ChuckPa

I have not changed the MTU. All network settings have been the same for a long time. The problem only recently started, I believe with one of the Plex releases in December.

NOTE: There is another video within the same log that plays just fine on this player. The videos that fail, play fine until about half-way through the file. The videos that fail, fail on all players, at about the same point. The videos that fail, play correctly outside of Plex. Best I can tell, the problem only exhibits itself on files downloaded since December.

From above…

I read the above before responding.

I look at your logs. They tell me the player is failing.

First / basic question to ask is Network.

Next question to ask is:

May I see the XML of a video file which fails ?
( From top of the XML , down through </media> marker.

Sorry for my ignorance here… Not sure what you mean by viewing the XML of a video file. Where would I find that?

Hover over an item you play which fails. → Get Info → View XML

In the browser tab which opens, copy from the first line down until you see </media>

Paste it into your reply.

It will likely disappear from viewing but you’ll see if when you edit .

Don’t worry, I’ll fix it.

Got it. See attached.
Including the XML file from a video that works and a file that fails (both shown in the previous log file)

.

Thank you.

Do you realize

  1. The working video has:
    – NTSC frame rate (59.94 hz)
    – Bitrate 2070K (2 Mbps)

  2. The stuttering one has
    – PAL frame rate (50 hz)
    – Bitrate: 275 Kbps.

142 Kbps of video. wow. (codec="h264" index="0" bitrate="142")
128 Kbps of audio, (codec="aac" index="1" channels="2" bitrate="128")

Is that encoding valid? It doesn’t look like it.

Players like VLC, Celluloid, etc will fill in missing data as it renders to try and make it look ok.

Plex plays as it is.

I’d run that stuttering video through handbrake or other tool and see if it improves.

Hmmm… Maybe sent you a bad example, attached is the XML from another file that was downloaded recently and also has stuttered playback. The one I’m attaching here is NTSC and has the same resolution. Actually, I can send you a bunch of examples if needed. I’ve tested on dozens of files. The main thing they seem to have in common is that they were downloaded recently.

I didn’t know that you could pull an XML from Plex containing some of this info, so I had been using a utility called “mediainfo” to compare the files.

It was several weeks ago when I began troubleshooting this, so I don’t remember everything I tried, but I’m pretty sure I tried running one of them through handbrake and it had the same problem. I also tried re-downloading at different resolutions (I use “4K Video Downloader”).

Is it possible that Plex recently began extracting/tagging information incorrectly when importing? I don’t remember there being a new version of 4K Downloader in December, but maybe there’s a problem that cropped up there…
[EDIT: I had mis-labeled the uploaded file]

Where are you downloading these from? They look like YouTube or VideoDownloadHelper captured streams at (forgive me) at crap resolution & bitrate.

There is an expression: “Garbage in - Garbage out”. I think that is what’s happening here. To confirm,

Try this one. Tell me what you think and how PMS behaves with it .

They’re downloaded from YouTube using 4K Video Downloader. Been doing it this way for a while and it’s been working fine (until recently). Usually 720p when available. Quality is fine for my purposes. The files are typically 30-60 minutes long.

The file you sent won’t be a good example to demonstrate the problem (too short). The files that have stuttered playback work fine until about 15-20 minutes into the playback. In fact, when it starts acting up, I’ve tried pausing it, going to another device/platform, and the problem continues where the file was paused. For example, I’ll start on my iPad, run into problems, go to a Roku, Plex for Windows, AppleTV, and the playback issues continue where they left off on the previous device. If I then re-start the video from the beginning on any of those platforms, it plays fine until about 15-20 minutes in, then the problem starts again.

A few minutes ago I tested again with the file I just sent you the XML for. Same behavior. Started on Plex Windows, problems start mid-playback, paused, went to Roku, same problem, but this time when I went to Plex-Web, the file played fine. I’m sure I had tested on Plex Web before, so I’m not sure why it played fine this time. I paused Plex-Web (with it working), went back to Plex Windows, stuttered playback began where I had paused it. FWIW, Plex-Web & Plex-Windows where physically on the same computer.

If they play 15-20 minutes before you develop issues, there is something else happening.

What I need to see are your DEBUG logs just as it starts happening.

Until then, there is no way of knowing further.

I will still question the source when you download from Youtube. You have no idea how it was encoded. Further, no control over how it was reduced in the downloader. That’s asking for problems.

Get me the logs of the failure and I’ll look further

Attached are the DEBUG logs. Issue starts about Jan 19, 2023 12:26:48

@gcan

You didn’t download from PMS… you grabbed the file and therefore didn’t get what was buffered.

File ends at:

Thanks again for your help @ChuckPa

I had tried downloading the logs from Plex yesterday (using Plex-Windows) and it wasn’t working, so as per the Plex how-to, I just grabbed the file. Since that seemed fine yesterday, I thought it would work today.

I just tried again, but instead used Plex-Web, and downloading the logs from Plex now works. I see that it downloads ALL logs. I assume you just want the “Plex Media Server.log” file. See attached. Let me know if you need more. Thanks!

Thanks again for your help @ChuckPa

I did some additional troubleshooting today. Based on your feedback, and following up on my quote above, I tried to figure out if a problem had maybe cropped up with 4K Video Downloader. I tried a different tool (YouTube-DL) and this time the file is working fine within Plex.

It is strange because I have used 4K Downloader for a long time without issue, but something must have changed in early December (when the problem began). I assumed (incorrectly) that it was perhaps related to a December update in Plex, but it appears that the problem is with 4K Downloader so I’ll take up the issue with them. Thanks for pointing me in the right direction.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.