## 5.2\. Video Encoding If device implementations support any video encoder and make it available to third-party apps, they: * SHOULD NOT be, over two sliding windows, more than 15% over the bitrate between intraframe (I-frame) intervals. * SHOULD NOT be more than 100% over the bitrate over a sliding window of 1 second. If device implementations include an embedded screen display with the diagonal length of at least 2.5 inches or include a video output port or declare the support of a camera via the `android.hardware.camera.any` feature flag, they: * [C-1-1] MUST include the support of at least one of the VP8 or H.264 video encoders, and make it available for third-party applications. * SHOULD support both VP8 and H.264 video encoders, and make it available for third-party applications. If device implementations support any of the H.264, VP8, VP9 or HEVC video encoders and make it available to third-party applications, they: * [C-2-1] MUST support dynamically configurable bitrates. * SHOULD support variable frame rates, where video encoder SHOULD determine instantaneous frame duration based on the timestamps of input buffers, and allocate its bit bucket based on that frame duration. If device implementations support the MPEG-4 SP video encoder and make it available to third-party apps, they: * SHOULD support dynamically configurable bitrates for the supported encoder. If device implementations provide hardware accelerated video or image encoders, and support one or more attached or pluggable hardware camera(s) exposed through the `android.camera` APIs: * [C-4-1] all hardware accelerated video and image encoders MUST support encoding frames from the hardware camera(s). * SHOULD support encoding frames from the hardware camera(s) through all video or image encoders. ### 5.2.1\. H.263 If device implementations support H.263 encoders and make it available to third-party apps, they: * [C-1-1] MUST support Baseline Profile Level 45. * SHOULD support dynamically configurable bitrates for the supported encoder. ### 5.2.2\. H.264 If device implementations support H.264 codec, they: * [C-1-1] MUST support Baseline Profile Level 3. However, support for ASO (Arbitrary Slice Ordering), FMO (Flexible Macroblock Ordering) and RS (Redundant Slices) is OPTIONAL. Moreover, to maintain compatibility with other Android devices, it is RECOMMENDED that ASO, FMO and RS are not used for Baseline Profile by encoders. * [C-1-2] MUST support the SD (Standard Definition) video encoding profiles in the following table. * SHOULD support Main Profile Level 4. * SHOULD support the HD (High Definition) video encoding profiles as indicated in the following table. If device implementations report support of H.264 encoding for 720p or 1080p resolution videos through the media APIs, they: * [C-2-1] MUST support the encoding profiles in the following table.
SD (Low quality) SD (High quality) HD 720p HD 1080p
Video resolution 320 x 240 px 720 x 480 px 1280 x 720 px 1920 x 1080 px
Video frame rate 20 fps 30 fps 30 fps 30 fps
Video bitrate 384 Kbps 2 Mbps 4 Mbps 10 Mbps
### 5.2.3\. VP8 If device implementations support VP8 codec, they: * [C-1-1] MUST support the SD video encoding profiles. * SHOULD support the following HD (High Definition) video encoding profiles. * [C-1-2] MUST support writing Matroska WebM files. * SHOULD provide a hardware VP8 codec that meets the [WebM project RTC hardware coding requirements]( http://www.webmproject.org/hardware/rtc-coding-requirements), to ensure acceptable quality of web video streaming and video-conference services. If device implementations report support of VP8 encoding for 720p or 1080p resolution videos through the media APIs, they: * [C-2-1] MUST support the encoding profiles in the following table.
SD (Low quality) SD (High quality) HD 720p HD 1080p
Video resolution 320 x 180 px 640 x 360 px 1280 x 720 px 1920 x 1080 px
Video frame rate 30 fps 30 fps 30 fps 30 fps
Video bitrate 800 Kbps 2 Mbps 4 Mbps 10 Mbps
### 5.2.4\. VP9 If device implementations support VP9 codec, they: * [C-1-2] MUST support Profile 0 Level 3. * [C-1-1] MUST support writing Matroska WebM files. * [C-1-3] MUST generate [CodecPrivate]( https://www.webmproject.org/docs/container/#vp9-codec-feature-metadata-codecprivate ) data. * SHOULD support the HD decoding profiles as indicated in the following table. * [SR] are STRONGLY RECOMMENDED to support the HD decoding profiles as indicated in the following table if there is a hardware encoder.
SD HD 720p HD 1080p UHD
Video resolution 720 x 480 px 1280 x 720 px 1920 x 1080 px 3840 x 2160 px
Video frame rate 30 fps 30 fps 30 fps 30 fps
Video bitrate 1.6 Mbps 4 Mbps 5 Mbps 20 Mbps
If device implementations claim to support Profile 2 or Profile 3 through the Media APIs: * Support for 12-bit format is OPTIONAL. ### 5.2.5\. H.265 If device implementations support H.265 codec, they: * [C-1-1] MUST support Main Profile Level 3. * SHOULD support the HD encoding profiles as indicated in the following table. * [SR] are STRONGLY RECOMMENDED to support the HD encoding profiles as indicated in the following table if there is a hardware encoder.
SD HD 720p HD 1080p UHD
Video resolution 720 x 480 px 1280 x 720 px 1920 x 1080 px 3840 x 2160 px
Video frame rate 30 fps 30 fps 30 fps 30 fps
Video bitrate 1.6 Mbps 4 Mbps 5 Mbps 20 Mbps