mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[Issue]: Bitrate limit is working weirdly? #5218
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Joly0 on GitHub (Nov 8, 2023).
Please describe your bug
So i have setup my bitrate limit to 10 mbps which is 1/4 of the upload speed of my internet connection. If someone outside my networks streams something now, i can see, that the content is getting converted to fit to the 10 mbps limit, which is totally fine. Though the issue is, that i still can see uploads of 30-35 mbps coming from jellyfin, but its not consistent, its spiking every 2-3 seconds. But this makes my whole network latency increase alot. I cant play any online games that rely on stable pings like this. My in game pings keep going up and down all constantly.
Is this right? Why is this? Is there something i could do to make this work so others can still stream content but my network doesnt suffer so much from it?
Jellyfin Version
10.8.z
if other:
No response
Environment
Jellyfin logs
No response
FFmpeg logs
No response
Please attach any browser or client logs here
No response
Please attach any screenshots here
No response
Code of Conduct
@joshuaboniface commented on GitHub (Nov 9, 2023):
So this is a consequence of how Jellyfin chunks content to endpoints and what the "bitrate limit" actually means.
When streaming from Jellyfin, content is split into chunks; I forget exactly how long they are (IIRC about 5 seconds but could be wrong there, @jellyfin/server feel free to correct me!).
When the client is ready for the next chunk, it requests it from the server. Then the server sends that chunk as fast as it can (i.e. based on your network bandwidth) to the client.
What the birtate limit in Jellyfin means is just that, this is the maximum video bandwidth a video stream can be.
So, as an example let's say the "bitrate limit" is set to 10Mbps. That means that the video source will be capped to 10Mbps (i.e. it will transcode down to about 10Mbps of video bandwidth if the source is higher than this).
That means that, assuming a chunk size of 5 seconds and 10Mbps, then every ~5 seconds the server is going to send a 50Mb (or 6.25MB) chunk out to the client. It will send that as fast as your network allows. Then there will be a relative idle period until the next chunk, and this repeats for as long as the video is playing.
This is why you're seeing spikes like that. Now, on aggregate, this means that you're going to be sending about 10Mbps out the connection. But it will be spiky like this on a seocnd-by-second level.
Jellyfin can't do anything about a congested network. If this is causing major problems for other services, you should look into QoS in your router to de-prioritize the Jellyfin traffic (i.e. prioritize the things you care about relative to Jellyfin). There's really no other way to handle this on the Jellyfin side, as it will just transmit as fast as the network lets it, so this is not a bug.