Hacker News new | past | comments | ask | show | jobs | submit login
About Adobe's Flash Player Not Having Access to H.264 HW Acceleration on OSX (daringfireball.net)
65 points by barredo on Feb 20, 2010 | hide | past | favorite | 86 comments



The facts that Flash performs just as poorly on Linux as on OS X, and far worse on a fast PowerPC (youtube is painfully choppy on a G5 Quad) than a slow x86 (youtube is tolerable on an Atom) suggest explanations that differ from the Adobe party line.


Also, Flash often, rather surprisingly, uses more CPU cycles when a video is paused than e.g. VLC does actually playing the darned thing (on OS X).

I guess this must be because Apple doesn't allow Adobe access to its proprietary, hardware based empty loop optimizations...


and far worse on a fast PowerPC

This is because Mainconcept's H.264 decoder doesn't have Altivec optimizations, only x86 SIMD. The VP6 and FLV decoders, as far as I know, do have Altivec, probably because back when they were released, PowerPC was a significant market.


The best explanation I've seen is http://www.kaourantin.net/2010/02/core-animation.html when you also realize that for video playback and animation in general, OpenGL > Core Animation > Quartz 2D > QuickDraw for OS X 10.2 and newer (I think QuickDraw was better pre-compositing.)


In my experience flash under Linux was much worse than OS X. One of the main reasons I switched to OS X was to make flex development less painful.


The overall experience is worse on Linux, with sound issues and on 64-bit Linux, clickable areas that don't line up with the visible controls. I was just talking about CPU usage.


You were doing Flex development on Linux? I'm so sorry...

We tried that once but gave up after finding out that turning on a blur filter would segfault the Flash Player. Whoops!


Not a good way to make your point in my opinion. 3D rendering is also slower on both OSX and linux distributions. I don't doubt Adobe and their software is a problem, but I also think it's become far to popular to blame everything on Adobe.


yeah why does Flash run so poorly on my 166Mhz P1. Crappy s/w right. Yeah its become fancy to criticize Adobe and flash, for everything.


Your account is new so I'm going to give you some advice: generally people on Hacker News have a reasonably high technical baseline and it would do you well to assume so. For example, a number of FFmpeg and x264 developers frequent the site and we have a pretty good idea of how video decoding works.


I think it was sarcasm...


I think it was sarcasm...

A sense of which, unfortunately, is in very, very low supply around here.


I quite easily recognized it as sarcasm. But it still wasn't funny. It was just kinda dumb and obvious.


I wasn't discussing whether or not the post was funny. I don't care if it was funny.

I was reacting to what I think is an occasional problem with HN. In a nutshell, some people here take "serious" so far that it turns into "puritanically self-righteously lacking in any sense or awareness of humor or irony." That can lead to really bizzare misfires of communication.

Case in point is the reaction to a recent comment by Jrockway's on the anti-IRS nutcase: http://news.ycombinator.com/item?id=1135693 (again, please don't feel the need to say whether you find his comment funny or in poor taste or whatever).


