Native RTP vs MPEG-2 Transport Stream

本文分析了不同音视频传输协议的头部开销,对比了RTP/UDP/IP、TS/RTP/UDP/IP及TS/UDP/IP等协议的效率。通过具体计算说明了视频和音频在各协议下的开销占比,并探讨了这些开销对于带宽的影响。

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

Packetization

Bytes in Header

IP

20

UDP

8

RTP

12

TS

4

PES

8, 131


For 7 TS packets carried over UDP, there are 7*4 (TS) + 8 (UDP) + 20 (IP) = 56 bytes ofheader. For 7 TS packets carried over RTP/UDP there are 7*4 (TS) + 12 (RTP) + 8 (UDP) +20 (IP) = 68 bytes. For TS, the overhead consists of not just the transport packet headers,but also the PES headers and the bytes used to pad TS packets that carry the end of thePES packet. However, these are hard to enumerate, since they depend on the size of thePES packet.

For native RTP, the header size is 12 (RTP) + 8 (UDP) + 20 (IP) = 40 bytes.

Thus, video using TS/UDP/IP requires 56 bytes, which is 40% more header, while videousing TS/RTP/UDP/IP requires 68 bytes, which is 70% more header than native RTP, at 40bytes. This calculation ignores the PES and adaptation field sizes, because these are notregularly distributed amongst the TS packets.

While the savings in header size for video are significant, they are still relatively smallcompared to the overall packet size. Seven TS packets form a payload of 7 x 184 = 1288bytes, so the header represents just 56/1288 = 4.3% for TS/UDP/IP or 68/1288 = 5.2% ofthe payload for TS/RTP/UDP/IP. Overall, the 28 byte difference in header size betweenTS/RTP/UDP/IP and native RTP is just 2% of the payload. Nevertheless, the extra headerbytes are a waste of bandwidth.

For audio carried over native RTP, where multiple frames are carried in the payload, there isan additional (approximately) 2 byte header per frame, as well as a fixed 2 byte header-length per packet. In this case the header length is (approximately) 2 (audio frame header-length) + 7*2 (audio frame header) + 12 (RTP) + 8 (UDP) + 20 (IP) = 56 bytes. For audiocarried over TS, a 7 byte “ADTS” header needs to be prepended to each audio frame, givingapproximately 7*7 = 49 extra bytes of header for a total of 105 or 117 bytes (for TS/UDP/IPand TS/RTP/UDP/IP respectively).

Thus, header size in the case of transmission of audio over native RTP is half the size of theheader in the case of TS/UDP/IP or TS/RTP/UDP/IP. It represents 4.3% of the payload inRTP/UDP/IP, 9% in TS/RTP/UDP/IP and 8.1% in TS/UDP/IP. 



Overhead

RTP/UDP/IP

TS/RTP/UDP/IP

TS/UDP/IP

Video

2%

5.2%

4.3%

Audio

4.3%

9%

8.1%

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值