rtcp 的jitter buffer

//@[TOC](jitter buffer)

jitter buffer

rtcp xr jb 草案
觉得这篇draft写的挺好,适合入门阅读。 zhangbin 20191128 翻译

jitterbuffer操作

  • A jitter buffer is required to absorb delay variation in network delivery of media packets. A jitter buffer works by holding media data for a period of time after it is received and before it is played out. Packets that arrive early are held in the jitter buffer longer. If packets arrive too early they may be discarded if there is no available jitter buffer space. If packets are delayed excessively by the network they may be discarded if they miss their playout time.

  • Overall user perceived delay = network round trip delay + local (jitter buffer (nominal) delay + encoder serialization delay) + remote (jitter buffer (nominal) delay + encoder serialization delay)

  • The jitter buffer can be considered as a time window with early edge aligned with the delay corresponding to the earliest arriving packet and late edge representing the maximum permissible delay before a late arriving packet would be discarded. The delay applied to packets that arrive at their expected time is known as the Nominal Delay and this is equivalent to the late edge.

  • The reference for the expected arrival time may, for example, be the first packet in the session or the running average delay. If all packets arrived at their expected arrival time then then every packet would be held in the jitter buffer exactly the Nominal Delay.

  • The Jitter Buffer maximum delay is the delay that is applied to an earliest arriving packet that is not discarded and corresponds to the early edge of the jitter buffer time window.

  • 需要一个抖动缓冲区来吸收媒体数据包网络传递中的延迟变化。抖动缓冲区的工作原理是,在接收到媒体数据并将其播放之前,将媒体数据保留一段时间。提早到达的数据包将在抖动缓冲区中保留的时间更长。如果数据包到达时间太早,如果没有可用的抖动缓冲区空间,则可能会将其丢弃。如果数据包被网络过度延迟,则如果错过了播出时间,则可能会将其丢弃。

  • 用户总感知延迟=网络往返延迟+本地(抖动缓冲区(标称)延迟+编码器序列化延迟)+远程(抖动缓冲区(标称)延迟+编码器序列化延迟)

  • 抖动缓冲器可以被认为是一个时间窗口,其早边缘与对应于最早到达的分组的延迟对齐,而后边缘表示在丢弃迟到达的分组之前的最大允许延迟。应用于到达其预期时间的数据包的延迟称为标称延迟,它等同于后期边缘。

  • 预期到达时间的参考可以是例如会话中的第一个数据包或运行平均延迟。如果所有数据包都已到达其预期的到达时间,则每个数据包将准确地保持在抖动缓冲器中的标称延迟中。

  • 抖动缓冲器最大延迟是应用于未丢弃的最早到达的数据包的延迟,它对应于抖动缓冲器时间窗口的早期边缘。

Idealized Jitter Buffer

  • 理想化的抖动缓冲区
  • 在实践中,抖动缓冲区的实现方式相差很大,但是应该在概念上与理想化的抖动缓冲区相一致,如下所述
(i). Receive the first packet and delay playout by D ms. 
Keep the RTP timestamp and receive time as a reference.

RTP TS[1]

receive time[1]

Assume that both are normalized in ticks.
(ii). Receive the next packet
(iii). Calculate r = RTP TS[n] - RTP TS[1] and t = receive time[n] - receive time[1]. If r = t then the packet arrived on time. If r < t then the packet arrived late and if r > t then the packet arrived early.
(iv). Delay playout of packet by D + (r -t)
(v). Go back to (ii)
  • 1
    接收第一个数据包并将播放延迟 D ms。
    保留RTP时间戳并接收时间作为参考。
    第一个包的时间戳 RTP TS[1]
    第一个包的接收时间 receive time[1]

  • 2
    假设两者都以刻度为单位进行了标准化。
    (ii) 收到来下一个包 n
    (iii) 计算 时间戳抖动值 r = RTP TS[n] - RTP TS[1]
    接受时间抖动值 t = receive time[n] - receive time[1]
    如果 r = t ,那么认为这个包按时到达了。
    如果 r < t ,那么这个包就来晚了。
    如果r > t ,那么这个包就来早了。
    (IV)
    将数据包的播出延迟 计算为 D +(r -t)
    (V) 回到 (ii)

  • 请注意,此理想化的实现假设发送方的RTP时钟与接收方的时钟同步,该时钟用于为数据包到达打上
    时间戳。如果没有这种固有的同步,则系统可能需要使用自适应抖动缓冲区或其他技术来确保可靠的接收。

Fixed Jitter Buffer 固定抖动缓冲器

  • 固定的抖动缓冲区具有固定的大小,数据包离开抖动缓冲区时,就有了恒定的延迟。

