Android MediaPlayer支持的音视频格式和协议

最近在研究android音视频相关的知识。下面是对应标题的官方文档
android 官网对于Mediaplayer支持格式的文档:
https://developer.android.google.cn/guide/topics/media/media-formats.html


一,对比Mediaplayer和IjkMediaPlayer

在写完MediaPlayer的demo(红米6.0.1系统)的时候,准备接入一下bilibili开源的ijkplayer的时候,在做对比的时候发现—
Mediaplayer对于:
1,raw下资源文件主要指.mp4 .mkv
2,sd卡下的mp4,mkv
3,http协议下的MP4
4,https协议下的MP4
5,rm,rmvb格式视频不支持

而对于ijkplayer的IjkMediaPlayer
1,raw下资源文件
2,sd卡下的mp4,mkv
3,http协议下的MP4
这些是支持的,但是对于https,rm,rmvb的竟然不支持。后来发现在编译的指定.so文件以后就会支持https和更多其他格式的视频文件。
这个时候不禁想,那Mediaplayer到底支持哪些格式的文件。所以才有了这篇文章。

二,支持格式

引言中已经贴出了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 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.

Section 5 of the Android Compatibility Definition specifies the media formats a device must support to be compatible with Android 8.1.
这里写图片描述
这里写图片描述
这里写图片描述

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:

Provide a Dolby Vision-capable extractor.
Properly display Dolby Vision content on the device screen or on a standard video output port (e.g., HDMI).
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.

这里写图片描述

以上就是官方文档。后续待ijkplayer研究完毕我会贴出我的github代码。欢迎关注

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值