Play YouTube video in browser on GNU/Linux with hardware acceleration

If you have a PC with low-end/low power CPU or you plan to build a budget HTPC that runs GNU/Linux, you definitely need this.

The current version of Firefox doesn't support hardware video decoding. Google's Chrome and Chromium can utilize VA-API (Video Acceleration API). The VA-API specification was originally designed by Intel, AMD's GPU can use it too, but the performance may not be as good as on Windows. If you plan to build a budget HTPC that runs GNU/Linux, you had better consider the blue side (Intel).

The official releases of Chrome and Chromium were not compiled with support for hardware video decoding. Compiling Chromium on a low-end CPU takes a long time. Fortunately, There are distros which offer precompiled Chromium binary with hardware video decoding support.

You need to install the VA-API driver first. For Intel, it's libva-intel-driver, for AMD GPU, it's libva-mesa-driver. For more info, visit https://wiki.archlinux.org/index.php/Hardware_video_acceleration.

If you want to play h264 format videos, you may need ffmpeg and a Chrome/Chromium plugin called h264ify too.


If you are using an AMD GPU and the browser can not play the video properly, you may need to add

allow_rgb10_configs=false
into /etc/environment. See this.

Comments

Popular

Intel 7th and 8th generation processor graphics driver for Windows 7/8/8.1

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part II - Fidelity

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part I - Lossless

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part IV - Decode

OBS Studio settings for best quality (loseless) recording

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part III - Quality

YouTube starts delivering videos in AV1 format