Preparing Your Media and Server for AirPlay
For your media to play over AirPlay, it needs to be playable on an iOS-based device, such as an iPhone, iPod touch, or iPad. For your server to work with AirPlay, it needs to be configured to send audio and video over HTTP.
Preparing Your Media
When preparing your media for AirPlay, you should do the following:
Encode your audio using mono or stereo AAC or MP3 compression.
Encode your video using H.264 compression.
Use Baseline Profile 3.0 if your video is intended for playback on iPhone 3G or earlier.
For playback on iPhone 4 and later, iPod touch, iPad, and Apple TV, use Baseline Profile 3.1.
Use Main Profile 3.1 if your video is intended for playback exclusively on iPad, OS X, and Apple TV.
Use a QuickTime reference movie or an alternate-stream playlist to provide an alternative version of audio/video content with an AC3 surround-sound track and high-definition video to be used when your media is being played through a home theater system.
If you are using HTTP Live Streaming to provide video at multiple bandwidths, see HTTP Live Streaming Overview for recommended bit rates and encoder settings.
You can package your media in
.mov files. Alternatively, you can pass your media directly to the HTTP Live Streaming media segmenter as an MPEG-2 transport stream containing AAC-compressed audio and H.264-compressed video (normally the case for live broadcast).
You can also create
.m3u8 playlists, but these are typically generated automatically by the HTTP Live Streaming server software, which also generates
.ts files from the media.
Providing AC3 Audio and High-Definition Video
The AirPlay-enabled sound system that is playing your audio media might be able to play AC3 surround-sound audio. You can provide an alternate stream playlist that has an AC3 selection to give your app richer sound when the output device supports it. Similarly, the AirPlay output device might be able to display high-definition video; provide a 1280 x 720 video stream alternate to give the user the richest display possible.
Alternate stream playlists are a feature of HTTP Live Streaming. Alternate streams are normally specified by bit rate, but you can also specify streams by screen resolution and required codecs, so that the AC3 audio and high-definition video streams are chosen only when the output device supports them.
You can specify the ability to play AC3 audio as a requirement for a stream alternate by setting the
CODECS parameter in your master playlist. The string for the AC3 audio codec is
"ac-3". Similarly, you can use the
RESOLUTION parameter to set the minimum video resolution required for a video stream.
As an example, the following variant playlist specifies a low bandwidth stream, a high bandwidth stream, and an AirPlay stream that requires a 1280 x 720 display, AC3 audio capability, and a 1.5 Mbit/s Internet connection.
For more information on alternate stream playlists, see HTTP Live Streaming Overview.
Configuring Your Server
Your server needs to be configured for sending audio and video over HTTP. The most important step in configuring your server is to associate the correct MIME type for each supported file extension. Table 1-1 summarizes the MIME types and file extensions.