question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error

See original GitHub issue

On certain devices the playback fails with MediaCodecVideoRenderer error. Error seems to relate to the fullHD rendition which is included in manifest file. So far we excluded the 1080p quality profile and playback works. Typically one can start the first playback, and when it tries to upscale, the player crashes. Following attempts to start another playback directly fail.

I attach the logs from JNY-LX1 Huawei. Huawei BP stream issue Android studio log_2.txt

Temporary fix was to set the maxbitrate to 4.2 mb

2022-08-08 12:43:30.220 29029-30690/nl.streamgroup.skylinkcz E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(video=4714400, null, null, video/avc, avc1.640029, 4714400, null, [1920, 1080, 25.0], [-1, -1]), format_supported=YES
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:575)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:219)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: android.media.MediaCodec$CryptoException: Crypto key not available
        at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
        at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2699)
        at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.queueSecureInputBuffer(SynchronousMediaCodecAdapter.java:149)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1345)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:794)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:998)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:499)
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:219) 

If needed I’ll send via email .mpd manifest file as well.

Not working list of devices is: Redmi Note 6 Pro, Redmi 5 Plus, Redmi K20 Pro/Mi 9T Pro, Honor 9, Redmi Note 7/Z717VL, Huawei mate 20 lite,JNY-LX1 and more.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
icbakercommented, Aug 15, 2022

The attached Huawei log file looks like a different error:

2022-08-08 12:43:31.513 29029-29029/nl.streamgroup.skylinkcz E/EventLogger: playerFailed [15.03]
    com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(video=4714400, null, null, video/avc, avc1.640029, 4714400, null, [1920, 1080, 25.0], [-1, -1]), format_supported=YES
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:575)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:219)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: android.media.MediaCodec$CryptoException: Crypto key not available
        at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
        at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2699)
        at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.queueSecureInputBuffer(SynchronousMediaCodecAdapter.java:149)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1345)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:794)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:998)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:499)
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:219) 
        at android.os.HandlerThread.run(HandlerThread.java:67) 

Can you clarify what your question is?

0reactions
icbakercommented, Sep 8, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't play video with exoplayer on recycler view
What exactly in this code doesn't work the way you expect? Tell us what is wrong with shared code. Do you have any...
Read more >
com.google.android.exoplayer2.ExoPlaybackException
This page shows Java code examples of com.google.android.exoplayer2. ... @Override public void onPlayerError(ExoPlaybackException error) { final String what ...
Read more >
MediaCodecVideoRenderer (ExoPlayer library)
Updates local counters and DecoderCounters with a new video frame processing offset. Methods inherited from class com.google.android.exoplayer2.mediacodec.
Read more >
Every time I try to play a live stream in the background ... - Reddit
ExoPlaybackException : MediaCodecVideoRenderer error, index=0, format=Format(4, ... Caused by: com.google.android.exoplayer2.mediacodec.
Read more >
ExoPlayer Error - Google Groups
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer. ... onInputFormatChanged(MediaCodecVideoRenderer.java:877)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found