Force software decoding when hardware decoder does not support keyframe only mode but requested by user
Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
parent
68bfabbaba
commit
0340eccb52
|
@ -814,6 +814,22 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||||
var options = allowHwAccel ? _configurationManager.GetEncodingOptions() : new EncodingOptions();
|
var options = allowHwAccel ? _configurationManager.GetEncodingOptions() : new EncodingOptions();
|
||||||
threads ??= _threads;
|
threads ??= _threads;
|
||||||
|
|
||||||
|
if (enableKeyFrameOnlyExtraction)
|
||||||
|
{
|
||||||
|
var supportsKeyFrameOnly = !allowHwAccel
|
||||||
|
|| (string.Equals(options.HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase) && options.EnableEnhancedNvdecDecoder)
|
||||||
|
|| (string.Equals(options.HardwareAccelerationType, "amf", StringComparison.OrdinalIgnoreCase) && OperatingSystem.IsWindows() && options.PreferSystemNativeHwDecoder)
|
||||||
|
|| (string.Equals(options.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase) && options.PreferSystemNativeHwDecoder)
|
||||||
|
|| string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals(options.HardwareAccelerationType, "videotoolbox", StringComparison.OrdinalIgnoreCase);
|
||||||
|
if (!supportsKeyFrameOnly)
|
||||||
|
{
|
||||||
|
// Disable hardware acceleration when the hardware decoder does not support keyframe only mode.
|
||||||
|
allowHwAccel = false;
|
||||||
|
options = new EncodingOptions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// A new EncodingOptions instance must be used as to not disable HW acceleration for all of Jellyfin.
|
// A new EncodingOptions instance must be used as to not disable HW acceleration for all of Jellyfin.
|
||||||
// Additionally, we must set a few fields without defaults to prevent null pointer exceptions.
|
// Additionally, we must set a few fields without defaults to prevent null pointer exceptions.
|
||||||
if (!allowHwAccel)
|
if (!allowHwAccel)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user