About Adobe's Flash Player Not Having Access to H.264 HW Acceleration on OSX
daringfireball.net
daringfireball.net
I guess this must be because Apple doesn't allow Adobe access to its proprietary, hardware based empty loop optimizations...
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.
We tried that once but gave up after finding out that turning on a blur filter would segfault the Flash Player. Whoops!
A sense of which, unfortunately, is in very, very low supply around here.
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).
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.
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.
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.
(Not to say Apple has an institutional problem, but, speaking in general.)
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.
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.
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.
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).
Straw man. Flash doesn't need direct GPU access, just access to video decoding APIs that are accelerated.
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.
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
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.
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.
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.
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
"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"
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.
EDIT: They might be good at other things though.
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/ .
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.
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.
They're currently burning a lot of cycles just drawing to the screen.
In fact, why isn't Adobe using QTKit? Why are they rolling out their own appalling h264 implementation?
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...)
http://blogs.adobe.com/penguin.swf/2010/01/solving_different...
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.
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.
Edit: There is a private H.264 API that is used by QuickTime.
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).
And I'd imagine that there's only one video decode ASIC between the two of them, no need to uselessly duplicate 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.
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?
Please address correspondence to:
comments@daringfireball.net”
Daring Fireball – Contact
See? that's a rhetorical question. Or isn't it?
http://www.phoronix.com/scan.php?page=news_item&px=NzU1M...
http://www.splitted-desktop.com/static/en/pdf/actu/Linux_wit...
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?
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.
"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.