Jellyfin Forum
Problem with bitrate limit affecting transcoding bitrate - 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: Problem with bitrate limit affecting transcoding bitrate (/t-problem-with-bitrate-limit-affecting-transcoding-bitrate)



Problem with bitrate limit affecting transcoding bitrate - flo f - 2024-03-05

My Internet connection has recently been upgraded, however due to keeping the power requirements to the minimum, my media server hardware is preatty weak. If I set streaming bitrate to 100 Mbps, then all media that needs to be transcoded for some reason (e.g. 4k media played on a 1080p display) will be aiming for 100 Mbps transcoded bitrate and will be stuttering and thus unwatchable. If I set it to 20 Mbps, then almost all media will need to be transcoded, even the ones that my upload speed would allow to stream directly. I would like to avoid that.

The only workaround that came to mind was to set up two accounts. One for watching direct streams and another one for transcoded media, where I'd set the bitrate limit much lower.

I submitted a feature request, but perhaps someone has a better workaround for this here? Thanks!


RE: Problem with bitrate limit affecting transcoding bitrate - Efficient_Good_5784 - 2024-03-05

Any reason why you can't leave the bitrate limit in the video player set to auto? Leaving it on auto will allow direct plays if possible. Then if you're watching from a client with a limited connection speed to your server, you can manually set a lower bitrate to set a max limit then.


RE: Problem with bitrate limit affecting transcoding bitrate - flo f - 2024-03-05

I'm not talking about the client bitrate limit. It's set to auto as far as I know. And the whole issue is not related to the client as far as I understand it. I'm talking about the server-side limit for a user. My use case is this:

I use jellyfin on my 4k HDR TV, so the things I watch are usually 4k HDR. A friend who uses jellyfin remotely only has a 1080p display with no HDR. There are many videos that are watched by just him or me, so I can just get them in the appropriate quality/resolution, but there is also some overlap in what we watch.

