iOS 11 - CMVideoFormatDescriptionCreateFromHEVCParameterSets returns -12714

When decoding H264 I do this:


        const uint8_t *sets[] = {[currentPPS bytes], [currentSPS bytes]};
        const size_t sizes[] = {[currentPPS length], [currentSPS length]};
        status = CMVideoFormatDescriptionCreateFromH264ParameterSets(NULL, 2, sets, sizes, 4, &formatDescription);


That works great. However when trying to decode HEVC ->


        const uint8_t *sets[] = {[currentPPS bytes], [currentSPS bytes], [currentVPS bytes]};
        const size_t sizes[] = {[currentPPS length], [currentSPS length], [currentVPS length]};
status = CMVideoFormatDescriptionCreateFromHEVCParameterSets(NULL, 3, sets, sizes, 4, &formatDescription);


CMVideoFormatDescriptionCreateFromHEVCParameterSets gives me ->


hevcbridgeAdvanceInBitstream signalled err=-12714 (kFigBridgeInvalidSerializedSampleDescriptionErr) (end of bitstream) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMediaFramework_Sim/EmbeddedCoreMedia-2010.7.3/Sources/Core/FigFormatDescription/FigHEVCBridge.c line 244


Edit.


Apples parser works. It was our parameter sets that was wrong... This issue is no more.

Replies

I am having similar issues now, I looked at the docs and it looks like it needs more infromation than just those 3. But i have still not gotten it to work.


"


The supported NAL unit types to be included in the format description are 32 (video parameter set), 33 (sequence parameter set), 34 (picture parameter set), 39 (prefix SEI) and 40 (suffix SEI). At least one of each parameter set must be provided.

"

I have been getting -12710 which is invalid I also am getting two PPS Nalu s from the hvcC attom from when I encode but cant find any SEI information in there. Where you ever able to resolve the issue or get any further?

The function seems to require an additional parameter:

CFDictionaryRef extensions.  Has anyone got this to work?