FlashComGuru Home Influxis ImediaseeUvault
                                                                                       Forum Index | Active Topics | Register
                                                                                                          List Overview | List Archives
                                                                                                                           About this site | Advertise
 

home

Adobe AIR (11)
Applications (41)
Books & Training (11)
Collaboration (18)
Components (11)
Events (87)
Flash Player (47)
Flex (41)
FMS (114)
General (128)
Hosting (6)
Jobs (17)
Off topic (43)
OSMF (5)
Press Releases (24)
Site Check (11)
Tools (56)
Videos & Players (74)

Follow me on Twitter

 
This is not a trick question, but more of a pushback on the recent FUD that various people have been spreading. Quotes such as 'HTML5 video uses 10% CPU while Flash uses 100%' were both unprofessional and not backed up by any actual data. The short answer to the above question could in fact be yes - if I wanted to spin these results, but the more correct way of putting things would actually be: 'It depends'.

My co-author Jan has gone through some lengths to come up with the most thorough like-for-like comparison of HTML5 versus Flash video decoding requirements as far as CPU usage is concerned. His conclusions follow below, and I recommend you head over to his blog for the full story.

=======================================
Overall Conclusions
When it comes to efficient video playback, the ability to access hardware acceleration is the single most important factor in the overall CPU load. On Windows, where Flash can access hardware acceleration, the CPU requirements drop to negligible levels. It seems reasonable to assume that if the Flash Player could access GPU-based hardware acceleration on the Mac (or iPod/iPhone/iPad), the difference between the CPU required for HTML5 playback and Flash playback would be very much narrowed, if not eliminated.

I don't follow the politics of the situation, but after noting significant playback efficiencies in Flash Player 10.1 on the Mac, respected technologist and AnandTech founder Anand Lai Shimpi commented "with actual GPU-accelerated H.264 decoding I'm guessing those CPU utilization numbers could drop to a remotely reasonable value. But it's up to Apple to expose the appropriate hooks to allow Adobe to (eventually) enable that functionality." So it looks like the ball is in Apple's court.

Overall, it's inaccurate to conclude that Flash is inherently inefficient. Rather, Flash is efficient on platforms where it can access hardware acceleration and less efficient where it can't. With Flash Player 10.1, Flash has the opportunity for a true leap in video playback performance on all platforms that enable hardware acceleration.

Turning full circle, if Anand is right, and I don't doubt that he is, Apple complaining about Flash being a CPU Hog while not exposing "the appropriate hooks" to enable Adobe to access hardware acceleration seems disingenuous at best. To be fair to Apple, though, the iPad related timing was unfortunate, with the bulk of the development work done under the shadow of Flash Player 10.0, which didn't offer hardware acceleration other than full screen on any platform and was clearly less efficient than the HTML5-based approach Apple adopted. Now that Adobe has proven the concept on Windows, perhaps Apple will cooperate with Adobe to make hardware acceleration on the Mac, iPad and future devices happen. If they choose not to, however, they should quit pointing fingers at Flash.

What else? We also learned that not all HTML5 browsers/H.264 decoders are created equal. Significantly, with Flash 10.1 deployed, Google's HTML5 implementation required the most CPU horsepower of all playback scenarios -- by far -- on the Windows platform. On the Mac, Firefox and Safari with Flash required less CPU horsepower than Chrome's HTML5 implementation.

At least from a CPU utilization perspective, Flash isn't BAD and HTML5 isn't GOOD. It all depends upon the platform and implementation.
=============================

For the full test procedure and detailed results head over to Jan's blog.

Comments
[Add Comment]
If Flash needs GPU acceleration on Mac, this is Adobe deal. They should rewtire Flash Player to make it run on native technologies implemented by system (Core Animation/Core Graphics/OpenGL ES). All depends for Adobe and Steve told that on conference with developers. He told what Adobe could use those technologies, but can't understand why they don't use them and i think thats why he called them "Lazy"
# Posted By Sergey | 3/1/10 8:13 AM
Truly enlightening Sergey. You didn't even bother reading Jan's article in detail, did you?
# Posted By Stefan Richter | 3/1/10 8:19 AM
Sergey, for a more detailed post on Adobe using Core Animation in Flash, check out this post by someone on the Flash Team:
http://www.kaourantin.net/2010/02/core-animation.h...

It goes into detail that Flash as a plugin can only access APIs that a browser exposes, which is completely different from a desktop app. Flash Player 10.1 will get a speed boost when used in the nightly builds of Safari, because it's only the only browser on a Mac that currently has the Core Animation API. Also mentioned in the comments, Tinic from the Flash Player team mentions they would love to access OpenGL on a Mac and hope this will happen in the future, but it seems like they can use it right now.
# Posted By Matthew Fabb | 3/1/10 3:44 PM
@Stefan
I've read it and respond on this part:
"But it's up to Apple to expose the appropriate hooks to allow Adobe to (eventually) enable that functionality." So it looks like the ball is in Apple's court."

Why Apple should make some changes on their system to fit it for plug-in? Maybe plug-in maker should do so.

@Matthew
They don't use it as well, because they can't make realtime conversion of all stuff from ABC and run it with Core Animation API. If they do, h.264 will consume less CPU time, because playing such video is native for Graphic subsystem of Mac OS, so what for we need flash player if system can play video by its own?
BTW Quartz 2D also not so weak part of graphic subsystem.
There is no word about what they can't reach Core Animatino API from browser.

BTW2. Apple already done much, because of flash issue, they make browser launch all plugins in separate process, which will protect browser from crashes because some buggy code in flash movie
# Posted By Sergey | 3/1/10 4:27 PM
@Sergey Going what is said in the comments in that link, Adobe still can't access the H.264 decoder, as it's only available via the QuickTime framework. That's no good for Adobe, as it's too high level for the Flash video player, which combines the video with other Flash and HTML elements. Flash needs a lower level video API available to plugins (not just desktop apps) to provide the RBG pixel values so that if the developer puts say video controls on top of the video, or a HTML drop down menu on top of the Flash element, it shows up.
# Posted By Matthew Fabb | 3/1/10 6:48 PM
"BTW2. Apple already done much, because of flash issue, they make browser launch all plugins in separate process, which will protect browser from crashes because some buggy code in flash movie"

And yet when my buggy actionscript code crashes safari, I have to reboot my Mac completely for safari to load again without crashing.

It also crashes dreamweaver and firefox at the same time.. so bloody annoying!
# Posted By guest | 3/1/10 7:37 PM
@guest There must be something wrong with your Mac then. It is designed to not require lockups or reboots when a single app crashes, for whatever reason. If you have to reboot due to a Safari crash then you have bigger issues lurking than a browser plugin...
# Posted By Stefan Richter | 3/1/10 7:40 PM
@Stefan Richter
Flash as plug-in runs in separate process only since 10.6 and Safari 4+
For example I've same situation as guest. If my AS3 code produce some exception and I don't close that message in time, plug in will hang my Safari and all other application which using that plug-in. Even if force quit Safari and launch it again, it will hang again when flash plug-in will be loaded to render flash content on page.
So as quest, I've to reboot my mac, because plug-in hangs somewhere, can't see it even in top.
# Posted By Sergey Mamontov | 3/1/10 8:10 PM
Maybe I have some miracle hardware then because neither my old iBook running Panther nor my Macbook Pro with Tiger have *ever* required a reboot because of a crashed browser. In fact I cannot recall having to have had to reboot the Macbook Pro for weeks on end, and that's me being the Flash geek that I am who runs nothing but Flash apps all day long, since that's how I make my living. I'm not saying browsers don't crash, but they don't bring a whole system down unless the system itself has some deep rooted issues.

So either my machines are gifted, or you're spreading a lot of inaccuracies. Which one is it?
# Posted By Stefan Richter | 3/1/10 8:16 PM
Also don't assume I'm using Safari to test my apps - it's my third choice browser. Maybe it's just Apple being lazy, who knows.
# Posted By Stefan Richter | 3/1/10 8:18 PM
@Stefan Richter
Interesting, what part of sentence:
"... plug-in will hang my Safari and all other application which using that plug-in."
So even FF 3, Chrome and Opera will hang too.
I'm flash developer, so I'm work all the time with flash. Maybe you have some other build of plug-in. I've roll back to 10 debug version from 10.1 beta 3.
BTW try make some error in code witch will produce exception in run-time. Embed that flash in HTML and open in browser. Wait about 10 seconds till exception window will appear and than try to close it. I can't close it if will spend time on reading backtrace.
# Posted By Sergey Mamontov | 3/1/10 8:37 PM
I get runtime errors in my apps too. They never crash my browser, and of course I can close the warning window. As I said, there's something else amiss on your end.
# Posted By Stefan Richter | 3/2/10 9:25 AM
@Stefan Richter
Who knows, but if I'm not alone with this problem, there can be more other people with same problem. This mean what problem not local and can't be ignored by Adobe, because their player really crash browser. I'm even not able to start standalone debug player.
If Adobe will finally start moving and will fix all that issues, than maybe peoples on Mac will turn on flash plug-in back in their browsers.

BTW, why flash drains so much battery power? Why if on MacBook Pro with SL turnoff flash plug-in, it will run 40% longer? Adobe still need work, and work harder! Or they can leave all as is and become another MS
# Posted By Sergey | 3/2/10 9:34 AM
Same here I've never had to reboot after a runtime error. I did have memory leaks that drove webkit to freeze when running the 10.1 beta but it's beta so you have to expect that. I think you need to look at what other processes are running on your system to force a reboot.

Also Adobe can only do so much if Apple does not want to play ball with it's system. The flash player compositing in the browser and where apple like to let 3rd parties access their api's sem to not line up. I do all my dev on a mac but if Apple does not shift their "Attitude" i'll be going to a windows box. Flash tech pays my bills, Apple tech does not.
# Posted By Ethan | 3/2/10 5:59 PM
It's a known bug with the flash player.

http://bugs.adobe.com/jira/browse/FP-2012


If you want to see the "cause" of this issue that Sergey and I have both independently experienced you can run the following test.

Create a simple flash app, run it in the flash player and have it trace out System.totalMemmory

Then, run the app in a new tab in your browser, and in multiple browsers. Every time you open up a new instance you will see all swfs printing out the same System.totalMemmory figure. meaning, the flash player is sharing the same resources across all browsers and programs that use the flash player (atleast on a mac)

On windows it might depend on if you are using an activeX player or the Mozilla/netscape player.
# Posted By guest | 3/2/10 7:51 PM
Yep there's a lot of innaccurate anti-flash propaganda flying about nowadays - saw quite a few people oohing and aahing over the 'skip intro' macheist javascript/css animation recently. After noticing it used loads of cpu decided to recreate it in flash to get some figures: PC JS 50% flash 5%, mac JS 90% flash 65% nuff said
# Posted By Mike Duguid | 3/2/10 11:13 PM
@Sergey
<Why Apple should make some changes on their system to fit it for plug-in? Maybe plug-in maker should do so>
thats right, or even better, lets use something better - windows for example.

@mike is right, it is turning into anti flash crap, thnx mr jobs.
# Posted By Denis K | 3/3/10 12:47 AM