Supported media formats

This document describes the media codec, container, and network protocol support provided by the Android platform.

As an application developer, you can use any media codec that is available on any Android-powered
device, including those provided by the Android platform and those that are device-specific.
However, it is a best practice to use media encoding profiles that are device-
agnostic.

The tables below describe the media format support built into the Android platform. Codecs that
are not guaranteed to be available on all Android platform versions are noted in parentheses, for
example: (Android 3.0+). Note that any given mobile device might support other formats
or file types that are not listed in the table.

Support for stereo/5.0/5.1
content with standard sampling rates from 8 to 48 kHz.

AAC ELD (enhanced low delay AAC)

•(Android 4.1+)

•(Android 4.1+)

Support for mono/stereo content
with standard sampling rates from 16 to 48 kHz

AMR-NB

•

•

4.75 to 12.2 kbps sampled @ 8kHz

3GPP (.3gp)

AMR-WB

•

•

9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16kHz

3GPP (.3gp)

FLAC

•(Android 4.1+)

•(Android 3.1+)

Mono/Stereo (no multichannel). Sample rates up to 48 kHz (but up to 44.1
kHz is recommended on devices with 44.1 kHz output, as the 48 to 44.1 kHz
downsampler does not include a low-pass filter). 16-bit recommended;
no dither applied for 24-bit.

FLAC (.flac) only

GSM

•

Android supports GSM decoding on telephony devices

GSM(.gsm)

MIDI

•

MIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelody

Video encoding recommendations

The table below lists the Android media framework video encoding profiles and parameters
recommended for playback using the H.264 Baseline Profile codec. The same recommendations apply to
the Main Profile codec, which is only available in Android 6.0 and later.

Video decoding recommendations

Device implementations must support dynamic video resolution and frame rate switching through the standard
Android APIs within the same stream for all VP8, VP9, H.264, and H.265 codecs in real
time and up to the maximum resolution supported by each codec on the device.

Implementations that support the Dolby Vision decoder must follow these guidelines:

Set the track index of
backward-compatible base-layer(s) (if present) to be the same as the combined Dolby
Vision layer's track index.

Video streaming requirements

For video content that is streamed over HTTP or RTSP, there are additional requirements:

For 3GPP and MPEG-4 containers, the moov atom must precede any mdat atoms, but must succeed the
ftyp atom.

For 3GPP, MPEG-4, and WebM containers, audio and video samples corresponding to the same time offset may be no more than 500 KB apart.
To minimize this audio/video drift, consider interleaving audio and video in smaller chunk sizes.

Image support

Format / Codec

Encoder

Decoder

Details

Supported File Type(s) / Container Formats

BMP

•

BMP (.bmp)

GIF

•

GIF (.gif)

JPEG

•

•

Base+progressive

JPEG (.jpg)

PNG

•

•

PNG (.png)

WebP

•(Android 4.0+)(Transparency, Android 4.2.1+)(Lossless Android 10+)

•(Android 4.0+)(Lossless, Transparency, Android 4.2.1+)

Lossless encoding can be achieved on Android 10 using a quality of 100.

WebP (.webp)

HEIF

•(Android 8.0+)

HEIF (.heic; .heif)

Network protocols

The following network protocols are supported for audio and video playback: