Video codec error when seeking file with encrypted audio stream
See original GitHub issueWe are encountering issues when trying to seek a video file, which is reproducible using the sample app. The video file in question has the audio stream encrypted (and the sample app doesn’t actually recognise an audio stream). We have a use case that allows users to seek paused video frame by frame and so this is issue is critical for our app.
To reproduce the issue, use the video file supplied (email across), pause playback and repeatedly tap the ‘seek back 5 seconds button’. The stack trace is below. It is worth noting that if we select video tracks ‘none’ the issue no longer appears.
E/MediaCodec: Codec reported err 0x80000000, actionCode 0, while in state 6
D/SurfaceUtils: disconnecting from surface 0x7599ff3ab0, reason disconnectFromSurface
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
D/CCodecBufferChannel: [c2.qti.avc.decoder#422] MediaCodec discarded an unknown buffer
I/hw-BpHwBinder: onLastStrongRef automatically unlinking death recipients
D/BufferPoolAccessor2.0: bufferpool2 0x74f9f10478 : 8(5505024 size) total buffers - 8(5505024 size) used buffers - 0/8 (recycle/alloc) - 8/255 (fetch/transfer)
D/EventLogger: positionDiscontinuity [eventTime=14.20, mediaPos=0.00, window=0, period=0, reason=SEEK, PositionInfo:old [window=0, period=0, pos=0], PositionInfo:new [window=0, period=0, pos=0]]
D/EventLogger: state [eventTime=14.20, mediaPos=0.00, window=0, period=0, BUFFERING]
D/EventLogger: state [eventTime=14.21, mediaPos=0.00, window=0, period=0, READY]
D/EventLogger: positionDiscontinuity [eventTime=14.45, mediaPos=0.00, window=0, period=0, reason=SEEK, PositionInfo:old [window=0, period=0, pos=0], PositionInfo:new [window=0, period=0, pos=0]]
D/EventLogger: state [eventTime=14.45, mediaPos=0.00, window=0, period=0, BUFFERING]
D/EventLogger: state [eventTime=14.46, mediaPos=0.00, window=0, period=0, READY]
E/MediaCodecVideoRenderer: Video codec error
java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueInputBuffer(Native Method)
at android.media.MediaCodec.dequeueInputBuffer(MediaCodec.java:2855)
at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueInputBufferIndex(SynchronousMediaCodecAdapter.java:93)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1209)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:845)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
E/ExoPlayerImplInternal: Playback error
com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.4D4033, -1, null, [848, 480, 29.970032], [-1, -1]), format_supported=YES
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:555)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: c2.qti.avc.decoder
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1410)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:864)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueInputBuffer(Native Method)
at android.media.MediaCodec.dequeueInputBuffer(MediaCodec.java:2855)
at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueInputBufferIndex(SynchronousMediaCodecAdapter.java:93)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1209)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:845)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
E/ExoPlayerImplInternal: Disable failed.
java.lang.IllegalStateException
at android.media.MediaCodec.native_flush(Native Method)
at android.media.MediaCodec.flush(MediaCodec.java:2298)
at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.flush(SynchronousMediaCodecAdapter.java:160)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushCodec(MediaCodecRenderer.java:912)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:905)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:761)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:483)
at com.google.android.exoplayer2.BaseRenderer.disable(BaseRenderer.java:176)
at com.google.android.exoplayer2.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1609)
at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1351)
at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1314)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:571)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
D/EventLogger: videoDisabled [eventTime=14.96, mediaPos=0.00, window=0, period=0]
D/EventLogger: videoDecoderReleased [eventTime=14.96, mediaPos=0.00, window=0, period=0, c2.qti.avc.decoder]
E/EventLogger: playerFailed [eventTime=14.96, mediaPos=0.00, window=0, period=0
com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.4D4033, -1, null, [848, 480, 29.970032], [-1, -1]), format_supported=YES
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:555)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: c2.qti.avc.decoder
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1410)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:864)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueInputBuffer(Native Method)
at android.media.MediaCodec.dequeueInputBuffer(MediaCodec.java:2855)
at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueInputBufferIndex(SynchronousMediaCodecAdapter.java:93)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1209)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:845)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:945)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
]
- ExoPlayer version number: 2.14.2
- Android version 11
- Android device: Google Pixel 3a
The video file causing the issue has been emailed to dev.exoplayer@gmail.com Thanks
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How do I Fix an Unsupported Video Codec?
How to fix an unsupported video codec error? · Method 1: Play video in a different media player · Method 2: Download the...
Read more >AC3 support not fully implemented yet · Issue #78 - GitHub
Hello,. I'm getting an error while trying to process an mp4 file with AC3 audio in it. Is that an expected behavior?
Read more >Downloading DRM protected video and decrypt with a known ...
It only contains an AVC video stream. The encrypted file made by ffmpeg, Sample_encrypted.mp4, does not play with a normal player -- it...
Read more >How to Fix Audio/Video Codec Not Supported on Windows (10)
Explanatorily, it means the codec of your video is not supported by the media player. That's why you end up with nothing but...
Read more >HTML5 video MEDIA_ERR_DECODE occurs randomly
Common reasons for firing · The video is encrypted, but you failed to decrypt it. · Your browser doesn't support the particular media...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting this. I can reproduce it on Pixel 4a running S beta. It seems that just pausing then seeking back and waiting a few seconds is enough to trigger the error.
yes. same issue