What is it with Ubuntu / Linux, Youtube / HTML5 videos and the high CPU load?

I had similar issue. My CPU used >100% in htop while watching YouTube videos in 1080p.

Specs:

CPU: 7700k
GPU: Nvidia GTX 1080
Drivers: 384.69

I had to install these plugins:

sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly

Then went to Google Chrome flags page chrome://flags/ and enabled option:

WebRTC H.264 software video encoder/decoder Mac, Windows, Linux, Chrome OS

Screen: enter image description here

After restarting browser my cpu usage dropped to around 30%.

As a last resort You can always disable Video Hardware Decode by using command line:

google-chrome --disable-accelerated-video-decode 

Here's a list of all possible command line options for Google Chrome: https://peter.sh/experiments/chromium-command-line-switches/

Alternative Solution:

There is another thing that, for me, made my CPU go high. It was a js script on the YouTube. I had to block it in uBlock addon:

enter image description here

Red rectangle shows many requests from a mss_4.js script - this caused the CPU spikes. Green rectangle shows that the script is blocked inside the uBlock addon, so no more request inside the mss_4.js are made.


Since your system has both Nvidia and Intel GPU, and the problem is found on every single browser you're using. It's definitely a problem with the drivers and not the browsers. Even though Chrome is not helping by not providing video hardware decoding. You should try using only the Intel GPU which has more stable drivers on Linux.

@Quasdunk reported that switching to the Intel GPU lowered significantly the load on the machine and now it's usable.

If you really want to use the Nvidia GPU, you should try upgrading your drivers using this ppa.