Learn about it:
In terms of voice, how does one calculate the bandwidth consumed by codec?
By default, after the analog voice is converted to a digital voice, it is cut in 20 ms segments for 20 ms segments, encapsulated with RTP, and then wrapped with UDP header, IP header, finally, the packet header of Layer 2 is sent out.
Suppose we use g.729 encoding and transmit it over Ethernet. Calculate the bandwidth required for a single voice.
G.729 the conversion starts when each voice is 8 kbit/s.
1000 bps/8 = 1000 bytes/s, get g.729 bandwidth bytes per second
By default, No 20 ms of voice is encapsulated into a packet, so you can calculate the number of packages sent within one period.
1 S/20 Ms = 50
That is to say, g.729 requires a bandwidth
1000 bytes/S/50 = 20 Bytes/s
Next, the Ethernet frame header is 6-byte, the IP packet header is 20-byte, The UDP packet header is 8-byte, And the RTP packet header is 12-byte.
In this way, the payload of g.729 is 20 bytes.
That is to say, a 6 + 20 + 8 + 12 + 20 = 66-byte frame is generated every 20 ms.
Then 50 66-byte will be sent in one second, which is equal to 3300-byte and converted to kbit/s.
3300 byte/S * 8/1000 = 26.4 kbit/s
Finally, the bandwidth occupied by g.729 voice (including Layer2 header) is 26.4 kbps.
From: http://blog.csdn.net/force_eagle/archive/2007/10/22/1836423.aspx