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

[BUG]: playback stop when changing selectedVideoTrack value 'resolution' #3804

Closed
anasvemmully opened this issue May 21, 2024 · 4 comments
Closed

Comments

@anasvemmully
Copy link

anasvemmully commented May 21, 2024

Version

6.0.0

What platforms are you having the problem on?

Android

Architecture

Old architecture

What happened?

I'm receiving the following problem while attempting to switch between resolutions of DRM protected Video and selectedVideoTrack types resolution and index as well. Without the selectedVideoTrack props, everything works perfectly; it's not causing an issue for every device, only certain of them; for me, the device I'm receiving the error for

Device Information:

  • Device: OPPO Reno 2f
  • Android Version: 11
  • adb shell getprop ro.product.model: CPH1989
  • adb shell getprop ro.product.manufacturer: OPPO
  • adb shell getprop ro.build.version.release: 11
  • adb shell getprop ro.build.display.id: CPH1989_11_F.24

Expected Behavior:
The track resolution of the video should need to be changed.

Actual Behaviour
The app crashes or phone freezes/restarts after changing the value for selectedVideoTrack.

NB:- without selectedVideoTrack works fine but why when using/changing value of selectedVideoTrack freezes

Reproduction

https://github.com/anasvemmully/rnvideotest

Reproduction

The app crashes or phone freezes/restarts after changing the value for selectedVideoTrack.

Caught through LogCat

Playback error
  androidx.media3.exoplayer.ExoPlaybackException: MediaCodecAudioRenderer
error, index=1, format=Format(15, null, null, audio/mp4a-latm, mp4a.40.2, 69168, en, [-1, -1, -1.0, null], [1, 24000]), format_supported=YES
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:601)
      at android.os.Handler.dispatchMessage(Handler.java:103)
      at android.os.Looper.loop(Looper.java:227)
      at android.os.HandlerThread.run(HandlerThread.java:67)
  Caused by: android.media.MediaCodec$CryptoException: Crypto key not available
      at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
      at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2699)
      at
androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.queueSecureInputBuffer(SynchronousMediaCodecAdapter.java:151)
      at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1396)
      at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:818)
      at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1047)
      at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:522)
      at android.os.Handler.dispatchMessage(Handler.java:103) 
      at android.os.Looper.loop(Looper.java:227) 
      at android.os.HandlerThread.run(HandlerThread.java:67) 

The following error caught from onError

{
    "errorStackTrace": "androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, 389802, null, [512, 288, 24.0, ColorInfo(Unset color space, Limited range, Unset color transfer, false)], [-1, -1]), format_supported=YES\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:601)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:264)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\nCaused by: android.media.MediaCodec$CryptoException: Crypto key not available\n\tat android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)\n\tat android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2821)\n\tat androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.queueSecureInputBuffer(SynchronousMediaCodecAdapter.java:151)\n\tat androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1396)\n\tat androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:818)\n\tat androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:852)\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1047)\n\tat androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:522)\n\t... 3 more\n",
    "errorCode": "26006",
    "errorException": "androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, 389802, null, [512, 288, 24.0, ColorInfo(Unset color space, Limited range, Unset color transfer, false)], [-1, -1]), format_supported=YES",
    "errorString": "ExoPlaybackException: ERROR_CODE_DRM_SYSTEM_ERROR"
}

video of the stated issue

without selectedVideoTrack prop Mp4
with selectedVideoTrack prop Mp4

@freeboub
Copy link
Collaborator

I tried to use the sample, I don't have the exact same issue...
Only P1 doesn't work (on emulator). It fails with NO_EXCEEDS_CAPABILITIES which is fixed by: #3791
But I don't reproduce the DRM error.

Notice also that following PR: #3778 can improve the behavior but not sure ...

@freeboub freeboub changed the title [BUG]: App crashes on changing selectedVideoTrack value 'resolution' [BUG]: playback stop when changing selectedVideoTrack value 'resolution' May 21, 2024
@anasvemmully
Copy link
Author

anasvemmully commented May 21, 2024

It's working for most of the devices but only a smal fraction of devices are getting this problem, don't know why

This is the video of the device having the issue with the selectedVideoTrack prop

with.prop.mp4

And this is the video of the same device without having the selectedVideoTrack prop

without.prop.mp4

What information should I need to provide to inspect?

@freeboub
Copy link
Collaborator

You should try to reproduce the issue with the exoplayer/media3 sample! It looks like a device issue. I will close it for now. Ping me if you have info. BTW it would be interesting to retest with the next release (6.1.0)

@freeboub freeboub closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
@anasvemmully
Copy link
Author

ok, sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants