[FFmpeg-devel] [PATCH] Pass VBV delay to the calling application via ctx

Michael Niedermayer michaelni
Tue Feb 8 15:55:05 CET 2011


On Tue, Feb 08, 2011 at 03:12:34PM +0100, Christophe Massiot wrote:
> VBV delay is useful for T-STD compliance in some TS muxers. It is
> certainly possible to retrieve it by parsing the output of FFmpeg, but
> getting it from the context makes it simpler and less error-prone.
> ---
>  doc/APIchanges             |    3 +++
>  libavcodec/avcodec.h       |    9 ++++++++-
>  libavcodec/mpegvideo_enc.c |    1 +
>  3 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index b44182d..05e15bf 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,9 @@ libavutil:   2009-03-08
>  
>  API changes, most recent first:
>  
> +2011-02-08 - X - lavc 52.110.0 - vbv_delay
> +  Add vbv_delay field to AVCodecContext
> +
>  2011-02-06 - fe174fc - lavf 52.97.0 - avio.h
>    Add flag for non-blocking protocols: URL_FLAG_NONBLOCK
>  
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index f96ae84..05fa743 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -32,7 +32,7 @@
>  #include "libavutil/cpu.h"
>  
>  #define LIBAVCODEC_VERSION_MAJOR 52
> -#define LIBAVCODEC_VERSION_MINOR 109
> +#define LIBAVCODEC_VERSION_MINOR 110
>  #define LIBAVCODEC_VERSION_MICRO  0
>  
>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> @@ -2843,6 +2843,13 @@ typedef struct AVCodecContext {
>      int64_t pts_correction_last_pts;       /// PTS of the last frame
>      int64_t pts_correction_last_dts;       /// DTS of the last frame
>  
> +    /**
> +     * VBV delay coded in the last frame (in seconds).
> +     * Used for compliant TS muxing.
> +     * - encoding: Set by libavcodec.
> +     * - decoding: unused.
> +     */
> +    double vbv_delay;
>  } AVCodecContext;

I would prefer an int or int64_t in 27mhz clock, that can represent
90khz, 27mhz and microseconds exactly. But more important it can be used in
regression tests

also a Xbit int is more precisse than a Xbit float with reasonable scale as int
doesnt waste bits on a exponent that is always within a similar range

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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- 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/20110208/1fa809f2/attachment.pgp>



More information about the ffmpeg-devel mailing list