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

[Android] MediaCodecVideoRenderer Video codec error #2134

Open
chengnay opened this issue Jan 15, 2025 · 4 comments
Open

[Android] MediaCodecVideoRenderer Video codec error #2134

chengnay opened this issue Jan 15, 2025 · 4 comments
Assignees
Labels
Android Android platform Fixed A fix will be in the next release triage Needs triage
Milestone

Comments

@chengnay
Copy link

Unity version

2021.3.41f1

Unity editor platform

Windows

AVPro Video edition

Trial

AVPro Video version

3.2.0

Device hardware

VIVE Focus Vision

Which Android OS version are you using?

12

Unity Graphics API

OpenGLES 3

Video API

MediaPlayer

Texture format

BGRA

Audio output

System Direct

Any other Media Player component configuration required to reproduce the issue.

I am using Demo_MediaPlayer scene and change to load URL.

Which output component(s) are you using?

No response

Any other component configuration required to reproduce the issue.

No response

The issue

After headset suspend/resume, there is video codec error and video stops playing.

Media information

https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8

Logcat output

01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer: Video codec error
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:   java.lang.IllegalStateException
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at android.media.MediaCodec.native_dequeueInputBuffer(Native Method)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at android.media.MediaCodec.dequeueInputBuffer(MediaCodec.java:2938)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.dequeueInputBufferIndex(SynchronousMediaCodecAdapter.java:101)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1316)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:875)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at android.os.Handler.dispatchMessage(Handler.java:102)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at android.os.Looper.loopOnce(Looper.java:201)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at android.os.Looper.loop(Looper.java:288)
01-15 15:41:01.020 12696 12909 E MediaCodecVideoRenderer:       at android.os.HandlerThread.run(HandlerThread.java:67)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal: Playback error
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:   androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.42C00D, 493000, null, [224, 100, 24.0, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:640)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:102)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at android.os.Looper.loopOnce(Looper.java:201)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:288)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:67)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:   Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: OMX.qcom.video.decoder.avc
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1982)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:893)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       ... 4 more
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:   Caused by: java.lang.IllegalStateException
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at android.media.MediaCodec.native_dequeueInputBuffer(Native Method)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at android.media.MediaCodec.dequeueInputBuffer(MediaCodec.java:2938)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.dequeueInputBufferIndex(SynchronousMediaCodecAdapter.java:101)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1316)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:875)
01-15 15:41:01.020 12696 12909 E ExoPlayerImplInternal:       ... 7 more
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal: Disable failed.
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:   java.lang.IllegalStateException
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at android.media.MediaCodec.native_flush(Native Method)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at android.media.MediaCodec.flush(MediaCodec.java:2350)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.flush(SynchronousMediaCodecAdapter.java:168)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushCodec(MediaCodecRenderer.java:960)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:953)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:780)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:794)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.BaseRenderer.disable(BaseRenderer.java:220)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1846)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1566)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1523)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:686)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:102)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at android.os.Looper.loopOnce(Looper.java:201)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:288)
01-15 15:41:01.022 12696 12909 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:67)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal: Reset failed.
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:   java.lang.IllegalStateException
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at android.media.MediaCodec.native_stop(Native Method)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at android.media.MediaCodec.stop(MediaCodec.java:2300)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.release(SynchronousMediaCodecAdapter.java:181)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.releaseCodec(MediaCodecRenderer.java:805)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onReset(MediaCodecRenderer.java:787)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onReset(MediaCodecVideoRenderer.java:804)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.BaseRenderer.reset(BaseRenderer.java:227)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1576)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1523)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:686)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:102)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at android.os.Looper.loopOnce(Looper.java:201)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:288)
01-15 15:41:01.028 12696 12909 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:67)
@chengnay chengnay added the triage Needs triage label Jan 15, 2025
@chengnay
Copy link
Author

chengnay commented Jan 15, 2025

If I upload full log, website will fail.
Maybe it is too large.

This issue seems quite random.
Just now I met the same error after adjusting audio volume.
Same error log as what I pasted above.

@Chris-RH
Copy link
Contributor

Chris-RH commented Jan 15, 2025

Have you been able to reproduce this on another android device?
Have you tested using different streams, e.g. this one

@Chris-RH Chris-RH added the Android Android platform label Jan 15, 2025
@Ste-RH
Copy link

Ste-RH commented Jan 15, 2025

There may be a fix for this in the next release. We have seen it a callstack like this recently with a seeking issue.

@Ste-RH Ste-RH added the Fixed A fix will be in the next release label Jan 15, 2025
@Ste-RH Ste-RH added this to the 0 - Next Release milestone Jan 15, 2025
@chengnay
Copy link
Author

Have you been able to reproduce this on another android device?

I will try testing on Meta Quest2.

Have you tested using different streams, e.g. this one

The link you shared works fine. I cannot reproduce same issue using VIVE Video too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android platform Fixed A fix will be in the next release triage Needs triage
Projects
None yet
Development

No branches or pull requests

3 participants