videotoolbox h264 decoder regression in iOS 15 / Apple Silicon

We have ffmpeg-based code that runs on both iOS and Macos. We've noticed, that with the upgrade from iOS 14 -> iOS 15 videotoolbox decoder started failing to process h264 stream.

Today we've finally dug a bit deeper into this, and it seems the failure is similar on iOS 15, and on MacOS 12.3 -- but only on Apply Silicon for the latter. The same software and input work fine on Intel Mac.

The failure is explained in some detail here: https://trac.ffmpeg.org/ticket/9713 and here: https://trac.ffmpeg.org/ticket/9016

It is quite easily reproduced with ffmpeg

This is the output seen in Console.app for VTDecode filter:

kernel  arm64e_plugin_host: running binary "VTDecoderXPCService" in keys-off mode due to entitlement: com.apple.security.cs.disable-library-validation
VTDecoderXPCService No persisted cache on this platform.
VTDecoderXPCService flock failed to lock list file (<private>): errno = 35
VTDecoderXPCService flock failed to lock list file (<private>): errno = 35
VTDecoderXPCService AppleAVDWrapperH264DecoderStartSession() codecType: AVC, encryptionScheme 6, 2560 x 1440, tryAllFrames = 0, iChatUsage: 0, session: 0x12b029020 built 20:42:46 Feb 21 2022
VTDecoderXPCService about to kAppleAVDSetMiscPreferences, storage->miscPreferences is 0
VTDecoderXPCService AppleAVDWrapperH264DecoderStartSession: Compressed buffers disabled! luma depth 8 chroma format 1
VTDecoderXPCService AppleAVDDecodeFrameInternal(): failed - error: 316
VTDecoderXPCService AppleAVDDecodeFrameResponse(): Received frameNum 1, errorCode 315, index 1
VTDecoderXPCService AppleAVDDecodeFrameInternal(): avdDec - Frame#      1, DecodeFrame failed with error: 0x13c
videotoolbox h264 decoder regression in iOS 15 / Apple Silicon
 
 
Q