Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media decoder exception #8262

Closed
Arunkarthicknallasami opened this issue Nov 22, 2020 · 5 comments
Closed

Media decoder exception #8262

Arunkarthicknallasami opened this issue Nov 22, 2020 · 5 comments
Assignees
Labels

Comments

@Arunkarthicknallasami
Copy link

Arunkarthicknallasami commented Nov 22, 2020

Hi,
I am using exoplayer in viewpager2. Some of videos are throwing Decoder exception.
Attaching log

>   com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, null, -1, null, [1080, 1920, 29.9998], [-1, -1]), format_supported=YES
>         at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:542)
>         at android.os.Handler.dispatchMessage(Handler.java:101)
>         at android.os.Looper.loop(Looper.java:164)
>         at android.os.HandlerThread.run(HandlerThread.java:65)
>      Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec, Format(1, null, null, video/avc, null, -1, null, [1080, 1920, 29.9998], [-1, -1])
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1047)
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:604)
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1470)
>         at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:640)
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readToFlagsOnlyBuffer(MediaCodecRenderer.java:994)
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:844)
>         at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:892)
>         at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:467)
>         at android.os.Handler.dispatchMessage(Handler.java:101) 
>         at android.os.Looper.loop(Looper.java:164) 
>         at android.os.HandlerThread.run(HandlerThread.java:65) 
>      Caused by: android.media.MediaCodec$CodecException: Error 0xffffec77
>         at android.media.MediaCodec.native_configure(Native Method)
>         at android.media.MediaCodec.configure(MediaCodec.java:1935)
>         at android.media.MediaCodec.configure(MediaCodec.java:1864)
>         at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.configure(SynchronousMediaCodecAdapter.java:43)
>         at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.configureCodec(MediaCodecVideoRenderer.java:580)
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1143)
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1040)
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:604) 
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1470) 
>         at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:640) 
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readToFlagsOnlyBuffer(MediaCodecRenderer.java:994) 
>         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:844) 
>         at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:892) 
>         at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:467) 
>         at android.os.Handler.dispatchMessage(Handler.java:101) 
>         at android.os.Looper.loop(Looper.java:164) 
>         at android.os.HandlerThread.run(HandlerThread.java:65) 

Is there any way to stop this from happening? or when this error occur how do we modify properties in such way player can play the video file.
Device: Samsungs s7 edge
OS: Android 8

@AquilesCanta
Copy link
Contributor

Is there any way to stop this from happening? or when this error occur how do we modify properties in such way player can play the video file.

The only way to avoid these issues is using software decoders. Other than that, they need to be handled on a case-by-case basis. This issue is not good enough for us to assist, because it lacks essential information, which is listed in the issue template.

  • For MediaCodec issues, sample media is almost always necessary.
  • For device specific issues, a bugreport is equivalently useful.
  • It's important for issue administration to keep issues well scoped. So, if you think two issues don't share a root cause (for example, one issue is around AVC, while another is about FLAC), then it's probably better if you file one github issue per piece of media (including the corresponding template-requested info).

Please update this report by filling all the info from the issue template, and update the description to better reflect the contents of the report.

@Arunkarthicknallasami
Copy link
Author

Arunkarthicknallasami commented Nov 23, 2020

Hey Thanks for responding. First we are having signed URL which has a lifespan so even if i give a url it wont work beyond a time. How to specify software codec? Is it part of sample app?

@AquilesCanta
Copy link
Contributor

First we are having signed URL which has a lifespan so even if i give a url it wont work beyond a time

In that case you should download the media and share the files directly or host a permalink we can use.

How to specify software codec? Is it part of sample app?

Software video decoders are not currently supported out of the box by ExoPlayer, and you'll have to look into adding them yourself following the existent audio extensions of this pull request: #7132.

I'll close this issue since there's no actionable items for us here. Please file a fresh issue if you can provide us with the means to reproduce the problem.

@cryinrain69
Copy link

Looks like I have the same error problem.
Device: Vsmart Star 3
OS: android 10 (API 29)
ExoPlayer: version 2.12.2
link video: http://mdtv.mediatech.vn/upload/video/video.1605753884.5fb5dc1c48032.mp4
That link working on android Vsmart bee 3 (android 9) device , but not working on android 10 (above device).
Please help me.

This is error:

ACodec: signalError(omxError 0x80001009, internalError -2147483648)
MediaCodec: Codec reported err 0x80001009, actionCode 0, while in state 6
ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, null, -1, null, [1920, 1080, 25.0], [-1, -1]), format_supported=YES
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:542)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: OMX.qcom.video.decoder.avc
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1377)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:872)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:892)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:467)
        at android.os.Handler.dispatchMessage(Handler.java:103at android.os.Looper.loop(Looper.java:214at android.os.HandlerThread.run(HandlerThread.java:67Caused by: java.lang.IllegalStateException
        at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
        at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2789)
        at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:58)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1774)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:857)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:892at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:467at android.os.Handler.dispatchMessage(Handler.java:103at android.os.Looper.loop(Looper.java:214at android.os.HandlerThread.run(HandlerThread.java:672020-12-08 00:25:11.943 6460-7074/vn.mediatech.istudiocafe E/ExoPlayerImplInternal: Disable failed.
      java.lang.IllegalStateException
        at android.media.MediaCodec.native_flush(Native Method)
        at android.media.MediaCodec.flush(MediaCodec.java:2194)
        at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.flush(SynchronousMediaCodecAdapter.java:81)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:914)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:773)
        at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:454)
        at com.google.android.exoplayer2.BaseRenderer.disable(BaseRenderer.java:175)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1507)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1254)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1218)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:546)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:67)

@nikulvaghani
Copy link

@ALL
this will be solved by releasing your exoplayer.
you can write it in onDestory() if it is activity otherwise it will be in onDestroyView of fragment not in onDestroy.

//activity
override fun onDestroy() {
super.onDestroy()
playerView.onPause()
simpleExoPlayer?.release()
}

//fragment
override fun onDestroyView() {
super.onDestroyView()
playerView.onPause()
simpleExoPlayer?.release()
}

:)

@google google locked and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants