2021年4月7日星期三

HTML5 Video Compatibility (MP4, WEBM, OGG) in 2021

The support of HTML5 video has evolved a lot over the years. I am trying to understand whether the <video> element still needs to have three sources: MP4, WEBM, and OGG.

There are a lot of answers throughout StackOverflow with deeply conflicting information - some of which say that you just need MP4 now, others say, MP4 and WEBM are enough, and then finally many say that you need all three (although many of those article are ~10 years old).

W3 suggests that either MP4 or WEBM alone would have universal support (Even though I found a 2011 article from Google saying that they would be removing support for MP4/H.264). Wikipedia paints a more complicated picture (as well as listing that Google Chrome does indeed support MP4/H.264). Azure Media services ONLY seems to allow output in MP4, which would suggest to me that MP4 must have widespread compatibility.

Also see Example 1, Example 2, Example 3.

Is there any definitive information on what video types to include in an HTML5 video player to achieve widespread compatibility?

Background: I am building a Content Management Platform that allows uploading videos. When a new video is uploaded, a conversion process kicks off to convert the video into the required formats. This takes time and CPU/Memory, so if it is possible I would like to convert uploaded videos into as few formats as possible.

p.s. This question HAS been asked before, however, the fundamentals of playing video on the web continually evolve and most of the answers out there have become irrelevant.

https://stackoverflow.com/questions/66996365/html5-video-compatibility-mp4-webm-ogg-in-2021 April 08, 2021 at 10:00AM

没有评论:

发表评论