[FFmpeg-devel] [PATCH] Handle G.722 in RTP (both muxer and demuxer)

Martin Storsjö martin
Sat Sep 11 21:36:26 CEST 2010


Hi,

The attached patch adds support for G.722 in RTP, both in the muxer and in 
the RTSP/SDP demuxers.

In principle, all of this should be straightforward, but there's one 
weirdness, according to RFC 3551:

   Even though the actual sampling rate for G.722 audio is 16,000 Hz,
   the RTP clock rate for the G722 payload format is 8,000 Hz because
   that value was erroneously assigned in RFC 1890 and must remain
   unchanged for backward compatibility.  The octet rate or sample-pair
   rate is 8,000 Hz.

So all cases that do the normal mapping between AVStream->time_base and 
AVCodecContext->sample_rate to the stream clock rate as written in the SDP 
need exceptions for this. All of this is taken care of in the attached 
patch - the rate written into the SDP and set into AVStream->time_base is 
8000, while AVCodecContext->sample_rate is set to 16000. Does it seem ok 
to you?

// Martin



More information about the ffmpeg-devel mailing list