

The NVIDIA Codec SDK or compiling FFmpeg with -enable-cuda-llvmįfmpeg configured with -enable-nvenc (default if the drivers are detected while configuring) Supported drivers for your operating system In order to enable it in FFmpeg you need: FFmpeg supports NVENC through the h264_nvenc and hevc_nvenc encoders. NVENC can be used for H.264 and HEVC encoding. They can be used for encoding and decoding on Windows and Linux. NVENC and NVDEC are NVIDIA's hardware-accelerated encoding and decoding APIs.

(yes, you can do both decoding and encoding with your nvidia graphics card) if you have more than one graphics card, you can change the number.

This is what worked for me: (NVIDIA GTX 1650 SUPER) ffmpeg -hwaccel_device 0 -hwaccel cuda -i "input.mkv" -c:v h264_nvenc -preset slow "output.mp4"ĭevice is set to 0 because that is the first GPU in your computer.
