简体   繁体   English

保证Android MediaCodec API支持哪些视频编码器?

[英]Which video encoders are guaranteed to be supported by android MediaCodec API?

Testing video encoding with the MediaCodec API in several devices, I noticed all of them have encoders for h264, h263, and MPEG-4. 我在几种设备中使用MediaCodec API测试了视频编码,我注意到它们都具有适用于h264,h263和MPEG-4的编码器。

Are any of these guaranteed to be supported by all devices which have at least Jelly Bean, even if the actual encoding done by MediaCodec is done by software instead of hardware? 即使MediaCodec进行的实际编码是通过软件而不是硬件进行的,即使至少具有Jelly Bean的所有设备也能保证支持这些方法吗?

The Android Compatibility Definition Document (CDD) defines a set of mandatory features. Android兼容性定义文档(CDD)定义了一组强制性功能。 Google "Android <version> CDD" to find the appropriate one. 谷歌“ Android <version> CDD”找到合适的一个。

For example, if you open the 4.3 CDD , and flip down to section 5.1 ("Media Codecs"), you can find a table of codecs. 例如,如果打开4.3 CDD并向下翻到5.1节(“媒体编解码器”),则可以找到一个编解码器表。 Section 5.2 ("Video Encoding") has some additional details. 第5.2节(“视频编码”)还有一些其他详细信息。

Not sure if there is a list of guaranteed codecs but you can list those supported by particular device: 不知道是否有保证编解码器的列表,但是您可以列出特定设备支持的编解码器:

 int numCodecs = MediaCodecList.getCodecCount();
 for (int i = 0; i < numCodecs; i++) {
     MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
     [...]
 }

More information in the docs: https://developer.android.com/reference/android/media/MediaCodecInfo.html 文档中的更多信息: https : //developer.android.com/reference/android/media/MediaCodecInfo.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM