2

I am having an issue on the better_player, where some devices aren't streaming a live link because of this exception:

Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.MTK.VIDEO.DECODER.AVC, Format(0, null, null, video/avc, avc1.4D4028, -1, null, [320, 180, -1.0], [-1, -1])
E/ExoPlayerImplInternal(14168):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:867)
E/ExoPlayerImplInternal(14168):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:561)
E/ExoPlayerImplInternal(14168):       ... 9 more
E/ExoPlayerImplInternal(14168):   Caused by: android.media.MediaCodec$CodecException: Failed to initialize OMX.MTK.VIDEO.DECODER.AVC, error 0xfffffff4
E/ExoPlayerImplInternal(14168):       at android.media.MediaCodec.native_setup(Native Method)
E/ExoPlayerImplInternal(14168):       at android.media.MediaCodec.<init>(MediaCodec.java:1811)
E/ExoPlayerImplInternal(14168):       at android.media.MediaCodec.createByCodecName(MediaCodec.java:1792)
E/ExoPlayerImplInternal(14168):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:925)
E/ExoPlayerImplInternal(14168):       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:860)
E/ExoPlayerImplInternal(14168):       ... 10 more

this seems to be coming from ExoPlayer, but how to solve this?

James Z
  • 12,209
  • 10
  • 24
  • 44
Lutaaya Huzaifah Idris
  • 3,596
  • 8
  • 38
  • 77

2 Answers2

3

Keep in mind that most devices can have a limited number of decoder instances at the same time. So, maybe you reached that limit. Also check that your app has released successfully any old exoplayer instances before creating new ones.

Moreover, a device may not support the resolution of your media. For this case, you may try to reencode your media files in one of these supported media formats.

Thanasis M
  • 1,144
  • 7
  • 22
  • 1
    I think it could be the device not supporting the media format, because I am having one instance since , I just click on th TV and then it plays. – Lutaaya Huzaifah Idris Jan 10 '21 at 17:07
  • Maybe I wold like to ask the stream am using ends with `.m3u8 `, I didn't see it on the list, is there a possibility of this device failing to stream with this link ? – Lutaaya Huzaifah Idris Jan 10 '21 at 17:10
  • Yeah, if this error occurs on some specific device it's most probable that it is relevant to its specs and hardware. That's why you should do more tests in other devices of different resolutions, brands etc. Good observation about the stream. Since it is not included in Google's official documentation, even if it works I wouldn't feel safe about it. So, it's better to stick to the official doc as closely as you can. – Thanasis M Jan 10 '21 at 17:14
  • Thank you so much @Thanasis, let me try using other links – Lutaaya Huzaifah Idris Jan 10 '21 at 17:15
0

I ran into this issue myself. Assuming you are using the BetterPlayer Widget in a listview you will run into this decoder issue. BetterPlayer has a specific widget to handle playing videos in a list view. I recommend that you check out the Better Video List Example and see if it fixes your error.

ChillBroDev
  • 154
  • 1
  • 7