Supported media formats (支持的媒体格式)

Supported media formats (支持的媒体格式)

GitHub 链接
译: https://developer.android.com/guide/topics/media/media-formats

media codec(媒体编解码器)
container(容器)
network protocol support(网络协议支持)

本文档描述了 Android 平台提供的 media codeccontainernetwork protocol support

作为应用程序开发人员,您可以使用任何 Android 设备上提供的任何 media codec,包括 Android 平台提供的设备和 device-specific 的设备。但是,最佳做法是使用与设备无关的媒体编码配置文件。

下表描述了 Android 平台内置的媒体格式支持。不保证在所有 Android 平台版本上都可用的 codec 会在括号中注明,例如:(Android 3.0+)。请注意,任何给定的移动设备都可能支持表中未列出的其他格式或文件类型。

Android Compatibility Definition 中的 Section 5 指定了设备必须支持的媒体格式,以便与 Android 8.1 兼容。

Audio support

Audio formats and codecs
Format/CodecEncoderDecoderDetailsSupported File Type(s) / Container Formats
AAC LCSupport for mono/stereo/5.0/5.1 content with standard sampling rates from 8 to 48 kHz.• 3GPP (.3gp)
• MPEG-4 (.mp4, .m4a)
• ADTS raw AAC (.aac, decode in Android 3.1+, encode in Android 4.0+, ADIF not supported)
• MPEG-TS (.ts, not seekable, Android 3.0+)
待续待续待续待续待续

注: 表格暂时都不全,可去官网查看。

Video support

Video formats and codecs
Format/CodecEncoderDecoderDetailsSupported File Type(s) / Container Formats
H.263Support for H.263 is optional in Android 7.0+• 3GPP (.3gp)
• MPEG-4 (.mp4)
待续待续待续待续待续
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.

SD (Low quality)SD (High quality)HD 720p (N/A on all devices)
Video resolution 分辨率176 x 144 px480 x 360 px1280 x 720 px
Video frame rate 帧率12 fps30 fps30 fps
Video bitrate 比特率56 Kbps500 Kbps2 Mbps
Audio codecAAC-LCAAC-LCAAC-LC
Audio channels1 (mono)2 (stereo)2 (stereo)
Audio bitrate24 Kbps128 Kbps192 Kbps
Video decoding recommendations(视频解码建议)

设备实现必须支持动态视频分辨率和帧速率切换,通过同一流中的标准 Android API 实时为所有 VP8,VP9,H.264 和 H.265 编解码器提供支持,并达到每个设备编解码器支持的最大分辨率。

支持 Dolby Vision 解码器的实现必须遵循以下准则:

  • 提供支持杜比视界的提取器。
  • 在设备屏幕或标准视频输出端口(例如 HDMI)上正确显示 Dolby Vision 内容。
  • 将向后兼容的基础库(如果存在)的 track index 设置为与杜比视觉层的 track idnex 相同。
Video Streaming requirements (视频流要求)

对于通过 HTTP 或 RTSP 流式传输的视频内容,还有其他要求:

  • 对于 3GPP 和 MPEG-4 containers,moov atom 必须在任何 mdat atom 之前,但必须接替 ftyp atom
  • For 3GPP,MPEG-4,和 WebM containers,对应于相同时间偏移的音频和视频样本可以相隔不超过 500KB。为了最大限度地减少音频/视频漂移,请考虑以较小的块大小交错音频和视频。

Image support

Format/CodecEncoderDecoderDetailsSupported File Type(s) / Container Formats
BMPBMP (.bmp)
GIFGIF (.gif)
JPEGBase+progressiveJPEG (.jpg)
PNGPNG (.png)
WebP
(Android 4.0+)
(Lossless, Transparency, Android 4.2.1+)

(Android 4.0+)
(Lossless, Transparency, Android 4.2.1+)
WebP (.webp)
HEIF
(Android 8.0+)
HEIF (.heic; .heif)

Network protocols

音频和视频播放支持以下网络协议:

  • RTSP(RTP,SDP)
  • HTTP/HTTPS progressive streaming
  • HTTP/HTTPS live streaming draft protocol:
    • MPEG-2 TS media files only
    • Protocol version 3 (Android 4.0 and above)
    • Protocol version 2 (Android 3.x)
    • Not supported before Android 3.0

Note: HTTPS is not supported before Android 3.1

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值