Error code -8969, -12909 while decoding h264 in iOS 8 with video tool box -
Follow this link for
I have the H264 stream inAnnex B format and implements h264 decoding with iOS8 videoToolBox.
I check OSStatus in every step.
-
Use CMVideoFormatDescriptionCreateFromH264ParameterSets with SPS and PPS data to create CMFormatDescription. (Status == noErr)
-
Create a VTDecompression session using VTDecompressionSessionCreate. (Status == noErr)
-
Ensure that the replacement code is replaced with a byte length code while capturing the NALUnit payload in a CMBlock Buffer. (Status == noErr)
-
Create a CMSampleBuffer. (Position == noErr)
-
Use VTDecompressionSessionDecodeFrame and get the error code -8969 (simulator) -12,909 (device) in the callback function.
I suspect that I did something wrong in step 3, I'm not completely sure what the length code means I just follow the WWDC session video every NALUnit start 00 00 00 00 00 00 00 00 00. Is this true or not? Or should i know something else ??? Thank you
Finally, it is working now. So, how do I share detail in the videoToolbox using Decoding 264 stream data compared to showing on the screen.
- SPS, PPS form 264 stream data is found.
- Generate CMFormatDescription by using CMVideoFormatDescriptionCreateFromH264ParameterSets.
- Create VTDecompressionSession by using VTDecompressionSessionCreate.
- The NALUnit payload is found in CMBlockBuffer.
- Change the start code with a 4 byte length code.
- Create a CMSampleBuffer by using CMSampleBufferCreate
- Use VTDecompressionSessionDecodeFrame and get result from callback
Then, you have to use dispatch_semaphore_t to decode and show the frame. I am uploading the hope of helping someone else
Comments
Post a Comment