2

Using ADB, is it possible to obtain a list of audio, video and image codecs supported on a given device? Whether or not they physically play is another story. I'm just trying to poke the device and get a list back so I can attempt to play whatever, say Nexus 5 supports.

Thanks.

1

1 Answer 1

2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .