mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-06 10:16:18 +00:00
added sync cpu settings
This commit is contained in:
@@ -70,10 +70,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
encodingJob.OutputFilePath = GetOutputFilePath(encodingJob);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(encodingJob.OutputFilePath));
|
||||
|
||||
if (options.Context == EncodingContext.Static && encodingJob.IsInputVideo)
|
||||
{
|
||||
encodingJob.ReadInputAtNativeFramerate = true;
|
||||
}
|
||||
encodingJob.ReadInputAtNativeFramerate = options.ReadInputAtNativeFramerate;
|
||||
|
||||
await AcquireResources(encodingJob, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -305,19 +302,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
/// <returns>System.Int32.</returns>
|
||||
protected int GetNumberOfThreads(EncodingJob job, bool isWebm)
|
||||
{
|
||||
// Only need one thread for sync
|
||||
if (job.Options.Context == EncodingContext.Static)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (isWebm)
|
||||
{
|
||||
// Recommended per docs
|
||||
return Math.Max(Environment.ProcessorCount - 1, 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return job.Options.CpuCoreLimit ?? 0;
|
||||
}
|
||||
|
||||
protected EncodingQuality GetQualitySetting()
|
||||
|
||||
@@ -124,10 +124,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
state.InputContainer = mediaSource.Container;
|
||||
state.InputFileSize = mediaSource.Size;
|
||||
state.InputBitrate = mediaSource.Bitrate;
|
||||
state.ReadInputAtNativeFramerate = mediaSource.ReadAtNativeFramerate;
|
||||
state.RunTimeTicks = mediaSource.RunTimeTicks;
|
||||
state.RemoteHttpHeaders = mediaSource.RequiredHttpHeaders;
|
||||
|
||||
if (mediaSource.ReadAtNativeFramerate)
|
||||
{
|
||||
state.ReadInputAtNativeFramerate = true;
|
||||
}
|
||||
|
||||
if (mediaSource.VideoType.HasValue)
|
||||
{
|
||||
state.VideoType = mediaSource.VideoType.Value;
|
||||
@@ -148,7 +152,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
state.RemoteHttpHeaders = mediaSource.RequiredHttpHeaders;
|
||||
state.InputBitrate = mediaSource.Bitrate;
|
||||
state.InputFileSize = mediaSource.Size;
|
||||
state.ReadInputAtNativeFramerate = mediaSource.ReadAtNativeFramerate;
|
||||
|
||||
if (state.ReadInputAtNativeFramerate ||
|
||||
mediaSource.Protocol == MediaProtocol.File && string.Equals(mediaSource.Container, "wtv", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
Reference in New Issue
Block a user