Android 支持的媒体格式(音频,视频,图片)

Android Supported Media Formats

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.

TypeFormat / CodecEncoderDecoderDetailsSupported File Type(s) / Container Formats
AudioAAC LC/LTPMono/Stereo content in any combination of standard bitrates up to 160 kbps and sampling rates from 8 to 48kHz3GPP (.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-NB4.75 to 12.2 kbps sampled @ 8kHz3GPP (.3gp)
AMR-WB9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16kHz3GPP (.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 iMelodyType 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)
ImageJPEGBase+progressiveJPEG (.jpg)
GIF  GIF (.gif)
PNG PNG (.png)
BMP  BMP (.bmp)
VideoH.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 qualityHigher quality
Video codecH.264 Baseline ProfileH.264 Baseline Profile
Video resolution176 x 144 px480 x 360 px
Video frame rate12 fps30 fps
Video bitrate56 Kbps500 Kbps
Audio codecAAC-LCAAC-LC
Audio channels1 (mono)2 (stereo)
Audio bitrate24 Kbps128 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值