canalplus / rx-player

DASH/Smooth HTML5 Video Player
https://developers.canal-plus.com/rx-player/
Apache License 2.0
869 stars 131 forks source link

MEDIA_ERROR_DECODE on mobile devices #1128

Open adamtatur opened 2 years ago

adamtatur commented 2 years ago

Hi,

During integration with rxplayer ver 3.26.2 we noticed a problem with streaming on mobile devices. After initialization, we get a MediaError (MEDIA_ERR_DECODE) An error occurred while trying to decode the media resource error. We checked the same content on different devices, here are the results:

  1. Samsung S20 FE with Android 12

    • Chrome 102.0.5005.78 - works
    • Firefox 101.1.1 - works
  2. Samsung S10 Android 12

    • Chrome 102.0.5005.78 - fails
    • Firefox 101.1.1 - fails
  3. Samsung A51 Android 11

    • Chrome 102.0.5005.78 - fails
    • Firefox 101.1.1 - fails

Have you encountered a similar problem?

peaBerberian commented 2 years ago

Hi,

MEDIA_ERR_DECODE is a decoding error originating from the browser when it cannot decode pushed media segments.

It may be a problem with the content or perhaps it is a side-effect of another problem. Are you playing encrypted contents ?

Can you test with the pre-version: release/v3.27.1-dev.2022060300? It adds supplementary information in the error message if it exists on the original error.

adamtatur commented 2 years ago

@peaBerberian thanks for your feedback.

Are you playing encrypted contents ?

Yes, we're using encrypted content.

Using new player version we get such error message: MediaError (MEDIA_ERR_DECODE) PIPELINE_ERROR_DECODE: video decoder reinitialization failed. Could this be managed using some sort of player configuration or this has to be fixes on content level?

m-scheepers commented 2 years ago

@peaBerberian FYI the same content works with another HTML5-based player (Bitmovin) from which we are migrating towards rxplayer. If needed we should be able to provide some test streams.

peaBerberian commented 2 years ago

Hi,

if bitmovin's MSE player plays without issues the same content on the same device (in the same OS/browser version), it means that it should be fixable player-side hopefully.

If you can easily provide a test stream, it would be nice yes! I'll try to reproduce it on my side and look if I see irregularities when going to chrome://media-internals - which is a special Chrome page giving supplementary details on media decoding going on in any chrome page (on PC, the goal being to see if there's peculiarities in those streams that may be poorly handled by the browser).

At worst, we have reverse-engineering tools that can compare media segments pushed by the RxPlayer to media segments pushed by other players. This may be used to understand if some trick go on in the segments to improve compatibility with those android devices.

peaBerberian commented 2 years ago

Also judging by the fact that the error talk about reinitialization, it may be an hint that this happens on some quality and/or track switch.

Do you also reproduce it if you force a quality (for example you can just force the minimum video quality by calling setVideoBitrate(0) and minimum audio quality by calling setAudioBitrate(0)) ?

We could also check if that happens as a side-effect of the changeType API which we may use in some cases, but for which support is generally poor. We could try a build with it (or even just testing with a monkey-patched SourceBuffer.prototype.changeType API which would just be a noop).

m-scheepers commented 2 years ago

@peaBerberian I have shared a play-out url and license url privately which is not working on mobile browsers as indicated by @adamtatur

m-scheepers commented 2 years ago

@peaBerberian the solution which was suggested earlier does not seem to correct for the issue for mobile browser playback.