Disable YouTube 60 FPS (Force 30 FPS): Save battery and reduce YouTube CPU usage by 2-4x!

Discussion in 'macOS' started by SteveJobzniak, Sep 18, 2016.

  1. SteveJobzniak, Sep 18, 2016
    Last edited: Nov 23, 2016

    SteveJobzniak Suspended

    SteveJobzniak

    Joined:
    Dec 24, 2015
    #1
    This was inspired by the fact that my MacBook Pro 2010 uses over 100% CPU and starts lagging when trying to play 1080p60 videos on YouTube. Safari slows down, the video freezes, the audio glitches and the browser feels like it is going to crash, all while the "VTDecoderXPCService" process uses all the CPU since my laptop hasn't got any hardware decoding support for 60FPS H.264!

    So... I've created a solution which switches all of YouTube's high-FPS videos back to 30FPS. It completely solved the issue for me. In fact, going back to 30FPS will actually reduce your CPU and battery usage no matter how fast your laptop is. So even modern laptop users may want this, if they don't see the point in wasting CPU and bandwidth on high-FPS videos. Enjoy!

    Disable YouTube 60 FPS (Force 30 FPS)
    * Download Here: https://greasyfork.org/en/scripts/23329-disable-youtube-60-fps-force-30-fps


    This script tells YouTube that your browser only supports 30FPS or less, which means that you will see regular 30FPS versions of all HD videos.

    WHY DO THIS?:
    For my six year old laptop, switching from 1080p60 to 1080p30 reduces the CPU usage by 2-4x, and removes all CPU overloads that used to make my browser and video playback freeze! This means longer battery life, and a much happier video watching experience!

    (Furthermore, most older graphics cards only support hardware acceleration of 1080p30 or lower, which means that using this script may allow your graphics card to perform the video decoding for great battery savings!)

    INSTALLATION:
    Install the Tampermonkey (https://tampermonkey.net) extension for your specific browser, and then install this script into Tampermonkey.

    This script has been tested and confirmed working in Safari 9 for Mac and Google Chrome for Mac. But it should work in allbrowsers and OS's that support the Tampermonkey extension - on Windows, Mac and Linux!

    (This script does NOT work via Chrome's own basic built-in script support!)

    IMPORTANT NOTE TO ALL USERS:
    We DO NOT affect embedded YouTube videos, because embedded players only check for high-FPS support, so blocking those queries would mean completely losing all HD resolutions for embedded videos!

    I suggest clicking the "Watch on YouTube" button to play embedded high-FPS videos directly on YouTube in 30FPS instead!

    VERY IMPORTANT NOTE FOR SAFARI BROWSER USERS:
    This script contains a workaround for a Safari bug. The Safari browser uses "lazy" extension loading, which means that your extensions (such as Tampermonkey) don't start running in new tabs until you actually visit a webpage in your new tab. And if the first page you visit in your new tab is YouTube, it may perform its codec check before the extension has been fully loaded, in which case YouTube will revert to giving you high-FPS videos in that tab. This "too late extension loading" will happen every time you write/paste a YouTube video URL in a brand new empty tab, or right-click a video link and choose "open in new tab/window", or use the History menu to browse to a video page. In other words, it's quite rare but common enough to be annoying. Our chosen workaround is that whenever we detect that Safari has loaded Tampermonkey too late in the current tab, we perform a very quick reload of the current YouTube page so that the extension can run before YouTube does its codec check. This reloading is automatic and happens so quickly that most people won't even notice anything at all. I just mention it here for the few people who pay attention to such things.
     

    Attached Files:

  2. SteveJobzniak, Sep 18, 2016
    Last edited: Sep 18, 2016

    SteveJobzniak thread starter Suspended

    SteveJobzniak

    Joined:
    Dec 24, 2015
    #2
    Hey, to the 5 or so early people who have already downloaded the extension:

    Please check the new greasyfork link above and download it again, for your own sake. Immediately after release, I came up with an automatic and very transparent workaround for Safari's browser "extension loading" bug, to make the extension even better. The rewritten "note for Safari users" section above describes the new, improved behavior. You'll now get to enjoy hassle-free 30 FPS videos from now on. :)
     
  3. RoboWarriorSr macrumors 6502a

    Joined:
    Feb 23, 2013
    #3
    Wow wished I had this sooner, it was a pain to watch YouTube videos on my 2009 13" MBP after Google turned on the 60 FPS switch.
     
  4. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #4
    Cracking work! I was looking for something like this for two years and I ended up using youtube-dl and Apple’s podcasts to download YouTube videos instead of using the website. Safari on Mavericks does not have this problem at all.
     
  5. SteveJobzniak thread starter Suspended

    SteveJobzniak

    Joined:
    Dec 24, 2015
    #5
    Wow that's horrible and sounds extremely painful. I wish I was around two years ago to help you out. :\ Sadly(?) I was using a desktop as my primary machine back then and didn't notice the issue until I recently dusted off my MacBook Pro 2010 and started using it as my main machine. Love laptops. Hate their lack of upgradability. ;-p

    I paid over $3200 for this laptop six years ago (high European taxes, plus lots of 3rd party upgrades for it...), so I stubbornly refuse to upgrade for a few more years. The top-end laptops released today in 2016 are so fast now that they should last for a decade, so by 2018 they should be incredible...
     
  6. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #6
    It is not nearly as bad. I don’t have a YouTube account, so using the feeds as podcasts is my way of keeping track of new videos. They work remarkably well. I also don’t like the YouTube app or mobile website at all and I can use Apple’s podcast app instead. The ads on YouTube are still annoying, even with an ad-blocker. I have also been using Mavericks mostly, so it was not much of a problem. The extension will be very useful when I grudgingly move fully to El Capitan or Sierra.

    QuickTime X has never run satisfactorily on my MacBook, at native resolution. There was always a slight frame-rate drop even at 30/24 fps. I am confident that Apple uses some form of throttling to keep the CPU usage at a minimum. This is probably what causes the choppiness of the video, especially at 60 fps. Alternative players like MPV don’t have this problem at all, but they do use all the available CPU to render the video smoothly.
     
  7. SteveJobzniak thread starter Suspended

    SteveJobzniak

    Joined:
    Dec 24, 2015
    #7
    Man... just get El Capitan (or Sierra on its ".1" bugfix release). I've never been happier with my Mac. It's faster than ever before. Get "AdGuard Adblocker". It's the best (and free) "Safari Content Blocker" which uses Apple's new native adblocking method, which is ultra-fast. Pages load instantly. I never see a single ad on YouTube, and I can even customize the web blocking to also block any non-ad elements I dislike. You just click on a "dropper" button and click on the element you want to hide. It's amazing. I've made YouTube hide the "related videos" bar, to stop distracting me into endless binge watching on random related videos. ;)

    Your method of subscribing to feeds and automatically downloading new videos for your favorite channels seems pretty cool though. Waste of disk space but still cool. There's something nice about having a new "offline podcast" to watch every day. :)

    Probably. I am also sure that they have less efficient decoders. Google Chrome's software decoder is about 2x faster than Safari's software decoder. And VLC's software decoder is even faster. I can watch 4K videos in software decoding with VLC with about 30% CPU usage, and I can watch 1080p60 in Chrome with about 80% CPU usage, whereas Safari chokes on 1080p60 causing 200% CPU usage. Same thing in QuickTime X which also uses Apple's decoder. Their decoder is awful.

    But despite their poor video decoder, I prefer Safari as a browser, so I had to code this 30fps fix for my own sanity. Now I can enjoy YouTube fully again. :) And for offline videos, there's nothing faster than VLC.
     
  8. KALLT, Sep 19, 2016
    Last edited: Sep 19, 2016

    KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #8
    It is not the case for me. I don’t agree with the design direction of OS X Yosemite. I do have and use El Capitan for Xcode and developer stuff and every single time when I am using it for prolonged periods, I make up my mind that I should upgrade the main installation. Then I log back into Mavericks and immediately think ‘nope’. It is that much of a difference for me, the design is comfortable and easily readable in every situation. I also like that it uses something else than grey or translucency.

    Not really, you can stream podcasts as well. The podcast app and iTunes both delete watched cached podcasts automatically. I disabled the automatic downloads of most.
     
  9. SteveJobzniak thread starter Suspended

    SteveJobzniak

    Joined:
    Dec 24, 2015
    #9
    That was my own main complaint. Losing all the colored blue buttons and the colored toolbar icons etc. But then I got used to it. And now I like how minimalist and "out of the way" the GUI is, so that the content is the main focus.

    Oh, thanks for the tip! :)
     
  10. RoboWarriorSr macrumors 6502a

    Joined:
    Feb 23, 2013
    #10
    Sounds like Quicktimee X is forcing the GPU to playback the video to conserve battery. I can see that happening with older Nvidia GPUs or perhaps HD 3000 but Intel's graphic cards seem to do a good job of video playback when they have the proper support.
     
  11. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #11
    I suspect it is something like this. The annoying thing is that QuickTime X did this from the start, back when Snow Leopard was released. My MacBook was not even a year old then.
     
  12. SteveJobzniak thread starter Suspended

    SteveJobzniak

    Joined:
    Dec 24, 2015
    #12
    Version 1.3 is now out, with a complete rewrite to improve the experience in Safari 10 on macOS Sierra.

    I still can't live without this script! This is literally the only thing that still makes YouTube usable on my MacBook Pro 2010!
     
  13. east85 macrumors 65816

    east85

    Joined:
    Jun 24, 2010
    #13
    Thanks for taking your time to write this. I watch a lot of YouTube and this helps tons on my older MacBook.
     
  14. SteveJobzniak, Nov 30, 2016
    Last edited: Nov 30, 2016

    SteveJobzniak thread starter Suspended

    SteveJobzniak

    Joined:
    Dec 24, 2015
    #14
    And thank you for your kind words and letting me know my time and work is appreciated! :) My situation is the same. I watch a lot of YouTube videos and I finally couldn't take all the freezing and stuttering anymore. At last I figured out that it was linked to high-FPS videos. So I sat down for a few days and coded this workaround.

    I'll keep updating it if necessary in the future (and Tampermonkey will auto-update it for you if that happens), but I think it's finished now. It disables high-FPS videos in a completely universal way by literally making the browser tell YouTube that all formats above 30 FPS are unsupported, so it should survive all future YouTube changes as the years roll on! Thus letting us keep enjoying these older laptops for a while longer. ;)

    Take care!
     

Share This Page