aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2024-09-22 10:01:47 +0800
committerGitHub <noreply@github.com>2024-09-21 20:01:47 -0600
commit56cf1a581c7f0ffc19fca284a13878d231136aaa (patch)
treeea6c2e77c8a4d5d02fa2bcd9a1b1a84b37a0431e /Jellyfin.Api/Helpers
parentc97c2217a59ea17666373460db4f7e53e67dbee8 (diff)
Better bitrate and resolution normalization (#12644)
Diffstat (limited to 'Jellyfin.Api/Helpers')
-rw-r--r--Jellyfin.Api/Helpers/StreamingHelpers.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs
index 3cc6a393b..3a5db2f3f 100644
--- a/Jellyfin.Api/Helpers/StreamingHelpers.cs
+++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs
@@ -219,11 +219,17 @@ public static class StreamingHelpers
}
else
{
+ var h264EquivalentBitrate = EncodingHelper.ScaleBitrate(
+ state.OutputVideoBitrate.Value,
+ state.ActualOutputVideoCodec,
+ "h264");
var resolution = ResolutionNormalizer.Normalize(
state.VideoStream?.BitRate,
state.OutputVideoBitrate.Value,
+ h264EquivalentBitrate,
state.VideoRequest.MaxWidth,
- state.VideoRequest.MaxHeight);
+ state.VideoRequest.MaxHeight,
+ state.TargetFramerate);
state.VideoRequest.MaxWidth = resolution.MaxWidth;
state.VideoRequest.MaxHeight = resolution.MaxHeight;