[FFmpeg-cvslog] r15015 - trunk/libavformat/utils.c

Diep Ho DHo
Wed Sep 3 10:33:01 CEST 2008


> -----Original Message-----
> From: ffmpeg-cvslog-bounces at mplayerhq.hu [mailto:ffmpeg-cvslog-
> bounces at mplayerhq.hu] On Behalf Of Michael Niedermayer
> Sent: mercredi 3 septembre 2008 1:24
> To: FFmpeg Subversion commit log and discussion
> Subject: Re: [FFmpeg-cvslog] r15015 - trunk/libavformat/utils.c
> 
> On Mon, Sep 01, 2008 at 02:29:08PM +0200, Diep Ho wrote:
> > > -----Original Message-----
> > > From: ffmpeg-cvslog-bounces at mplayerhq.hu [mailto:ffmpeg-cvslog-
> > > bounces at mplayerhq.hu] On Behalf Of Michael Niedermayer
> > > Sent: vendredi 29 ao?t 2008 20:32
> > > To: FFmpeg Subversion commit log and discussion
> > > Subject: Re: [FFmpeg-cvslog] r15015 - trunk/libavformat/utils.c
> > >
> > > On Fri, Aug 29, 2008 at 11:15:24AM -0700, Baptiste Coudurier wrote:
> > > > Hi Michael,
> > > >
> > > > michael wrote:
> > > > > Author: michael
> > > > > Date: Fri Aug 29 03:43:27 2008
> > > > > New Revision: 15015
> > > > >
> > > > > Log:
> > > > > Do not truncate timestamps before the muxer as it makes simple
> > > > > things like last_pts - pts rather tricky and is not good for
> > > anything.
> > > > > Timestamps should be truncated just before storing when needed.
> > > > >
> > > >
> > > > Nice I had the same idea.
> > > >
> > > > > Modified:
> > > > >    trunk/libavformat/utils.c
> > > > >
> > > > > Modified: trunk/libavformat/utils.c
> > > > >
> > >
> ====================================================================
> > > ===
> > > =======
> > > > > --- trunk/libavformat/utils.c	(original)
> > > > > +++ trunk/libavformat/utils.c	Fri Aug 29 03:43:27 2008
> > > > > @@ -2574,18 +2574,6 @@ static int compute_pkt_fields2(AVStream
> > > > >      return 0;
> > > > >  }
> > > > >
> > > > > -static void truncate_ts(AVStream *st, AVPacket *pkt){
> > > > > -    int64_t pts_mask = (2LL << (st->pts_wrap_bits-1)) - 1;
> > > > > -
> > > >
> > > > 'pts_wrap_bits field' is now useless I think. Should we remove it
> ?
> > >
> > > I think it still used by the demuxer side.
> >
> > It should be used by the demuxer. But the 33-bit mpeg wrap-over has
> not been treated properly, resulting in non-monotone timestamps when
> timestamps jump from large values of about 2^33 to almost 0.
> 
> Either i do not understand you or you do not understand the code

In bref, MPES PS saves files with 33-bit timestamps. When reading a file containing both timestamps < 2^33 and "timestamps > 2^33" (even we see only the lower 33 bits), the chosen behavior of ffmpeg is to return the truncated timestamps. It should be nice to return the continuous timestamps at least WITHIN these particular files. The internal 64bit timestamps and also the pts_wrap_bits used in truncating timestamps when writing to MPEG-PS file could be used for this particular issue. 

Sorry to be too bref. You have already show your point for this problem (see bug issue 516). I just to take this occasion to resurface this again. 

DHO




More information about the ffmpeg-cvslog mailing list