1

When I transcode video to H265 with following command, I get a bitrate about 600K and the quality is almost the same as the original.

ffmpeg -i data2.mp4 -c:v libx265 -c:a copy d2.mp4

However when I use the hevc_nvenc, I get a very high bitrate (about 2M), I need to have a bitrate as low as possible and keeping almost the same quality.

ffmpeg -i data2.mp4 -c:v hevc_nvenc -c:a copy d3.mp4

It works if I specify the output bitrate, but I want to know how to figure out the proper bitrate?

seaguest
  • 2,510
  • 5
  • 27
  • 45
  • 1
    What you want is a min quality level at resulting in a variable bit rate. See this detailed answer: https://superuser.com/questions/1236275/how-can-i-use-crf-encoding-with-nvenc-in-ffmpeg But be aware pls that unless you use a Turing GPU the nvenc encoder will need way higher bitrates for the same image quality compared to x265 – Crigges Jun 12 '19 at 11:55

1 Answers1

3

There is no such thing as "proper bitrate". You get to choose the bitrate. if you don't, the encoder will choose on for you. In this case, you are using two different encoders, so you get different bitrates. You can change this by adding -b:v option to ffmpeg.

But that's probably not what you want. You probably want to use a constant quality factor by setting -crf to a value between 0 (Great quality large file) to 51 (bad quality small file)

Note that hevc_nvenc will almost produce larger files than libx265 at a given quality because it not as efficient as an encoder.

szatmary
  • 29,969
  • 8
  • 44
  • 57