AIR still lets you stream video the classic way: take a Camera, attach it to a NetStream, publish over RTMP, and display the remote stream with a Video object. It works on a desktop. On phones and tablets, especially older ones, it runs into its limits quickly.
Where the classic AIR camera path breaks
- CPU and battery. AIR hands the frames through its own runtime before they reach an encoder. On an older Android tablet that's the difference between a smooth stream and a hot, stuttering device.
- Picture quality. You get little control over resolution, frame rate, bitrate and keyframes, and AIR's quality settings interact in surprising ways.
- Decoding and display. Showing an H.264 stream with AIR means AIR decodes it and draws it on the stage, with no hardware overlay, no crop-to-fill and awkward rotation handling.
- Camera features. Torch, real optical zoom, camera switch with USB cameras on the Mac, snapshots straight from the sensor: none of that is reachable through
Camera. - Audio session conflicts. Starting AIR's camera can reconfigure the audio session on iOS and break a running echo canceller (see our article on two-way voice).
How KlugMedia does it
KlugMedia moves the whole video path into one native session:
| Apple platforms | Android | Windows | |
|---|---|---|---|
| Capture | AVFoundation | Camera2 | native implementation |
| Encoding | VideoToolbox (hardware H.264) | MediaCodec (hardware H.264) | native implementation |
| Publish | RTMP, classic H.264 FLV tags | RTMP, classic H.264 FLV tags | RTMP |
| Receive | native H.264 decode, drawn above the AIR stage | native decode on a SurfaceView / TextureView | native |
Because the video is sent as classic H.264 FLV tags (no enhanced RTMP), it plays on standard RTMP servers, including older ones.
var media:CameraStreamANE = CameraStreamANE.instance;
// publish the back camera: 640×360, 12 fps, 800 kbps, keyframe every 2 s (defaults)
media.startPublish( "rtmp://your.server:1935/live", "camera-1" );
// on the other device: receive and draw it natively, crop-to-fill
media.startReceive( "rtmp://your.server:1935/live", "camera-1",
0, 0, 640, 480, 0, CameraStreamANE.RECEIVE_CROPFILL );
Things we learned in production
- Native video floats above the AIR stage. Your AIR buttons end up underneath it. KlugMedia can draw its own native button strip and zoom controls on top of the video, and reports taps back to ActionScript.
- Keep the device awake while streaming. iOS locks the screen after the auto-lock time and the camera stops. KlugMedia keeps the idle timer disabled while it publishes and restores your app's setting afterwards.
- Recover from the unexpected. A phone call, a camera taken by another app, a lost network: the native session detects it, stops cleanly and reports it, so your app can show "Network Error" and reconnect instead of freezing.
- Hardware encoders can be invalidated. iOS can drop a VideoToolbox session, for example after a background switch. KlugMedia rebuilds it and forces a fresh keyframe, so the viewer doesn't wait for a picture.
- Lower frame rates often look sharper. At the same bitrate, 12 fps gives each frame more bits than 30 fps. For a monitoring camera that's the better trade.
Who it's for
Live monitoring, video chat, remote inspection, anything where an AIR app has to send or show live video reliably, including on the old phones and tablets that end up as permanent cameras.
KlugMedia: camera, H.264 video and two-way voice for Adobe AIR on iOS, Android, macOS and Windows. Documentation and pricing: klughomesolutions.com/klugmedia.html
More articles
- Shipping an AIR app to the Mac App Store and TestFlight
- Why AIR native extensions don't need a package manager
- One app, many native extensions – and they have to work together
- Two-way voice with echo cancellation in Adobe AIR
- Sign in with Apple and Google in an Adobe AIR app
- Adobe AIR on iOS 27: the launch crash and how to ship anyway
- A distriqt alternative for Adobe AIR native extensions