PCsuggest

  • Quick tip
  • SECURITY
  • NETWORKING
  • OpenWrt
  • HARDWARE

Hardware accelerated video decoding in Chromium for Linux

Last Updated on October 19, 2017 by Arnab Satapathi 46 Comments

If you're using a laptop you may be familiar with playing videos on Chrome or Chromium sucks the battery pretty quick.

Well, Google Chrome or Chromium are not video players, but they can play almost  every video quite well.

And in case of watching youtube or other videos online, no one bothers to play that video with some other software that supports GPU accelerated video playback.

A laptop suffers most by this glitch in browsers, but even if you're on a desktop, you might want to take advantage of your GPU, let the GPU do what it deserved to do.

So, if you're planning to play youtube or other videos efficiently in Chromium browser, this tutorial is for you, let's get started ...

Contents

Show/Hide
  • 1.  Why is this happening ?
  • 2. Install Chromium Beta with hardware acceleration enabled
  • 3. Checking hardware accelerated video decoding capability
  • Thoughts, Credits and Conclusion

1.  Why is this happening ?

It's simply because lack of proper H.264 decoding support in browsers, hardware accelerated video decoding is disabled in Chrome/Chromium for Linux.

There is another problem, most videos on youtube are encoded with VP9/VP8 codec, but older GPUs can't decode VP8 or VP9 at all, that could be fixed easily with the h264ify Chrome extension.

Though chrome://gpu URL says it can decode videos with GPU if Override software rendering list chrome flag is enabled, but actually it can't, more about this here.

chrome_gpu_decode1

Let's have a look at the chrome://flags URL for the Hardware-accelerated video decode flag. This feature is only available on Mac, Windows and Chrome OS, and there is no way to enable it with default Linux builds.

chrome_gpu_decode_not_available

There is a workaround for this problem too, patch the source to enable chrome VAAPI support and rebuild, or use already patched Chromium builds, the second option is fairly easier.

2. Install Chromium Beta with hardware acceleration enabled

While patching chromium source and compiling it is the best choice for learning, but it's pretty impractical for most. Compiling Chromium from source also requires a descent hardware setup, you might want to check their official instruction.

So If you're running Ubuntu or Debian, why not use prebuilt Chromium Beta from Saikrishna Arcot's PPA ? Here the link to the PPA.

It's pretty simple to installing Chromium Beta with hardware acceleration enabled in Ubuntu,

sudo add-apt-repository ppa:saiarcot895/chromium-beta

sudo apt-get update

sudo apt-get install chromium-browser

You will also need proper GPU drivers for accelerated video decoding, for Intel GPUs install VA-API driver and relate shared libraries.

sudo apt-get install libva-glx1 libva-x11-1 i965-va-driver

Note: I was trying to use VDPAU for decoding videos with NVIDIA Optimus GPUs on Chromium, but that seems to be not possible at this moment.

3. Checking hardware accelerated video decoding capability

Now you can see the Hardware-accelerated video decode flag in enabled and it's available for Linux.

chromium_gpu_decode_enabled

You can confirm that accelerated decoding is working by running a local or online 1080p video encoded with h.264, may be VP9 if your GPU supports decoding that, testing that on the chrome://media-internals URL, Example screenshot below,

chromium_gpuvideodecoder Here yo can see video_decoder is GpuVideoDecoder , and the Video codec is avc.

Thoughts, Credits and Conclusion

No doubt that Saikrishna Arcot deserves a warm "thank you" for patching latest Chromium and maintaining the PPAs,  excellent work, seriously !!!!

It would be a little better if the Saikrishna fixes the Chromium API key related problem, or completely disabling it.

Hope you all enjoyed this this tutorial, don't forget to share if you think it's helpful.

Filed Under: featured, how to Tagged With: browser, chromium, webkit

Comments

  1. umbro says

    January 20, 2018

    My Desktop PC:- Asus P5KC Intel Q6600 2.4GHz 4Gb RAM DDR3 Geforce GT1030 Lubuntu 64bit Geforce GT1030 driver version:- 390.12

    Hi. I am using the right drivers from Linux Lubuntu CPU is 80% to 100% on YouTube 4K video

    on YouTube playing on 4K @60fps very high CPU i tried h264ify still lag and very high CPU tried different Internet browser, for example chrome, Firefox, Opera still lag and very high CPU. tried patched chromium still lag very high CPU

    i don't have this problem with windows 10 (64bit) on windows 10 64bit CPU usage is 10% or 20% to 30% on YouTube 4K video all web browsers work excellent on windows 10, only problem is Memory (RAM) on windows 10

    so that's why i tried Linux Lubuntu

    Reply
    • Arnab Satapathi says

      January 20, 2018

      I don't think that VA-API is yet supported with Nvidia cards at least on Linux.
      Yeah, Windows tends to perform much better in terms of video decoding on browsers, specially Edge browser.

      Reply
  2. Pierre says

    January 24, 2018

    FYI, the Chromium API key error message can be hidden with the parameters --disable-infobars

    Reply
    • Pierre says

      February 28, 2018

      Unfortunately it doesn't seems to work anymore since version 65...

      Reply
      • Arnab Satapathi says

        February 28, 2018

        Checked it with a 1080p video, on youtube and from the file:// URL, VA-API decoding is working on Chromium 65.0.3298.3 , Developer Build.

        Reply
  3. Guy CLO says

    February 26, 2018

    Thank you very much.

    Reply
  4. Adrian says

    March 8, 2018

    Thanks very much for posting this. 1080p30 3mb/s High@L4.1 works great with GPU decoding on my Celeron N3000 which can barely handle 720p30 in software.

    Unfortunately Widevine content is still not accelerated. Netflix does work in these builds of Chromium, assuming you change to a Chrome user agent, but rendering is performed in software, even after disabling the GPU whitelist.

    Reply
    • Arnab Satapathi says

      March 8, 2018

      I think VA-API is not smart enough to decode widevine encrypted streams.

      Reply
« Older Comments

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Fresh Posts

  • How to sideload KODI on Amazon FireTV Stick easily
  • How to connect a MTP USB device on Windows and Linux
  • How to adjust Linux screen brightness on laptops and PC
  • 13 best USB to Ethernet Adapter for 4 different purpose
  • How to properly install RTL8153 driver on Linux
  • MySQL allow remote connections, from another server
  • How to Download and Install Visual Studio for Linux
  • 3 ways to create Windows 10 bootable USB

Get more ideas

Thank you for subscribing.

Something went wrong.

We're committed to protect your privacy

Recent Comments

  • Don on How To Dual boot Windows 10 and Ubuntu on UEFI systems
  • Ricardo on How To Dual boot Windows 10 and Ubuntu on UEFI systems
  • Ricardo on How To Dual boot Windows 10 and Ubuntu on UEFI systems
  • Arnab Satapathi on How To Dual boot Windows 10 and Ubuntu on UEFI systems
  • Don on How To Dual boot Windows 10 and Ubuntu on UEFI systems

Copyright © PCsuggest.com · All rights reserved.

  • Home Page
  • About PCsuggest
  • Contact Us
  • Privacy Policy
  • Sitemap