The file media_codecs.xml
located in /system/etc
lists the codecs available for a particular device.
To read it via adb shell:
adb shell cat /system/etc/media_codecs.xml
Part of Media_codecs.xml content on my phone:
<MediaCodecs>
<Settings>
<Setting name="max-video-encoder-input-buffers" value="10" />
</Settings>
<Decoders>
<!-- ffmpeg video decoders -->
<MediaCodec name="OMX.ffmpeg.h263.decoder" type="video/3gpp">
<Limit name="size" min="16x16" max="1920x1088" />
<Limit name="alignment" value="2x2" />
<Feature name="adaptive-playback" />
</MediaCodec>
<MediaCodec name="OMX.ffmpeg.h264.decoder" type="video/avc">
<Limit name="size" min="16x16" max="2048x2048" />
<Limit name="alignment" value="720x1280" />
<Feature name="adaptive-playback" />
</MediaCodec>
<MediaCodec name="OMX.ffmpeg.hevc.decoder" type="video/hevc">
<Limit name="size" min="2x2" max="2048x2048" />
<Limit name="alignment" value="2x2" />
<Feature name="adaptive-playback" />
</MediaCodec>
</Decoders>
<Encoders>
<!-- mediatek video encoders -->
<MediaCodec name="OMX.MTK.VIDEO.ENCODER.MPEG4" type="video/mp4v-es" >
<Limit name="size" min="16x16" max="1920x1088" />
<Limit name="alignment" value="16x16" />
<Limit name="block-size" value="16x16" />
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
</MediaCodec>
<MediaCodec name="OMX.MTK.VIDEO.ENCODER.H263" type="video/3gpp" >
<Limit name="size" min="16x16" max="1920x1088" />
<Limit name="alignment" value="16x16" />
<Limit name="block-size" value="16x16" />
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
</MediaCodec>
<MediaCodec name="OMX.MTK.VIDEO.ENCODER.AVC" type="video/avc" >
<Limit name="size" min="16x16" max="1920x1088" />
<Limit name="alignment" value="16x16" />
<Limit name="block-size" value="16x16" />
<Quirk name="requires-allocate-on-input-ports" />
<Quirk name="requires-allocate-on-output-ports" />
</MediaCodec>
</Encoders>
<!-- <Include href="media_codecs_mediatek_audio.xml" /> -->
<!-- <Include href="media_codecs_mediatek_video.xml" /> -->
<Include href="media_codecs_google_audio.xml" />
<Include href="media_codecs_google_telephony.xml" />
<Include href="media_codecs_google_video_le.xml" />
<Include href="media_codecs_ffmpeg.xml" />
</MediaCodecs>
It may also point to other files as on my phone to get a complete list. Therefore, use the command below to get the full list of files listing codecs available on your device.
adb shell find /system/etc -type f -name "media_codecs*.xml"
You can then filter the files on the codec types with the following commands:
cat /system/etc/media_codecs*.xml | grep "type="
Media Codec Info app offers an easier way to list the codecs on a device.
adb shell getprop