bcc-code / bccm-player

[BCC Media] Flutter package for video-heavy apps
https://bcc-code.github.io/bccm-player/
Other
17 stars 11 forks source link

|BUG| HDR and Dolby Vision #34

Closed sudhanshugairola closed 1 year ago

sudhanshugairola commented 1 year ago

While playing video with multiple resolutions with m3u8

  1. Dobly Vision
  2. HDR
  3. SDR

After sometime player shift to unsupported codec and player stopped and dispose automatically after that.

error: I/CCodec (22003): [c2.qti.hevc.decoder] release(1) D/CCodecBufferChannel(22003): [c2.qti.hevc.decoder#582] MediaCodec discarded an unknown buffer D/CCodecBufferChannel(22003): [c2.qti.hevc.decoder#582] MediaCodec discarded an unknown buffer E/ExoPlayerImplInternal(22003): Playback error E/ExoPlayerImplInternal(22003): androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(2, null, null, video/dolby-vision, dvhe.05.03, 15414490, null, [1920, 1080, 24.0], [-1, -1]), format_supported=NO_UNSUPPORTED_TYPE E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:586) E/ExoPlayerImplInternal(22003): at android.os.Handler.dispatchMessage(Handler.java:102) E/ExoPlayerImplInternal(22003): at android.os.Looper.loopOnce(Looper.java:226) E/ExoPlayerImplInternal(22003): at android.os.Looper.loop(Looper.java:313) E/ExoPlayerImplInternal(22003): at android.os.HandlerThread.run(HandlerThread.java:67) E/ExoPlayerImplInternal(22003): Caused by: androidx.media3.exoplayer.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: [-49999], Format(2, null, null, video/dolby-vision, dvhe.05.03, 15414490, null, [1920, 1080, 24.0], [-1, -1]) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:989) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:539) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.reinitializeCodec(MediaCodecRenderer.java:2128) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.processEndOfStream(MediaCodecRenderer.java:2010) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1840) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:784) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1015) E/ExoPlayerImplInternal(22003): at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:510) E/ExoPlayerImplInternal(22003): ... 4 more I/CCodec (22003): [c2.android.aac.decoder] state->set(FLUSHING) I/CCodec (22003): [c2.android.aac.decoder] state->set(FLUSHED) D/CCodecBuffers(22003): [c2.android.aac.decoder#647:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 0 D/CCodecBuffers(22003): [c2.android.aac.decoder#647:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 1 D/CCodecBuffers(22003): [c2.android.aac.decoder#647:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 2 D/MediaCodec(22003): keep callback message for reclaim I/CCodec (22003): [c2.android.aac.decoder] state->set(RESUMING) I/CCodecConfig(22003): query failed after returning 20 values (BAD_INDEX) W/Codec2Client(22003): query -- param skipped: index = 1342179345. W/Codec2Client(22003): query -- param skipped: index = 2415921170. W/Codec2Client(22003): query -- param skipped: index = 1610614798. I/CCodec (22003): [c2.android.aac.decoder] state->set(RUNNING) I/CCodecBufferChannel(22003): [c2.android.aac.decoder#647] 4 initial input buffers available I/CCodec (22003): [c2.android.aac.decoder] state->set(RELEASING) D/CCodecBufferChannel(22003): [c2.android.aac.decoder#647] MediaCodec discarded an unknown buffer D/CCodecBufferChannel(22003): [c2.android.aac.decoder#647] MediaCodec discarded an unknown buffer D/CCodecBufferChannel(22003): [c2.android.aac.decoder#647] MediaCodec discarded an unknown buffer I/CCodec (22003): [c2.android.aac.decoder] release(1) D/CCodecBufferChannel(22003): [c2.android.aac.decoder#647] MediaCodec discarded an unknown buffer I/CCodec (22003): [c2.qti.hevc.decoder] state->set(RELEASED) I/hw-BpHwBinder(22003): onLastStrongRef automatically unlinking death recipients D/SurfaceUtils(22003): disconnecting from surface 0xb400007b48bf9010, reason disconnectFromSurface I/MediaCodec(22003): Codec shutdown complete D/MediaCodec(22003): flushMediametrics D/MediaCodec(22003): flushMediametrics I/CCodec (22003): [c2.android.aac.decoder] state->set(RELEASED) I/hw-BpHwBinder(22003): onLastStrongRef automatically unlinking death recipients I/MediaCodec(22003): Codec shutdown complete D/MediaCodec(22003): flushMediametrics D/MediaCodec(22003): flushMediametrics D/bccm (22003): playbackState: 1

sudhanshugairola commented 1 year ago

My primary device support HDR capability and unsupported with Dolby vision.

For testing purpose i try one more thing, and i found a bug with HDR and dolby vision unsupported device, while playing video on low end device player automatically set video on hdr instead of SDR resolution that automatic selection create a issue with color washout on low end device because player automatically select and unsupported codec on low end device.

sudhanshugairola commented 1 year ago

Do something like, which device support dolby vision that surely capable for HDR and Dolby vision and also support SDR like on latest iphones, and which device only support HDR absolutely that not support dolby vision, but perfectly work with other codec for SDR resolution.

And last thing for low end device which neither support HDR and Dolby vision, and specially work with SDR resolution only.