Until now I had a bad upload speed so his account was limited on the server to 7 Mbps. This meant that every single media item was transcoded to meet this bitrate. Since the bitrate is low, the server managed it just fine. Now I have a high upload speed so I set his account limit to 100 Mbps (or could've left it unset, same outcome i suppose). So now he can watch a lot of things in direct stream with good quality which is great, but any media that transcodes for any reason, transcodes with extremely high bitrate like 100 Mbps, which my server can't handle so he can't watch it at all.

So what I'd need is a way to limit only transcoding. Actually same problem applies to me whenever I want to watch a 4k HDR movie on a computer or tablet screen. The transcoding is too much for the server to handle if it's not bitrate-limited.


RE: Problem with bitrate limit affecting transcoding bitrate - Efficient_Good_5784 - 2024-03-05

Can you provide examples of why your friend's streams will need to transcode? Is it due to something like subs being incompatible with the client? A video codec being unsupported by the client? Or is it always because the bitrate limit was passed?

If it's just for the bitrate limit being passed, it makes sense that the transcode bitrate will be as high as possible (up to your set limit) to avoid losing video quality. Your friend will have to manually set a lower bitrate on the client to force a lower bitrate that will play.

You can also make your friend use a client that can direct play most to all media types to avoid transcoding in general. Something like Jellyfin Media Player or MPV Shim will direct play most things.

Just to make sure, are you saying that videos with a low bitrate are being transcoded with a super high final bitrate? For example, a video with 5Mbps bitrate being transcoded to 100Mbps?


RE: Problem with bitrate limit affecting transcoding bitrate - gnattu - 2024-03-05

Let me try to summarize what you want:

1. You have a good upload speed, but the Jellyfin server's hardware has poor performance.
2. You want to utilize the upload speed, but when transcoding media that cannot be played directly and needs to be transcoded, your server cannot keep up with the high bitrate.
3. Now, you want a feature to throttle the transcoding bitrate only while keeping the network speed bitrate unaffected.

If you are not using hardware transcoding of any kind, you can set the CRF value to an extreme high value (like 50) and see if the makes the situation better.

You can also try to change the Encoding Preset to ultrafast.


RE: Problem with bitrate limit affecting transcoding bitrate - flo f - 2024-03-06

> Just to make sure, are you saying that videos with a low bitrate are being transcoded with a super high final bitrate? For example, a video with 5Mbps bitrate being transcoded to 100Mbps?

I'm sorry, I might have gotten the wrong impression from what the Admin Dashboard is showing me. It's probably transcoding to a similar bitrate to the original, so something like 60-70 Mbps. Reason for transcoding is unsupported Video and Audio codec. The original video is HEVC 10bit HDR. The transcoding target is H264. The client is a Chromecast HD (Google TV).

The thing is, when I limit the account to 7 Mbps then my hardware manages to do the transcoding without stuttering. Anythink above that it can't manage for 4k source.


RE: Problem with bitrate limit affecting transcoding bitrate - flo f - 2024-03-06

(2024-03-05, 10:17 PM)gnattu Wrote: Let me try to summarize what you want:

1. You have a good upload speed, but the Jellyfin server's hardware has poor performance.
2. You want to utilize the upload speed, but when transcoding media that cannot be played directly and needs to be transcoded, your server cannot keep up with the high bitrate.
3. Now, you want a feature to throttle the transcoding bitrate only while keeping the network speed bitrate unaffected.

If you are not using hardware transcoding of any kind, you can set the CRF value to an extreme high value (like 50) and see if the makes the situation better.

You can also try to change the Encoding Preset to ultrafast.

Yes you're completely on point, this is exactly what I meant. 
I'm using hardware transcoding, but only to decode the HEVC, not for H264 encoding, because that is not supported (or so I thought from jellyfin documentation, where I remember reading that there is almost no hw that supports it). That's why I thought I could still use CRF and Preset, but it doesn't seem to be doing anything, like I mentioned in another Thread: https://forum.jellyfin.org/t-do-the-transcoding-quality-settings-actually-work

Like I said there, the preset doesn't seem to help even if set to the fastest setting. My settings are:

HW acceleration: Intel QuickSync
Hardware decoding: VC1, HEVC 10bit, VP9 10Bit
Prefer OS native DXVA or VA-API 
Options:
Enable Hardware Encoding
Enable Intel Low-Power H.264 hardware encoder <-- is this the problem?
Enable Intel Low-Power HEVC hardware encoder

I'm a bit confused, because when I look at the performance during encoding, intel htop shows only 20% use, while all CPU cores are at 98-100%.

I'm currently checking out a workaround to store multiple versions of the same video, to avoid transcoding alltoghether. But I'd prefer to avoid having to do that.


RE: Problem with bitrate limit affecting transcoding bitrate - gnattu - 2024-03-06

(2024-03-06, 08:39 AM)flo f Wrote:
(2024-03-05, 10:17 PM)gnattu Wrote: Let me try to summarize what you want:

1. You have a good upload speed, but the Jellyfin server's hardware has poor performance.
2. You want to utilize the upload speed, but when transcoding media that cannot be played directly and needs to be transcoded, your server cannot keep up with the high bitrate.
3. Now, you want a feature to throttle the transcoding bitrate only while keeping the network speed bitrate unaffected.

If you are not using hardware transcoding of any kind, you can set the CRF value to an extreme high value (like 50) and see if the makes the situation better.

You can also try to change the Encoding Preset to ultrafast.

Yes you're completely on point, this is exactly what I meant. 
I'm using hardware transcoding, but only to decode the HEVC, not for H264 encoding, because that is not supported (or so I thought from jellyfin documentation, where I remember reading that there is almost no hw that supports it). That's why I thought I could still use CRF and Preset, but it doesn't seem to be doing anything, like I mentioned in another Thread: https://forum.jellyfin.org/t-do-the-transcoding-quality-settings-actually-work

Like I said there, the preset doesn't seem to help even if set to the fastest setting. My settings are:

HW acceleration: Intel QuickSync
Hardware decoding: VC1, HEVC 10bit, VP9 10Bit
Prefer OS native DXVA or VA-API 
Options:
Enable Hardware Encoding
Enable Intel Low-Power H.264 hardware encoder <-- is this the problem?
Enable Intel Low-Power HEVC hardware encoder

I'm a bit confused, because when I look at the performance during encoding, intel htop shows only 20% use, while all CPU cores are at 98-100%.

I'm currently checking out a workaround to store multiple versions of the same video, to avoid transcoding alltoghether. But I'd prefer to avoid having to do that.

If this is your settings and from the logs of the other post, you are indeed using the Intel hardware encoder, and it seems like Intel hardware cannot keep up in this case.

You can try disable the "Enable Hardware Encoding" option and then CRF should work, but I'm quite curios that which CPU are you using? the Intel Low-Power encoder is not well supported on all generations and enabling that could cause issue. You can try disable that first and see if things improved.