我正在尝试检查在 Apple Silicon 上运行的设备是否支持 VP9 的硬件视频解码。
我凭经验(通过使用 Chrome 和 Safari)知道 Apple Silicon 上的硬件支持
VP9
解码,但是,使用下面的基本检查我得到 VP9
的错误。
FWIW 它显示
H.264
为真。
我的代码是否缺少某些内容? - 我正在使用最新版本的 Ventura (
13.5.2 (22G91)
) 在 M1 Max MBP 上进行测试。
我确实认为它可能是像 Google 这样的大公司私有的,但是
kCMVideoCodecType_VP9
常数存在......
class HardwareDecProfiler {
func hardwareDecodeSupported(codec: CMVideoCodecType) -> Bool {
return VTIsHardwareDecodeSupported(codec)
}
func runChecks() {
let vp9Support = self.hardwareDecodeSupported(codec: kCMVideoCodecType_VP9)
print("VP9 hardware decoding support check: \(vp9Support)")
}
}
//prints: VP9 hardware decoding support check: false
需要先调用
VTRegisterSupplementalVideoDecoderIfAvailable(kCMVideoCodecType_VP9)
,启用该进程的VP9硬件解码支持。