[FFmpeg-trac] #8809(avcodec:new): hevc_nvenc / b_ref_mode each is not working

FFmpeg trac at avcodec.org
Mon Jul 20 20:14:13 EEST 2020


#8809: hevc_nvenc / b_ref_mode each is not working
-------------------------------------+-------------------------------------
             Reporter:  enctac       |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:  avcodec      |                  Version:  git-
             Keywords:  nvenc        |  master
  hevc_nvenc b_ref_mode              |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 When using "-c:v hevc_nvenc", "-b_ref_mode each" option is not working by
 saying out:
 {{{Each B frame as reference is not supported}}}

 How to reproduce:
 {{{
 % ffmpeg.exe -y -i input.mp4 -c:v hevc_nvenc -bf 3 -b_ref_mode each -an
 output.mp4
 }}}

 Memo:
   "-b_ref_mode each" needs '''Turing GPU''' and '''"-c:v hevc_nvenc"'''.
   h264_nvenc doesn't support "-b_ref_mode each". (#7301)

 Examples:

 [https://forums.developer.nvidia.com/t/details-about-nvenc-in-
 turing/64148/102 Case1(English)]:ffmpeg-20200311-36aaee2-win64-static,
 GPU:RTX 2080 SUPER (Driver:442.59)

 [https://egg.5ch.net/test/read.cgi/software/1555776689/881-/
 Case2(Japanese)]:ffmpeg 4.3(Zeranoe), GPU: 1660 SUPER (Driver:446.14)

 Comment:

   Source Code:
     https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/nvenc.c#L425

   NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE:
     https://github.com/FFmpeg/nv-codec-
 headers/blob/master/include/ffnvcodec/nvEncodeAPI.h#L1089

   When GPU supports "each" and "middle",
 NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE '''maybe''' returns '''"3" (0x01 |
 0x02)'''.

     ref.
 [https://github.com/rigaya/NVEnc/blob/master/GPUFeatures/rtx2070.txt
 RTX2070 features] ("Codec: H.265/HEVC -> B Ref Mode" is "3")

   But
 [https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/nvenc.c#L426
 code] is:

     ret = nvenc_check_cap(avctx, NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE);
     if (ctx->b_ref_mode == NV_ENC_BFRAME_REF_MODE_EACH && '''ret != 1''')
 {
         av_log(avctx, AV_LOG_WARNING, "Each B frame as reference is not
 supported\n");
         return AVERROR(ENOSYS);
     } else if ...


 I don't have Turing GPU.
 Please check and fix this problem.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8809>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list