Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
avcodec/nvenc: mark newly deprecated rc modes
  • Loading branch information
BtbN committed Oct 21, 2020
1 parent 11a8e93 commit cde3c08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions libavcodec/nvenc.c
Expand Up @@ -933,10 +933,7 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)

if (ctx->rc >= 0 && ctx->rc & RC_MODE_DEPRECATED) {
av_log(avctx, AV_LOG_WARNING, "Specified rc mode is deprecated.\n");
av_log(avctx, AV_LOG_WARNING, "\tll_2pass_quality -> cbr_ld_hq\n");
av_log(avctx, AV_LOG_WARNING, "\tll_2pass_size -> cbr_hq\n");
av_log(avctx, AV_LOG_WARNING, "\tvbr_2pass -> vbr_hq\n");
av_log(avctx, AV_LOG_WARNING, "\tvbr_minqp -> (no replacement)\n");
av_log(avctx, AV_LOG_WARNING, "Use -rc constqp/cbr/vbr, -tune and -multipass instead.\n");

This comment has been minimized.

Copy link
@diegocr

diegocr Oct 29, 2020

Hi @BtbN, first of all sorry for bothering here, but those changes (plus 9115d77) have caused being unable to use hevc_nvenc any longer, at least under certain configurations, see:

$ ./ffmpeg -v verbose -i x.mkv -preset:v slow -tune:v hq -multipass:v qres -c:v hevc_nvenc -y x.mp4
ffmpeg version N-99793-gae9a1a9698 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
....
[hevc_nvenc @ 000000c54807ca40] Loaded Nvenc version 11.0
[hevc_nvenc @ 000000c54807ca40] Nvenc initialized successfully
[hevc_nvenc @ 000000c54807ca40] 1 CUDA capable devices found
[hevc_nvenc @ 000000c54807ca40] [ GPU #0 - < GeForce GTX 970M > has Compute SM 5.2 ]
[hevc_nvenc @ 000000c54807ca40] supports NVENC
[hevc_nvenc @ 000000c54807ca40] InitializeEncoder failed: invalid param (8): Presets P1-P7 are only supported with valid NV_ENC_INITIALIZE_PARAMS::tuningInfo
[hevc_nvenc @ 000000c54807ca40] Nvenc unloaded
...

Looks like no matter the combination of preset / tune / multipass i may use, i do always get the same error about NV_ENC_INITIALIZE_PARAMS::tuningInfo

So, i was wondering, is this an issue with my GTX970M, or perhaps the deprecation of those options were just made too prematurely if other parts of ffmpeg were not yet ready?

Thanks in advance for any light you could bring.

Edit: I am now realizing i rather should have opened an issue in https://github.com/BtbN/FFmpeg-Builds/issues, sorry again.


ctx->rc &= ~RC_MODE_DEPRECATED;
}
Expand Down
6 changes: 3 additions & 3 deletions libavcodec/nvenc_h264.c
Expand Up @@ -106,9 +106,9 @@ static const AVOption options[] = {
{ "ll_2pass_size", "Multi-pass optimized for constant frame size (deprecated)",
0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP) }, 0, 0, VE, "rc" },
{ "vbr_2pass", "Multi-pass variable bitrate mode (deprecated)", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_2_PASS_VBR) }, 0, 0, VE, "rc" },
{ "cbr_ld_hq", "Constant bitrate low delay high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ }, 0, 0, VE, "rc" },
{ "cbr_hq", "Constant bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_HQ }, 0, 0, VE, "rc" },
{ "vbr_hq", "Variable bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR_HQ }, 0, 0, VE, "rc" },
{ "cbr_ld_hq", "Constant bitrate low delay high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ) }, 0, 0, VE, "rc" },
{ "cbr_hq", "Constant bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_CBR_HQ) }, 0, 0, VE, "rc" },
{ "vbr_hq", "Variable bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_VBR_HQ) }, 0, 0, VE, "rc" },
{ "rc-lookahead", "Number of frames to look ahead for rate-control",
OFFSET(rc_lookahead), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "surfaces", "Number of concurrent surfaces", OFFSET(nb_surfaces), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_REGISTERED_FRAMES, VE },
Expand Down
6 changes: 3 additions & 3 deletions libavcodec/nvenc_hevc.c
Expand Up @@ -95,9 +95,9 @@ static const AVOption options[] = {
{ "ll_2pass_size", "Multi-pass optimized for constant frame size (deprecated)",
0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_2_PASS_FRAMESIZE_CAP) }, 0, 0, VE, "rc" },
{ "vbr_2pass", "Multi-pass variable bitrate mode (deprecated)", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_2_PASS_VBR) }, 0, 0, VE, "rc" },
{ "cbr_ld_hq", "Constant bitrate low delay high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ }, 0, 0, VE, "rc" },
{ "cbr_hq", "Constant bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR_HQ }, 0, 0, VE, "rc" },
{ "vbr_hq", "Variable bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR_HQ }, 0, 0, VE, "rc" },
{ "cbr_ld_hq", "Constant bitrate low delay high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_CBR_LOWDELAY_HQ) }, 0, 0, VE, "rc" },
{ "cbr_hq", "Constant bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_CBR_HQ) }, 0, 0, VE, "rc" },
{ "vbr_hq", "Variable bitrate high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = RCD(NV_ENC_PARAMS_RC_VBR_HQ) }, 0, 0, VE, "rc" },
{ "rc-lookahead", "Number of frames to look ahead for rate-control",
OFFSET(rc_lookahead), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "surfaces", "Number of concurrent surfaces", OFFSET(nb_surfaces), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_REGISTERED_FRAMES, VE },
Expand Down

0 comments on commit cde3c08

Please sign in to comment.