2020-08-03, 07:00 PM
Although NVenc is still no match for x264, it's improved to the point at which it's become useful to me under certain circumstances, especially making a quick "Just wanna watch it" encoding. Here's a starting point that produces output that works with my BD player. (Some of the settings spell out the defaults to demonstrate the encoder's options and are strictly speaking redundant.)
You can even make a relatively quick UHD-to-BD conversion, all in one step, without generating an intermediate file, which is handy if space is a consideration:
Note that not every NVIDIA card supports all the encoder's features, so tweak the settings accordingly, and make sure that your drivers are up to date. Have fun testing!
Code:
ffmpeg -i input.mkv -vcodec h264_nvenc -profile:v high -level 41 -rc vbr_hq -2pass 1 -qmin 0 -qmax 51 -maxrate:v 40000k -b:v 35000k -bufsize:v 30000k -bf 3 -refs:v 3 -spatial-aq 1 -temporal-aq 1 -aq-strength 8 -b_ref_mode 2 -rc-lookahead 32 -surfaces 48 -no-scenecut 0 -nonref_p 1 -strict_gop 1 -coder:v cabac -g 24 -bluray-compat 1 output.264
You can even make a relatively quick UHD-to-BD conversion, all in one step, without generating an intermediate file, which is handy if space is a consideration:
Code:
ffmpeg -i input.mkv -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=1920:1080" -sws_flags sinc -pix_fmt yuv420p -vcodec h264_nvenc -profile:v high -level 41 -rc vbr_hq -2pass 1 -qmin 0 -qmax 51 -maxrate:v 40000k -b:v 35000k -bufsize:v 30000k -bf 3 -refs:v 3 -spatial-aq 1 -temporal-aq 1 -aq-strength 8 -b_ref_mode 2 -rc-lookahead 32 -surfaces 48 -no-scenecut 0 -nonref_p 1 -strict_gop 1 -coder:v cabac -g 24 -bluray-compat 1 output.264
Note that not every NVIDIA card supports all the encoder's features, so tweak the settings accordingly, and make sure that your drivers are up to date. Have fun testing!