HEVC_NVENC: Add qmin and qmax

  • Hello,


    when i used HEVC_NVENC with FFMPEG, i used the commandline from De-M-oN (i think you know which forum), which works very good and should be similar to crf from x264:

    Code
    ffmpeg -i "<path to video> or avisynth script" -vcodec hevc_nvenc -pix_fmt p010le -preset slow -profile:v main10 -tier high -rc:v vbr_hq -b:v 0 -qmin 10 -qmax 19 -rc-lookahead 60 -spatial_aq 1 -aq-strength 7 -weighted_pred 1 "<output.mkv>"


    The only things that are missing in Voukoder (Please correct me if im wrong) are these commands, that are important for this method:

    Code
    -rc:v vbr_hq -b:v 0 -qmin 10 -qmax 19


    Would be nice, if you could make it possible to use this "method".

  • Vouk

    Set the Label from Feature Request to Done
  • Sorry to bother you again, but in order to use qmax and qmin without bitrate limitations, you need the parameter: -b:v 0


    You can test that in ffmpeg with the following code:

    ffmpeg -i "yourinput" -vcodec h264_nvenc -preset hp -profile:v main -rc:v vbr -b:v 0 -qmin 10 -qmax 16 Out.mkv


    If you remove -b:v 0, ffmpeg will always use a constant qc value, but with -b:v 0 set ffmpeg/nvenc can use a lower value (qmin) for scenes that are more complex (more quality).


    In ffmpeg you can see the current used value while encoding:ffmpeg.jpg

  • Can't confirm.


    If i run this ...


    ffmpeg -i "z:\overvouk\2016-11-02-Dead by Daylight #001.mp4" -vcodec h264_nvenc -preset hp -profile:v main -rc:v vbr -qmin 0 -qmax 50 Out.mkv


    ... the quantizer value is frequently changing. Maybe the range between qmin and qmax in your case is just too small.

  • What "bitrate=0" does is that it actually says "bitrate can be unlimited", which is what you want. This basically simulates a dynamic quantizer like CRF with x264.


    So, yes i'll change it to allow bitrate=0.