mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-03 08:51:56 +01: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)
|
||||
{
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace MediaBrowser.Api.Subtitles
|
||||
|
||||
if (string.Equals(request.Format, "vtt", StringComparison.OrdinalIgnoreCase) && request.AddVttTimeMap)
|
||||
{
|
||||
text = text.Replace("WEBVTT", "WEBVTT\nX-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000");
|
||||
//text = text.Replace("WEBVTT", "WEBVTT\nX-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000");
|
||||
}
|
||||
|
||||
return ResultFactory.GetResult(text, MimeTypes.GetMimeType("file." + request.Format));
|
||||
|
||||
Reference in New Issue
Block a user