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

不问归期 提交于 2019-12-12 06:17:12

问题


Testing video encoding with the MediaCodec API in several devices, I noticed all of them have encoders for h264, h263, and 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?


回答1:


The Android Compatibility Definition Document (CDD) defines a set of mandatory features. Google "Android <version> CDD" to find the appropriate one.

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. Section 5.2 ("Video Encoding") has some additional details.




回答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://stackoverflow.com/questions/32082938/which-video-encoders-are-guaranteed-to-be-supported-by-android-mediacodec-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!