Android MediaCodec H264编码设置Main Profile & High Profile
16lz
2021-01-23
1. 为什么要用Main Profile & High Profile
在Android上硬编码视频码率远远高于软编码,原因是Android只支持H264 Baseline。MP(Main Profile )& HP(High Profile)可以大幅减少视频的码率。关于H264 Profile参见:H264 Profile。
2. Android平台对MP & HP的支持情况
2.1 Android
Google声称在Android 6.0就已经支持MP,但是6.0的源代码中还是强制使用Baseline:
if (h264type.eProfile != OMX_VIDEO_AVCProfileBaseline) { ALOGW("Use baseline profile instead of %d for AVC recording", h264type.eProfile); h264type.eProfile = OMX_VIDEO_AVCProfileBaseline; }
详情参考:https://my.oschina.net/jerikc/blog/483641
在Android 7.0之后才移除了这段代码。也就是说要想使用MP要求Android系统版本在7.0及其以上。
关于HP(High Profile)Android文档中并没有说明支持这个Profile,但是我们在源代码中找到了对应的支持,详情参考:Android MediaCodec参数笔记
在Android 7.0及其之后的系统中已经支持了MP和HP。
2.2 平台厂商
这里说的平台厂商是指芯片提供商,如高通、MTK、华为、三星等。
笔者测试了几款机器结果如下:
3. 参考文献
https://my.oschina.net/jerikc/blog/483641
更多相关文章
- Android IOS平台AE动画库
- 编译Android平台的opencv
- ReactNative: Android与iOS平台兼容处理
- 有米平台 发布android软件教程
- 移动APP自动化漏洞检测平台架构
- 智能手机软件平台 Android VS iPhone OS: 技术先进性分析 (3/4)
- 【源代码】一键分享各个社交平台_android
- 智能手机软件平台 Android VS iPhone OS: 商业模式分析 (2/4)
- 智能手机软件平台 Android VS iPhone OS: 平台对比分析 (1/4)