简体   繁体   English

RTP数据包丢失处理

[英]RTP packet Loss handling

I am writing a jitter buffer program in c to handle rtp packets.Here RTP uses UDP for transportation so connection is not reliable and packets will not be in order and also there will be some packet loss.In case of change in packet order,i will arrange them through sequence number(in RTP header information) but how can i handle or compensate packet loss?(because packet loss is not in my hand) 我正在用c编写一个抖动缓冲区程序来处理rtp数据包。这里RTP使用UDP进行传输,因此连接不可靠,数据包将不整齐,并且还会有一些数据包丢失。将通过序列号排列它们(在RTP标头信息中),但是我该如何处理或补偿丢包?(因为丢包不在我手中)

Note: I am handling h264 as payload and they asked me to use only RTP header 注意:我将h264作为有效负载处理,他们要求我仅使用RTP标头

You can't. 你不能 Short of fabricating the lost data there's nothing you can do. 缺少伪造的数据,您无能为力。

Hopefully the actual encoding used within the RTP packets can help the actual recipient deal with packet loss a little better. 希望RTP数据包中使用的实际编码可以帮助实际接收者更好地处理数据包丢失。 Short of you decoding the RTP payload and acting as a codec for the payload there's nothing that you can do that the codec wont do anyway. 除非您解码RTP有效负载并充当有效负载的编解码器,否则您将无能为力。

With H.264 each RTP packet will contain either a whole NAL unit, a NAL unit fragment or, perhaps, multiple NAL units. 使用H.264,每个RTP数据包将包含一个完整的NAL单元,一个NAL单元片段或多个NAL单元。 The H.264 codec will just expect to be fed the stream of NAL units and IT will know what to do if there is packet loss. H.264编解码器将仅预期将被馈送到NAL单元流,IT部门将知道如果发生丢包该怎么办。

In short, as others said it as well, you can't. 简而言之,就像其他人所说的那样,你做不到。

If packets are lost randomly following a uniform distribution, you can protect your stream by adding FEC to it. 如果数据包在均匀分发后随机丢失,则可以通过在其中添加FEC来保护数据流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM