310.684.3047

The State of Flash and Hardware Acceleration

I’m putting the final touches on my talk for FITC Toronto next week, on the subject of Delivering the Best Flash HD Video, using Stage Video and OSMF. And I thought this was a good opportunity to discuss the state of Flash and hardware acceleration. It’s something of a geeky, unsexy topic (when compared to ‘devices’ or ‘3D’), but it’s been so important to the advances of the Flash Platform across the past few years, that it really deserves some attention.

For those who don’t know, Stage Video is a feature in the recently-released Adobe Flash Player 10.2, which uses hardware acceleration to help you deliver jaw-droppingly rich HD video to your viewers, right through the standard Flash Player.

In the last installment of my State of the Flash series, on Flash and Devices, I mentioned the impressive performance improvements that we’ve seen in the Flash Player over the past few versions. Indeed, in the past year, we’ve seen some incredible new announcements from the powerful native-3D functionality that’s been added, to the brand new Stage Video feature, which can be used to play super-high res HD video right in Flash.

And you’ve likely noticed this trend as well: Flash just keeps getting stronger and more powerful. You now see Flash experiences on the web featuring outstanding quality HD video, and 3D environments with hundreds of thousands of polygons, animating at full-frame rate, without any external plug-ins or libraries. And even the plain vanilla Flash banner ads that litter the web run more smoothly.

None of this is a coincidence. It is the result of a concerted effort on behalf of Adobe to massively improve the performance of the Flash Player.

And while those efforts were, at least in part, targeted at getting the Flash Player to run on weaker, mobile devices, that same effort has yielded dividends on the desktop, as well. In other words, Flash Player on the desktop has gotten more powerful, because Adobe now supports Flash Player on mobile.

But, this performance optimization only explains part the explosion in Flash Player performance.

The fact remains that Flash Player is a piece of software. And, in relative terms, software is weak (while quite flexible), in comparison to hardware, which is much more powerful (while more static with less range). Stated in other terms, software is Johnny Depp and hardware is Arnold Schwarzenegger.

And this is where “hardware acceleration” enters the picture. “Hardware Acceleration” can definitely be a scary term. First, because it has the word ‘hardware’ in it (and, in my world, even technically proficient people tend to be more focused on software), and it’s followed by the word “acceleration”, which is not something you generally want your hardware to do (you want it staying put, thank you very much).

Fortunately, hardware acceleration is not a complex or difficult concept — and understanding hardware acceleration is critical to understanding why Flash has gotten so much more powerful in the past few years.

Let’s step backwards a bit in time. The year is 2000. The version of Flash that is on the market is Flash 4. You open up an FLA, and the default framerate is 12 fps (do you remember that?) And, you hoped that, after optimizing your work, you were actually able to run your SWF at the full 12 frames per second.

True, computers then were much weaker. And Flash was a vastly weaker, significantly less mature technology. But that wasn’t the whole story.

Early on in the history of Flash, Macromedia assumed a platform-agnostic stance. Macromedia didn’t care if the Flash Player was running on Mac or Windows (or, in later versions, Linux) or whatever — Macromedia just wanted it to run, and to run consistently. Macromedia wanted your Flash experience to run, as identically as possible, on every device that could view it.

And, that was a huge selling point to web developers like me, who were incredibly frustrated by the amount of debugging that had to go into building HTML pages (I recall that, on some HTML web projects, debugging and remediation to ensure cross-browser/cross-platform consistency took up to 50% of the production time).

However, in order to keep the Flash-experience consistent between platforms, Macromedia intentionally eschewed any platform-specific enhancements. This meant, for example, that Macromedia never really utilized native-PC GPU power (the graphics processor on the video card in your computer).

In other words, Flash *could* have been more powerful, if Macromedia had been willing to tap into some of the extra powers on a PC. But then Flash would have been different on the PC, than on a Mac.

In short, Macromedia hobbled Flash’s performance, in order to maximize the consistency of cross-platform performance.

What happened to that stance?

Well, too many things to enumerate here. Adobe bought Macromedia, for one. PCs and Macs got way more powerful. Bandwidth expanded considerably. The market for mobile devices (which are much weaker than traditional desktops) has exploded. HD video has become far more popular. Etc, etc, etc.

The point is that, in the past four years, the platform-agnostic stance shifted. Instead of refusing to tap into the powers of the native device, Adobe is trying to tap into as many as possible. Yes, this means that the Flash Player now runs very differently on a brand-new top-of-the-line Mac Tower, than it does on a Samsung Galaxy Tab. Indeed, the Flash Player can now run differently on a Mac Tower with an NVIDIA Geforce graphics card, than it will on the same computer with a ATI Radeon graphics card.

Why?

Flash has a lot of drawing to do. With each frame, Flash must redraw the entire movie. But remember that Flash is software, which is relatively weak. So, a demanding animations can lead to slow performance; and a high-res HD video can lead to dropped-frames.

So, instead, Flash now passes off much of the heavy-duty work to the graphics card, if one is available. The graphics card on your computer becomes a sherpa to Flash, assuming the demanding grunt-work to maximize the viewer’s experience. Instead of drawing the graphics to the screen, Flash can pass those graphics to the graphics card, which will draw them to the screen.

Again, this has all been relatively recent. Adobe first made hardware acceleration available (via ActionScript) in full-screen mode with Flash Player 9.0.115 (when Adobe also added support for H.264 video to the Flash Player). They added hardware acceleration out of full-screen mode in Flash Player 10 (triggered by setting the WMODE embed parameter to “gpu” or “direct”). They further improved hardware acceleration in Flash Player 10.1, and also made it the default playback mode (unless overridden by another WMODE). And, with Flash Player 10.2, Adobe introduced the Stage Video feature (available via ActionScript, and ensured by setting the WMODE embed parameter to “direct”), which further improves the quality of the video you can deliver, and the graphics and animation that you can support at the same time.

So, while the nuts and bolts of hardware acceleration can be a bit complex, in a nutshell, understanding what it means is quite simple: when we say that Flash has hardware acceleration, it means that the Flash Player has the ability to ask the hardware in the viewer’s computer to help share in the work-load.

And that lets people like you and me deliver better, more engaging, richer experiences, to more people, on more devices, around the world.

So, in conclusion, as we stand here in 2011, we can say the state of Flash and hardware acceleration is both strong and encouraging. Gone are the days of 12 frames-per-second and abandoning device-specific performance enhancement. True, there are some new terms and concepts for Flash developers to learn, but that’s only because the performance power of Flash continues to expand and become more sophisticated. With these continued enhancements, Adobe is tapping into the power required to support the next generation of digital interfaces.

See you next week at FITC Toronto.

Share and enjoy,

-r

Category: General Posts

Tagged:

One Response

  1. [...] in the Flash Player, which led me to post my latest installment in the State of the Flash series. "The State of Flash & Hardware Acceleration" covers the recent advances in how Adobe is exploiting the computing power available in local [...]

Leave a Reply