Jellyfin Forum
Jellyfin stuttering over VPN despite fast download speed - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+---- Forum: Networking & Access (https://forum.jellyfin.org/f-networking-access)
+---- Thread: Jellyfin stuttering over VPN despite fast download speed (/t-jellyfin-stuttering-over-vpn-despite-fast-download-speed)

Pages: 1 2


Jellyfin stuttering over VPN despite fast download speed - StaticUnit97 - 2024-11-03

Hey everyone. I've been working with my brother to set him up with Jellyfin on my local server, but we have been running into some pretty severe stuttering on his end. Videos are playing smoothly for a few seconds and then pausing to load/buffer for a few seconds, and repeat. We've seen this behavior across a number of titles.

Some relevant info:
  • Server is running Ubuntu server 24.04, has an i5-9500T, 8 GB RAM, and Jellyfin (v10.10.0) is running via docker on a 256 GB SSD
  • Using the Speedtest CLI tool, the server is getting 820 mbps up and down consistently
  • He is connecting to my network via a Wireguard VPN (wg-easy via docker specifically) on a Windows laptop and an Android phone. On his local network, he is getting ~120 mbps down over the VPN connection. He lives about ~100 miles from me.
  • He is using the Jellyfin Media Player on Windows, and the integrated player on the Android app.

Some things we've tried:
  • We've tried a number of titles, and all of them are direct playing. Highest bitrate title we've tried is ~68 mbps, so well within the download speeds he's getting.
  • If he forces the player to 20 mbps, all videos play fine. This seems strange, since he's getting ~120 down on the VPN, so you would think all titles would play fine.
  • We've played with various Wireguard MTU values. Some make it much worse, others are at best the same as the default.
  • I've been able to run all titles fine on my Android phone over the VPN on a cell connection.

Does anyone have suggestions on what to try next? Is this a problem with the Jellyfin server, client, or Wireguard? I'm having trouble identifying what the bottleneck could be. Based on the fact that forcing the bitrate to 20 mbps works makes me think it's a networking issue, but this is not reflected in any of the speedtests we've tried. Any other ideas?


RE: Jellyfin stuttering over VPN despite fast download speed - 34626 - 2024-11-03

I suspect that your brothers laptop is connected to the internet over Wi-Fi.
Please try connect it to the router/internet via lan cable and see if that helps


RE: Jellyfin stuttering over VPN despite fast download speed - TheDreadPirate - 2024-11-03

Even a run-of-the-mill WIFI 5 router should be able to get 300-600Mbps on the 5Ghz band. If they are on 2.4Ghz, and have a 5Ghz network available, make sure they are on the 5Ghz band. It isn't just bandwidth, consistency matters to. And 2.4Ghz is notoriously bad for consistency when living in a densely populated area with a lot of nearby networks.

You can also try setting up a librespeed container to do a speed test that way instead of a CLI tool.

https://hub.docker.com/r/linuxserver/librespeed


RE: Jellyfin stuttering over VPN despite fast download speed - StaticUnit97 - 2024-11-03

(2024-11-03, 06:08 PM)TheDreadPirate Wrote: Even a run-of-the-mill WIFI 5 router should be able to get 300-600Mbps on the 5Ghz band.  If they are on 2.4Ghz, and have a 5Ghz network available, make sure they are on the 5Ghz band.  It isn't just bandwidth, consistency matters to.  And 2.4Ghz is notoriously bad for consistency when living in a densely populated area with a lot of nearby networks.

You can also try setting up a librespeed container to do a speed test that way instead of a CLI tool.

https://hub.docker.com/r/linuxserver/librespeed

I'll have him give a wired connection a try. He's tried the 5 GHz, and his devices are also WiFi 6E compatible with 6 GHz, but the issue still persists.

What other points between the server and client could be a problem? Is it possible my router is causing a problem? It's a TP Link AX-21. Or is he getting bad packet loss over the wireguard connection perhaps? Definitely grasping at straws here.


RE: Jellyfin stuttering over VPN despite fast download speed - TheDreadPirate - 2024-11-03

What are the specs on their laptop? And can you provide the media info (the one in the Jellyfin UI) for some of your videos?


RE: Jellyfin stuttering over VPN despite fast download speed - StaticUnit97 - 2024-11-03

(2024-11-03, 10:02 PM)TheDreadPirate Wrote: What are the specs on their laptop?  And can you provide the media info (the one in the Jellyfin UI) for some of your videos?

Laptop:
  • CPU: Intel i9-11900H
  • GPU: Nvidia Quadro RTX A3000

Phone:
  • Samsung Galaxy S24, using integrated player, hardware decoding

Media info from 3 titles we've tried:

Title 1:
  • Title: 1080p H264 SDR
  • Codec: H264
  • AVC: Yes
  • Profile: High
  • Level: 41
  • Resolution: 1920x1080
  • Aspect ratio: 16:9
  • Anamorphic: No
  • Interlaced: No
  • Framerate: 23.976025
  • Bitrate: 42149 kbps
  • Bit depth: 8 bit
  • Video range: SDR
  • Video range type: SDR
  • Pixel format: yuv420p
  • Ref frames: 1
  • NAL: 4

Title 2:
  • Title: 4K HEVC SDR
  • Codec: HEVC
  • AVC: No
  • Profile: Main 10
  • Level: 156
  • Resolution: 3840x2160
  • Aspect ratio: 16:9
  • Anamorphic: No
  • Interlaced: No
  • Framerate: 23.976025
  • Bitrate: 66645 kbps
  • Bit depth: 10 bit
  • Video range: SDR
  • Video range type: SDR
  • Color space: bt709
  • Color transfer: bt709
  • Color primaries: bt709
  • Pixel format: yuv420p10le
  • Ref frames: 1

Title 3:
  • Title: 1080p VC1 SDR
  • Codec: VC1
  • Codec tag: WVC1
  • AVC: No
  • Profile: Advanced
  • Level: 3
  • Resolution: 1920x1080
  • Aspect ratio: 16:9
  • Anamorphic: No
  • Interlaced: No
  • Framerate: 23.976025
  • Bitrate: 23567 kbps
  • Bit depth: 8 bit
  • Video range: SDR
  • Video range type: SDR
  • Color space: bt709
  • Color transfer: bt709
  • Color primaries: bt709
  • Pixel format: yuv420p
  • Ref frames: 1


Like I mentioned before, all of these stutter by default, and all work when dropped to a fixed 20 mbps playback. Title 3 also stutters by default, which is interesting since it's only ~24 mbps.


RE: Jellyfin stuttering over VPN despite fast download speed - TheDreadPirate - 2024-11-03

For testing, can you setup port forwarding on port 8096 in your router and have your friend bypass the VPN? We need to rule out some limitation with how fast/consistently wireguard can stream data.


RE: Jellyfin stuttering over VPN despite fast download speed - StaticUnit97 - 2024-11-04

(2024-11-03, 10:27 PM)TheDreadPirate Wrote: For testing, can you setup port forwarding on port 8096 in your router and have your friend bypass the VPN?  We need to rule out some limitation with how fast/consistently wireguard can stream data.

Good idea, I hadn't thought of that.

So we gave this a try, and the stuttering was still occuring, so we can rule out the vpn as the issue at least.

A couple of other things we tried:
  • Video decoding with his Intel iGPU and his Nvidia GPU. Neither of them were ever close to being maxed out, so unlikely to be a hardware problem.
  • My server has two HDDs, one connected via SATA and one via a USB dock. We played titles from both, and both experienced stuttering, so I don't think it's related to the drives.
  • I transcoded one of the videos with Handbrake ahead of time, and the resulting average bitrate was 10 mbps. This direct played without issue, so it seems to be bandwidth related, somewhere.

Any other things stand out as a potential problem? I've still been able to successfully stream to my phone over the VPN on a cell connection during this, so it seeks like my server and router can handle the traffic. The only difference between us is the physical proximity to my server. There just seems to be something between him and me that's causing the bottleneck.


RE: Jellyfin stuttering over VPN despite fast download speed - TheDreadPirate - 2024-11-04

Try just remuxing one of your videos. To make sure there isn't something wrong with the container.

Code:
ffmpeg -fflags +genpts+igndts -i "/path/to/your/file.mkv" -codec copy -max_muxing_queue_size 2048 -max_interleave_delta 0 -avoid_negative_ts auto newFile.mkv



RE: Jellyfin stuttering over VPN despite fast download speed - StaticUnit97 - 2024-11-04

(2024-11-04, 02:44 AM)TheDreadPirate Wrote: Try just remuxing one of your videos.  To make sure there isn't something wrong with the container.

Code:
ffmpeg -fflags +genpts+igndts -i "/path/to/your/file.mkv" -codec copy -max_muxing_queue_size 2048 -max_interleave_delta 0 -avoid_negative_ts auto newFile.mkv

I'll give that a try tomorrow. Are you talking about the docker container potentially having a problem, or the mkv file(s)?