[FFmpeg-devel] [PATCH] RTP Timestamps

Luca Abeni lucabe72
Mon Sep 3 11:28:10 CEST 2007


Hi all,

here are 2 patches for properly (I hope :) setting RTP and RTCP timestamps.

The first patch (fix_rtcp_ts.diff) fixes the generation of RTCP SR 
packets. According to the RFC, such packets must contain an "RTP 
timestamp" and an "NTP timestamp": such timestamps must indicate the 
same time, in different time scales, and are used for mapping RTP 
timestamps into usable times. Moreover, such timestamps must indicate 
the time when the RTCP packet is sent. The current code is sending two 
different times, based on the RTP timestamp of the last sent packets.
So, I changed it to use av_gettime() for the NTP timestamp, and to 
convert it into the proper RTP timestamp. This needed to properly set 
the stream time base, so that the "90Khz timestamp" assumption is not 
hardcoded anymore.
I performed various tests, and nothing seems to be broken by this patch 
(I also tested PCM streaming, which uses a different time base).

The second patch (use_correct_rtp_ts.diff) sets RTP timestamps based on 
the packet PTSs (as requested by the RFC, I think) instead of computing 
them "by hand" in the RTP code. To do so, I changed the streams PTSs to 
be 32 bit, so that they can be directly used in RTP packets.


			Thanks,
				Luca
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix_rtcp_ts.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070903/ee508e28/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: use_correct_rtp_ts.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070903/ee508e28/attachment.txt>



More information about the ffmpeg-devel mailing list