|
|
|
@ -2826,6 +2826,38 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
|
|
return GetHwaccelType(state, encodingOptions, "vp9");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (string.Equals(encodingOptions.HardwareAccelerationType, "videotoolbox", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
switch (videoStream.Codec.ToLowerInvariant())
|
|
|
|
|
{
|
|
|
|
|
case "avc":
|
|
|
|
|
case "h264":
|
|
|
|
|
if (_mediaEncoder.SupportsDecoder("h264_videotoolbox") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return "-c:v h264_videotoolbox";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "mpeg2video":
|
|
|
|
|
if (_mediaEncoder.SupportsDecoder("mpeg2_videotoolbox") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return "-c:v mpeg2_videotoolbox";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "mpeg4":
|
|
|
|
|
if (_mediaEncoder.SupportsDecoder("mpeg4_videotoolbox") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg4", StringComparer.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return "-c:v mpeg4_videotoolbox";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "vc1":
|
|
|
|
|
if (_mediaEncoder.SupportsDecoder("vc1_videotoolbox") && encodingOptions.HardwareDecodingCodecs.Contains("vc1", StringComparer.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return "-c:v vc1_videotoolbox";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var whichCodec = videoStream.Codec.ToLowerInvariant();
|
|
|
|
|