Skip to main content
Hardware decoding offloads video decode work from the CPU to dedicated GPU hardware. mpv does not enable it by default to keep out-of-the-box behavior as reliable as possible, but on modern hardware it usually works well and can reduce CPU usage significantly.
Hardware decoding is disabled by default (--hwdec=no). Enable it at runtime with the Ctrl+h shortcut, which toggles between auto and no.

Choosing a method

1

Try auto first

Start with --hwdec=auto. This selects from a whitelist of known-safe hwdec methods that the mpv development team actively supports.
2

Test all codecs

To see exactly which hardware decoder is being used and for which codecs:
3

Add to config if it works

If hardware decoding works as desired for your content, add it to ~/.config/mpv/mpv.conf:

—hwdec values

You can also mix specific API names with special values:

Platform methods

vaapi (Intel / AMD)

Requires --vo=gpu, --vo=gpu-next, --vo=vaapi, or --vo=dmabuf-wayland.
Works with Intel and AMD GPUs. Requires the OpenGL EGL backend if the GPU does not support DRM modifiers.Requires --vo=gpu or --vo=gpu-next. Available on any platform where CUDA is available.
nvdec is the newest and recommended method for NVIDIA GPU hardware decoding. Prefer it over vdpau and cuda.Requires --vo=gpu with --gpu-context=x11, or --vo=vdpau.
vdpau always forces RGB conversion in hardware and does not support newer colorspaces (BT.2020) or 10-bit/HDR content correctly. Use --hwdec=nvdec instead.

drm (SoC / embedded)

Requires --vo=gpu or --vo=gpu-next with the DRM backend.

Native vs. copy modes

Every hardware decoding method comes in two variants:

Native mode (e.g. vaapi)

Decoded frames stay in GPU memory and are passed directly to the video output. Lower overhead, but works only with compatible VOs and may limit which video filters you can apply.

Copy mode (e.g. vaapi-copy)

Decoded frames are copied back to system RAM after decoding. Works with all video filters and all video outputs, at the cost of a copy operation.
Use --hwdec=auto-copy to automatically select the best available copy-back method:

Hardware decoding + GPU rendering interop

For the best result with native (non-copy) modes, pair --hwdec with --vo=gpu or --vo=gpu-next:

Restricting codecs

By default, hardware decoding is whitelisted for: h264, vc1, hevc, vp8, vp9, av1, prores, prores_raw, ffv1, dpx. Use --hwdec-codecs to override this list:

When not to use hardware decoding

Disable hardware decoding if you encounter any of the following:
  • Corrupted frames, glitches, or visual artifacts
  • Incorrect colors or discoloration
  • Random crashes or freezes
  • Incorrect playback of HDR content
The first thing to try when debugging playback issues is --hwdec=no.
Known limitations:
  • vdpau: Forces RGB conversion in hardware; BT.2020, 10-bit, and HDR are not supported correctly.
  • dxva2: Always uses BT.601 for RGB conversion; causes incorrect colors on HD/UHD content.
  • cuda: Reported to corrupt timestamps in some mixed streams, causing flashing frames. Prefer nvdec.
  • mediacodec (Android): Forces RGB conversion; 10-bit support is limited and reduces output to 8-bit.

Fallback behavior

By default, mpv falls back to software decoding if the hardware decoder fails for 3 consecutive frames (--hwdec-software-fallback=3). You can adjust this:

Additional options