VTDecompressionSessionDecodeFrame or enqueueSampleBuffer fail when NALU bigger than 65536. Is there a workaround?

Whenever an iFrame NALU is bigger than 65536 bytes, the video decoder fails with the -12909 error code (kVTVideoDecoderBadDataErr).


Function used is VTDecompressionSessionDecodeFrameWithOutputHandler. It's completely fine when all NALUs are less than 65536 bytes.


When using a 2 Mbps 1080p stream, it can happen that iframe sizes go up to 90kB.


Does anyone know the root cause? Is there a workaround?

I'm getting the same error code when trying to decode HEVC/H.265 NAL units from a 4K camera. The NALUs are around 300kB and I have to reassemble them from fragments in multiple RTP packets.

Did you (or somebody) ever find a solution to this problem?

VTDecompressionSessionDecodeFrame or enqueueSampleBuffer fail when NALU bigger than 65536. Is there a workaround?
 
 
Q