Archive

Archive for October, 2011

AIR 3 enables hardware decoding of H.264 video in iOS apps

October 7th, 2011 8 comments

Previously it was not possible to achieve hardware decoding of streaming H.264 video in AIR-made apps on iOS, perhaps served in a multi-bitrate manner . I KNOW, huh? It is, in fact, a very specific requirement for achieving quality video playback on devices. And it is now possible because of AIR 3 and a few other technologies that have been released recently by Adobe.

First of all there is OSMF 1.6 which was release a couple weeks ago. As far as iOS is concerned, the most important feature here is the seamless support of StageVideo. This enables close-to-metal high-performance hardware-decoded hardware-rendered video. Within the context of an AIR application there are a couple boilerplate items, in addition to using OSMF ver1.6 to playback your video, that you need to add to your AS3 or Flex project in order to enable this performance.

  1. add this compiler argument to ensure it targets Flash Player 11:
    -swf-version=13
  2. set the rendermode item in the app descriptor file to “gpu” or “direct”
    <renderMode>gpu</renderMode >

Secondly, and it’s a biggie, is that you need to point to a streaming service using the recently released FMS 4.5. It is the support for Apple’s HLS (HTTP Live Streaming) support that is required. (By the way, the “Live”, as in rhyming with “hive”, refers to VOD as well as Live. I like to think of it as that which rhymes with “give” and I am less confused). And since you have access to the latest greatest FMS technology you may as well use a manifest file and several versions of the video encoded at different bit rates to take advantage of the dynamic-mutlibitrate-switching support made possible by various parts of this technology stack. OSMF makes this easy by accepting a URL pointing to the manifest file and everything is taken care of.

The final ingredient is AIR 3. FMS 4.5 can be used to stream video directly to iOS using mobile safari which is a great solution, but the user is presented with the default iOS video player. Perhaps you want to provide a customized video experience and an app made with AIR is just what you need. AIR version 3 to be more precise. With the Flash api at your disposal, so much is possible. AIR 3, released this week, is the final enabling piece of the puzzle in achieving in-app video nirvana on an iPad. Use AS3-only or Flex Mobile projects with Flash Builder to build an awesome and unique video service, and AIR 3 to package it up and sell it on the app-store.

Categories: Flash development Tags: