androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.7k stars 406 forks source link

Media Decode error #673

Open sridhard opened 1 year ago

sridhard commented 1 year ago

Version

ExoPlayer 2.19.1

More version details

No response

Devices that reproduce the issue

Google Pixel 2 XL

Devices that do not reproduce the issue

Samsung

Reproducible in the demo app?

Not tested

Reproduction steps

Random. Just play the video. We are getting media decode error. Below is the exception trace. Once the issue happens we restarted the device and the video started playing fine. Before restarting the device we have tested with exostream app from playstore(https://play.google.com/store/apps/details?id=com.mtdeer.exostreamr&hl=en&gl=US). It also gave same error.

After restarting device all videos are working fine. This issue happens for many users.

Is this issue because of video resources are not released? Even if we kill and open app, or clear cache and data, the video does not play. But if we restart the video plays.

If it is resource leak by our app then kill and open should clear resources correct? Can you please tell us how to solve this issue.

-24 16:36:45.265 31252 31900 E MediaCodec: queueCSDInputBuffer failed w/ error -2147483648
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer: Video codec error
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:   android.media.MediaCodec$CodecException: Error 0x80000000
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:106)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1806)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:792)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:998)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:499)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at android.os.Handler.dispatchMessage(Handler.java:102)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at android.os.Looper.loop(Looper.java:223)
09-24 16:36:45.266 31252 31891 E MediaCodecVideoRenderer:       at android.os.HandlerThread.run(HandlerThread.java:67)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal: Playback error
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:   com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.42C01E, 509370, null, [430, 240, 30.0], [-1, -1]), format_supported=YES
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:575)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:102)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:223)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:67)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:   Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: OMX.qcom.video.decoder.avc.secure
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1512)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:813)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:998)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:499)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       ... 3 more
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:   Caused by: android.media.MediaCodec$CodecException: Error 0x80000000
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:106)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1806)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:792)
09-24 16:36:45.266 31252 31891 E ExoPlayerImplInternal:       ... 5 more
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal: Disable failed.
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:   android.media.MediaCodec$CodecException: Error 0x80000000
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at android.media.MediaCodec.native_flush(Native Method)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at android.media.MediaCodec.flush(MediaCodec.java:2298)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.flush(SynchronousMediaCodecAdapter.java:166)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushCodec(MediaCodecRenderer.java:864)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:857)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:710)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:561)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.BaseRenderer.disable(BaseRenderer.java:186)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1671)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1411)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1374)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:591)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:102)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:223)
09-24 16:36:45.267 31252 31891 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:67)
09-24 16:36:45.267 31252 31900 D SurfaceUtils: connecting to surface 0x7083c2c8a0, reason connectToSurface
09-24 16:36:45.267 31252 31900 I MediaCodec: [OMX.qcom.video.decoder.avc.secure] setting surface generation to 32002054
09-24 16:36:45.267 31252 31900 D SurfaceUtils: disconnecting from surface 0x7083c2c8a0, reason connectToSurface(reconnect)
09-24 16:36:45.267 31252 31900 D SurfaceUtils: connecting to surface 0x7083c2c8a0, reason connectToSurface(reconnect)
09-24 16:36:45.268 31252 31901 E SurfaceUtils: native window cannot handle protected buffers: the consumer should either be a hardware composer or support hardware protection
09-24 16:36:45.268 31252 31900 W MediaCodec: error setting release surface: err = -1

Expected result

Video should play

Actual result

Video is giving media decode error

Media

Any DRM video will give the error

Bug Report

marcbaechinger commented 1 year ago

Thanks for reporting. Can you please provide us with a URI to the media for reproduction?

sridhard commented 1 year ago

As I told it doesnot happen for any specific stream. it happens for any stream randomly.

Random. Just play the video. We are getting media decode error. Below is the exception trace. Once the issue happens we restarted the device and the video started playing fine. Before restarting the device we have tested with exostream app from playstore(https://play.google.com/store/apps/details?id=com.mtdeer.exostreamr&hl=en&gl=US). It also gave same error.

After restarting device all videos are working fine. This issue happens for many users.

Is this issue because of video resources are not released? Even if we kill and open app, or clear cache and data, the video does not play. But if we restart the video plays.

If it is resource leak by our app then kill and open should clear resources correct? Can you please tell us how to solve this issue.

sridhard commented 1 year ago

Any update on this please