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

Martin Storsjö martin
Sat Sep 11 21:39:15 CEST 2010

On Sat, 11 Sep 2010, Martin Storsj? wrote:

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

Agh, this time with the patch actually attached, too...

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Handle-G722-in-RTP-and-all-the-exceptions-due-to-RFC.patch
Type: text/x-diff
Size: 4958 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100911/4f2a1560/attachment.patch>

More information about the ffmpeg-devel mailing list