[FFmpeg-devel] RTP PCM_MULAW packet size

Luca Abeni lucabe72
Thu Feb 19 09:20:19 CET 2009


Georges-Etienne Legendre wrote:
> 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.

Note that "-re" has nothing to do with the packet size or with the
output bitrate: "-re" only ensures that frames are read, encoded,
and sent at the correct frame rate (so, if your sample rate is for
example 44100 samples per second ffmpeg will send out about 44100
encoded samples per second).

> 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.

Looking at your example, it seems to me that what you really want is
to use smaller frame sizes.
I mean: ffmpeg is probably generating frames of about 580 bytes.
Every time a frame is written, rtp_write_packet() sends it out
immediately (independently on the packet size). If you want a
different behaviour, you have to somehow ask ffmpeg to generate
smaller frames.


More information about the ffmpeg-devel mailing list