mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 06:23:03 +03:00
update image encoding
This commit is contained in:
@@ -968,7 +968,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
if (bitrate.HasValue && videoStream.BitRate.HasValue)
|
||||
{
|
||||
bitrate = Math.Min(bitrate.Value, videoStream.BitRate.Value);
|
||||
bitrate = GetMinBitrate(bitrate.Value, videoStream.BitRate.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -981,13 +981,25 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
// If a max bitrate was requested, don't let the scaled bitrate exceed it
|
||||
if (request.VideoBitRate.HasValue)
|
||||
{
|
||||
bitrate = Math.Min(bitrate.Value, request.VideoBitRate.Value);
|
||||
bitrate = GetMinBitrate(bitrate.Value, request.VideoBitRate.Value);
|
||||
}
|
||||
}
|
||||
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
private int GetMinBitrate(int sourceBitrate, int requestedBitrate)
|
||||
{
|
||||
if (sourceBitrate <= 2000000)
|
||||
{
|
||||
sourceBitrate *= 2;
|
||||
}
|
||||
|
||||
var bitrate = Math.Min(sourceBitrate, requestedBitrate);
|
||||
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
public int? GetAudioBitrateParam(BaseEncodingJobOptions request, MediaStream audioStream)
|
||||
{
|
||||
if (request.AudioBitRate.HasValue)
|
||||
|
||||
Reference in New Issue
Block a user