I think the comment you link to is actually kinda an odd illustration of your point[1]: the first reply (Poe's rule) clearly recognizes it as humor and suggests that others will take it overly-seriously.

The second reply is somewhere in the middle -- at least it didn't start out with "OMG you are a terrible person how could you say that!!!11" I don't know who jrockway is: maybe he's making a joke, and maybe not. It's more likely that he's making a joke, but you never can tell on teh intarwebs... even in a place like HN.

Regardless, I wouldn't consider pw0ncakes' comment puritanical or self-righteous in the least: in fact he/she slightly revels in the possibility of fat-cat execs getting their comeuppance.

[1] Though I don't disagree with your point; I have indeed seen the issue of which you speak, though I can't think of any specific examples.


No, it was just plain dumb.


To play devil's advocate a little bit it's funny how all the negativity is now focused on Adobe when not many months ago it was all focused on Apple's App Store policy.


This article doesn't directly deal with the iPhone or app store. It's talking about Flash on desktop/laptop Macs, and as far as I can tell, the vast majority of the problems with that are Adobe's fault.

I hate that Apple has made its phone OS a walled garden. I won't buy one, and I won't develop for it, but this article doesn't really have anything to do with it.


Apple's fixed the criticisms from a few months ago (long submission updates, poor/inconsistent private API policy, etc). Not to say that you wouldn't have to look far to find new criticisms (their recent removal of "adult" apps, to name one).

Adobe, on the other hand, hasn't fixed any of their problems. And they've had much longer to fix their problems than Apple has. Hell, it took less time for Apple to create a problem that had to be fixed then for Adobe to fix their problems.


Well the Apple App Store problems were merely procedural issues whereas the Adobe issues are technically difficult problems that haven't been solved well by anyone and aren't helped by platform/codec war politics.


From what I know of the issue, the technical problems with Flash are not difficult to solve. The fundamental problem seems to be that Adobe is not willing to put in the effort to make Flash work well on multiple platforms.


Institutional problems can be as hard to fix as technical problems. Whats going on at Adobe might be both types of problems.

(Not to say Apple has an institutional problem, but, speaking in general.)


Goddamnit, why do people keep taking Adobe's statements at face value -- shipping versions of Flash on Windows aren't hardware accelerated either!

The Windows Flash 10.1 plugin has been in public beta for less than 6 months, and only accelerates video decoding on minority hardware. A few percent of their install base has it, tops. Flash on Windows has decoded H.264 video at unaccelerated libavcodec speeds just fine without it going back to Flash 9 in 2007, and H.263 going back to Flash 6 in 2002. Neither of those codecs works nearly as well on OS X or Linux.

They're pushing this angle because it makes them out to be the heroes -- see the passive-aggressive spiel you get when you visit the Flash page on an iPhone -- they'd love to frame everything as "if only Apple would let us". Unfortunately it's not true in the slightest.


Adobe ignored OS X for years and is now finding themselves in a position where they're losing a hold on Flash as the 'standard' for online video. Rather than fixing the technical issues they're focused on marketing. The last 3 years of iPhone sales have proven that people can live without Flash. All Apple has to do now is continue to ignore them and hold their ground while Flash slowly fades away.


Actually they are fixing Flash, although that doesn't excuse Doing It Wrong for all those years.

http://www.kaourantin.net/2010/02/core-animation.html


Yes, I think this is a little to late for them. It seems to me that they went along with something like "Apple has too little market share so it's not so relevant to us".

In the meanwhile Apple become relevant increasing its computer market share with the Mac, conquering the third place in the smartphone market with the iPhone and creating a device (the iPad) that is targeted to a big new audience and in my opinion will take a big share on of the pie (also considering that this is the "multimedia" pie, one very relevant to Adobe).

But in all these years they pissed of Steve Jobs, and he is the wrong person to have as an enemy when you will depend more and more on Apple platforms.


It seems more like Adobe's development teams slowed down after the Macromedia acquisition.


It seems more like they fired what few good devs they had, more like.


"Lastly, does anyone really think it would be a good idea for web content plugins to have direct access to graphics card hardware?" As if there's no secure way to allow it access? Of course there is, and it should have that access if it means the difference between being able to stream video from the web well or not.

I'm not clicking links to anymore of this guy's posts. He's the very definition of a mouthpiece. Nearly every post of his are bad rationalizations for Apple's policies.


> Of course there is, and it should have that access if it means the difference between being able to stream video from the web well or not.

Evidence seems to be strongly indicating that it is not necessary, unless you're Adobe and you need someone to blame for years of neglect.

Also, as pointed out all over the place, it hardly amounts to an excuse for everything else that Flash does that isn't related to h.264.

> Nearly every post of his are bad rationalizations for Apple's policies.

Hard to argue that a browser plugin should have direct GPU access when it clearly doesn't need it.

Also note that Gruber is an Apple pundit and obviously a fan of the company, but he has also been very critical of them in areas (eg, App Store policies).


> Hard to argue that a browser plugin should have direct GPU access when it clearly doesn't need it.

Straw man. Flash doesn't need direct GPU access, just access to video decoding APIs that are accelerated.


As if there's no secure way to allow it access? Of course there is, and it should have that access if it means the difference between being able to stream video from the web well or not.

A safe, high level API exists: QTKit. Adobe wants direct access, so they've ignored this totally. Whether it makes sense to give hardware control to a piece of software notorious for instability and resource consumption is a judgment call, but it seems a pretty clear one.


This argument is ridiculous. Flash is native code and does not run in a sandbox. It already interacts with graphics hardware through numerous other APIs and has the ability to kill your system in innumerable other ways. An API for hardware acceleration of video decoding should be the least of your worries.

Furthermore, this argument would apply just as well to WebGL, which gives graphics hardware access directly to Javascript on any website you visit. WebGL is awesome and I believe it can be done safely.

I don't know much about QTKit but I think it's entirely plausible that it isn't flexible enough for use in Flash. Flash needs complete control over drawing because videos are integrated with other Flash content (likely rendered at least partially in software), and can be manipulated by ActionScript to produce effects such as 360 degree video: http://www.immersivemedia.com/work/cbc/hockey/index.html


> This argument is ridiculous. Flash is native code and does not run in a sandbox. It already interacts with graphics hardware through numerous other APIs and has the ability to kill your system in innumerable other ways.

Actually, in Safari 4 (Intel, 64bit) each plugin runs in its own process, and it _is_ effectively sandboxed. If Flash crashes, it no longer takes down the browser, or even the tab a la Chrome; you just get a hole in the page.


That's not what sandboxing means. Flash is in a separate process but not sandboxed. It has full access to the local system.


Adobe's platform evangelist claims( http://theflashblog.com/?p=1641#comment-639881 ) that the reason they can't use h.264 hardware acceleration on OS X is due to restrictions on browser plugins, which implies that it does not have full access to the local system.


I believe it has to do specifically with how drawing to the screen happens; if that has to go through the browser, then it can't utilize hardware acceleration.

One interesting test we did recently was to make a very simple flash app that draws some basic controls on the screen and scales to the window size. It also prints out the amount of memory being used by the AVM. In IE, memory usage was extremely low and was about the same regardless of the screen size. In Firefox, memory usage was higher and also almost entirely dependent on window size. To me this implies that IE is allowing Flash to interface with the video card directly, while in Firefox it's having to maintain its own frame buffer internally.


"I'm not clicking links to anymore of this guy's posts. He's the very definition of a mouthpiece."

In my opinion, you'd be making a mistake. John Gruber offers the highest quality commentary on Apple related topics of anyone (maybe matched by John Siracusa). He doesn't always take a pro-Apple line - he's been a very strong critic of the App Store acceptance process, for example.


Siracusa has a significantly more in-depth understanding of the technology. Gruber's area of expertise is in the user experience side of things. Gruber is at his best when he's critiquing UI design, somewhat less so when analyzing technical issues.


There is no denying that Gruber is a Mac pundit. Just like a political pundit that means rationalizing and cheering whatever decision the mothership makes, with little insider information. The thing is that whether you agree with him or not Gruber firmly has his fingers on the pulse of Apple.


I was really turned by this statement as well. There are plenty of plugins that do ALREADY including Unity 3d, Director (Adobe product that died in the Macromedia-Adobe transition via lack of investment by Adobe (it did lead browser 3d gaming for a while)), Java and more.

There is NO excuse that a plugin shouldn't be able to access the hardware that is pretty standard today. The worst set of cards can even handle better than software many times over. The worst cards are the intel 945s and more but those are also in netbooks. There hasn't been a better time FOR graphics hardware acceleration. This is also the sole reason flash seems slow on OSX and why native apps on the iPhone are the only way for immersive experiences.

Here is Unity 3D's hardware of the casual gamer breakdown: http://unity3d.com/webplayer/hwstats/pages/web-2009Q3.html


Lets fish out two hypothetical news items from a parallel universe where someone gives a shit. Contrast and compare:

"A browser plugin crashes and takes Safari with it, on this maliciously crafted file"

"A kernel module crashes and execution continues starting at byte 0xDEAD0101, with kernel-level privileges"


There are plenty of ways to make hardware accelerated plugins safe (most run in a sandbox that wraps the OpenGL or DirectX calls). One method is only play them from trusted sites, as you only install apps on your desktop or mobile that you trust. The other is run the process like chrome where it only crashes the plugin, not the browser.

Hardware acceleration is used in many plugins (even Quicktime, Windows Media, etc) and gaming plugins like Unity3D, Director, Java (with processing and GL libraries).

Unless you like hearing your processor spin to death taking days of life out of it, you too should be for hardware accelerated plugins. They are no different than applications that you have to trust.

In fact WebGL is another and O3D is another example of hardware acceleration in a wrapper where what you can use is strictly limited to graphics acceleration.


I don't want Adobe to touch any of my hardware. They are not a hardware company.

EDIT: They might be good at other things though.


true.Daring Fireball seems more and more like from Steve Jobs irrational marketing strategy mouth. Does this guy even realize what hardware acceleration is and why its used, and how flash content is more useful with full hardware acceleration. Next time would just ignore this guy


I subscribe that at least part of the 'problem' is Adobe's (previously Macromedia's) attention to the Mac. Flash has always been subpar, and I'm not alone in that the majority of apps that crash Flash is the root problem. If Adobe would step up their game it would probably go a long way, but they may have already blown their chance. Jobs does not like that Safari crashes unexpectedly, especially cause the layman user doesn't realize it was really the Flash plugin.


