Flash/AIR Stage Video on iOS - Is It Possible? How is the performance?

Adrian Pirvulescu picture Adrian Pirvulescu · Apr 9, 2012 · Viewed 11.3k times · Source

Does any of you can point me to some resource about video performance of AIR (3.2) on iOS devices.

I am interested into:

  • is StageVideo available
  • is video streaming allowed/enabled
  • is the performance ok with high definition videos?
  • is .flv playback allowed? (how about on android: flash is there already)

Answer

Tiberiu-Ionuț Stan picture Tiberiu-Ionuț Stan · Apr 19, 2012

Only H264 has hardware decoding on iOS. This means comparable video performance with native player only for H264 and slugish (at best) decoding for Sorenson and VP6 (even with low resolutions).

"AIR 3 for iOS uses the StageVideo object for H.264 video with hardware decoding, with limited supported for NetStream functionality. AIR 3 for iOS also supports On2 and Sorenson codecs through the StageVideo object. This support does not use hardware decoding, and it does not limit NetStream functionality." flash.media.StageVideo

FLV and MP4 are encapsulation formats. FLV can contain VP6+MP3 or H264+AAC (or any of them taken alone). MP4 can contain H264+AAC. The docs don't say anything about FLV not beeing supported on iOS.

However, on iOS, if FLV/H264 won't play, you won't be able to remux it to MP4 on the fly because of the following restriction (otherwise you would lose hardware decoding): "Note: This method is not supported for H.264 video in AIR 3.0 for iOS." flash.net.NetStream::appendBytes()

Nothing is said about Sorenson or VP6 not beeing suported for on the fly remuxing (thus they should be).

You shouldn't need appendBytes anyways, unless you plan on doing some very advanced stuff, like switching bitrates on the fly without any interruption during play.

Live streaming requires something similar of what appendBytes does. Since H264 hardware decoding is required and does not have a software mode, you won't get H264 for live streams.

"It turns out that real-time streaming of an H264 video does not render on iOS devices in Adobe Air. Other video codecs will work (H263), but not for H264. You'll consume the feed, but will only hear audio. I confirmed this after talking with members of the Adobe Air development team." From Adobe Forums

How well H264 decoding performs on different Apple ARM CPUs really depends a lot on video encode settings (B-frames or keyframes, bitrates, etc.) and wether you have dynamic content, static content, fast switching scenes, resolution, color palletes, etc.

Conclusion: Use FLV or MP4 (whichever suits you best), with H264+AAC inside. Experiment with encode settings, or lots of videos of which you are targeting (if any). Determine which is the lowest (oldest) iOS device you want to target, and test on that.