[FFmpeg-devel] [PATCH v3] avcodec: Add librav1e encoder

James Almer jamrial at gmail.com
Thu May 30 17:51:35 EEST 2019


On 5/29/2019 3:28 PM, Derek Buitenhuis wrote:
> Uses the crav1e C bindings for rav1e.
> 
> Port to the new send/receive API by: James Almer <jamrial at gmail.com>.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
> Changes since v2:
> 
>     * Removed 4:0:0 support; seems broken in rav1e (ref: https://github.com/xiph/rav1e/issues/1312)
>     * Moved to use FF_CODEC_CAP_INIT_CLEANUP.
>     * Set time base for ratecontrol purposes (tested, as well).
>     * Used desc->nb_components for loop.
> ---
>  configure              |   4 +
>  doc/encoders.texi      |  29 +++
>  doc/general.texi       |   7 +
>  libavcodec/Makefile    |   1 +
>  libavcodec/allcodecs.c |   1 +
>  libavcodec/librav1e.c  | 415 +++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 457 insertions(+)
>  create mode 100644 libavcodec/librav1e.c

[...]

> +static const AVOption options[] = {
> +    { "qp", "use constant quantizer mode", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
> +    { "rav1e-params", "set the rav1e configuration using a :-separated list of key=value parameters", OFFSET(rav1e_opts), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },

You could add tile-columns, tile-rows, and speed options.

> +    { NULL }
> +};
> +
> +static const AVCodecDefault librav1e_defaults[] = {
> +    { "qmax", "-1" },

And you should also set g and keyint_min here to -1, check the relevant
avctx fields (gop_size and keyint_min), and map them to
key_frame_interval and min_key_frame_interval rav1e options if >= 0.

> +    { NULL }
> +};


More information about the ffmpeg-devel mailing list