Encoding high-quality HEVC content in a two-pass manner with FFmpeg - based NVENC encoder on supported hardware:
If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.
Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:
ffmpeg -i <inputfile> -pass 1 \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload,format=nv12 \
-c:v hevc_nvenc -profile main -preset slow -rc vbr_2pass \