[FFmpeg-devel] [PATCH] avcodec/nvenc: add AV1 encoding support

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Nov 2 03:14:52 EET 2022


Timo Rothenpieler:
> ---
> 
> diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
> index 3c6fce391d..9a1a1fcc37 100644
> --- a/libavcodec/nvenc.c
> +++ b/libavcodec/nvenc.c
> @@ -1,5 +1,5 @@
>  /*
> - * H.264/HEVC hardware encoding using nvidia nvenc
> + * H.264/HEVC/AV1 hardware encoding using nvidia nvenc
>   * Copyright (c) 2016 Timo Rothenpieler <timo at rothenpieler.org>
>   *
>   * This file is part of FFmpeg.
> @@ -222,8 +222,14 @@ static void nvenc_map_preset(NvencContext *ctx)
>  
>  static void nvenc_print_driver_requirement(AVCodecContext *avctx, int level)
>  {
> -#if NVENCAPI_CHECK_VERSION(11, 2)
> +#if NVENCAPI_CHECK_VERSION(12, 1)
>      const char *minver = "(unknown)";
> +#elif NVENCAPI_CHECK_VERSION(12, 0)
> +# if defined(_WIN32) || defined(__CYGWIN__)
> +    const char *minver = "???.??";
> +# else
> +    const char *minver = "???.??";
> +# endif

Either one of the above is wrong or the above #if is superfluous (or I
am blind).

>  #elif NVENCAPI_CHECK_VERSION(11, 1)
>  # if defined(_WIN32) || defined(__CYGWIN__)
>      const char *minver = "471.41";
> @@ -658,6 +664,11 @@ static av_cold int nvenc_setup_device(AVCodecContext *avctx)
>      case AV_CODEC_ID_HEVC:
>          ctx->init_encode_params.encodeGUID = NV_ENC_CODEC_HEVC_GUID;
>          break;
> +#if CONFIG_AV1_NVENC_ENCODER
> +    case AV_CODEC_ID_AV1:
> +        ctx->init_encode_params.encodeGUID = NV_ENC_CODEC_AV1_GUID;
> +        break;
> +#endif
>      default:
>          return AVERROR_BUG;
>      }
> @@ -1325,6 +1336,86 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
>      return 0;
>  }
>  



More information about the ffmpeg-devel mailing list