YouTube, Battery Life, Firefox, and Linux

Watch too much YouTube? Battery life poor under Linux? Fan running too often? If you answered yes to all of these, it might be because Firefox is not using your GPU properly.

YouTube tends to use the AV1 and VP9 codecs and, if you don't see happy green when you scroll about half way down in about:support to Media for Hardware Decoding for these, your CPU is working hard doing stuff your GPU was specifically designed for.

https://preview.redd.it/ql2lrz9pn97e1.png?width=1006&format=png&auto=webp&s=d142c4554ec47df1b09a2c32ecb0f53a092a5a3c

The fix? Simple. In about:config, toggle media.ffmpeg.vaapi.enabled so it's true.

Once I made this change, and restarted Firefox, my CPU usage dropped by half whenever I watched a YouTube video.

Hope this helps someone else!