Log in

View Full Version : How to extract IDR frames from H.264 elementary bitstream?


zoeliu
9th February 2012, 15:54
Here is what I did:

Given an H.264 elementary bitstream, use a parser to extract all the SPS/PPS/IDR nalus (judging from nal_unit_type 7/8/5), add starting code 0x00000001 at the beginning of each nalu, and write to a file.

The result however cannot be decoded correctly. What am I missing here? Great thanks! :thanks:

Dust Signs
10th February 2012, 08:22
The start code is 0x000001, not 0x00000001. I assume that this is the problem. However, two questions:
* What error do you get exactly when trying to decode the stream?
* Did you escape 0x000001 sequences within the NALUs to 0x00000001 (unlikely that they appear, but nonetheless possible)?

Best regards
Dust Signs