[FFmpeg-devel] [PATCH] lavc: add duration field to AVFrame

Stefano Sabatini stefasab at gmail.com
Thu Sep 13 11:36:23 CEST 2012


On date Tuesday 2012-09-11 22:45:33 +0200, Stefano Sabatini encoded:
> On date Tuesday 2012-09-04 14:13:07 +0200, Stefano Sabatini encoded:
> > On date Sunday 2012-08-26 05:22:39 +0200, Michael Niedermayer encoded:
> > > On Thu, Aug 02, 2012 at 05:32:23PM +0200, Stefano Sabatini wrote:
> > > > On date Thursday 2012-08-02 12:17:48 +0200, Stefano Sabatini encoded:
> > > >  avcodec.h |   12 ++++++++++++
> > > >  utils.c   |    5 +++++
> > > >  2 files changed, 17 insertions(+)
> > > > 91ac00288f8063d65db98fed503f2c73850956a6  0006-lavc-add-duration-field-to-AVFrame.patch
> > > > From dffa5ba28c9c9d9510bcfbe8bcb576e895e59c2e Mon Sep 17 00:00:00 2001
> > > > From: Stefano Sabatini <stefasab at gmail.com>
> > > > Date: Thu, 2 Aug 2012 13:12:28 +0200
> > > > Subject: [PATCH] lavc: add duration field to AVFrame
> > > 
> > > LGTM
> > 
> > The main problem I see with this patch, is that the
> > avcodec_decode_video2() can't set this value in a sane value (assuming
> > pkt_duration if not specified and rescaling), since the pkt/stream
> > time base is not known at the decoder level.
> > 
> > With audio this is not a problem, since we can deduce the frame
> > duration from the number of samples.
> > 
> > As a consequence, if frame.duration is not set by the video decoder,
> > the only possible way to set it, it is to do that at the application
> > level, which I'd like to avoid.
> > 
> > Other possible solutions:
> 

> > - set the stream/packet timebase in the decoder context

This is already implemented.

Patch updated.
-- 
FFmpeg = Funny and Furious Mind-dumbing Pitiless Elastic Generator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavc-add-duration-field-to-AVFrame.patch
Type: text/x-diff
Size: 3849 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120913/26c5c6b3/attachment.bin>


More information about the ffmpeg-devel mailing list