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

Måns Rullgård mans
Fri Feb 11 15:40:30 CET 2011


Christophe Massiot <massiot at via.ecp.fr> writes:

> 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.
>
> This version exports a uint64_t based on the periods of a 27 MHz clock.
> ---
>  doc/APIchanges             |    3 +++
>  libavcodec/avcodec.h       |    7 +++++++
>  libavcodec/mpegvideo_enc.c |    1 +
>  3 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index e7cd1c1..7a4957c 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,9 @@ libavutil:   2009-03-08
>
>  API changes, most recent first:
>
> +2011-02-10 - xxxxxxx - lavc 52.110.0 - vbv_delay
> +  Add vbv_delay field to AVCodecContext
> +
>  2011-02-08 - xxxxxxx - lavf 52.98.0 - av_probe_input_buffer
>    Add av_probe_input_buffer() to avformat.h for probing format from a
>    ByteIOContext.
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 09f0a12..5b33427 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2845,6 +2845,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 periods of a 27 MHz clock).
> +     * Used for compliant TS muxing.
> +     * - encoding: Set by libavcodec.
> +     * - decoding: unused.
> +     */
> +    uint64_t vbv_delay;
>  } AVCodecContext;

No objections from me.

That said, the encoding functions should be changed to output AVPackets
where this value can be added.  However, that is a major change and
should not hold up this patch.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list