Hardware decoding in mpv: hwdec settings that work

Performance6 min readUpdated

Two decode paths: software decoding on the CPU and hardware decoding on the GPU, both ending at the display, with hwdec=auto and Ctrl+h labels.

High-bitrate 4K, HEVC and AV1 files can keep a CPU busy. Hardware decoding hands that work to the dedicated video block in your graphics chip. mpv supports it on every major platform, but leaves it off by default. Here's how to turn it on and check that it's working.

What hardware decoding changes

Normally mpv decodes video in software through FFmpeg, using the CPU. With hardware decoding, compressed video goes to the GPU's fixed-function decoder instead. The decoded frames then stay on the GPU for rendering. The benefits:

  • much lower CPU use on demanding files,
  • less fan noise and better battery life on laptops,
  • smooth playback of codecs your CPU struggles with, if the GPU supports them.

The trade-off is that you depend on the GPU's decoder and driver. If either doesn't support a codec or profile, mpv falls back to software decoding. A buggy driver can occasionally produce glitches, which is why the mpv developers keep hardware decoding off by default.

Turning it on

Add one line to mpv.conf:

hwdec=auto

auto tries the hardware decoding methods mpv considers reliable on your platform, in order of preference, and quietly uses software decoding if none of them works. In current versions auto-safe means the same thing, so older guides that recommend it are not wrong.

To test before committing, press Ctrl+h during playback. It toggles hardware decoding between off and auto, and the change applies immediately.

How to confirm it is working

  • Press i for the statistics overlay. The video section names the hardware decoder in use, such as d3d11va or nvdec, when one is active.
  • Or start mpv from a terminal (mpv.com on Windows). It prints a line like Using hardware decoding (d3d11va) when the GPU takes over.
  • Watch CPU usage in Task Manager while a 4K file plays, then press Ctrl+h and compare.

Which decoder gets used

PlatformCommon methods
Windowsd3d11va (any modern GPU), nvdec (NVIDIA), vulkan
macOSvideotoolbox
Linuxvaapi (Intel / AMD), nvdec (NVIDIA), vulkan

You can force one, for example hwdec=nvdec, but auto is usually the better choice because it adapts when you change GPUs. mpv 0.41 prefers Vulkan decoding when it is available. It also prefers methods that keep frames on the GPU before falling back to "-copy" variants.

What the "-copy" variants are for

Methods ending in -copy, and hwdec=auto-copy, decode on the GPU but copy each frame back to system memory. That costs some efficiency, but it makes CPU-side video filters work. If you use video filters (vf=…) and they stop working with hardware decoding, auto-copy is the fix.

When to leave it off

  • Your GPU predates the codec. AV1 hardware decoding, for example, only exists on fairly recent graphics chips. mpv falls back to software automatically, so you lose nothing.
  • You see corruption: green frames, blocky artefacts or flicker. Set hwdec=no, update your graphics driver and test again.
  • Your CPU copes easily. On a desktop with a strong CPU, software decoding is perfectly fine and avoids driver quirks.

Still seeing a black picture or stutter? The troubleshooting guide goes through renderer and driver checks step by step.

Ready to try it? The homepage has the Windows download and a short setup checklist.

Download Now