[FFmpeg-devel] [PATCH] lavfi: add duration field to AVFilterBufferRef

Michael Niedermayer michaelni at gmx.at
Sun Aug 26 05:22:39 CEST 2012


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:
> [...]
> > So my proposal is to extend AVFrame with a duration field, expressed
> > as a number of units in the assumed time_base, and accepting the value
> > 0, and unspecified is AV_PTS_NOVALUE.
> 
> See attached patch.
> 
> Note that this approach has the following inconvenients: we could miss
> the AVFrame.duration information but only pkt_duration, so we need to
> decide which priority to assign to each field (and remember that
> they're expressed in different time bases and with different
> "undefined" semantic).
> 
> The logic to apply thus could be:
> - check if AVFrame.duration is defined, and convert it to the target TB
> - otherwise check if AVFrame.pkt_duration is defined, and convert it to the target TB
> - otherwise return the undefined value
> 
> I'm not sure if we should rely on the AVFrame.pkt_duration for audio
> frames (for example in case there is more than one frame per packet).
> 
> In the long term, we may consider to change the undefined value for
> AVFrame.pkt_duration (and pkt.duration) from 0 to AV_NOPTS_VALUE for
> better consistency.
> -- 
> FFmpeg = Fundamental and Fundamental Marvellous Programmable Ecumenical Genius

>  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

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120826/c172df0d/attachment.asc>


More information about the ffmpeg-devel mailing list