Merge pull request #3711 from yrjyrj123/fix_hw_decoder_for_macos

Fix the problem that hardware decoding cannot be used on macOS.
This commit is contained in:
Anthony Lavado 2020-07-26 15:37:13 -07:00 committed by GitHub
commit ea0489a98e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,6 +456,7 @@ namespace MediaBrowser.Controller.MediaEncoding
var isQsvEncoder = outputVideoCodec.IndexOf("qsv", StringComparison.OrdinalIgnoreCase) != -1;
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
var isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
var isMacOS = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
if (!IsCopyCodec(outputVideoCodec))
{
@ -511,6 +512,12 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
}
if (state.IsVideoRequest
&& string.Equals(encodingOptions.HardwareAccelerationType, "videotoolbox", StringComparison.OrdinalIgnoreCase))
{
arg.Append("-hwaccel videotoolbox ");
}
}
arg.Append("-i ")