How to Enable Hardware Acceleration for Video Playback on Arch Linux

Learn how to enable hardware acceleration for video playback on Arch Linux

Smooth video playback is a critical part of the modern multimedia experience. Whether you’re watching YouTube videos, streaming 4K content, or editing high-definition video, proper hardware acceleration can make a significant difference. Arch Linux, being a rolling-release distribution geared toward experienced users, gives you full control over how hardware acceleration is implemented. However, with great power comes the need for proper configuration.

This guide walks you through how to enable hardware acceleration for video playback on Arch Linux. We’ll cover the fundamental concepts, how to identify your GPU, install the necessary drivers, configure video players like MPV and VLC, and ensure that your browser (like Firefox or Chromium) uses hardware acceleration correctly.


📌 What Is Hardware Acceleration?

Hardware acceleration offloads certain tasks (such as video decoding) from the CPU to specialized hardware — usually the GPU (Graphics Processing Unit). This results in:

  • Reduced CPU usage
  • Smoother video playback
  • Better power efficiency
  • Lower system temperatures (especially on laptops)

Without hardware acceleration, video decoding is performed in software, which is much more resource-intensive.


🧩 Step 1: Identify Your GPU

Before enabling acceleration, you need to determine what GPU your system uses.

Run the following command:

lspci | grep -E "VGA|3D"

You might see something like:

  • Intel integrated graphics
  • AMD Radeon graphics
  • NVIDIA graphics

Depending on your GPU, the drivers and setup steps will differ slightly.


🎮 Step 2: Install the Appropriate GPU Drivers

🔹 Intel Graphics

For Intel integrated graphics:

sudo pacman -S xf86-video-intel libva-intel-driver intel-media-driver

Note:

  • intel-media-driver is recommended for newer Intel GPUs (Gen8+).
  • libva-intel-driver is used for older Intel GPUs.

🔹 AMD Graphics

For AMD GPUs, Mesa provides open-source drivers:

sudo pacman -S mesa libva-mesa-driver mesa-vdpau

These drivers include both VA-API and VDPAU support.

🔹 NVIDIA Graphics

For NVIDIA GPUs, you can use the proprietary driver or the open-source Nouveau driver.

Option A: Proprietary Driver

sudo pacman -S nvidia nvidia-utils libva libva-nvidia-driver

Additionally, you might want:

sudo pacman -S vdpauinfo libvdpau

Option B: Nouveau Driver

sudo pacman -S xf86-video-nouveau mesa libva-mesa-driver mesa-vdpau

⚠️ Hardware acceleration with Nouveau is limited and may not work well with VDPAU.


🛠 Step 3: Verify VA-API and VDPAU Support

Two APIs are commonly used for video decoding:

  • VA-API: Commonly used with Intel and AMD
  • VDPAU: Common with NVIDIA and older systems

VA-API Check

vainfo

Expected output should show your GPU and supported codecs like H264, HEVC, VP9, etc.

VDPAU Check

vdpauinfo

You should see similar information listing supported codecs and your GPU backend.

If either of these commands fails, it may indicate missing drivers or misconfiguration.


🎥 Step 4: Enable Hardware Acceleration in MPV

MPV is a powerful media player with excellent support for hardware acceleration.

Install it:

sudo pacman -S mpv

Edit or create the config file:

nano ~/.config/mpv/mpv.conf

Add the following lines:

hwdec=auto
vo=gpu

Or, to explicitly use VA-API or VDPAU:

hwdec=vaapi
vo=gpu

You can test it by running a video with:

mpv --hwdec=auto your-video-file.mp4

To check if hardware decoding is used, open the on-screen stats (i key by default) or observe CPU usage (htop or top).


📺 Step 5: Enable Hardware Acceleration in VLC

Install VLC:

sudo pacman -S vlc

Launch VLC → Preferences → Input/Codecs

  • Under “Hardware-accelerated decoding”, choose Automatic or the specific API (e.g., VA-API).

To confirm it’s working:

  • Play a high-resolution video and observe system performance via htop.

🌐 Step 6: Enable Hardware Acceleration in Web Browsers

🔸 Firefox

Firefox uses VA-API on Wayland and X11 (with certain configurations).

To enable it:

  1. Launch Firefox and go to about:config
  2. Set the following:
media.ffmpeg.vaapi.enabled → true
gfx.webrender.all → true
  1. If using Wayland:

    • Launch Firefox like this:
    MOZ_ENABLE_WAYLAND=1 firefox
    
  2. On X11, ensure you have libva and the right VA driver installed.

To check if hardware acceleration is working:

  • Go to about:support
  • Look under Graphics for “Hardware Video Decoding” — it should say “Available by default”.

🔸 Chromium / Google Chrome

Chromium has good VA-API support with a bit of tweaking.

Install chromium (or google-chrome from the AUR):

sudo pacman -S chromium

Then launch Chromium with these flags:

chromium --enable-features=VaapiVideoDecoder --use-gl=egl

To make this permanent, create a desktop entry override:

mkdir -p ~/.local/share/applications
cp /usr/share/applications/chromium.desktop ~/.local/share/applications
nano ~/.local/share/applications/chromium.desktop

Edit the Exec= line:

Exec=chromium --enable-features=VaapiVideoDecoder --use-gl=egl %U

To confirm, open chrome://media-internals while playing a video and check the decoder.


🔬 Step 7: Optional – Install FFmpeg with VAAPI Support

To use VA-API with FFmpeg (for encoding/decoding tasks):

sudo pacman -S ffmpeg

Check VAAPI support:

ffmpeg -hwaccels

To encode or decode with VAAPI:

ffmpeg -hwaccel vaapi -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4

🧪 Troubleshooting Tips

  1. Check logs:

    journalctl -xe | grep -i vaapi
    
  2. Ensure the correct VA/VDPAU driver is loaded:

    • For Intel: intel-media-driver or libva-intel-driver
    • For AMD: libva-mesa-driver
    • For NVIDIA: libva-nvidia-driver
  3. Check permissions: Your user must be part of the video group:

    sudo usermod -aG video $USER
    

    Then reboot or re-login.

  4. Wayland vs X11:

    • Hardware acceleration is generally more reliable under Wayland.
    • Ensure your session type supports GPU acceleration.
  5. Missing codecs:

    • Install gst-plugins-good, gst-plugins-bad, gst-libav for GStreamer-based apps.

📦 Summary

Enabling hardware acceleration on Arch Linux requires a little manual work, but the performance benefits are well worth it. Whether you’re using Intel, AMD, or NVIDIA, the Arch ecosystem gives you all the tools you need — you just have to know how to put them together.

Here’s a quick recap:

ComponentRequired PackagesAcceleration API
Intel (newer GPUs)intel-media-driverVA-API
Intel (older GPUs)libva-intel-driverVA-API
AMDmesa, libva-mesa-driverVA-API, VDPAU
NVIDIA (proprietary)nvidia, libva-nvidia-driverVDPAU, VA-API
Video Playersmpv, vlcConfigure settings
Browsersfirefox, chromiumUse launch flags / config
Verification Toolsvainfo, vdpauinfo, ffmpegCheck support

🔚 Conclusion

With this guide, you should now have a fully hardware-accelerated video playback setup on Arch Linux. You’ll enjoy smoother performance, lower CPU usage, and better battery life on laptops. While some steps might seem complex, they offer deep insight into how your Linux system handles multimedia processing — one of the many perks of running Arch.

If you’re still having trouble after following these steps, check out the Arch Wiki pages for Hardware Video Acceleration, as they are some of the most up-to-date and community-driven resources available.