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
Try auto first
Start with
--hwdec=auto. This selects from a whitelist of known-safe hwdec methods that the mpv development team actively supports.—hwdec values
| Value | Description |
|---|---|
no | Always use software decoding (default) |
auto | Enable any whitelisted hw decoder |
auto-safe | Alias for auto |
yes | Alias for auto |
auto-unsafe | Forcibly enable any hw decoder found (bypasses whitelist — for testing only) |
auto-copy | Like auto, but only copy-back modes (see below) |
auto-copy-safe | Alias for auto-copy |
auto-copy-unsafe | Like auto-copy but without the whitelist |
Platform methods
- Linux
- macOS
- Windows
vaapi (Intel / AMD)
Requires--vo=gpu, --vo=gpu-next, --vo=vaapi, or --vo=dmabuf-wayland.nvdec (NVIDIA — recommended)
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.vdpau (NVIDIA legacy — not recommended)
Requires--vo=gpu with --gpu-context=x11, or --vo=vdpau.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.
--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
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
| Option | Description |
|---|---|
--hwdec-extra-frames=<N> | Number of GPU frames to preallocate for hardware decoding. Increase if you see frame drops during decode. |
--hwdec-threads=<N> | Number of threads for hardware decoding (default: 4). Set to 0 for auto (number of CPU cores). |
--hwdec-image-format=<name> | Internal pixel format for hardware decoding (default: no, which uses the decoder’s default). |
--gpu-hwdec-interop=<auto|all|no|name> | Troubleshooting option to select or block specific hwdec interop backends. |
--cuda-decode-device=<auto|0..> | Select which GPU to use for cuda/nvdec decoding. |
--vaapi-device=<path> | DRM device path for vaapi-copy (default: /dev/dri/renderD128). |