Adobe's inattention to the Mac extends far beyond flash.

All their applications now basically use a cross-platform UI that mocks both Mac OS and Windows conventions, and defines their own bizarre little world. (Flash is just more of the same.)

Their Mac updater software is a Byzantine nightmare.

I could go on. Just read some of the irate Mac users' commentary on John Nack's blog at http://blogs.adobe.com/jnack/ .


Should Flash Player be a kernel extension, so that it can ensure it gets plenty of CPU cycles and have direct access to whatever hardware it wants?

Yes, that way developers code for the proprietary platform Flash, and Apple joins all the other PC manufacturers in making commodity hardware with little differentiation except styling.


I'd love to see someone come up with actual facts around this Flash on Mac issue. There seems to be somewhat of a shortage of facts. Gruber has mostly hearsay (although he is very convincing with that).

We'd need to do real benchmarking for various sorts of flash content. What about poorly written ActionScript in the SWF? Does it matter when you are running multiple instances of the player, etc.

These ongoing political speculations are entertaining, but they are getting us nowhere.


As posted twice in this thread already: http://www.kaourantin.net/2010/02/core-animation.html

They're currently burning a lot of cycles just drawing to the screen.


Yep, that is already quite interesting. He doesn't say how this compares to the situation on windows (and linux). Nevertheless - this is already far more substantial.


