Jellyfin Forum
Stuttering 4k media - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Stuttering 4k media (/t-stuttering-4k-media)



Stuttering 4k media - chr1s - 2024-03-02

Hi,

I am having trouble with some high quality 4k media, specially movies with details like:

Code:
Video
Titel: 4K HEVC HDR
Codec: HEVC
Profil: Main 10
Level: 153
Auflösung: 3840x2160
Seitenverhältnis: 16:9
Zeilensprungverfahren: No
Bildrate: 23.976025
Bitrate: 79307 kbps
Bit-Tiefe: 10 bit
Videobereich: HDR
Video range type: HDR10
DV title: DV Profile 7.6
DV version major: 1
DV version minor: 0
DV profile: 7
DV level: 6
DV rpu preset flag: 1
DV el preset flag: 1
DV bl preset flag: 1
DV bl signal compatibility id: 6
Farbraum: bt2020nc
Farbübertragung: smpte2084
Primärfarben: bt2020
Pixelformat: yuv420p10le
Referenz-Frames: 1

Code:
Audio
Titel: TrueHD 7.1 Atmos - Eng - Default
Sprache: eng
Codec: TRUEHD
Darstellung: 7.1
Kanäle: 8 ch
Bitrate: 3242 kbps
Abtastrate: 48000 Hz
Bit-Tiefe: 24 bit
Standard: Yes
Erzwungen: No
Extern: No

The media is not playing smoothly... I do have a regular stuttering on various clients.
I first thought it is my network, which is backed up by a wifi b.a.t.m.a.n. mesh with 2.4 Ghz and 5 Ghz (Wifi 6).

I do have constant rates between involved clients with ~160-250 Mbps throughput (messured with iperf3). Messured from a AP, which connected to the interface jellyfin is using, I see rates between 50-96 Mbps when playing such media. 

Jellyfin v10.8.13 (TrueCharts) is running on TrueNas Scale with additional Nvidia P400. Since all tested clients are capable of the format (It shows direct play im media information and there is no ffmpeg log), I ruled this out as a bottleneck. I do use the Traefik, provided by TrueCharts with TLS to connect to Jellyfin.

Every now and then, I for sure have a log entry like this:
Code:
[2024-03-02 13:39:17.018 +01:00] [WRN] [55] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from "https://jellyfin.<redacted>/Sessions/Playing/Progress" to "192.168.XXX.XXX" in 0:00:00.6292633 with Status Code 204


Hoewever, this happen every 10-20 minutes and is not like the stuttering, which happens every 20-60 seconds.

How can I best debug this stuttering? I remember, with Emby, back in the days, I was able to get debug information on my client. What are your tips to get this fixed?

Thank you very much,
   Christian


RE: Stuttering 4k media - Efficient_Good_5784 - 2024-03-02

(2024-03-02, 12:53 PM)chr1s Wrote: Messured from a AP, which connected to the interface jellyfin is using, I see rates between 50-96 Mbps when playing such media.

This might be the problem.

The 4K details example you provided has a bitrate of 79307Kbps. That's equal to 79.3Mbps. Your Access Point needs to provide bandwidth a that speed or faster at all time without dropping below that example's bitrate to avoid video stutters.

Do the 4K videos stutter if you pause a bit and let the client build a buffer?

You can always transcode to a lower bitrate to get smooth playback.

Also fyi, the "slow http response" log entries are kind of useless. The developers even let you disable that exact warning in the dashboard (or you can change the milliseconds before a warning is reported).


RE: Stuttering 4k media - chr1s - 2024-03-02

(2024-03-02, 02:43 PM)Efficient_Good_5784 Wrote:
(2024-03-02, 12:53 PM)chr1s Wrote: Messured from a AP, which connected to the interface jellyfin is using, I see rates between 50-96 Mbps when playing such media.

This might be the problem.

The 4K details example you provided has a bitrate of 79307Kbps. That's equal to 79.3Mbps. Your Access Point needs to provide bandwidth a that speed or faster at all time without dropping below that example's bitrate to avoid video stutters.

Do the 4K videos stutter if you pause a bit and let the client build a buffer?

You can always transcode to a lower bitrate to get smooth playback.

Also fyi, the "slow http response" log entries are kind of useless. The developers even let you disable that exact warning in the dashboard (or you can change the milliseconds before a warning is reported).

Thank your for the response. You might be right... Is there a way I can configure transcoding to limit this bitrate while keeping 4k and hdr? The web config and/or web player config seems quite limiting.

..OR.. is there a recommended player which can "buffer" the stream to keep the quality?

Thank you,
   Christian


RE: Stuttering 4k media - TheDreadPirate - 2024-03-02

You would have to manually pre-transcode your media with handbrake or ffmpeg to keep HDR. Jellyfin does not currently transcode HDR to HDR.


RE: Stuttering 4k media - Efficient_Good_5784 - 2024-03-02

(2024-03-02, 05:41 PM)chr1s Wrote: ..OR.. is there a recommended player which can "buffer" the stream to keep the quality?

All Jellyfin clients should be creating a buffer from my understanding.

Since you used quotes for "buffer", I'm going to assume that you don't know what this is, so I'll explain.

A buffer is when video/audio is loaded onto a player before it actually plays it on screen.
For example, when you're on youtube, you can see a video's progress bar turn grey-ish white.
If you click on any of these white parts, the video will instantly play since that was already downloaded from youtube's servers onto your browser (the client).

If you ever dealt with slow internet while being on youtube, you probably noticed that you can pause the video and wait a bit to allow the buffer to grow so you can then watch the buffer's amount of video again until the next buffer stop.
This is what people refer to as video buffering when their videos stop playing. The buffer is supposed to provided a "buffer cushion" so that network interruptions/slowdowns don't affect the viewers experience.
Buffers work by loading in data faster than what the user is using at a time.

The amount of buffering is customizable too. Youtube used to buffer a lot more of a video, but have since lowered the amount.
As for Jellyfin clients, some let you customize how much of a buffer it creates. One of these is the Jellyfin MPV shim client.


RE: Stuttering 4k media - chr1s - 2024-03-02

Thanks. Unfortunately I have not found a option to control this Buffer. All the clients I have used so far rely on the web player.
Is this different when using the Android TV Implementation?

About converting the Media.
I would not like to convert my media upfront. Is there a feature planned to allow such a transcoding - which I might can support?


RE: Stuttering 4k media - Efficient_Good_5784 - 2024-03-03

Jellyfin Media Player: https://github.com/jellyfin/jellyfin-media-player
It lets you choose how much of a cache (the buffer) it creates as you watch in its client settings.

Once again, all clients should be creating a buffer. I suspect you might get what you want (not having to encode your media) by just connecting your clients to the Jellyfin server directly with wires.


RE: Stuttering 4k media - 34626 - 2024-03-03

Try and disable 2.4 Ghz Wi-Fi (Also disable dual band). and set the 5 Ghz for 160 mhz and see if that helps you out..