mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
adjust bitrate in h264/h265 conversions
This commit is contained in:
@@ -1207,7 +1207,7 @@ namespace MediaBrowser.Api.Playback
|
||||
}
|
||||
}
|
||||
|
||||
private int? GetVideoBitrateParamValue(VideoStreamRequest request, MediaStream videoStream)
|
||||
private int? GetVideoBitrateParamValue(VideoStreamRequest request, MediaStream videoStream, string outputVideoCodec)
|
||||
{
|
||||
var bitrate = request.VideoBitRate;
|
||||
|
||||
@@ -1232,6 +1232,12 @@ namespace MediaBrowser.Api.Playback
|
||||
}
|
||||
}
|
||||
|
||||
if (bitrate.HasValue)
|
||||
{
|
||||
var inputVideoCodec = videoStream == null ? null : videoStream.Codec;
|
||||
bitrate = ResolutionNormalizer.ScaleBitrate(bitrate.Value, inputVideoCodec, outputVideoCodec);
|
||||
}
|
||||
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
@@ -1692,7 +1698,7 @@ namespace MediaBrowser.Api.Playback
|
||||
if (videoRequest != null)
|
||||
{
|
||||
state.OutputVideoCodec = state.VideoRequest.VideoCodec;
|
||||
state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream);
|
||||
state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream, state.OutputVideoCodec);
|
||||
|
||||
if (state.OutputVideoBitrate.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user