I am using VideoToolbox API from Apple to decode the HEVC stream. I am using AVSampleBufferDisplayLayer
layer for rendering decoded frames.
I am successfully able to decode frames if the source resolution is 1080p (1920 X 1080) or less.
If the resolution is higher than 1080p, I see a black screen and the following error message from AVSampleBufferDisplayLayerFailedToDecodeNotification
,
Optional(Error Domain=AVFoundationErrorDomain Code=-11821 "Cannot Decode" UserInfo={AVErrorMediaSubTypeKey=( 1752589105 ), NSLocalizedDescription=Cannot Decode, NSLocalizedFailureReason=The media data could not be decoded. It may be damaged., AVErrorMediaTypeKey=vide, AVErrorPresentationTimeStampKey=CMTime: {INVALID}, NSUnderlyingError=0x2830c3390 {Error Domain=NSOSStatusErrorDomain Code=-12909 "(null)"}})
-11821 = AVErrorDecodeFailed
-12909 = kVTVideoDecoderBadDataErr
Am I missing anything for higher resolution? Do I need to set the correct HEVC level, profile, or tier? I am not sure what to do.
I would appreciate your inputs guys. Thanks!