How to Check FFmpeg for NVDEC Support

Checking whether your FFmpeg binary supports NVDEC (NVIDIA Hardware Video Decoder) is essential for enabling hardware-accelerated video decoding on systems with NVIDIA GPUs. This guide provides direct terminal commands to inspect your FFmpeg build configuration, verify hardware acceleration support, check for specific NVDEC-enabled decoders, and run a functional test to confirm everything works properly.

1. Check Enabled Hardware Accelerators

The fastest way to verify if your FFmpeg binary recognizes NVDEC is by querying the supported hardware acceleration methods:

ffmpeg -hwaccels

Look at the output list. If your binary was compiled with NVDEC support, you should see either cuda or nvdec (or both) listed:

Hardware acceleration methods:
cuda
nvdec
...

2. Inspect the Build Configuration

You can inspect the configuration flags used when the FFmpeg binary was compiled by running:

ffmpeg -version

Scan the configuration: line in the output. For modern NVDEC support, you should see flags enabling NVIDIA's hardware frameworks, such as:

  • --enable-ffnvcodec
  • --enable-cuvid
  • --enable-nvdec
  • --enable-cuda-llvm (or --enable-cuda)

If these flags are missing, your FFmpeg build was compiled without the required NVIDIA headers and libraries.

3. Check for NVDEC Decoders

NVDEC decoders are commonly exposed in FFmpeg with the _cuvid suffix. To see all available hardware decoders built into your binary, run:

ffmpeg -decoders | grep cuvid

If NVDEC is properly compiled, you will see decoders for formats such as H.264, HEVC, and VP9:

 V..... av1_cuvid            Nvidia CUVID AV1 decoder (codec av1)
 V..... h264_cuvid           Nvidia CUVID H264 decoder (codec h264)
 V..... hevc_cuvid           Nvidia CUVID HEVC decoder (codec hevc)
 V..... mjpeg_cuvid          Nvidia CUVID MJPEG decoder (codec mjpeg)
 V..... mpeg2_cuvid          Nvidia CUVID MPEG2VIDEO decoder (codec mpeg2video)
 V..... mpeg4_cuvid          Nvidia CUVID MPEG4 decoder (codec mpeg4)
 V..... vc1_cuvid            Nvidia CUVID VC1 decoder (codec vc1)
 V..... vp8_cuvid            Nvidia CUVID VP8 decoder (codec vp8)
 V..... vp9_cuvid            Nvidia CUVID VP9 decoder (codec vp9)

4. Run a Functional Test

Even if the binary was compiled with the appropriate flags, you must have compatible NVIDIA drivers installed to utilize NVDEC. To test hardware decoding in real time, run a decode benchmark using a test video:

ffmpeg -hwaccel cuda -i input.mp4 -f null -

Or using an explicit CUVID decoder:

ffmpeg -c:v h264_cuvid -i input.mp4 -f null -

If the command processes the file without errors, your FFmpeg binary contains full, working NVDEC support.