Containers and Codecs

When we talk about video on the Web, we talk in terms of containers and codecs. You might think of a video you get off your digital camera as an AVI or an MPEG file, but that’s an oversimplification. A container is like an envelope that holds audio streams, video streams, and sometimes additional metadata such as subtitles. These audio and video streams need to be encoded, and that’s where codecs come in. Video and audio can be encoded in hundreds of different ways, but when it comes to HTML5 video, only a few matter.

Video Codecs

When you watch a video, your video player has to decode it. Unfortunately, the player you’re using might not be able to decode the video you want to watch because the video was encoded using a format ...

Get HTML5 and CSS3, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.