mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
added sync cpu settings
This commit is contained in:
@@ -1415,5 +1415,9 @@
|
||||
"OptionAllowMediaPlaybackTranscodingHelp": "Users will receive friendly messages when content is unplayable based on policy.",
|
||||
"TabStreaming": "Streaming",
|
||||
"LabelRemoteClientBitrateLimit": "Remote client bitrate limit (mbps):",
|
||||
"LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all remote clients. This is useful to prevent clients from requesting a higher bitrate than your connection can handle."
|
||||
"LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all remote clients. This is useful to prevent clients from requesting a higher bitrate than your connection can handle.",
|
||||
"LabelConversionCpuCoreLimit": "CPU core limit:",
|
||||
"LabelConversionCpuCoreLimitHelp": "Limit the number of CPU cores that will be used during sync conversion.",
|
||||
"OptionEnableFullSpeedConversion": "Enable full speed conversion",
|
||||
"OptionEnableFullSpeedConversionHelp": "By default sync conversion is performed at a low speed to reduce resource consumption."
|
||||
}
|
||||
|
||||
@@ -456,17 +456,18 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
|
||||
jobItem.Progress = 0;
|
||||
|
||||
var syncOptions = _config.GetSyncOptions();
|
||||
var user = _userManager.GetUserById(job.UserId);
|
||||
|
||||
var video = item as Video;
|
||||
if (video != null)
|
||||
{
|
||||
await Sync(jobItem, job, video, user, enableConversion, progress, cancellationToken).ConfigureAwait(false);
|
||||
await Sync(jobItem, job, video, user, enableConversion, syncOptions, progress, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
else if (item is Audio)
|
||||
{
|
||||
await Sync(jobItem, job, (Audio)item, user, enableConversion, progress, cancellationToken).ConfigureAwait(false);
|
||||
await Sync(jobItem, job, (Audio)item, user, enableConversion, syncOptions, progress, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
else if (item is Photo)
|
||||
@@ -480,7 +481,7 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Sync(SyncJobItem jobItem, SyncJob job, Video item, User user, bool enableConversion, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
private async Task Sync(SyncJobItem jobItem, SyncJob job, Video item, User user, bool enableConversion, SyncOptions syncOptions, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var jobOptions = _syncManager.GetVideoOptions(jobItem, job);
|
||||
var conversionOptions = new VideoOptions
|
||||
@@ -542,7 +543,9 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
|
||||
jobItem.OutputPath = await _mediaEncoder.EncodeVideo(new EncodingJobOptions(streamInfo, conversionOptions.Profile)
|
||||
{
|
||||
OutputDirectory = jobItem.TemporaryPath
|
||||
OutputDirectory = jobItem.TemporaryPath,
|
||||
CpuCoreLimit = syncOptions.TranscodingCpuCoreLimit,
|
||||
ReadInputAtNativeFramerate = !syncOptions.EnableFullSpeedTranscoding
|
||||
|
||||
}, innerProgress, cancellationToken);
|
||||
}
|
||||
@@ -677,7 +680,7 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
|
||||
private const int DatabaseProgressUpdateIntervalSeconds = 2;
|
||||
|
||||
private async Task Sync(SyncJobItem jobItem, SyncJob job, Audio item, User user, bool enableConversion, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
private async Task Sync(SyncJobItem jobItem, SyncJob job, Audio item, User user, bool enableConversion, SyncOptions syncOptions, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var jobOptions = _syncManager.GetAudioOptions(jobItem, job);
|
||||
var conversionOptions = new AudioOptions
|
||||
@@ -725,7 +728,8 @@ namespace MediaBrowser.Server.Implementations.Sync
|
||||
|
||||
jobItem.OutputPath = await _mediaEncoder.EncodeAudio(new EncodingJobOptions(streamInfo, conversionOptions.Profile)
|
||||
{
|
||||
OutputDirectory = jobItem.TemporaryPath
|
||||
OutputDirectory = jobItem.TemporaryPath,
|
||||
CpuCoreLimit = syncOptions.TranscodingCpuCoreLimit
|
||||
|
||||
}, innerProgress, cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user