[FFmpeg-devel] [RFC] Add duration info to AVFrame

Stefano Sabatini stefasab at gmail.com
Tue Jun 5 18:48:41 CEST 2012


On date Friday 2012-06-01 14:10:35 +0200, Michael Niedermayer encoded:
> On Fri, Jun 01, 2012 at 11:14:04AM +0200, Stefano Sabatini wrote:
> > On date Thursday 2012-03-08 15:50:21 +0100, Stefano Sabatini encoded:
> > > Hi,
> > > 
> > > the feature would be useful for different purposes, especially for
> > > normalization/correction timestamp filters (e.g. setpts).
> > > 
> > > Different approaches:
> > > 
> > > 1. I could export pkt_duration in AVFrame, like it is done with
> > >    pkt_pts, duration is expressed in stream time_base units.
> > > 
> > >    This alone is not sufficient, because to decode pkt* things we need
> > >    to reference the AVStream, which is not always available.
> > > 
> > > 2. I create a duration field in AVFrame, with no specified timebase,
> > >    which is done for passing the duration information between
> > >    different layers (e.g. lavc -> lavfi -> lavc), similar to what we
> > >    did for pts.
> > >    Then I could add a time_base unit in AVFrame, which is used for
> > >    specifying the PTS and duration timebase.
> > > 
> > > 3. a combination of 1/2
> > > 
> > > Comments are welcome.
> > 
> > Done like 1.
> > 
> > Problems: 
> > * as mentioned, pkt_pts alone can't be interpreted if there is no
> >   reference to the stream timebase.
> 
> > * it is not possible to distinguish between duration=0 and
> >   duration=unknown, because 0 == unknown, which depends on how
> >   duration is defined in AVPacket.
> >   Otherwise: would it make sense to change the semantics in AVPacket
> >   (unknown=-1)?
> 
> when/where does something have a duration of 0 ?
> 
> the patch LGTM

Applied.
-- 
FFmpeg = Funny and Fanciful Maxi Portentous Erroneous Gladiator


More information about the ffmpeg-devel mailing list