Brightcove
Support+1 888 882 1880
Produkte
Lösungen
Ressourcen
Unternehmen
Search IconA magnifying glass icon.
MIT UNS REDENRequest a Demo

Zurück

By Zencoder

at Brightcove

Encoding Settings for Perfect iPad and iPhone Video

Tech Talk

Any serious video publisher either already supports iPad and iPhone or needs to think hard about adding support. For some major publishers, iPad delivery represents a third of total video views or more.

Encoding for iOS is a little tricky, though. These devices have gone through several generations of technical capabilities, and the ideal video settings for the iPhone 4 are not ideal for the iPhone 3GS or for the iPad.

Fortunately, with just a few encoding profiles, you can stream high quality video to every iOS device, from the first iPhone to the iPad 2, and even prepare for future generations of mobile hardware.

General Settings

Like 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. The iPhone 3GS and earlier only supports the h.264 Baseline profile, level 3.0 (and some support a more constrained version than that), whereas newer devices support the Main and High profiles.

For the best user experience, HTTP Live Streaming (HLS) 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.

General Approach

ResolutionProfileBitrate@ 16:9@ 4:3AudioComments
1024x768Main@3.12Mbps1024x5761024x76856kbps HE-AAC
960x640Main@3.11.5Mbps960x540854x64056kbps HE-AAC
640x432Main@3.11Mbps640x360576x43256kbps HE-AAC
480x320Baseline@3.0600kbps480x272426x32056kbps HE-AAC
400x288Baseline@3.0400kbps400x224384x28856kbps HE-AAC
400x288Baseline@3.0200kbps400x224384x28856kbps HE-AACdecimate frame rate
N/A (Audio Only)56kbps HE-AAC

Why these recommendations?

  • 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 are rumored to have 4x the resolution of the current iPad, so consider adding 720p for future-proofing.
  • The h.264 profile is important. The iPad 1 and iPhone 4 both support the Main profile. The iPad 2/iPhone 4S support the High profile, which is marginally better than Main, but given the number of iPad 1 devices in the world, it is probably better to stick to Main profile. For truly optimal device targeting, encode to both Main and High.
  • These six resolutions and bitrates provide reasonably good coverage of varying bandwidth. You could certainly do more, 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). Users of the iPad and iPhone 4 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.

Other Settings

  • Set the speed 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.
  • 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., five seconds, or 5x the bitrate\_cap).
  • Brightcove 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 five 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 one h.264 reference\_frame, so enable this on the Baseline streams for max compatibility.

Zurück zum Anfang