With Android 5.0, there are now more diagnosis tools built in to find problems with media codecs.
Google's recommendations for troubleshooting MediaCodec issues are as follows:
When receiving a MediaCodec.CodecException you can find the issue by using the isRecoverable() and the isTransient() method calls on the CodecException object, as well as from reading the diagnosticInformation. For more information about the MediaCodec.CodecException, refer to: MediaCodec.CodecException.
Note that the minimum API level for this is 21, meaning for non-Lollipop versions of Android you will not be able to diagnose in this fashion.
As of API level 21 Google has added the MediaCodec.Callback abstract class. This allows developers to be able to react to specific MediaCodec events, including error events. For more information about the MediaCodec.Callback, refer to: MediaCodec.Callback.
Keywords: Codec, logging, MediaCodec