[FFmpeg-devel] [RFC] Synchronize the start times of multiple RTP streams

Ronald S. Bultje rsbultje
Fri Apr 2 15:55:13 CEST 2010


Hi,

On Mon, Mar 29, 2010 at 3:14 AM, Martin Storsj? <martin at martin.st> wrote:
> On Sun, 28 Mar 2010, Ronald S. Bultje wrote:
>> What's more worrying is that I think this shouldn't be needed. There's
>> several functions in utils.c that do this automatically (no action
>> needed), but they don't work because of overflows because of the crazy
>> randomness in starttime here. We should fix (imo) that, rather than
>> trying to workaround it in the RTSP demuxer...
>
> Ok, if the rest of lavf is supposed to take care of this, then this indeed
> is redundant.

I'm starting to believe I was wrong here, also because my earlier
patch broken RTSP seeking. utils.c works based on
AVStream->start_time, rebasing it to a global timebase, and then
setting AVFormatContext->start_time to that. We set (I think validly)
these AVStream->start_time values to the range: value in the SDP,
which has no relation to RTP header timestamps. :-(. That's why it all
doesn't work the way it should.

I think we should revive your patch, with some fixes:
- we should test/verify it fixes seeking (in ffplay)
- I'm not quite sure why you do this under if (ret < 0), I think that
if can be removed, and in fact I'm wondering if you should only use it
if ret == 0/1 (?)
- for many streams, the first RTCP packet only comes after a bunch of
RTP packets. We want to make sure that after parsing, when they can be
assigned a timestamp, this doesn't get < 0

Ronald



More information about the ffmpeg-devel mailing list