[FFmpeg-devel] [PATCH 2/2] libvpxenc: Report encoded VP9 level

James Zern jzern at google.com
Tue Nov 22 22:04:01 EET 2016


On Fri, Nov 18, 2016 at 2:01 PM, Alex Converse <alex.converse at gmail.com> wrote:
> Report the actual level of the encoded output if a level is
> targeted or the level is passively tracked with a target of 0.
> ---
>  libavcodec/libvpxenc.c | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
>

lgtm.
I don't know if there's a better way to report this at the stream
level (AV_PKT_DATA_STRINGS_METADATA?), there doesn't seem to be
anything specific right now. This info can be translated quickly if
someone wants to make this more structured or has any opinion now.

> +
>  static av_cold int vpx_free(AVCodecContext *avctx)
>  {
>      VPxContext *ctx = avctx->priv_data;
> +    int level_out = 0;

could relocate this to avoid unused warnings against older libs.

> +
> +#if VPX_ENCODER_ABI_VERSION >= 12
> +    if (ctx->level >= 0 && !(avctx->flags & AV_CODEC_FLAG_PASS1) &&
> +        !codecctl_intp(avctx, VP9E_GET_LEVEL, &level_out))
> +      av_log(avctx, AV_LOG_INFO, "Encoded level %.1f\n", level_out * 0.1);

indent is off.

> +#endif
>
>      vpx_codec_destroy(&ctx->encoder);
>      if (ctx->is_alpha)
> --
> 2.8.0.rc3.226.g39d4020
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list