Skip to content Skip to sidebar Skip to footer

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. Are any of these guaranteed to be supported by al

Solution 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.

Solution 2:

Not sure if there is a list of guaranteed codecs but you can list those supported by particular device:

intnumCodecs= MediaCodecList.getCodecCount();
 for (inti=0; i < numCodecs; i++) {
     MediaCodecInfocodecInfo= MediaCodecList.getCodecInfoAt(i);
     [...]
 }

More information in the docs: https://developer.android.com/reference/android/media/MediaCodecInfo.html

Post a Comment for "Which Video Encoders Are Guaranteed To Be Supported By Android Mediacodec Api?"