mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-24 18:26:10 +00:00
update image encoding
This commit is contained in:
parent
1be515ddf7
commit
9cd2d793be
9 changed files with 141 additions and 44 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue