Android Supported Media Formats

In this document

  1. Network Protocols
  2. Core Media Formats
  3. Video Encoding Recommendations

See also

  1. Audio and Video

Key classes

  1. MediaPlayer
  2. MediaRecorder

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

As an application developer, you are free to make use of 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.

Network Protocols

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

  • RTSP (RTP, SDP)
  • HTTP progressive streaming
  • HTTP live streaming draft protocol (Android 3.0 and above)

Note: HTTPS is not supported at this time.

Core Media Formats

The table below describes the media format support built into the Android platform. Note that any given mobile device may provide support for additional formats or file types not listed in the table.

Note: Media codecs that are not guaranteed to be available on all Android platform versions are accordingly noted in parentheses—for example "(Android 3.0+)".

Table 1. Core media format and codec support.

Type Format / Codec Encoder Decoder Details Supported File Type(s) / Container Formats
Audio AAC LC/LTP Mono/Stereo content in any combination of standard bitrates up to 160 kbps and sampling rates from 8 to 48kHz 3GPP (.3gp), and MPEG-4 (.mp4, .m4a). ADTS raw AAC (.aac, decode only, ADIF not supported, Android 3.1+).
HE-AACv1 (AAC+)
HE-AACv2 (enhanced AAC+)
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 3.1+)
Mono/Stereo (no multichannel). Sample rates up to 48 kHz (but up to 44.1kHz is recommended on devices with 44.1 kHz output, as the 48 to 44.1 kHzdownsampler does not include a low-pass filter). 16-bit recommended;no dither applied for 24-bit. FLAC (.flac) only
MP3 Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate (VBR) MP3 (.mp3)
MIDI MIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelody Type 0 and 1 (.mid, .xmf, .mxmf). Also RTTTL/RTX (.rtttl, .rtx), OTA (.ota), and iMelody (.imy)
Ogg Vorbis Ogg (.ogg)
PCM/WAVE 8- and 16-bit linear PCM (rates up to limit of hardware) WAVE (.wav)
Image JPEG Base+progressive JPEG (.jpg)
GIF GIF (.gif)
PNG PNG (.png)
BMP BMP (.bmp)
Video H.263 3GPP (.3gp) and MPEG-4 (.mp4)
H.264 AVC
(Android 3.0+)
Baseline Profile (BP) 3GPP (.3gp) and MPEG-4 (.mp4). MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)
MPEG-4 SP 3GPP (.3gp)
VP8
(Android 2.3.3+)
WebM (.webm)

Video Encoding Recommendations

Table 2, below, lists examples of video encoding profiles and parameters that the Android media framework supports for playback. In addition to these encoding parameter recommendations, a device's available video recording profiles can be used as a proxy for media playback capabilities. These profiles can be inspected using the CamcorderProfile class, which is available since API level 8.

Table 2. Examples of supported video encoding parameters.

Lower quality Higher quality
Video codec H.264 Baseline Profile H.264 Baseline Profile
Video resolution 176 x 144 px 480 x 360 px
Video frame rate 12 fps 30 fps
Video bitrate 56 Kbps 500 Kbps
Audio codec AAC-LC AAC-LC
Audio channels 1 (mono) 2 (stereo)
Audio bitrate 24 Kbps 128 Kbps

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.
  • 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.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android(安卓)调用堆栈跟踪
  2. Android事件拦截机制(一)
  3. Android拍照获得图片URI为空的处理方法
  4. Android(安卓)版本代号
  5. 【原创】Android仿新浪微博的“更多”页
  6. 使用 IntelliJ 查看 Android(安卓)源码
  7. ListView的item点击失效解决
  8. Android(安卓)HTTP GET/POST
  9. Android(安卓)DOM解析XML示例程序
  10. java - How to install and use db4o for