mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
don't throttle when using hardware encoding
This commit is contained in:
parent
9349cc5beb
commit
438507b53d
1 changed files with 11 additions and 10 deletions
|
@ -1118,22 +1118,23 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
private void StartThrottler(StreamState state, TranscodingJob transcodingJob)
|
private void StartThrottler(StreamState state, TranscodingJob transcodingJob)
|
||||||
{
|
{
|
||||||
if (EnableThrottling(state) && state.InputProtocol == MediaProtocol.File &&
|
if (EnableThrottling(state) && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||||
state.RunTimeTicks.HasValue &&
|
|
||||||
state.VideoType == VideoType.VideoFile &&
|
|
||||||
!string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
{
|
||||||
if (state.RunTimeTicks.Value >= TimeSpan.FromMinutes(5).Ticks && state.IsInputVideo)
|
transcodingJob.TranscodingThrottler = state.TranscodingThrottler = new TranscodingThrottler(transcodingJob, Logger, ServerConfigurationManager);
|
||||||
{
|
state.TranscodingThrottler.Start();
|
||||||
transcodingJob.TranscodingThrottler = state.TranscodingThrottler = new TranscodingThrottler(transcodingJob, Logger, ServerConfigurationManager);
|
|
||||||
state.TranscodingThrottler.Start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool EnableThrottling(StreamState state)
|
protected virtual bool EnableThrottling(StreamState state)
|
||||||
{
|
{
|
||||||
return true;
|
// do not use throttling with hardware encoders
|
||||||
|
return state.InputProtocol == MediaProtocol.File &&
|
||||||
|
state.RunTimeTicks.HasValue &&
|
||||||
|
state.RunTimeTicks.Value >= TimeSpan.FromMinutes(5).Ticks &&
|
||||||
|
state.IsInputVideo &&
|
||||||
|
state.VideoType == VideoType.VideoFile &&
|
||||||
|
!string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
string.Equals(GetVideoEncoder(state), "libx264", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task StartStreamingLog(TranscodingJob transcodingJob, StreamState state, Stream source, Stream target)
|
private async Task StartStreamingLog(TranscodingJob transcodingJob, StreamState state, Stream source, Stream target)
|
||||||
|
|
Loading…
Reference in a new issue