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.

  1. Use CMVideoFormatDescriptionCreateFromH264ParameterSets with SPS and PPS data to create CMFormatDescription. (Status == noErr)

  2. Create a VTDecompression session using VTDecompressionSessionCreate. (Status == noErr)

  3. Ensure that the replacement code is replaced with a byte length code while capturing the NALUnit payload in a CMBlock Buffer. (Status == noErr)

  4. Create a CMSampleBuffer. (Position == noErr)

  5. 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.

  1. SPS, PPS form 264 stream data is found.
  2. Generate CMFormatDescription by using CMVideoFormatDescriptionCreateFromH264ParameterSets.
  3. Create VTDecompressionSession by using VTDecompressionSessionCreate.
  4. The NALUnit payload is found in CMBlockBuffer.
  5. Change the start code with a 4 byte length code.
  6. Create a CMSampleBuffer by using CMSampleBufferCreate
  7. Use VTDecompressionSessionDecodeFrame and get result from callback
(re: length = NALUnit length - start code length)

Then, you have to use dispatch_semaphore_t to decode and show the frame. I am uploading the hope of helping someone else


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -