什么决定了RTP包的长度?

我已经build立了两个客户端之间的SIP会话。 我在wireshark上观察他们之间的RTP踪迹。 对于从客户端1stream向客户端2的RTP分组,“长度”列具有172的值,对于从客户端2stream向客户端1的分组具有值252.客户端1和客户端2是不同的公司。 客户端1在64位Ubuntu 12.10上运行,客户端2在Ubuntu 10.04上运行。 我想知道什么决定了RTP包的长度。

我不能给你任何具体的细节,因为正如我在笔记中所说的那样,它取决于很多因素(包括编解码器,抑制沉默的存在和采样率),但是如果你想要一些地方开始,看看RFC3551

这里有几条相关的话题:

A G729 RTP packet may consist of zero or more G.729 or G.729 Annex A frames, followed by zero or one G.729 Annex B frames. The presence of a comfort noise frame can be deduced from the length of the RTP payload. The default packetization interval is 20 ms (two frames), but in some situations it may be desirable to send 10 ms packets.

The RTP timestamp clock rate is always 90,000, independent of the sampling rate. MPEG-1 audio supports sampling rates of 32, 44.1, and 48 kHz (ISO/IEC 11172-3, section 1.1; "Scope"). MPEG-2 supports sampling rates of 16, 22.05 and 24 kHz. The number of samples per frame is fixed, but the frame size will vary with the sampling rate and bit rate.

看一下这篇文章可以提供一些答案:

分组化对VoIP性能的影响