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

23 November, 2022

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 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.

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.