[FFmpeg-devel] Howto flush encoder on closing?

Diego Biurrun diego
Wed Jan 21 12:08:02 CET 2009


On Wed, Jan 21, 2009 at 08:55:12AM +0100, Bitbreaker/METALVOTZE wrote:
> WHAAA, wrong patch :-) Here is the right one.
> 
> --- libavcodec/avcodec.h	(Revision 16683)
> +++ libavcodec/avcodec.h	(Arbeitskopie)
> @@ -520,8 +526,9 @@
>  /**
> - * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
> - * If this is not set, the codec is guaranteed to never be fed with NULL data.
> + * If set, the codec expects to be fed with NULL data after the last input frame, until it returns a zero size.
> + * Thus the codec is able to flush remaining delayed frames from its buffers.

Please keep lines below 80 characters.

> + * If not set, the codec always must be fed with valid data, as no precautions are taken on codec side.

must always

> @@ -2851,7 +2858,11 @@
>   * \p pict. To encode it, it makes use of the video codec which was coupled with
>   * \p avctx using avcodec_open(). The resulting encoded bytes representing the
>   * frame are stored in the output buffer \p buf. The input picture should be
> - * stored using a specific format, namely \c avctx.pix_fmt.
> + * stored using a specific format, namely \c avctx.pix_fmt. It must not be NULL
> + * unless specified else (see CODEC_CAP_DELAY), as usually there are no precautions

elsewhere

> + * taken on codec side.

the codec side

> + * Please also take into account that codec capabilities may request a different
> + * handling and result evaluation of this function (for e.g. see CODEC_CAP_DELAY).

Uh?

Diego




More information about the ffmpeg-devel mailing list