General settingsLike most video today, use H.264 video and AAC audio when targeting iOS. On the audio side, consider using HE-AAC at <64kbps, for App Store compliance. HE-AAC sounds reasonably good at these bitrates, even for complex audio. On the video side, use multiple profiles to target each device. iPhone 3GS and earlier only support H.264 Baseline profile, level 3.0 (and some support a more constrained version than that), whereas newer devices support Main and High profile. For the best user experience, HTTP Live Streaming is a must. Apple requires it of any video app in the App Store that plays content longer than 10 minutes, and it is the only true streaming format supported by iOS. HLS is also being adopted by Android (version 3+), Roku, and a range of other destinations. Zencoder fully supports HLS, and does so better than anyone else in the cloud.
|Resolution||Profile||Bitrate||@ 16:9||@ 4:3||Audio||Comments|
|400x288||Baseline@3.0||200kbps||400x224||384x288||56kbps HE-AAC||decimate frame rate|
|N/A (Audio Only)||56kbps HE-AAC|
- These are just recommendations. Different resolutions and bitrates are perfectly valid, and may actually be preferable in some circumstances. For example, extremely complex content may warrant higher bitrates.
- 720p is the largest video playable on iPad 1 and iPhone 4, and iPad 2/iPhone 4S play anything up to 1080p. But since the native display is only 1024 pixels wide, going all the way to 720p or 1080p isn't critical. Unless, of course, you want to reuse a video somewhere else - 720p is a great resolution for fullscreen web playback, and 1080p is entirely appropriate for connected TVs. Future iPads, by the way, are rumored to have 4x the resolution of the current iPad, so consider adding 720p for future-proofing.
- H.264 profile is important. iPad 1 and iPhone 4 both support Main profile. iPad 2/iPhone 4S support High profile, which is marginally better than Main, but given the tens of millions of iPad 1 devices in the world, it is probably better to stick to Main profile. Of course, for truly optimal device targeting, encode to both Main and High.
- These 6 resolutions and bitrates provide reasonably good coverage of varying bandwidth. You could certainly do more - Apple recommends 8 - so add or subtract resolutions and profiles as desired.
- Legacy iPhone/iPod Touch users will have three streams available to them, including a reasonably high quality 480x320 video (the screen resolution of these devices). iPad and iPhone 4 users will be able to make use of all six streams.
- The resolution scaler on the iPad is pretty good, so videos that are rescaled will generally look good.
- As much as possible, these settings allow for resolution dimensions divisible by 16. This makes for more efficient compression. The efficiency gains are small, especially at high resolutions, but at lower resolutions they start to make a difference.
- Be sure to keep the audio identical across each video. If the audio specifications change from one version to another, the user may hear pops and clicks during playback when switching streams.
- Speed: set this based on desired turnaround time. For these recommendations, we're going to use Speed 2, which improves compression a bit over the baseline but is still reasonably fast.
- Peak limiting: ensure that each segment is roughly the same size by using a peak bitrate_cap of 150% of the target bitrate, but within a long buffer_size (e.g. 5 seconds, or 5x the bitrate_cap).
- Zencoder automatically chooses proper keyframe placement when you set the type to "segmented". If you're encoding to MP4 for separate segmenting to HLS, set "forced_keyframe_rate" to "0.2" or "0.1" (for 5 or 10 second keyframe intervals, respectively).
- If you can accept slightly unpredictable bitrates, add quality to the mix, and change video_bitrate to max_video_bitrate to optimize for file size. The encoder will use the max bitrate when needed, and will use a lower bitrate when it can achieve the desired quality with fewer bits.
- Set the max_frame_rate to 30 and the max_audio_sample_rate to 48000.
- The first generation if iOS devices only allow 1 H.264 reference_frame, so enable this on the Baseline streams for max compatibility.