google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.71k stars 6.02k forks source link

Black Screen on changing the bitrate in demo app #8196

Closed GouravSna closed 3 years ago

GouravSna commented 3 years ago

[REQUIRED] Question

In ExoPlayer demo app, if I change the Video bit rate then i see a blackscreen then video frame appears. It is only happening in Dash DRM content; which i can see. For HLS and Clear Dash, when i change the bit rate, video frame is visible and resumes the content after the track update.

A full bug report captured from the device

Not required.

Link to test content

In Demo app. Widevine DASH H264 (MP4) -> Secure (cenc)

PS: We can show a loader on bitrate switching OR may show an overlay but want to ask that is this a known and intended behaviour ? From UX viewpoint, I felt that it is not good.

kim-vde commented 3 years ago

Thanks for reporting this. Could you clarify how you change the bitrate?

GouravSna commented 3 years ago

I am changing it manually from the 'Select Tracks' button from PlayerScreen then under 'Video' selecting bitrate.

kim-vde commented 3 years ago

I can indeed observe this behaviour with Widevine secure content but not with Widevine clear content. I can see some DRM errors in the strack trace when changing the track but I am not sure whether they are linked. This issue was already present in ExoPlayer 11.7.

Assigning to @AquilesCanta for further investigation.

GouravSna commented 3 years ago

Hi @kim-vde @AquilesCanta , Please let us know if we have any update on it.

ojw28 commented 3 years ago

Note: This only happens with manual track selection. It doesn't happen on adaptive track selections performed by the player during playback.

What you're seeing is the result of a platform limitation related to how secure video playback is implemented. In short, the implementation clears the Surface when the decoder is released. It doesn't appear to happen on a Pixel 4 XL running Android 11. I'm unsure whether this means that the limitation has been removed completely in Android 11, or whether the exact behaviour varies by the system-on-chip in the device. I have a Galaxy S20 that currently does reproduce the issue running Android 10, and is expected to receive Android 11 soon according to Samsung. So a good test will be whether the issue is still present on this device after it receives the update.

There is also a TODO in ExoPlayer to do a better job of re-using the decoder in this case, which would help with some cases, but is unlikely to fully solve the problem because we will still need to release and recreate the decoder in some cases.

I will leave this issue open until I can report back on what the Galaxy S20 does after it receives its update. Once that's done I will close this issue because it's a limitation of the underlying platform. We have no plan to look at the TODO mentioned above any time soon, because it's quite a complicated piece of work for quite a minor improvement, and because it would also not resolve the issue in all cases.

GouravSna commented 3 years ago

Thanks a lot @ojw28 😀

ojw28 commented 3 years ago

The S20 I have was upgraded to Android 11, and still has the same behaviour unfortunately. Closing regardless as a platform limitation, as described above.