How to find Nal header in h.264 RTP packet -
i need find nal header parsing rtp packet each nal unit encapsulated 1 rtp packet, parse nal header know whether it's pps unit or not. tried following got no result: databuffer = (char*)message_returnpacket(msg); byte * hdr = (byte*)databuffer + rtp_hdr_size; //databuffer contains rtp packet rtpparsing((byte*)databuffer,rp,hdr); if (rp.nal_type == 8 ) { printf("\n pps found \n"); } else { printf("\n no pps found\n"); } where int rtpparsing(byte *pdata,rtppacket_t &rp, byte *hdr) { if ((pdata[0] & 0xc0) != (2 << 6)){ printf("[rtp] version incorrect! dump = 0x%x 0x%x 0x%x 0x%x \n",pdata[0], pdata[1], pdata[2], pdata[3]); return 0; } /* parse rtp header */ rp.v = (pdata[0] & 0xc0) >> 6; /* protocol version */ rp.p = (pdata[0] & 0x40) >> 5; /* padding flag */ rp.x = (pdata[0] & 0x20) ...