0

I am trying to use the hevc_nvenc encoder in ffmpeg to reencode an old video I have. Obviously software encoding using libx265 would be better, but I want to make in fast. I am trying to optimize for video quality, so I am using these options:

-profile:v main -b_ref_mode 0 -preset p7 -tune hq -rc vbr

b_ref_mode 0 since my gpu doesn't support bframe reference mode.

This gives results with average bitrate of around 2M, so I am guessing that is the default bitrate setting for nvenc. Increasing -b:v increases average bitrate, but around 6.5M it stops. Even using -b:v 50M gives the same video bitrate. I have also tried setting -cq 1 to force the best quality possible, but that actually decreases bitrate to around 4.5M. The only way I found to get the desired bitrate is using -cq 1 and -maxrate set to a big value. This removes the restriction, and actually the -b:v option is no longer needed, it seems like it doesn't have any effect at all.

All of this behaviour seems very strange to me, with some hidden default values for bitrate and maxrate, so the question is where can I see these values? I tried using ffmpeg with -loglevel debug but didn't see these values getting passed, and the documentation I found says maxrate default in ffmpeg is 0 (what does this mean?).

1 Answer 1

-1
ffmpeg.exe -h encoder=hevc_nvenc
2
  • Welcome to Stack Overflow! While this code may solve the question, including an explanation of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply.
    – Yunnosch
    Mar 19 at 19:03
  • This does not answer the question, as I've written there is no information on these default values in ffmpeg documentation.
    – Ivan Gorin
    Mar 23 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.