Accelerated Video Playback

From NixOS Wiki
Revision as of 09:51, 18 July 2019 by Doronbehar (talk | contribs) (MPV: Make MPV headline an internal link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is meant to help with techniques for getting accelerated video playback working in NixOS. This is generally done via libva and vaapi (and sometimes vdpau).

This is done by adding relevant libva-related packages to the hardware.opengl.extraPackages option.

Additionally, the vaapiIntel package can be overriden to enable Intel's Hybrid Driver.

Intel users also can enable intel-media-driver. It can be used at runtime with LIBVA_DRIVER_NAME=iHD mpv ... for example, if you use Mic92's mpv settings below.

Sample configuration:

  nixpkgs.config.packageOverrides = pkgs: {
    vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
  hardware.opengl = {
    enable = true;
    extraPackages = with pkgs; [
      intel-media-driver # only available starting nixos-19.03 or the current nixos-unstable

Prepared Hardware configuration

Sometimes different opengl packages are required to achieve full performance. You can check different configuration repositories for similar hardware configuration:



Chromium builds from nixpkgs now support vaapi by default. It can be disabled via a flag in about:config. (see: and


@Mic92 needed the following configuration in ~/.mpv/config for mpv to use hardware acceleration for VP9 on Intel Broadwell:


With Wayland, you need to nudge mpv to do the right thing:


This is based on the archlinux MPV article.


See the Arch Linux wiki.