Closed zoriya closed 1 month ago
Hi @zoriya,
In the manifest, the 1920*1080 stream has avc1.424033
as the codec, which the MediaCodecVideoRenderer
thought it supports this format during the track selection.
#EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=4800000,BANDWIDTH=8000000,RESOLUTION=1920x1080,CODECS="avc1.424033",CLOSED-CAPTIONS=NONE
However, when the playback adapts to this stream, the codec information got from H264Reader
is avc1.6e0033
, which MediaCodecVideoRenderer
doesn't support anymore. Thus to avoid such scenario happens, I think the codec information provided in the manifest and in the actual stream should be consistent.
I'm closing this issue, but feel free to reopen if there are more questions.
Version
Media3 main branch
More version details
No response
Devices that reproduce the issue
Pixel 6 Pro running Android14
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Expected result
Another variant should be picked automatically and played successfully.
Actual result
Only tries to decode the first variant and fails with the logs:
logs
``` 32013-32013 ExoPlayerImpl androidx.media3.demo.main I Init baac854 [AndroidXMedia3/1.4.0] [raven, Pixel 6 Pro, Google, 34] 32013-32013 DefaultRenderersFactory androidx.media3.demo.main I Loaded LibvpxVideoRenderer. 32013-32013 DefaultRenderersFactory androidx.media3.demo.main I Loaded Libgav1VideoRenderer. 32013-32013 DefaultRenderersFactory androidx.media3.demo.main I Loaded FfmpegVideoRenderer. 32013-32013 DefaultRenderersFactory androidx.media3.demo.main I Loaded MidiRenderer. 32013-32013 DefaultRenderersFactory androidx.media3.demo.main I Loaded LibopusAudioRenderer. 32013-32013 DefaultRenderersFactory androidx.media3.demo.main I Loaded LibflacAudioRenderer. 32013-32013 DefaultRenderersFactory androidx.media3.demo.main I Loaded FfmpegAudioRenderer. 32013-32013 EventLogger androidx.media3.demo.main D playWhenReady [eventTime=0.00, mediaPos=0.00, window=0, true, USER_REQUEST] 32013-32013 EventLogger androidx.media3.demo.main D surfaceSize [eventTime=0.00, mediaPos=0.00, window=0, 0, 0] 32013-32013 EventLogger androidx.media3.demo.main D timeline [eventTime=0.00, mediaPos=0.00, window=0, periodCount=1, windowCount=1, reason=PLAYLIST_CHANGED 32013-32013 EventLogger androidx.media3.demo.main D period [?] 32013-32013 EventLogger androidx.media3.demo.main D window [?, seekable=false, dynamic=true] 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D mediaItem [eventTime=0.00, mediaPos=0.00, window=0, reason=PLAYLIST_CHANGED] 32013-32013 EventLogger androidx.media3.demo.main D state [eventTime=0.01, mediaPos=0.00, window=0, BUFFERING] 32013-32013 ContentCaptureHelper androidx.media3.demo.main I Setting logging level to OFF 32013-32013 EventLogger androidx.media3.demo.main D surfaceSize [eventTime=0.04, mediaPos=0.00, window=0, 1440, 2891] 32013-32013 TextView androidx.media3.demo.main W onProvideContentCaptureStructure(): calling assumeLayout() 32013-32013 EventLogger androidx.media3.demo.main D loading [eventTime=0.05, mediaPos=0.00, window=0, period=0, true] 32013-32013 EventLogger androidx.media3.demo.main D timeline [eventTime=0.08, mediaPos=0.00, window=0, period=0, periodCount=1, windowCount=1, reason=SOURCE_UPDATE 32013-32013 EventLogger androidx.media3.demo.main D period [60.09] 32013-32013 EventLogger androidx.media3.demo.main D window [60.09, seekable=true, dynamic=false] 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D videoEnabled [eventTime=0.08, mediaPos=0.00, window=0, period=0] 32013-32013 EventLogger androidx.media3.demo.main D tracks [eventTime=0.08, mediaPos=0.00, window=0, period=0 32013-32013 EventLogger androidx.media3.demo.main D group [ 32013-32013 EventLogger androidx.media3.demo.main D [X] Track:0, id=0, mimeType=video/avc, container=application/x-mpegURL, bitrate=8000000, codecs=avc1.424033, res=1920x1080, supported=YES 32013-32013 EventLogger androidx.media3.demo.main D [X] Track:1, id=1, mimeType=video/avc, container=application/x-mpegURL, bitrate=1400000, codecs=avc1.640028, res=640x360, supported=YES 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D group [ 32013-32013 EventLogger androidx.media3.demo.main D [X] Track:0, id=ID3, mimeType=application/id3, supported=YES 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D Metadata [ 32013-32013 EventLogger androidx.media3.demo.main D HlsTrackMetadataEntry 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-459 MediaCodecInfo androidx.media3.demo.main D NoSupport [codec.profileLevel, avc1.6E0033, video/avc] [c2.exynos.h264.decoder, video/avc] [raven, Pixel 6 Pro, Google, 34] 32013-459 MediaCodecInfo androidx.media3.demo.main D NoSupport [codec.profileLevel, avc1.6E0033, video/avc] [c2.android.avc.decoder, video/avc] [raven, Pixel 6 Pro, Google, 34] 32013-32013 EventLogger androidx.media3.demo.main D downstreamFormat [eventTime=0.12, mediaPos=0.00, window=0, period=0, id=0, mimeType=null, container=application/x-mpegURL, bitrate=8000000, codecs=avc1.424033, res=1920x1080] 32013-459 DMCodecAdapterFactory androidx.media3.demo.main I Creating an asynchronous MediaCodec adapter for track type video 32013-490 CCodec androidx.media3.demo.main D allocate(c2.exynos.h264.decoder) 32013-490 CCodec androidx.media3.demo.main I setting up 'default' as default (vendor) store 32013-490 CCodec androidx.media3.demo.main I Created component [c2.exynos.h264.decoder] 32013-490 CCodecConfig androidx.media3.demo.main D read media type: video/avc 32013-490 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: output.subscribed-indices.values 32013-490 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: input.buffers.allocator-ids.values 32013-490 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: output.buffers.allocator-ids.values 32013-490 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: output.buffers.pool-ids.values 32013-490 ReflectedParamUpdater androidx.media3.demo.main D ignored struct field coded.color-format.locations 32013-490 CCodecConfig androidx.media3.demo.main D ignoring local param raw.size (0xd2001800) as it is already supported 32013-490 CCodecConfig androidx.media3.demo.main D ignoring local param default.color (0x5200180b) as it is already supported 32013-490 ReflectedParamUpdater androidx.media3.demo.main D ignored struct field raw.hdr-static-info.mastering 32013-490 CCodecConfig androidx.media3.demo.main I query failed after returning 15 values (BAD_INDEX) 32013-490 CCodecConfig androidx.media3.demo.main D c2 config diff is Dict { c2::u32 algo.low-latency.value = 0 c2::i32 algo.priority.value = 0 c2::float algo.rate.value = 0 c2::u32 coded.pl.level = 20496 c2::u32 coded.pl.profile = 20481 c2::u32 coded.vui.color.matrix = 0 c2::u32 coded.vui.color.primaries = 0 c2::u32 coded.vui.color.range = 0 c2::u32 coded.vui.color.transfer = 0 c2::u32 default.color.matrix = 0 c2::u32 default.color.primaries = 0 c2::u32 default.color.range = 0 c2::u32 default.color.transfer = 0 c2::u32 input.buffers.max-size.value = 7340032 string input.media-type.value = "video/avc" c2::u32 output.delay.value = 3 string output.media-type.value = "video/raw" c2::u32 raw.color.matrix = 0 c2::u32 raw.color.primaries = 0 c2::u32 raw.color.range = 0 c2::u32 raw.color.transfer = 0 c2::float raw.hdr-static-info.max-cll = 0 c2::float raw.hdr-static-info.max-fall = 0 c2::u32 raw.max-size.height = 240 c2::u32 raw.max-size.width = 320 c2::u32 raw.pixel-format.value = 34 c2::i32 raw.rotation.flip = 32013-490 ColorUtils androidx.media3.demo.main W expected specified color aspects (0:0:0:0) 32013-489 MediaCodec androidx.media3.demo.main I MediaCodec will operate in async mode 32013-489 SurfaceUtils androidx.media3.demo.main D connecting to surface 0xb400007aeeac2ed0, reason connectToSurface 32013-489 MediaCodec androidx.media3.demo.main I [c2.exynos.h264.decoder] setting surface generation to 32781322 32013-489 SurfaceUtils androidx.media3.demo.main D disconnecting from surface 0xb400007aeeac2ed0, reason connectToSurface(reconnect) 32013-489 SurfaceUtils androidx.media3.demo.main D connecting to surface 0xb400007aeeac2ec0, reason connectToSurface(reconnect-with-listener) 32013-490 CCodec androidx.media3.demo.main D [c2.exynos.h264.decoder] buffers are bound to CCodec for this session 32013-490 CCodecConfig androidx.media3.demo.main D no c2 equivalents for csd-1 32013-490 CCodecConfig androidx.media3.demo.main D no c2 equivalents for log-session-id 32013-490 CCodecConfig androidx.media3.demo.main D no c2 equivalents for native-window 32013-490 CCodecConfig androidx.media3.demo.main D no c2 equivalents for native-window-generation 32013-490 CCodecConfig androidx.media3.demo.main D no c2 equivalents for flags 32013-490 CCodecConfig androidx.media3.demo.main D c2 config diff is c2::u32 raw.max-size.height = 1080 c2::u32 raw.max-size.width = 1920 c2::u32 raw.size.height = 1080 c2::u32 raw.size.width = 1920 32013-490 Codec2Client androidx.media3.demo.main W query -- param skipped: index = 1107298332. 32013-490 CCodec androidx.media3.demo.main D client requested max input size 1566720, which is smaller than what component recommended (7340032); overriding with component recommendation. 32013-490 CCodec androidx.media3.demo.main W This behavior is subject to change. It is recommended that app developers double check whether the requested max input size is in reasonable range. 32013-490 CCodec androidx.media3.demo.main D encoding statistics level = 0 32013-490 CCodec androidx.media3.demo.main D setup formats input: AMessage(what = 0x00000000) = { int32_t height = 1080 int32_t level = 65536 int32_t max-input-size = 7340032 string mime = "video/avc" int32_t priority = 0 int32_t profile = 65536 int32_t width = 1920 Rect crop(0, 0, 1919, 1079) } 32013-490 CCodec androidx.media3.demo.main D setup formats output: AMessage(what = 0x00000000) = { int32_t android._color-format = 2130708361 int32_t android._video-scaling = 1 int32_t rotation-degrees = 0 int32_t color-standard = 1 int32_t color-range = 2 int32_t color-transfer = 3 float cta861.max-cll = 0.000000 float cta861.max-fall = 0.000000 int32_t sar-height = 1 int32_t sar-width = 1 Rect crop(0, 0, 1919, 1079) int32_t width = 1920 int32_t height = 1080 int32_t max-height = 1080 int32_t max-width = 1920 string mime = "video/raw" int32_t priority = 0 int32_t android._dataspace = 260 int32_t color-format = 2130708361 } 32013-490 CCodecConfig androidx.media3.demo.main I query failed after returning 15 values (BAD_INDEX) 32013-459 MediaCodec androidx.media3.demo.main D keep callback message for reclaim 32013-490 Codec2Client androidx.media3.demo.main W query -- param skipped: index = 1073743886. 32013-490 Codec2Client androidx.media3.demo.main W query -- param skipped: index = 1610614798. 32013-490 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#939] Created input block pool with allocatorID 16 => poolID 22 - OK (0) 32013-490 CCodecBufferChannel androidx.media3.demo.main I [c2.exynos.h264.decoder#939] Created output block pool with allocatorID 18 => poolID 4505 - OK 32013-490 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#939] Configured output block pool ids 4505 => OK 32013-490 Codec2-Out...ufferQueue androidx.media3.demo.main D C2SurfaceSyncMemory created 20(20) 32013-490 Codec2-Out...ufferQueue androidx.media3.demo.main D remote graphic buffer migration 0/0 32013-490 Codec2Client androidx.media3.demo.main D setOutputSurface -- failed to set consumer usage (6/BAD_INDEX) 32013-490 Codec2Client androidx.media3.demo.main D setOutputSurface -- generation=32781322 consumer usage=0x900 sync 32013-490 Codec2Client androidx.media3.demo.main D Surface configure completed 32013-459 MediaCodecInfo androidx.media3.demo.main D NoSupport [codec.profileLevel, avc1.6E0033, video/avc] [c2.exynos.h264.decoder, video/avc] [raven, Pixel 6 Pro, Google, 34] 32013-32099 BufferPoolAccessor2.0 androidx.media3.demo.main D bufferpool2 0xb400007c1e9f8818 : 0(0 size) total buffers - 0(0 size) used buffers - 1/6 (recycle/alloc) - 2/4 (fetch/transfer) 32013-32099 BufferPoolAccessor2.0 androidx.media3.demo.main D Destruction - bufferpool2 0xb400007c1e9f8818 cached: 0/0M, 0/0% in use; allocs: 6, 17% recycled; transfers: 4, 50% unfetched 32013-32099 BufferPoolAccessor2.0 androidx.media3.demo.main D bufferpool2 0xb400007c1ea1fd18 : 0(0 size) total buffers - 0(0 size) used buffers - 318/326 (recycle/alloc) - 8/331 (fetch/transfer) 32013-32099 BufferPoolAccessor2.0 androidx.media3.demo.main D Destruction - bufferpool2 0xb400007c1ea1fd18 cached: 0/0M, 0/0% in use; allocs: 326, 98% recycled; transfers: 331, 98% unfetched 32013-459 MediaCodecRenderer androidx.media3.demo.main W Format exceeds selected codec's capabilities [id=0, mimeType=video/avc, bitrate=8000000, codecs=avc1.6E0033, res=1920x1080, color=NA/NA/NA/10/10, c2.exynos.h264.decoder] 32013-32013 EventLogger androidx.media3.demo.main D videoDecoderInitialized [eventTime=0.15, mediaPos=0.00, window=0, period=0, c2.exynos.h264.decoder] 32013-32013 EventLogger androidx.media3.demo.main D videoInputFormat [eventTime=0.16, mediaPos=0.00, window=0, period=0, id=0, mimeType=video/avc, bitrate=8000000, codecs=avc1.6E0033, res=1920x1080, color=NA/NA/NA/10/10] 32013-490 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#939] work failed to complete: 14 32013-489 MediaCodec androidx.media3.demo.main E Codec reported err 0xe/14 (Unknown error -14), actionCode 0, while in state 6/STARTED 32013-490 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#939] work failed to complete: 14 32013-489 SurfaceUtils androidx.media3.demo.main D disconnecting from surface 0xb400007aeeac2ed0, reason disconnectFromSurface 32013-459 MediaCodec androidx.media3.demo.main E getBufferAndFormat - invalid operation (the index 2 is not owned by client) 32013-459 MediaCodec androidx.media3.demo.main E index 2 is not owned by client 32013-489 MediaCodec androidx.media3.demo.main E Codec reported err 0xe/14 (Unknown error -14), actionCode 0, while in state 0/UNINITIALIZED 32013-459 MediaCodecVideoRenderer androidx.media3.demo.main E Video codec error java.lang.IllegalStateException: index 2 is not owned by client at android.media.MediaCodec.getBuffer(Native Method) at android.media.MediaCodec.getInputBuffer(MediaCodec.java:4534) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.getInputBuffer(AsynchronousMediaCodecAdapter.java:229) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1320) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:875) at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018) at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136) at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.os.HandlerThread.run(HandlerThread.java:85) 32013-459 MediaCodecInfo androidx.media3.demo.main D NoSupport [codec.profileLevel, avc1.6E0033, video/avc] [c2.exynos.h264.decoder, video/avc] [raven, Pixel 6 Pro, Google, 34] 32013-459 MediaCodecInfo androidx.media3.demo.main D NoSupport [codec.profileLevel, avc1.6E0033, video/avc] [c2.android.avc.decoder, video/avc] [raven, Pixel 6 Pro, Google, 34] 32013-459 ExoPlayerImplInternal androidx.media3.demo.main E Playback error androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.6E0033, 8000000, null, [1920, 1080, -1.0, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 10bit Luma, 10bit Chroma)], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:640) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.os.HandlerThread.run(HandlerThread.java:85) Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: c2.exynos.h264.decoder at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1982) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:893) at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018) at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136) at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.os.HandlerThread.run(HandlerThread.java:85) Caused by: java.lang.IllegalStateException: index 2 is not owned by client at android.media.MediaCodec.getBuffer(Native Method) at android.media.MediaCodec.getInputBuffer(MediaCodec.java:4534) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.getInputBuffer(AsynchronousMediaCodecAdapter.java:229) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1320) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:875) ... 7 more 32013-489 MediaCodec androidx.media3.demo.main E flush() is valid only at Executing states; currently at Released state 32013-459 ExoPlayerImplInternal androidx.media3.demo.main E Disable failed. java.lang.IllegalStateException: flush() is valid only at Executing states; currently at Released state at android.media.MediaCodec.native_flush(Native Method) at android.media.MediaCodec.flush(MediaCodec.java:2583) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.flush(AsynchronousMediaCodecAdapter.java:247) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushCodec(MediaCodecRenderer.java:960) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:953) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:780) at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:794) at androidx.media3.exoplayer.BaseRenderer.disable(BaseRenderer.java:220) at androidx.media3.exoplayer.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1846) at androidx.media3.exoplayer.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1566) at androidx.media3.exoplayer.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1523) at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:686) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.os.HandlerThread.run(HandlerThread.java:85) 32013-32013 EventLogger androidx.media3.demo.main D videoDisabled [eventTime=0.18, mediaPos=0.00, window=0, period=0] 32013-489 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#939] MediaCodec discarded an unknown buffer 32013-489 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#939] MediaCodec discarded an unknown buffer 32013-32013 EventLogger androidx.media3.demo.main D videoSize [eventTime=0.19, mediaPos=0.00, window=0, period=0, 0, 0] 32013-490 hw-BpHwBinder androidx.media3.demo.main I onLastStrongRef automatically unlinking death recipients 32013-32013 EventLogger androidx.media3.demo.main D videoDecoderReleased [eventTime=0.19, mediaPos=0.00, window=0, period=0, c2.exynos.h264.decoder] 32013-32013 EventLogger androidx.media3.demo.main D timeline [eventTime=0.19, mediaPos=0.00, window=0, period=0, periodCount=1, windowCount=1, reason=SOURCE_UPDATE 32013-32013 EventLogger androidx.media3.demo.main D period [60.09] 32013-32013 EventLogger androidx.media3.demo.main D window [60.09, seekable=true, dynamic=false] 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main E playerFailed [eventTime=0.20, mediaPos=0.00, window=0, period=0, errorCode=ERROR_CODE_DECODING_FAILED androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.6E0033, 8000000, null, [1920, 1080, -1.0, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 10bit Luma, 10bit Chroma)], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:640) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.os.HandlerThread.run(HandlerThread.java:85) Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: c2.exynos.h264.decoder at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1982) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:893) at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018) at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136) at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.os.HandlerThread.run(HandlerThread.java:85) Caused by: java.lang.IllegalStateException: index 2 is not owned by client at android.media.MediaCodec.getBuffer(Native Method) at android.media.MediaCodec.getInputBuffer(MediaCodec.java:4534) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.getInputBuffer(AsynchronousMediaCodecAdapter.java:229) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1320) at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:875) ... 7 more ] 32013-32013 EventLogger androidx.media3.demo.main D loading [eventTime=0.20, mediaPos=0.00, window=0, period=0, false] 32013-32013 EventLogger androidx.media3.demo.main D state [eventTime=0.20, mediaPos=0.00, window=0, period=0, IDLE] 32013-32013 VRI[Sample...rActivity] androidx.media3.demo.main D visibilityChanged oldVisibility=true newVisibility=false 32013-32036 HWUI androidx.media3.demo.main D endAllActiveAnimators on 0xb400007bee9d5dc0 (ExpandableListView) with handle 0xb400007c6e9f9930 32013-32013 WindowOnBackDispatcher androidx.media3.demo.main W OnBackInvokedCallback is not enabled for the application. Set 'android:enableOnBackInvokedCallback="true"' in the application manifest. 32013-32098 BufferPoolAccessor2.0 androidx.media3.demo.main D bufferpool2 0xb400007c1e9edaa8 : 0(0 size) total buffers - 0(0 size) used buffers - 1/6 (recycle/alloc) - 2/4 (fetch/transfer) 32013-32098 BufferPoolAccessor2.0 androidx.media3.demo.main D evictor expired: 3, evicted: 1 32013-32013 WindowOnBackDispatcher androidx.media3.demo.main W sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda11@a84aab3 32013-32036 HWUI androidx.media3.demo.main D endAllActiveAnimators on 0xb400007beea9b020 (RippleDrawable) with handle 0xb400007c6ea21860 32013-32013 WindowOnBackDispatcher androidx.media3.demo.main W OnBackInvokedCallback is not enabled for the application. Set 'android:enableOnBackInvokedCallback="true"' in the application manifest. 32013-32013 EventLogger androidx.media3.demo.main D state [eventTime=8.22, mediaPos=0.00, window=0, period=0, BUFFERING] 32013-32013 EventLogger androidx.media3.demo.main D loading [eventTime=8.24, mediaPos=0.00, window=0, period=0, true] 32013-32013 EventLogger androidx.media3.demo.main D timeline [eventTime=8.29, mediaPos=0.00, window=0, period=0, periodCount=1, windowCount=1, reason=SOURCE_UPDATE 32013-32013 EventLogger androidx.media3.demo.main D period [60.09] 32013-32013 EventLogger androidx.media3.demo.main D window [60.09, seekable=true, dynamic=false] 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D videoEnabled [eventTime=8.30, mediaPos=0.00, window=0, period=0] 32013-32013 EventLogger androidx.media3.demo.main D tracks [eventTime=8.31, mediaPos=0.00, window=0, period=0 32013-32013 EventLogger androidx.media3.demo.main D group [ 32013-32013 EventLogger androidx.media3.demo.main D [ ] Track:0, id=0, mimeType=video/avc, container=application/x-mpegURL, bitrate=8000000, codecs=avc1.424033, res=1920x1080, supported=YES 32013-32013 EventLogger androidx.media3.demo.main D [X] Track:1, id=1, mimeType=video/avc, container=application/x-mpegURL, bitrate=1400000, codecs=avc1.640028, res=640x360, supported=YES 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D group [ 32013-32013 EventLogger androidx.media3.demo.main D [X] Track:0, id=ID3, mimeType=application/id3, supported=YES 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D Metadata [ 32013-32013 EventLogger androidx.media3.demo.main D HlsTrackMetadataEntry 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D ] 32013-32013 EventLogger androidx.media3.demo.main D downstreamFormat [eventTime=8.39, mediaPos=0.00, window=0, period=0, id=1, mimeType=null, container=application/x-mpegURL, bitrate=1400000, codecs=avc1.640028, res=640x360] 32013-459 DMCodecAdapterFactory androidx.media3.demo.main I Creating an asynchronous MediaCodec adapter for track type video 32013-519 CCodec androidx.media3.demo.main D allocate(c2.exynos.h264.decoder) 32013-519 CCodec androidx.media3.demo.main I setting up 'default' as default (vendor) store 32013-519 CCodec androidx.media3.demo.main I Created component [c2.exynos.h264.decoder] 32013-519 CCodecConfig androidx.media3.demo.main D read media type: video/avc 32013-519 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: output.subscribed-indices.values 32013-519 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: input.buffers.allocator-ids.values 32013-519 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: output.buffers.allocator-ids.values 32013-519 ReflectedParamUpdater androidx.media3.demo.main D extent() != 1 for single value type: output.buffers.pool-ids.values 32013-519 ReflectedParamUpdater androidx.media3.demo.main D ignored struct field coded.color-format.locations 32013-519 CCodecConfig androidx.media3.demo.main D ignoring local param raw.size (0xd2001800) as it is already supported 32013-519 CCodecConfig androidx.media3.demo.main D ignoring local param default.color (0x5200180b) as it is already supported 32013-519 ReflectedParamUpdater androidx.media3.demo.main D ignored struct field raw.hdr-static-info.mastering 32013-519 CCodecConfig androidx.media3.demo.main I query failed after returning 15 values (BAD_INDEX) 32013-519 CCodecConfig androidx.media3.demo.main D c2 config diff is Dict { c2::u32 algo.low-latency.value = 0 c2::i32 algo.priority.value = 0 c2::float algo.rate.value = 0 c2::u32 coded.pl.level = 20496 c2::u32 coded.pl.profile = 20481 c2::u32 coded.vui.color.matrix = 0 c2::u32 coded.vui.color.primaries = 0 c2::u32 coded.vui.color.range = 0 c2::u32 coded.vui.color.transfer = 0 c2::u32 default.color.matrix = 0 c2::u32 default.color.primaries = 0 c2::u32 default.color.range = 0 c2::u32 default.color.transfer = 0 c2::u32 input.buffers.max-size.value = 7340032 string input.media-type.value = "video/avc" c2::u32 output.delay.value = 3 string output.media-type.value = "video/raw" c2::u32 raw.color.matrix = 0 c2::u32 raw.color.primaries = 0 c2::u32 raw.color.range = 0 c2::u32 raw.color.transfer = 0 c2::float raw.hdr-static-info.max-cll = 0 c2::float raw.hdr-static-info.max-fall = 0 c2::u32 raw.max-size.height = 240 c2::u32 raw.max-size.width = 320 c2::u32 raw.pixel-format.value = 34 c2::i32 raw.rotation.flip = 32013-519 ColorUtils androidx.media3.demo.main W expected specified color aspects (0:0:0:0) 32013-517 MediaCodec androidx.media3.demo.main I MediaCodec will operate in async mode 32013-517 SurfaceUtils androidx.media3.demo.main D connecting to surface 0xb400007aeea67620, reason connectToSurface 32013-517 MediaCodec androidx.media3.demo.main I [c2.exynos.h264.decoder] setting surface generation to 32781323 32013-517 SurfaceUtils androidx.media3.demo.main D disconnecting from surface 0xb400007aeea67620, reason connectToSurface(reconnect) 32013-517 SurfaceUtils androidx.media3.demo.main D connecting to surface 0xb400007aeea67610, reason connectToSurface(reconnect-with-listener) 32013-519 CCodec androidx.media3.demo.main D [c2.exynos.h264.decoder] buffers are bound to CCodec for this session 32013-519 CCodecConfig androidx.media3.demo.main D no c2 equivalents for csd-1 32013-519 CCodecConfig androidx.media3.demo.main D no c2 equivalents for log-session-id 32013-519 CCodecConfig androidx.media3.demo.main D no c2 equivalents for native-window 32013-519 CCodecConfig androidx.media3.demo.main D no c2 equivalents for native-window-generation 32013-519 CCodecConfig androidx.media3.demo.main D no c2 equivalents for flags 32013-519 CCodecConfig androidx.media3.demo.main D c2 config diff is c2::u32 raw.max-size.height = 360 c2::u32 raw.max-size.width = 480 c2::u32 raw.size.height = 360 c2::u32 raw.size.width = 480 32013-519 Codec2Client androidx.media3.demo.main W query -- param skipped: index = 1107298332. 32013-519 CCodec androidx.media3.demo.main D client requested max input size 132480, which is smaller than what component recommended (7340032); overriding with component recommendation. 32013-519 CCodec androidx.media3.demo.main W This behavior is subject to change. It is recommended that app developers double check whether the requested max input size is in reasonable range. 32013-519 CCodec androidx.media3.demo.main D encoding statistics level = 0 32013-519 CCodec androidx.media3.demo.main D setup formats input: AMessage(what = 0x00000000) = { int32_t height = 360 int32_t level = 65536 int32_t max-input-size = 7340032 string mime = "video/avc" int32_t priority = 0 int32_t profile = 65536 int32_t width = 480 Rect crop(0, 0, 479, 359) } 32013-519 CCodec androidx.media3.demo.main D setup formats output: AMessage(what = 0x00000000) = { int32_t android._color-format = 2130708361 int32_t android._video-scaling = 1 int32_t rotation-degrees = 0 int32_t color-standard = 4 int32_t color-range = 2 int32_t color-transfer = 3 float cta861.max-cll = 0.000000 float cta861.max-fall = 0.000000 int32_t sar-height = 1 int32_t sar-width = 1 Rect crop(0, 0, 479, 359) int32_t width = 480 int32_t height = 360 int32_t max-height = 360 int32_t max-width = 480 string mime = "video/raw" int32_t priority = 0 int32_t android._dataspace = 259 int32_t color-format = 2130708361 } 32013-519 CCodecConfig androidx.media3.demo.main I query failed after returning 15 values (BAD_INDEX) 32013-459 MediaCodec androidx.media3.demo.main D keep callback message for reclaim 32013-519 Codec2Client androidx.media3.demo.main W query -- param skipped: index = 1073743886. 32013-519 Codec2Client androidx.media3.demo.main W query -- param skipped: index = 1610614798. 32013-519 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#860] Created input block pool with allocatorID 16 => poolID 23 - OK (0) 32013-519 CCodecBufferChannel androidx.media3.demo.main I [c2.exynos.h264.decoder#860] Created output block pool with allocatorID 18 => poolID 4506 - OK 32013-519 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#860] Configured output block pool ids 4506 => OK 32013-519 Codec2-Out...ufferQueue androidx.media3.demo.main D C2SurfaceSyncMemory created 20(20) 32013-519 Codec2-Out...ufferQueue androidx.media3.demo.main D remote graphic buffer migration 0/0 32013-519 Codec2Client androidx.media3.demo.main D setOutputSurface -- failed to set consumer usage (6/BAD_INDEX) 32013-519 Codec2Client androidx.media3.demo.main D setOutputSurface -- generation=32781323 consumer usage=0x900 sync 32013-519 Codec2Client androidx.media3.demo.main D Surface configure completed 32013-32099 BufferPoolAccessor2.0 androidx.media3.demo.main D Destruction - bufferpool2 0xb400007c1e9edaa8 cached: 0/0M, 0/0% in use; allocs: 6, 17% recycled; transfers: 4, 50% unfetched 32013-32013 EventLogger androidx.media3.demo.main D videoDecoderInitialized [eventTime=8.42, mediaPos=0.00, window=0, period=0, c2.exynos.h264.decoder] 32013-32013 EventLogger androidx.media3.demo.main D videoInputFormat [eventTime=8.43, mediaPos=0.00, window=0, period=0, id=1, mimeType=video/avc, bitrate=1400000, codecs=avc1.640015, res=480x360, color=NA/NA/NA/8/8] 32013-519 CCodecConfig androidx.media3.demo.main D c2 config diff is c2::u32 output.delay.value = 6 32013-519 Codec2-Out...ufferQueue androidx.media3.demo.main D set max dequeue count 13 from update 32013-32099 CCodecBufferChannel androidx.media3.demo.main D [c2.exynos.h264.decoder#860] Ignoring stale input buffer done callback: last flush index = 0, frameIndex = 0 32013-519 Codec2-Out...ufferQueue androidx.media3.demo.main D set max dequeue count 13 from update 32013-519 Codec2-Out...ufferQueue androidx.media3.demo.main D set max dequeue count 13 from update 32013-519 CCodecConfig androidx.media3.demo.main D c2 config diff is c2::u32 raw.crop.height = 360 c2::u32 raw.crop.left = 0 c2::u32 raw.crop.top = 0 c2::u32 raw.crop.width = 480 c2::u32 raw.max-size.height = 368 c2::u32 raw.size.height = 368 32013-519 CCodecBuffers androidx.media3.demo.main D [c2.exynos.h264.decoder#860:2D-Output] popFromStashAndRegister: at 1000000083422us, output format changed to AMessage(what = 0x00000000) = { int32_t android._color-format = 2130708361 int32_t android._video-scaling = 1 int32_t rotation-degrees = 0 int32_t color-standard = 4 int32_t color-range = 2 int32_t color-transfer = 3 float cta861.max-cll = 0.000000 float cta861.max-fall = 0.000000 int32_t sar-height = 1 int32_t sar-width = 1 Rect crop(0, 0, 479, 359) int32_t width = 480 int32_t height = 368 int32_t max-height = 368 int32_t max-width = 480 string mime = "video/raw" int32_t priority = 0 int32_t android._dataspace = 259 int32_t color-format = 2130708361 } 32013-32013 EventLogger androidx.media3.demo.main D videoSize [eventTime=8.46, mediaPos=0.00, window=0, period=0, 480, 360] 32013-32013 EventLogger androidx.media3.demo.main D renderedFirstFrame [eventTime=8.46, mediaPos=0.00, window=0, period=0, Surface(name=null)/@0x3768b0a] 32013-32013 EventLogger androidx.media3.demo.main D surfaceSize [eventTime=8.47, mediaPos=0.00, window=0, period=0, 1440, 810] 32013-32013 EventLogger androidx.media3.demo.main D state [eventTime=8.48, mediaPos=0.00, window=0, period=0, READY] 32013-32013 EventLogger androidx.media3.demo.main D isPlaying [eventTime=8.49, mediaPos=0.01, window=0, period=0, true] 32013-32013 EventLogger androidx.media3.demo.main D playWhenReady [eventTime=9.37, mediaPos=0.89, window=0, period=0, false, USER_REQUEST] 32013-32013 EventLogger androidx.media3.demo.main D isPlaying [eventTime=9.39, mediaPos=0.89, window=0, period=0, false] ```Media
https://drive.google.com/file/d/1boaFwlO5kTnpK6Wzg2kYaTHwvryr-Rl2/view?usp=drive_link
zip file containing a master.m3u8 with two variants. The original (in h264 10bits) that can't be played and a 360p (in h264 8bits) that can be played.
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.