rtp&&rtcp整理的小知识点

本文详细解析了RTP(实时传输协议)和RTCP(实时传输控制协议)的工作原理及交互过程,包括如何通过RTP同步音频包并转换编码以适应低带宽链接,以及RTCP中的不同报文类型及其作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1, RTP

1.1

 Thismixer resynchronizes incoming audio packets to

  reconstruct the constant 20 ms spacing generated by the sender, mixes

  these reconstructed audio streams into a single stream, translates

  the audio encoding to a lower-bandwidth one and forwards the lower-

  bandwidth packet stream across the low-speed link.

 

所以,目测,可以使用timestamp(采样个数) *( 1/20ms ) 得到采样率 

 但是仅针对audio

 

2 RTCP

2.1

         每个rtcp包都一定有SDES  因为必须要有CNAME

2.2

SR:   Sender report, for transmission andreception statistics from

        participants that are active senders

 

  RR:   Receiver report, forreception statistics from participants

        that are not active senders and in combination with SR for

        active senders reporting on more than 31 sources

 

  SDES: Source description items, including CNAME

 

  BYE:  Indicates end ofparticipation

 

  APP:  Application-specificfunctions

 

2.3 RTCP中多个source

个人理解,RTCP中的ssrc是和rtp的ssrc是一样的,但是包里面可以有多个source (比如SR包),而且,每个source第一个属性 identify也是rtp ssrc, 又因为rtp中是可以有多个csrc (贡献源,在组合的时候用的),所以个人猜测,rtcp的多个source 对应于rtp的多个csrc,(当然如果只有一个,那就直接是rtp了),identify就是多个csrc的ssrc.

 

 

 

2.4 RTP  RTCP ssrc 图

 

9.99:13628 --------à 9.31:15672   RTP ssrc : 7217

9.31:15672 --------à9.99:13628    RTP ssrc : 6587

 

 

9.99:13629 ------à9.31:15673

SR/RR: ssrc 7217  (和rtp的一样)

         Identifier:6587 (和对面的rtp一样)

SDES : ssrc 7217

 

反过来就反一下

 

所以,rtcp的ssrc 是和rtp的一样,不管是SR, RR, SDES都是一样的,source中的identity 是对面的rtp的ssrc

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值