Adaptive Jitter Buffer 自适应抖动缓冲器

  • An adaptive jitter buffer have variable size and variable delay. It allows the nominal delay to be set to a low value initially, to minimize user perceived delay, however can automatically extend the late edge (and possibly also retract 缩回the early edge) of buffer window if a significant proportion of packets are arriving late (and hence being discarded).
  • 自适应抖动缓冲器具有可变的大小和可变的延迟。它允许最初将标称延迟设置为一个较低的值,以最大程度地减少用户感知的延迟,但是,如果有很大一部分数据包延迟到达并因此而被丢弃,则可以自动扩展缓冲区窗口的后沿,并可能还撤回前沿。

Jitter Buffer Metrics Block 抖动缓冲区指标块

  • This block describes the configuration and operating parameters of the jitter buffer in the receiver of the RTP end system or RTP mixer which sends the report. Instances of this Metrics Block refer by SSRC to the separate auxiliary Measurement Information block [RFC6776] which describes the measurement interval in use. This Metrics Block relies on the measurement interval in the Measurement Information block indicating the span of the report and should be sent in the same compound RTCP packet as the measurement information block. If the measurement interval is not received in the same compound RTCP packet as this Metrics Block, this Metrics Block should be discarded.
  • 此块描述了发送报告的RTP终端系统或RTP混合器的接收器中抖动缓冲区的配置和操作参数。 SSRC将此度量标准块的实例引用到单独的辅助测量信息块[RFC6776],它描述了正在使用的测量间隔。该 Metrics Block度量模块依赖于指示报告跨度的“测量信息”模块中的测量间隔,并且应在与测量信息模块相同的复合RTCP数据包中发送。如果未在与此度量标准块相同的复合RTCP数据包中接收到测量间隔,则应丢弃此度量标准块。

Report Block Structure

jitter buffer nominal delay (JB nominal): 16 bits

  • This is the current nominal jitter buffer delay in milliseconds, which corresponds to the nominal jitter buffer delay for packets that arrive exactly on time. It is calculated based on the time spend in the jitter buffer for the packet that arrives exactly on time. This parameter MUST be provided for both fixed and adaptive jitter buffer implementations.

If the measured value exceeds 0xFFFD, the value 0xFFFE MUST be reported to indicate an over-range measurement. If the measurement is unavailable, the value 0xFFFF MUST be reported.

这是当前的标称抖动缓冲延迟(以毫秒为单位),它对应于准时到达的数据包的标称抖动缓冲延迟。它是根据在抖动缓冲区中为准时到达的数据包所花费的时间计算的。必须为固定和自适应抖动缓冲器实现提供此参数。

如果测量值超过0xFFFD,则必须报告0xFFFE值以指示超量程测量。如果测量不可用,则必须报告值0xFFFF。
如果测量值超过0xFFFD,则必须报告0xFFFE值以指示超量程测量。如果测量不可用,则必须报告值0xFFFF。

jitter buffer maximum delay (JB maximum): 16 bits

This is the current maximum jitter buffer delay in milliseconds which corresponds to the earliest arriving packet that would not be discarded. It is calculated based on the time spent in the jitter buffer for the earliest arriving packet In simple queue implementations this may correspond to the size of the jitter buffer. In adaptive jitter buffer implementations, this value may vary dynamically. This parameter MUST be provided for both fixed and adaptive jitter buffer implementations.

If the measured value exceeds 0xFFFD, the value 0xFFFE MUST be reported to indicate an over-range measurement. If the measurement is unavailable, the value 0xFFFF MUST be reported.

jitter buffer high water mark (JB high water mark): 16 bits

This is the highest value of the jitter buffer nominal delay in milliseconds which occurred at any time during the reporting interval. This parameter MUST be provided for adaptive jitter buffer implementations and its value MUST be set to JB maximum for fixed jitter buffer implementations.

If the measured value exceeds 0xFFFD, the value 0xFFFE MUST be reported to indicate an over-range measurement. If the measurement is unavailable, the value 0xFFFF MUST be reported.

jitter buffer low water mark (JB low water mark): 16 bits

This is the lowest value of the jitter buffer nominal delay in milliseconds which occurred at any time during the reporting interval. This parameter MUST be provided for adaptive jitter buffer implementations and its value MUST be set to JB maximum for fixed jitter buffer implementations.

If the measured value exceeds 0xFFFD, the value 0xFFFE MUST be reported to indicate an over-range measurement. If the measurement is unavailable, the value 0xFFFF MUST be reported.

发布了664 篇原创文章 · 获赞 55 · 访问量 217万+

猜你喜欢

转载自blog.csdn.net/commshare/article/details/103294245