Merge pull request #13194 from gnattu/av1-videotoolbox

Enable VideoToolbox AV1 decode
This commit is contained in:
Bond-009
2025-03-30 23:12:53 +02:00
committed by GitHub
5 changed files with 118 additions and 0 deletions

View File

@@ -6621,6 +6621,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|| string.Equals("yuv420p12le", videoStream.PixelFormat, StringComparison.OrdinalIgnoreCase)
|| string.Equals("yuv422p12le", videoStream.PixelFormat, StringComparison.OrdinalIgnoreCase)
|| string.Equals("yuv444p12le", videoStream.PixelFormat, StringComparison.OrdinalIgnoreCase);
var isAv1SupportedSwFormatsVt = is8_10bitSwFormatsVt || string.Equals("yuv420p12le", videoStream.PixelFormat, StringComparison.OrdinalIgnoreCase);
// The related patches make videotoolbox hardware surface working is only available in jellyfin-ffmpeg 7.0.1 at the moment.
bool useHwSurface = (_mediaEncoder.EncoderVersion >= _minFFmpegWorkingVtHwSurface) && IsVideoToolboxFullSupported();
@@ -6654,6 +6655,13 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return GetHwaccelType(state, options, "hevc", bitDepth, useHwSurface);
}
if (string.Equals("av1", videoStream.Codec, StringComparison.OrdinalIgnoreCase)
&& isAv1SupportedSwFormatsVt
&& _mediaEncoder.IsVideoToolboxAv1DecodeAvailable)
{
return GetHwaccelType(state, options, "av1", bitDepth, useHwSurface);
}
}
return null;