If Adobe wants access to h264 acceleration, use the QuickTime libraries.

In fact, why isn't Adobe using QTKit? Why are they rolling out their own appalling h264 implementation?


Adobe claims there's a mismatch between QTKit and Flash Player's rendering model, so using QTKit would either introduce more overhead or require a re-architecture of Flash Player.


I performed a little experiment on my MacBook (Core 2 Duo, no hardware acceleration). With flash, rendering 720p h264 routinely eats 100% of the cycles on one of my cores. That same video eats 10-20% in QuickTime.

This isn't very scientific - ignoring cache and lots of other considerations - but memcpy()ing 30fps of 720p video from one buffer to another eats 5%. Decoding h264 in QT, and copying the buffer would take 15-25% total. 25% compares favorably to 100%.

I'm aware that the problem is the way Flash writes into Safari's window. But if Adobe thinks that h264 acceleration would dramatically improve its performance, they'd still have to copy frames into Safari somehow.

(Maybe they mean they want to write directly to the GPU's buffer...)


Well then, I guess they need to re-architect some of Flash Player. They've had more than three years to get this figured out.


How does Perian handle it?


AFAIK Perian doesn't use hardware decoding either. Also, Perian isn't bound by the weird Flash rendering model.

http://blogs.adobe.com/penguin.swf/2010/01/solving_different...


Perian is just a set of decoders for QuickTime, not a full video player pipeline.


Yes. Perian mostly includes ffmpeg decoders that plug into the OS X Component Manager.


By not overriding Apple's decoder for baseline and main profile H.264


I may be misremembering, but I believe QTKit basically just lets you hand it encoded video data, and then it decodes and renders it to the screen (where you tell it to, of course).

Because of how browser plugins work, Flash needs an API that will let them decode the video, get the decoded YUV data back, and then do something with them. I don't think QTKit provides this.

This is why VDPAU on Linux is also unsuitable for in-browser video acceleration.


Thats what video compositing is for I am not a QTKit expert but just quick glance over the documentation they offer QTMovieLayer which allows you to have multiple layers of media which will be composited later ( i.e. one for video, one for the media controls, etc )


Cool! I hadn't known about QTMovieLayer. Thanks for the correction.


I don't see how the fact that other developers aren't complaining is proof that hardware acceleration is not useful. There is a full spectrum of how much access you allow browser plugins and client-side code to features of the underlying OS and hardware. Apple has chosen a relatively conservative point along that spectrum, Microsoft chose a more aggressive one (ActiveX). There is an obvious tradeoff between capabilities/performance and security. Google, with its Native Client sandbox, static analysis tools, etc. is attempting to get the performance of ActiveX with the security of more stringent sandboxes. This is an extraordinarily difficult problem, and Apple is justified in not wanting to deal with it. However, they are not justified in saying they're not leaving performance on the table.

Adobe should be able to improve H.264 decode performance without HW acceleration, but it is unclear what the upper bound is on performance when running inside the browser sandbox. Certainly it can do no better than a native app.

EDIT: wmf is probably right; though there is no browser-specific sandbox that prevents third-party browsers from allowing plugins access to underlying OS APIs, such an API for HW-accelerated video decoding doesn't exist. It's unclear to me if acceleration is just not supported by the driver at all, or if the capability is only exposed via a private API, reserving it for first-party apps like Quicktime. Certainly many of the GPUs included in Apple products support hardware acceleration, so it seems to be primarily a software issue.


I don't think OS X has any browser plugin sandbox. The issue is not that browser plugins are denied access to the H.264 API for security reasons; there is no public H.264 API.

Edit: There is a private H.264 API that is used by QuickTime.


Apple’s own QuickTime on Snow Leopard only makes use of H.264 hardware acceleration with a single graphics card: the Nvidia 9400M. If you don’t have that graphics card in your Mac, you don’t get H.264 hardware acceleration, period.

Seems very surprising if H264 hardware accel is not also supported by the 9600M GT (which is an upgrade on some models of the MBP).


Those MBPs have a 9600 in addition to the 9400.


Right -- but as far as I know, switching between the 9400 and 9600 requires logging out. Seems strange if you'd actually see worse H264 performance using the 9600 than the 9400.


The 9400 is still active when the 9600 is; you can use both at the same with with OpenCL for instance.

And I'd imagine that there's only one video decode ASIC between the two of them, no need to uselessly duplicate hardware.


Interesting. Thanks for the info!


>Lastly, does anyone really think it would be a good idea for web content plugins to have direct access to graphics card hardware?

Well, since moving all applications 'into the cloud' seems to be all the rage these days, it's inevitable that browsers expose deeper functionality of the underlying operating system. So, no, its not that unreasonable to expect it.


This is off-topic, but, why does Gruber ends his posts with open ended questions when there's no way of leaving comments?

Sites like CopyBlogger always suggest that ending a post with a question or two is a way to make sure that people will feel compelled to comment. What's the reason here?

Is he (ab)using sites like HN as his comment system? Or is this a new form of linkbait?


It was a rhetorical question.


I don't think so. Aren't rhetorical questions devices intended to reinforce a point whose nobody shoukd answer? Do we even need an answer regarding the access of a plugin to the hardware card?

See? that's a rhetorical question. Or isn't it?


“I encourage you to send me your comments regarding Daring Fireball. Unfortunately, I am at times a lousy correspondent — where by “at times” I mean “most of the time”. If I don’t respond to your email, or do so only after an inordinate amount of time has passed, please don’t take it personally.

Please address correspondence to:

comments@daringfireball.net”

Daring Fireball – Contact


Probably because of the sort of stuff found here

http://daringfireballwithcomments.net/


Sounds like he sent them a nasty letter. They stopped.


Is there some reason adobe can't use OpenCL to accelerate video decoding?


What is mildly amusing is that Gnash has had H.264 HW acceleration available for months.

http://www.phoronix.com/scan.php?page=news_item&px=NzU1M...

http://www.splitted-desktop.com/static/en/pdf/actu/Linux_wit...


IMHO, Adobe should definitely act more responsible and finetune Flash Player to perform better across all platforms.

But i disagree with John Gruber.

#1) Flash is not "slower" on Mac . It uses up too much resources compared to its Windows edition. I switch between Windows(work) and Mac (personal) all the time and i have never seen anything Flash playing "slower" on mac.Flash makes use of GPU access (if required) not just for video playback. I assume Adobe's excuse for resource hungriness is , 'too much time marketing'?

#2) As http://www.apple.com/quicktime/guide/hd/recommendations.html suggests, without a card you are going to experience crappy playback for HD video on Quicktime,Flash plugin and everything.

#3)John is comparing native desktop video playback tools to a plugin that lives inside a browser.

Lastly.. read staunch's comment.

Why doesnt John have comments enabled in his blog?


> Flash is not "slower" on Mac . It uses up too much resources compared to its Windows edition. I switch between Windows(work) and Mac (personal) all the time and i have never seen anything Flash playing "slower" on mac.

I think you'll find that, with regards to computer software "slower" and "uses more resources" are generally interchangable; it's a trade-off. And "slower" can be quite obviously observed when a "uses more resources" app hits a resource limit. For instance, there are flash games (not videos -- _games_) which are so choppy as to be unplayable on my dual core 2.5GHz MBP -- because it uses too much of "more resources," and runs out of cpu cycles.


"slower" means "choppy" and is not interchangeable with "use more resources" as you suggests. I have never seen any flash content that runs choppy on my 2 GHz Macbook. Post an example and back up your claim.


Why doesnt John have comments enabled in his blog?

"Sometimes a design decision is what you don’t put in, as opposed to what you put in."

http://shawnblanc.net/2007/07/why-daring-fireball-is-comment...

I find his restraint refreshing.


Such constant extreme unfounded evangelism for Apple is making it very difficult to extract any true insight from John Gruber's "articles".


IDEA: why not get Adobe's perspective before hitting "Publish"? Two views are better than rants.


Oh that's right. This is better as a one-sided topic...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: