Zend certified PHP/Magento developer

High quality compression with cuda

I want to convert

ffmpeg -i input.mp4 -maxrate 63317762 -bufsize 63317762 -map_metadata -1 -vcodec libx265 -c:a copy -crf 28 -color_range 2 output.mp4

into a command that uses cuda to speed the conversion process.

I tried

ffmpeg.exe -hwaccel cuvid -i input.mp4 -pix_fmt p010le -c:v hevc_nvenc -preset slow -rc vbr_hq -b:v 6M -maxrate:v 63317762 -bufsize:v 63317762 -c:a aac output.mp4

And it didn’t work.

I tried

ffmpeg.exe -hwaccel cuvid -i input.mp4 -c:v hevc_nvenc -preset slow -rc vbr_hq -b:v 6M -maxrate:v 63317762 -bufsize:v 63317762 -c:a aac output.mp4

and it worked, yet it set the bitrate for video to 6M.

I want ffmpeg to guess it based on content up to 63317762 bytes. Like a good tradeoff between quality and bitrate but below 63317762 bytes but also without visible block building and blurryness.

And with cuda.

Which command does that?