I tried to Identify idr packet in c from h264 over rtp.
I follow this answer but I don't understand.
Do I need to search 00 00 01
or 00 00 00 01
and than 0x65 mean start code of idr?
Because I saw a table of all defined NALUs
Type Name
0 [unspecified] 1 Coded slice 2 Data Partition A 3 Data Partition B 4 Data Partition C 5 IDR (Instantaneous Decoding Refresh) Picture 6 SEI (Supplemental Enhancement Information) 7 SPS (Sequence Parameter Set) 8 PPS (Picture Parameter Set) 9 Access Unit Delimiter 10 EoS (End of Sequence) 11 EoS (End of Stream) 12 Filter Data 13-23 [extended] 24-31 [unspecified]
And this code that looking about another conditions (type=5 and more)
public static bool
isH264iFrame(byte[] paket)
{
int RTPHeaderBytes = 0;
int fragment_type = paket[RTPHeaderBytes + 0] & 0x1F;
int nal_type = paket[RTPHeaderBytes + 1] & 0x1F;
int start_bit = paket[RTPHeaderBytes + 1] & 0x80;
if (((fragment_type == 28 || fragment_type == 29) && nal_type == 5 && start_bit == 128) || fragment_type == 5)
{
return true;
}
return false;
}
So how do identify idr packet?