Does YouTube stutter, heat up your laptop, kick your fans into gear, or just use a lot of CPU? Even if you’ve never noticed, YouTube in Chrome is almost certainly using more battery power than it needs to. Like Chrome’s other performance problems, this is probably worst on Macs.

This is a result of the shift to HTML5 video and quirks with the video codecs used by YouTube in Chrome versus other browsers. Bear with us and we’ll explain why Google made YouTube playback so inefficient in the first place. Firefox may have the same problem, too.

HTML5, H.264, VP8, and VP9

RELATED: 10 Things You Didn’t Know Your Web Browser Could Do Yet

YouTube has now largely dumped the Flash video plug-in for HTML5 video playback. But HTML5 video playback isn’t standardized. Browsers can choose which video codec they want to use, and there’s not a single codec all browsers prefer.

When YouTube used Flash, it used the H.264 codec for playing back videos. Videos with this codec usually have the .mp4 file extension, and are often referred to as MP4 videos. This is a de facto industry-wide standard beyond just web browsers.

Safari, Internet Explorer, Microsoft Edge, Chrome, and Firefox all include support for playing H.264-encoded videos, although Firefox dug its heels in and avoided including this for as long as possible.

While Apple and Microsoft only support H.264 for video playback in their browsers, Google has also been pushing its own codecs. Google acquired the VP8 codec and built it into Chrome, and Firefox followed suit. Google is now pushing the next-generation VP9 codec, which is now also built into Chrome and Firefox. Files using this codec usually have the .webm file extension, and are also sometimes called WebM files.

Why Did Google Create VP8 and VP9?

While H.264 is a de facto industry-wide standard, it has a significant problem. The underlying technologies are covered by a wide variety of patents. To use these technologies — if you were building them into a product, for example — you’d need to pay a fee to the H.264 patent portfolio.

That’s why Mozilla held out so long against H.264 — it wanted the web to be based on an open standard that didn’t require any fees. Google released VP8 and VP9 with an irrevocable patent promise, allowing people to do whatever they want with it — Google won’t try to extract patent fees. Cisco is effectively paying the licensing fees and providing a free plug-in for Firefox users. Firefox automatically downloads this plug-in and uses it to enable H.264 support.

VP8 Hasn’t Gained Traction

But Google wasn’t particularly successful with VP8. At the beginning of 2011, Google announced it would be removing H.264 support from Chrome to support only open codecs like VP8 and Theora. More than four years later, Google never did this and we haven’t heard anything about that promise since.

Mozilla was likely holding on for Google to follow through on its promise, but Google never could — instead, Mozilla relented and added H.264 support years later. H.264 is the current de facto  standard codec, like it or not — and, when using an Apple or Microsoft browser, it’s the only available one. It’s the only real option for mobile browsers, too. Many websites have implemented HTML5 video with only H.264 support, and Chrome and FIrefox would be shut out of it if they didn’t support H.264.

The Real Problem: Hardware Acceleration

There’s one simple, core problem here. H.264 decoding (playback) is hardware-accelerated. This means that the “work” of playing an H.264 video file is done by the graphics processor (GPU) in a much more efficient way. If hardware decoding wasn’t available, the CPU would have to do all the work in a less efficient way. This means playback takes less CPU time, which means less battery power is wasted and less heat is generated. It also could mean smoother playback if the CPU can’t keep up with playing the video.

Really, all modern pieces of hardware support H.264 hardware-accelerated decoding. This includes all types of smartphones, tablets, PCs, Macs, and even Chromebooks. When a web browser — yes, even Chrome — plays H.264 video, it’s offloaded to the GPU. Even Adobe Flash supported hardware acceleration of H.264 video.

But there is no hardware out there that will accelerate VP8 and VP9 videos. When Google announced VP8 in mid-2010, a variety of companies including big names like nVIDIA, AMD, and Qualcomm announced they’d be supporting VP8 in their products. But, more than five years later, no devices ever arrived with hardware-accelerated VP8 decoding.

In Google’s recent announcement of VP9, it notes that “More than 20 device partners across the industry are launching products in 2015 and beyond using VP9.” The same post also notes other advantages of VP9, like smaller file size for the same quality. Intel, nVIDIA, AMD, and other companies have pledged to support hardware-accelerated decoding of VP9.

We searched to find hardware that supports hardware-accelerated VP9 decoding, and all we found was that Intel released new Haswell and Broadwell drivers for Windows with “partial ardwareardware (sic) acceleration support” for VP9 at the start of 2015. Clearly there’s a lot more work to be done.

Like Chrome’s other performance problems, this may be worse on a Mac. Chrome engineers closed a bug about high CPU usage and heat generation on a MacBook with the comment “CPU usage during VP9 playback on a Mac is not a bug.” That may be true, but Google probably shouldn’t be serving all those VP9 videos to Chrome users on Macs if high CPU usage is normal. That just encourages Mac users to use Safari instead.

How to Make YouTube Play Videos More Effeciently

It’s a chicken and egg problem, really — manufacturers aren’t going to implement hardware-accelerated VP9 until it’s actually being used in the real world. Google solved this problem by adding VP8 and VP9 to Chrome and telling YouTube to serve VP9 and VP8 videos to Chrome. YouTube may also serve VP8 and VP9 videos to Firefox.

This might save some download time, but it means that YouTube drains more battery power and CPU cycles in Chrome. On devices with particularly slow CPUs, videos may even stutter instead of playing back smoothly.

To get more efficient playback, you could just switch to Safari, Microsoft Edge, or Internet Explorer. But you don’t have to do that. You can install the h264ify browser extension for Chrome, which will force Chrome to request H.264 videos from YouTube. They’ll look the same, but Chrome will play them back more smoothly.

Download h264ify for Chrome, get h264ify for Firefox, or consult the project page at GitHub for more details

How to See Whether YouTube is Using H.264, VP8, or VP9

To check which codec YouTube is serving to your browser, right-click a YouTube video during playback and select “Stats for nerds.” To the right of “Mime Type,” you’ll see “video/mp4” and the “avc” codec for H.264/MP4 videos.

For VP8 and VP9 videos, you’ll see “video/webm” and either “vp9” or “vp8”.

In the longrun, Google’s VP9 push might be better for the web and lead to hardware that can provide accelerated decoding of this new codec. But, in the present, you might want to save some battery life and make your laptop run more efficiently be opting out of Google’s experiment and using H.264 video instead.

Image Credit: Esther Vargas on Flickr