H264 video packet loss is inevitable during transmission in the group network, especially when the network environment is poor, transmission of h264 code streams, packet loss will lead to the decoding terminal screen, mosaic is serious, this cutting-edge technology is FEC, NACK, the former is the forward correction technology, and the latter is the retransmission. The two can work well to solve the visual effect caused by packet loss, which is generally unavailable to small manufacturers, if you want to pause the screen even when packet loss occurs, do not flat the screen. The most direct method I want is: Once the packet loss is found, all the packets will be dropped before the next I frame arrives, so once packet loss is detected, mark it and start to judge whether the received rtp packet is 264 I frame. For the method of determining the I frame, see static bool ishpoliciframe (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 | fragment_type = 7 | fragment_type = 8) {return true ;} return false ;}