videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.85k stars 7.43k forks source link

Videojs H265/HEVC playback garbled then crashes on Edge (Chromium) #7032

Open RafalLukawiecki opened 3 years ago

RafalLukawiecki commented 3 years ago

Description

VideoJS cannot play an m3u8 containing both H264 and H265 on Edge (Chromium) on several Microsoft Surface devices. Browser display becomes garbled and the video player page seems to crash. However, if the same data is presented in an m3u8 that does not contain the H265 streams, and only contains the very same H264 ones, it plays correctly. This assumes override native is selected. With override native deselected nothing plays properly at all in Edge (Chromium) on those Surface.

Part of the problem seems to be caused by video.js selecting the H265 representations by default. If a H264 representation is manually selected, playback is normal, until video.js switches to a H265 representation.

This issue only affects Edge on those devices on which video.js decides to load the H265 representations, including some tablets and Surface PCs. On other devices, like Surface laptop, video.js only loads the H264 representations, ignoring H265. Similarly, video.js in Edge running on non-Surface Windows 10 devices does not attempt to load the H265 representations, either. On all those devices playback is normal.

For those reasons, it would be helpful to disable H265 playback in video.js on all Edge browsers until a fix is known so that it does not try to load H265 that it cannot play at all. Unfortunately, I have failed to do that in my own code. If there is a way to explicitly disable H265 using JS and video.js API I would like to know how, as I have failed after many attempts. The only workaround is to completely stop serving H265 as part of the m3u8.

Steps to reproduce

  1. Play stream https://d2gw5qqm1tusud.cloudfront.net/future-test-fmp4h264-h265/main.m3u8 using https://videojs-http-streaming.netlify.app using Edge on Windows 10 Surface
  2. Ensure that the selected representation is a H265 one (ids 0-4 in this stream):
Screenshot 2021-01-08 at 10 43 48

If those representations are not loaded you are probably using a Surface on which video.js decided not to load H265 at all. This issue only affects those Surface devices where video.js loads H265 representations.

  1. Press play and wait approx 2-10 seconds.

Results

Expected

Normal playback.

Actual

After a few seconds of playback, browser display becomes garbled like one of these, sometimes flicking between these outputs (please ignore the "RL" and "G" pointers which are not part of the actual output):

Screenshot 2021-01-08 at 11 01 44 Screenshot 2021-01-08 at 11 08 19 Screenshot 2021-01-08 at 10 53 08 Screenshot 2021-01-08 at 10 44 12

The same .m3u8 plays correctly on other browsers and devices and OSes.

Error output

Sometimes (rarely) the console will log "Excessive main segment downloading detected" but usually there is no error output. When the browser window becomes garbled, the console can become unresponsive, and sometimes it starts reporting errors to Microsoft (aria...)

Screenshot 2021-01-08 at 10 50 43

Additional Information

versions

videojs

7.10.0, 7.11.0

browsers

Edge 86.0.622.68 onwards, till latest tested on 87.0.664.75.

OSes

Windows 10 (recent, Oct 2020 onwards) running on some Surface devices. Notably, this affects both older ones, like Surface Pro 3, and much newer ones, like the AMD Ryzen 7 Microsoft Surface Edition. Some variants, like the Surface laptop, seem to be unaffected.

plugins

Only the core and VHS, as per the testing page at https://videojs-http-streaming.netlify.app

video-archivist-bot commented 3 years ago

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

RafalLukawiecki commented 3 years ago

@gkatsev, since you have been following a few of my issues, I wonder if there is anything I could do to help debug this. Alternatively, if you have any suggestions how I could force Edge not to load the H265 representations, which it cannot play, that would be much appreciated. Thanks either way.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

RafalLukawiecki commented 2 years ago

(not stale)