HEVC on Linux
On Linux the HEVC decoder comes from FFmpeg (libavcodec), already used by VLC, mpv and Kodi. What needs setting up is hardware acceleration, especially for 4K.
Key points
- The HEVC decoder lives in FFmpeg (libavcodec): VLC, mpv, Kodi and Celluloid use it.
- Ubuntu:
ubuntu-restricted-extras. Debian:ffmpegandgstreamer1.0-libav. Fedora: RPM Fusion. - For smooth 4K enable acceleration: VA-API (Intel, AMD) or NVDEC (NVIDIA), and verify it with
vainfo.
Ubuntu and derivatives (Linux Mint, Pop!_OS)
sudo apt update
sudo apt install ubuntu-restricted-extras ffmpeg gstreamer1.0-libav vainfo
# Intel (Broadwell or newer):
sudo apt install intel-media-va-driver-non-free
# AMD:
sudo apt install mesa-va-drivers
Linux Mint offers to install multimedia codecs during setup or from the welcome screen.
Debian
Since Debian 12, FFmpeg and GStreamer from the official repositories include HEVC. Enable contrib non-free non-free-firmware in /etc/apt/sources.list if you want Intel's non-free VA-API driver.
sudo apt install ffmpeg gstreamer1.0-libav gstreamer1.0-plugins-bad vainfo
sudo apt install intel-media-va-driver-non-free # Intel
sudo apt install mesa-va-drivers # AMD
Fedora
Fedora ships no HEVC because of patents: its FFmpeg is cut down and its Mesa disables HEVC acceleration. RPM Fusion fixes it:
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf swap ffmpeg-free ffmpeg --allowerasing
sudo dnf install gstreamer1-plugin-libav libva-utils
sudo dnf swap mesa-va-drivers mesa-va-drivers-freeworld # AMD
sudo dnf install intel-media-driver # Intel
On openSUSE the equivalent is the Packman repository; on Arch, everything is in the official repos (ffmpeg, libva-utils, intel-media-driver or libva-mesa-driver).
Verify hardware acceleration
- Run vainfo
vainfo | grep -i hevcshould listVAProfileHEVCMain(andMain10) withVAEntrypointVLD. - Test with mpv
mpv --hwdec=auto video.mkvand press i: you'll see "HW: vaapi" or "nvdec". - NVIDIAWith the proprietary driver, mpv uses NVDEC directly; Firefox and Chrome need the
nvidia-vaapi-driverbridge. - BrowserFirefox 137 or later plays HEVC with working VA-API; in Chrome, check
chrome://gpu.
GPUs with an HEVC decoder
- 2015 6th gen (Skylake): 8-bit
- 2016 7th gen (Kaby Lake): 10-bit
- 2015 Carrizo APUs and R9 Fury: 8-bit
- 2016 RX 400 (Polaris): 10-bit
- 2015 GTX 950/960: Main y Main 10
- 2016 GTX 10: up to 12-bit
If you use Flatpak
Flathub players (VLC, mpv, Celluloid, Haruna, Kodi) bring their own FFmpeg with HEVC through the org.freedesktop.Platform.ffmpeg-full runtime; for acceleration on Intel, also install org.freedesktop.Platform.VAAPI.Intel. It's the easiest route on Fedora if you'd rather not enable RPM Fusion.
Frequently asked questions
Why doesn't Fedora play HEVC out of the box?
Because of patents, Fedora ships no HEVC decoders in its official repositories and its Mesa build disables HEVC acceleration. Enable RPM Fusion and install full ffmpeg and mesa-va-drivers-freeworld.
How do I know if my GPU accelerates HEVC on Linux?
Run vainfo (package vainfo or libva-utils) and look for VAProfileHEVCMain and VAProfileHEVCMain10 with VAEntrypointVLD. With NVIDIA's proprietary driver, use mpv with --hwdec=nvdec.
Sources
- FFmpeg Wiki. Hardware acceleration (VA-API, NVDEC, QSV, VideoToolbox)
- Arch Wiki. Hardware video acceleration (VA-API, comprobación con vainfo)
- RPM Fusion. Configuration and multimedia
- Debian Wiki. Multimedia codecs
- Ubuntu Desktop documentation (paquete ubuntu-restricted-extras)
- GStreamer. Plugins: libav, va y x265