Why does flash video consume so much CPU?

5,798

Why can't more processing be offloaded on to the GPU?

Because Flash (used to) lack integration with the operating system and the graphics card's APIs that would allow it to do so. In order for the Flash plugin to defer decoding to the GPU, it needs to talk to the operating system, and subsequently to the graphics card to pass decoding and rendering instructions.

Flash 10.1 finally introduced GPU acceleration.

Hardware-accelerated H.264 decoding is supported on some video cards and drivers running on Windows XP, Windows Vista, and Windows 7. Linux and Mac OS X hardware-accelerated decoding is not supported in this version.

Here's the main culprit: OS X did allow Flash to access the GPU later on for decoding h.264 video, but their support wasn't that great. Because – simply put – Apple still hates Flash (lack of API support is for the same reasons they don't ever want Flash on a mobile device such as the iPhone or iPad). For GPU support in OS X also see this short Adobe knowledgebase entry.

Why it does not work on Linux yet, I personally don't know.

To answer your first question, I'll also cite Adobe itself. The main point is that modern video codecs such as h.264 are very very complicated to decode, and they stress CPUs a lot. If there's no API for GPU decoding, or bad support for it, you'll see high CPU usage, and there's not a lot you can do about it.

H.264 provides excellent video quality but requires a great deal of processing power to decode it. H.264 video is decoded in Flash Player 10.1 by a GPU or media accelerator whenever capable hardware is available, which greatly improves playback performance and battery life. This is particularly useful for resource-constrained mobile devices, such as netbooks and smartphones.

Share:
5,798

Related videos on Youtube

52d6c6af
Author by

52d6c6af

Updated on September 18, 2022

Comments

  • 52d6c6af
    52d6c6af almost 2 years

    Is it simply a CPU-intensive activity, or is there more to it? Why can't more processing be offloaded on to the GPU?

  • 52d6c6af
    52d6c6af over 12 years
    Thank you for your excellent answer. I use a MacBook Pro. Is there any way I can pretend to YouTube that I do not have flash and hence see their HTML5 version? (and reduce the burning sensation in my lap ;)
  • slhck
    slhck over 12 years
    @Ben Sure, sign up for the HTML5 beta. Not all videos are available in HTML5, but YouTube will try and serve them to you in a less lap-burning manner (there's also a MacBook Pro user speaking here). I've had mixed results though with videos not loading.