swiftcodechardware-accelerationvideo-toolboxvp9

Checking VP9 hardware video decode support on Apple Silicon


I'm trying to check whether a device running on Apple Silicon supports hardware video decode of VP9.

I know empirically (from using Chrome and Safari) that VP9 decode is supported in hardware on Apple Silicon, however, using the basic check below I get false for VP9.

FWIW it shows true for H.264.

Is my code missing something? - I'm testing on an M1 Max MBP using the latest release of Ventura (13.5.2 (22G91)).

I did think maybe it's private to big players like Google, but the kCMVideoCodecType_VP9 constant exists...

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


Solution

  • Needed to call VTRegisterSupplementalVideoDecoderIfAvailable(kCMVideoCodecType_VP9) first, to enable VP9 hardware decode support for the process.