[FFmpeg-devel] [PATCH] fix start time with delay

Michael Niedermayer michaelni
Fri Nov 26 00:32:55 CET 2010


On Thu, Nov 25, 2010 at 03:20:35PM -0800, Baptiste Coudurier wrote:
> On 11/25/10 3:16 PM, Michael Niedermayer wrote:
> > On Wed, Nov 24, 2010 at 06:29:29PM -0800, Baptiste Coudurier wrote:
> >> Hi guys,
> >>
> >> $subject.
> >>
> >> This happens if the first I frame is delayed and the following frames
> >> are decodable and reordered.
> >>
> >> -- 
> >> Baptiste COUDURIER
> >> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> >> FFmpeg maintainer                                  http://www.ffmpeg.org
> > 
> >>  utils.c |    2 ++
> >>  1 file changed, 2 insertions(+)
> >> 8ea30827f607b6af0ffafaa87a573895ef8b18d8  fix_start_time_with_delay.patch
> >> Index: libavformat/utils.c
> >> ===================================================================
> >> --- libavformat/utils.c	(revision 25824)
> >> +++ libavformat/utils.c	(working copy)
> >> @@ -1045,6 +1045,8 @@
> >>          if(st->codec->codec_id == CODEC_ID_H264){ //we skiped it above so we try here
> >>              update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts); // this should happen on the first packet
> >>          }
> >> +        if (pkt->pts < st->start_time)
> >> +            st->start_time = pkt->pts;
> > 
> > This breaks with timestamp discontinuities as well as with timestamp wrap
> > around
> 
> What do you suggest ?

* limit this to the first 10 or so frames
* consider pts and pts+(1<<bits) and use the one that is closer to the start_time
  for the comparission and for setting

also changes to update_initial_timestamps() might be needed too

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101126/c34ca97c/attachment.pgp>



More information about the ffmpeg-devel mailing list