[FFmpeg-devel] RTP PCM_MULAW packet size

Georges-Etienne Legendre legege
Wed Feb 18 23:48:12 CET 2009


Hi,

The RTP format allows to set the packet size with the pkt_size  
parameter (in the URL). In the rtpenc.c file, when the function  
rtp_write_packet is called (or other more specialized function like  
rtp_send_samples), this packet size parameter is taken into account.

The problem with this approach, at least for PCM MULAW, is that RTP  
packets are sent without respecting the -re parameter. That's because  
final RTP packet size is driven in the rtpenc.c file, and not before.  
The other problem is that small packets are generated.

Here is an example for PCM MULAW:

--------- Situation #1 ---------
In that situation, if the -re option is used, RTP packets are sent  
only when needed.

Without the pkt_size set:
1. RTP packet size = 588 (including header), 576 bytes of payload
2. RTP packet size = 588 (including header), 576 bytes of payload

--------- Situation #2 ---------
In that situation, if the -re option is used, RTP packets are sent in  
block.

With pkt_size set to 92 (rtp://localhost:5000?pkt_size=92):
Only one call to rtp_send_samples, the split is performed here
1.1. RTP packet size = 92, 80 bytes of payload
1.2. RTP packet size = 92, 80 bytes of payload
1.3. RTP packet size = 92, 80 bytes of payload
1.4. RTP packet size = 92, 80 bytes of payload
1.5. RTP packet size = 92, 80 bytes of payload
1.6. RTP packet size = 92, 80 bytes of payload
1.7. RTP packet size = 92, 80 bytes of payload
1.8. RTP packet size = 28, 16 bytes of payload

2.1. RTP packet size = 92, 80 bytes of payload
2.2. RTP packet size = 92, 80 bytes of payload
2.3. RTP packet size = 92, 80 bytes of payload
2.4. RTP packet size = 92, 80 bytes of payload
2.5. RTP packet size = 92, 80 bytes of payload
2.6. RTP packet size = 92, 80 bytes of payload
2.7. RTP packet size = 92, 80 bytes of payload
2.8. RTP packet size = 28, 16 bytes of payload

------

I'm trying to figure out where in the code the size is really enforced  
(where before the call to rtp_write_packet).

For my use case, I need to send RTP packets with 80 bytes of payload,  
at their respective rate (not in block).

Thanks,
-- 
Georges-Etienne Legendre





More information about the ffmpeg-devel mailing list