4 April 2011
ページ ツール |
Adobe Flash Player 10.2 for mobile can decode every video codec supported by Flash Player on the desktop: Sorenson video, On2 VP6, and H.264, but only H.264 can be decoded leveraging the built-in hardware acceleration. On2 VP6 and Sorenson use a purely software path.
H.264 is now the de facto standard for video on medium- and high-end mobile devices, and the vast majority of devices implement a hardware-based solution dedicated to H.264 video decoding acceleration. This assures better quality and lower power consumption.
H.264 is a complex standard with several complex encoding techniques. To simplify support of the standard for any kind of device, the subset of encoding techniques and settings used by the encoder are defined by the profile and level parameters:
Although only high-end devices are able to accelerate the most complex profiles and levels, every device with generic hardware acceleration can decode an H.264 video encoded in the baseline profile. Thus, it's a common best practice to encode mobile content with the baseline profile, which was indeed originally designed for low-power consumption and low decoding complexity.
Flash Player can leverage hardware acceleration capabilities only if they are offered by the underlying operating system. For example, in Android 2.2 it is possible to accelerate the H.264 decoding in hardware (if the handset has such capabilities) but the color conversion, scaling, and compositing is performed by the CPU. When running in Android 3.0 (Honeycomb), Flash Player 10.2 (or AIR 2.6) can additionally leverage a full hardware H.264 decoding pipeline using the StageVideo object instead of the classic Video object.
This kind of hardware acceleration is necessary for optimal performance on wide screens (tablets) and at HD resolutions like 720p.
You also have to consider that hardware decoders are not usually capable of decoding arbitrary resolutions. Therefore, it's important also to target a safe resolution. Remember that the list of accelerated resolutions can vary from device to device. You can achieve a good balance between performance and details, and a high support of hardware acceleration, using the resolutions in Table 1 for mobile phones (Android 2.2) and Table 2 for tablets (Android 3.0, RIM BlackBerry PlayBook).
Table 1. Recommended resolutions for H.264-encoded video on mobile phones
| 4:3 | 16:9 |
|---|---|
| 640 × 480 | 640 × 360 |
| 512 × 384 | 512 × 288 |
| 480 × 360 | 480 × 272 |
Table 2. Recommended resolutions for H.264-encoded video on tablets
| 4:3 | 16:9 |
|---|---|
| – | 1280 × 720 |
| 768 × 576 | 1024 × 576 |
| 640 × 480 | 640 × 360 |
| 512 × 384 | 512 × 288 |
| 480 × 360 | 480 × 272 |
Note: Every resolution in this table is a multiple of 8 or 16, which is an important best practice to achieve maximum compression efficiency.
Video for mobile comes with a set of specific constraints you must consider. Previously I mentioned adhering to level, profile, and resolution constraints to ensure reasonable hardware acceleration.
You also have to target bit rates, which can be consumed using a mobile connection. Dynamic streaming can help in this scenario, serving the most appropriate bit rate for the current connection speed, but it's always important to find a good mix between resolution and bit rate to maximize user experiences in any condition.
Below are my recommended Adobe Media Encoder CS5 settings to target a generic mobile device that supports Flash Player 10.2:
For the final encoding, enable the "Use max quality" check box.