h264ify Addon by erkserkserks

https://github.com/erkserkserks/h264ify

“Try h264ify if YouTube videos stutter, take up too much CPU, eat battery life, or make your laptop hot.

By default, YouTube streams VP8/VP9 encoded video. However, this can cause problems with less powerful machines because VP8/VP9 is not typically hardware accelerated.

In contrast, H.264 is commonly hardware accelerated by GPUs, which usually means smoother video playback and reduced CPU usage. h264ify makes YouTube stream H.264 videos instead of VP8/VP9 videos[…]”

H264ify is a browser extension for Chrome and Firefox that aims to improve the performance of YouTube video playback by redirecting YouTube to use the H.264 video codec instead of the VP9 codec. H.264 is a widely used video compression standard that is known for its high efficiency and good quality. VP9, on the other hand, is a newer codec developed by Google that is designed to be more efficient than H.264, but it is not as widely supported.

The problem with VP9 is that it can cause high CPU usage and lead to poor performance on some systems, especially on older computers or those with weaker processors, resulting in choppy playback, dropped frames, and other issues. H264ify addresses this problem by redirecting YouTube to use H.264 instead of VP9, leading to a significant improvement in video playback performance, especially on systems that have difficulty decoding VP9. In addition to improving performance, H264ify also has the added benefit of reducing data usage and battery consumption, as H.264 is a more efficient codec than VP9.

To determine if you might need the H264ify addon on an Ubuntu 22.04 system, you can check the processor architecture of your computer. If your processor is a 64-bit architecture, then you are less likely to experience the poor video playback performance that the addon aims to fix. To check the processor architecture of your system, you can use the command uname -m in the terminal, which will output either “x86_64” for a 64-bit processor or “i686” for a 32-bit processor. Additionally, you can also check the codec used by your browser to decode the video by using the browser's developer tools, or by using a website such as YouTube HTML5 Video Player Detection.

It is worth noting that even if you have a 64-bit processor, you may still want to use the H264ify addon to reduce data usage and battery consumption. To install H264ify, users can download it from the Chrome Web Store or the Firefox Add-ons page. They may also need to enable GPU acceleration, which can be done by following instructions from WebUpd8.org. Once installed, users can check which format YouTube is using to stream videos by right-clicking on the video and selecting the “stats for nerds” option. If H264ify is working correctly, the mime type should read video/mp4.

H264ify is a browser extension for Chrome and Firefox that helps improve video streaming performance on YouTube. It does this by switching the YouTube video stream from using VP8/VP9 to H.264 instead. This change is instant and not visible or noticeable to the user's eye.

The main benefit of using H264ify is that it reduces the load on the CPU, as H.264 is commonly hardware accelerated by GPUs. This usually results in smoother video playback and reduced CPU usage. Additionally, it may help users who try to play high resolution video on YouTube, such as 1080p video, and notice dropped frames or jerky playback.

To install H264ify, users can download it from the Chrome Web Store or the Firefox Add-ons page. They may also need to enable GPU acceleration, which can be done by following instructions from WebUpd8.org.

Once installed, users can check which format YouTube is using to stream videos by right-clicking on the video and selecting the “stats for nerds” option. If H264ify is working correctly, the mime type should read video/mp4.

In summary, H264ify is a browser extension that aims to improve YouTube video playback performance by forcing the use of the H.264 codec instead of VP9. This can lead to a significant improvement in video playback performance, especially on systems that have difficulty decoding VP9. Additionally, it also has the added benefit of reducing data usage and battery consumption. It's worth noting that even if you have a 64-bit processor, you may still want to use the H264ify addon to reduce data usage and battery consumption, as H.264 is a more efficient codec than VP9.

To check if your Firefox or Chrome browser is using the VP9 codec, you can use the browser's developer tools.

In Firefox:

Open Firefox and navigate to a YouTube video. Press F12 to open the developer tools. Select the Network tab. Refresh the page and look for a request to a video with “vp9” in the name.

In Chrome:

Open Chrome and navigate to a YouTube video. Press F12 to open the developer tools. Select the Network tab. Refresh the page and look for a request to a video with “vp9” in the name. If you see requests for videos with “vp9” in the name, then your browser is likely using the VP9 codec to decode the video. If you don't see any requests with “vp9” in the name, then your browser is likely using a different codec, such as H.264.

Alternatively, you can use a website such as YouTube HTML5 Video Player Detection to check which codec your browser uses to play YouTube videos.

It's worth noting that, even if your browser is using VP9 codec, it does not mean you will experience poor video playback performance, it may depend on the type and quality of your computer hardware and network connection.

It is possible to determine which codec your browser is using to decode video from the terminal, but it would require additional tools and commands.

One way to do this is by using the youtube-dl command-line tool, which can be installed by running the following command:

sudo apt-get install youtube-dl

Once installed, you can use the youtube-dl command to download a YouTube video, and the tool will display information about the codecs used in the video.

For example, to download a YouTube video and display information about the codecs used:

youtube-dl --verbose [video_url]

This command will download the video and output a lot of information about the video, including the codecs used. You can look for the “vp9” in the output to see if the video is using VP9 codec.

Another way is using ffmpeg tool that can be installed by running the following command:

sudo apt-get install ffmpeg

Then you can use the ffmpeg command to analyze the video file and get information about the codecs used.

ffmpeg -i [video_file]

This command will output information about the video, including the codecs used, you can look for the “vp9” in the output to see if the video is using VP9 codec.

It's worth noting that these methods just give you an idea of the codec used in the video file, but they don't indicate the codec used by the browser to decode the video, because browsers have their own codecs and sometimes use different codecs than the ones used in the video file.

Citations :

  1. https://www.quora.com/What-exactly-does-the-h264ify-Chrome-extension-do-and-should-we-use-it
  2. https://www.ghacks.net/2016/06/26/improve-youtube-performance-firefox/
  3. https://www.reddit.com/r/chromeos/comments/583f9b/psa_if_you_dont_know_about_the_h264ify_extension/
  4. https://github.com/erkserkserks/h264ify
  5. https://github.com/erkserkserks/h264ify-firefox
  6. https://lifehacker.com/h264ify-stops-youtube-from-draining-your-laptops-batter-1729588002
  7. https://www.reddit.com/r/chromeos/comments/gv6b4g/psa_if_you_dont_know_about_the_h264ify_extension/

There are several forks too, like this for example

“A Firefox/Chrome extension that blocks video codecs you have chosen on YouTube […]

“enhanced-h264ify is a fork of well-known h264ify extension for Firefox/Chrome which blocks VP8/VP9 codecs on YouTube, so that you can use H264 only. This may be useful because there are lots of devices on the market which support H264 hardware decoding and do not support VP8/VP9.

This extension has new features such as manual blocking of H264, VP8, VP9, AV1 codecs and 60fps video. By default it blocks everything but H264 and 60fps video. It works only on YouTube[…]”

https://github.com/alextrv/enhanced-h264ify