I'm using the H264 encoder from Media Foundation (MFT).
I extracted the SPS and PPS from it, because I need it for smooth streaming.
The MSDN says that the number of bytes used for the length field that appears before each NALU can be 1, 2, or 4
. This is all in network byte order. As you can see, the first 4 bytes in the buffer are 0, 0, 0, 1
. If we apply any of the possible lengths, we will get nothing. If the number of bytes used for length is 1, then the length is zero, if it is 2, the length is zero again. If it is 4, the length of first NALU is 1?! And, that's not correct.
Does anybody know how should I interpret this SPS and PPS concatenated together??
SPS and PPS (aka dwSequenceHeader) in Media Foundation's H264 encoder
7.8k Views Asked by user1764961 At
1
The answer here is simple: the data is valid and formatted according to Annex B, prefixed by start codes
00 00 00 01
and not run length encoding.H.264 extradata (partially) explained - for dummies
More details on H.264 spec - freely available for download. Page 326 starts with "Annex B - Byte stream format".