If you're not really trying to decode frames, you can write a simple "parser" by reading the h.264 byte stream and looking for a NAL signature.
Here is what you need to know:
- NAL Trigger Code: 00 00 01 XY
- X = NRRR image units (e.g. 25, 45, 65)
- Y = UnIDR Picture NAL Units (e.g. 01, 21, 41, 61)
So, if you find 3 bytes [00 00 01] in a sequence, it is very likely that this is the beginning of a NAL block. Then you will need to parse the next two bytes [XY] to find out the type of frame. See spec for more details.
source share