HTML
Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
specification as the standard way of playing video via the web. Introduced in
HTML5
HTML5 (Hypertext Markup Language 5) is a markup language used for structuring and presenting hypertext documents on the World Wide Web. It was the fifth and final major HTML version that is now a retired World Wide Web Consortium (W3C) recommend ...
, it is designed to partially replace the object element and the previous de facto standard of using the proprietary
Adobe Flash
Adobe Flash (formerly Macromedia Flash and FutureSplash) is a mostly discontinuedAlthough it is discontinued by Adobe Inc., for the Chinese market it is developed by Zhongcheng and for the international enterprise market it is developed by Ha ...
plugin, though early adoption was hampered by lack of agreement as to which
video coding format
A video coding format (or sometimes video compression format) is a content representation format of digital video content, such as in a data file or bitstream. It typically uses a standardized video compression algorithm, most commonly based on ...
s and
audio coding format
An audio coding format (or sometimes audio compression format) is a content representation format for storage or transmission of digital audio (such as in digital television, digital radio and in audio and video files). Examples of audio coding f ...
s should be supported in web browsers. As of 2020, HTML video is the only widely supported video playback technology in modern browsers, with the Flash plugin being phased out.
History of <video> element
The element started being discussed by the
WHATWG
The Web Hypertext Application Technology Working Group (WHATWG) is a community of people interested in evolving HTML and related technologies. The WHATWG was founded by individuals from Apple Inc., the Mozilla Foundation and Opera Software, ...
in October 2006. The element was proposed by
Opera Software
Opera (formerly Opera Software AS) is a Norwegian multinational technology corporation headquartered in Oslo, Norway with additional offices in European Union, Europe, China, and Africa. Opera offers a range of products and services that inclu ...
in February 2007. Opera also released a preview build that was showcased the same day, and a manifesto that called for video to become a first-class citizen of the web.
<video> element examples
The following HTML code fragment will embed a
WebM
WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
video into a web page.
The "controls" attribute enables the browser's own user interface for controlling playback. Alternatively, playback can be controlled with
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
, which the web designer can use to create a custom user interface. The optional "poster" attribute specifies an image to show in the video's place before playback is started. Its purpose is to be representative of the video.
Multiple sources
Video format support varies among browsers (see below), so a web page can provide video in multiple formats. For other features,
browser sniffing
Browser sniffing (also known as browser detection) is a set of techniques used in websites and web applications in order to determine the web browser a visitor is using, and to serve browser-appropriate content to the visitor. It is also used to d ...
is used sometimes, which may be error-prone: any web developer's knowledge of browsers will inevitably be incomplete or not up-to-date. The browser in question "knows best" what formats it can use. The "video" element supports fallback through specification of multiple sources. Using any number of <source> elements, as shown below, the browser will choose automatically which file to download. Alternatively, the
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
function can be used to achieve the same. The "type" attribute specifies the
MIME type
In information and communications technology, a media type, content type or MIME type is a two-part identifier for file formats and content formats. Their purpose is comparable to filename extensions and uniform type identifiers, in that they ide ...
and possibly a list of codecs, which helps the browser to determine whether it can decode the file without beginning to download it. The MIME type denotes the
container format
A container format (informally, sometimes called a wrapper) or metafile is a file format that allows multiple data streams to be embedded into a single file, usually along with metadata for identifying and further detailing those streams. Nota ...
of the file, and the container format defines the interpretation of the codec string.
Supported video and audio formats
The HTML specification does not specify which video and audio formats browsers should support. User agents are free to support any video formats they feel are appropriate, but content authors cannot assume that any video will be accessible by all complying user agents, since user agents have no minimal set of video and audio formats to support.
The HTML5 Working Group considered it desirable to specify at least one video format which all user agents (browsers) should support. The ideal format in this regard would:
*Have good compression, good image quality, and low decode processor use.
*Be royalty-free.
*In addition to software decoders, a hardware
video decoder
A video decoder is an electronic circuit, often contained within a single integrated circuit chip, that converts base-band analog video signals to digital video. Video decoders commonly allow programmable control over video characteristics such as ...
should exist for the format, as many embedded processors do not have the performance to decode video.
Initially,
Ogg
Ogg is a digital multimedia container format designed to provide for efficient streaming and manipulation of digital multimedia. It is maintained by the Xiph.Org Foundation and is free and open, unrestricted by software patents. Its name is ...
Theora
Theora is a free lossy video compression format. It was developed by the Xiph.Org Foundation and distributed without licensing fees alongside their other free and open media projects, including the Vorbis audio format and the Ogg contai ...
was the recommended standard video format in HTML5, because it was not affected by any known patents. But on 10 December 2007, the HTML5 specification was updated, replacing the reference to concrete formats:
with a placeholder:
The result was a polarisation of HTML video between industry-standard, ISO-defined but
patent
A patent is a type of intellectual property that gives its owner the legal right to exclude others from making, using, or selling an invention for a limited period of time in exchange for publishing an sufficiency of disclosure, enabling discl ...
-encumbered formats, and
open format
An open file format is a file format for storing digital data, defined by an openly published specification usually maintained by a standards organization, and which can be used and implemented by anyone. An open file format is licensed with a ...
Alliance for Open Media
The Alliance for Open Media (AOMedia) is a non-profit industry consortium headquartered in Wakefield, Massachusetts, and formed to develop open, royalty-free technology for multimedia delivery. It uses the ideas and principles of open web standa ...
aims to be both industry standard, royalty-free, and open, and has wide industry support.
Free formats
Although Theora is not affected by known non-free patents,
Apple
An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
has expressed concern about unknown patents that might affect it, whose owners might be waiting for a corporation with extensive financial resources to use the format before suing. Formats like H.264 might also be subject to unknown patents in principle, but they have been deployed much more widely and so it is presumed that any patent-holders would have already made themselves known.
Apple
An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
has also opposed requiring Ogg format support in the HTML standard (even as a "should" requirement) on the grounds that some devices might support other formats much more easily, and that HTML has historically not required particular formats for anything.
Some
web developer
A web developer is a programmer who develops World Wide Web applications using a client–server model. The applications typically use HTML, CSS, and JavaScript in the client, and any general-purpose programming language in the server. is used ...
s criticized the removal of the Ogg formats from the specification. A follow-up discussion also occurred on the W3C questions and answers blog.
Mozilla
Mozilla is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, publishes and supports Mozilla products, thereby promoting free software and open standards. The community is supported institution ...
and
Opera
Opera is a form of History of theatre#European theatre, Western theatre in which music is a fundamental component and dramatic roles are taken by Singing, singers. Such a "work" (the literal translation of the Italian word "opera") is typically ...
support only the open formats of
Theora
Theora is a free lossy video compression format. It was developed by the Xiph.Org Foundation and distributed without licensing fees alongside their other free and open media projects, including the Vorbis audio format and the Ogg contai ...
and
WebM
WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
. Google stated its intention to remove support for H.264 in 2011, specifically for the HTML video tag. Although it has been removed from
Chromium
Chromium is a chemical element; it has Symbol (chemistry), symbol Cr and atomic number 24. It is the first element in Group 6 element, group 6. It is a steely-grey, Luster (mineralogy), lustrous, hard, and brittle transition metal.
Chromium ...
, it has yet to be removed from
Google Chrome
Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
ten years later.
MPEG-DASH Support via the Media Source Extensions (MSE)
The adaptive bitrate streaming standard MPEG-DASH can be used in Web browsers via the Media Source Extensions (MSE) and JavaScript-based DASH players. Such players are, e.g., the open-source project dash.js of the DASH Industry Forum, but there are also products such as the HTML5 Video Player of
Bitmovin
Bitmovin is a multimedia technology company which provides services that transcode digital video and audio to streaming formats using cloud computing, and streaming media players. Founded in 2013, the Austrian company contributes to MPEG-DASH, a ...
(using HTML with JavaScript, but also a Flash-based DASH players for legacy Web browsers not supporting the MSE).
Google's purchase of On2
Google
Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
's acquisition of
On2
On2 Technologies, formerly known as The Duck Corporation, was a small publicly traded company (on the American Stock Exchange), founded in New York City in 1992 and headquartered in Clifton Park, New York, that designed video codec technology. ...
in 2010 resulted in its acquisition of the
VP8
VP8 is an open format, open and royalty-free Video coding format, video compression format released by On2 Technologies in 2008.
Initially released as a Proprietary software, proprietary successor to On2's previous VP7 format, VP8 was released a ...
video format. Google has provided a
royalty-free
Royalty-free (RF) material subject to copyright or other intellectual property rights may be used without the need to pay royalties or license fees for each use, per each copy or volume sold or some time period of use or sales.
Computer standards ...
license to use VP8. Google also started
WebM
WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
, which combines the standardized open source VP8 video codec with
Vorbis
Vorbis is a free and open-source software project headed by the Xiph.Org Foundation. The project produces an audio coding format and software reference encoder/decoder ( codec) for lossy audio compression, libvorbis. Vorbis is most comm ...
audio in a
Matroska
Matroska (styled Matroška) is a project to create a container format that can hold an unlimited number of video, audio, picture, or subtitle tracks in one file. The Matroska Multimedia Container is similar in concept to other containers like ...
based container. The opening of VP8 was welcomed by the
Free Software Foundation
The Free Software Foundation (FSF) is a 501(c)(3) non-profit organization founded by Richard Stallman on October 4, 1985. The organisation supports the free software movement, with the organization's preference for software being distributed ...
.
When Google announced in January 2011 that it would end native support of H.264 in Chrome, criticism came from many quarters including Peter Bright of
Ars Technica
''Ars Technica'' is a website covering news and opinions in technology, science, politics, and society, created by Ken Fisher and Jon Stokes in 1998. It publishes news, reviews, and guides on issues such as computer hardware and software, sci ...
and Microsoft web evangelist Tim Sneath, who compared Google's move to declaring
Esperanto
Esperanto (, ) is the world's most widely spoken Constructed language, constructed international auxiliary language. Created by L. L. Zamenhof in 1887 to be 'the International Language' (), it is intended to be a universal second language for ...
the official language of the United States. However, Haavard Moen of Opera Software strongly criticized the Ars Technica article and Google responded to the reaction by clarifying its intent to promote WebM in its products on the basis of openness.
After the launch of WebM, Mozilla and Opera have called for the inclusion of VP8 in HTML.
On 7 March 2013, Google Inc. and
MPEG LA
MPEG LA was an American company based in Denver, Colorado that licensed patent pools covering essential patents required for use of the MPEG-2, MPEG-4, IEEE 1394, VC-1, ATSC, MVC, MPEG-2 Systems, AVC/H.264 and HEVC standards.
Via Licensin ...
, LLC announced agreements covering techniques that "may be essential" to VP8, with Google receiving a license from MPEG LA and 11 patent holders, and MPEG LA ending its efforts to form a VP8 patent pool.
In 2012, VP9 was released by Google as a successor to VP8, also open and royalty free.
At the end of 2017 the new AV1 format developed by the
Alliance for Open Media
The Alliance for Open Media (AOMedia) is a non-profit industry consortium headquartered in Wakefield, Massachusetts, and formed to develop open, royalty-free technology for multimedia delivery. It uses the ideas and principles of open web standa ...
(AOMedia) as the evolution of VP9 has reached the feature freeze, and the bitstream freeze is expected for January 2018. Firefox nightly builds already include support for AV1.
Non-free formats
H.264/MPEG-4 AVC is widely used, and has good speed, compression, hardware decoders, and video quality, but is patent-encumbered. Users of H.264 need licenses either from the individual patent holders, or from the
MPEG LA
MPEG LA was an American company based in Denver, Colorado that licensed patent pools covering essential patents required for use of the MPEG-2, MPEG-4, IEEE 1394, VC-1, ATSC, MVC, MPEG-2 Systems, AVC/H.264 and HEVC standards.
Via Licensin ...
, a group of patent holders including Microsoft and Apple, except for some Internet broadcast video uses. H.264 is usually used in the MP4 container format, together with
Advanced Audio Coding
Advanced Audio Coding (AAC) is an audio coding standard for lossy digital audio compression. It was developed by Dolby, AT&T, Fraunhofer and Sony, originally as part of the MPEG-2 specification but later improved under MPEG-4.ISO (2006ISO/ ...
(AAC) audio. AAC is also covered by patents in itself, so users of MP4 will have to license both H.264 and AAC.
In June 2009, the WHATWG concluded that no existing format was suitable as a specified requirement.
Apple still only supports H.264, but Microsoft now supports VP9 and WebM, and has pledged support for AV1.
Cisco makes a licensed H.264 binary module available for free
On 30 October 2013,
Cisco
Cisco Systems, Inc. (using the trademark Cisco) is an American multinational digital communications technology conglomerate corporation headquartered in San Jose, California. Cisco develops, manufactures, and sells networking hardware, s ...
announced that it was making a binary H.264 module available for download. Cisco will pay the costs of patent licensing for those binary modules ''when downloaded by the using software while it is being installed'', making H.264 free to use in that specific case.
In the announcement, Cisco cited its desire of furthering the use of the
WebRTC
WebRTC (Web Real-Time Communication) is a free and open-source project providing web browsers and mobile applications with real-time communication (RTC) via application programming interfaces (APIs). It allows audio and video communication and ...
project as the reason, since WebRTC's video chat feature will benefit from having a video format supported in all browsers. The H.264 module will be available on "all popular or feasibly supportable platforms, which can be loaded into any application".
Cisco is also planning to publish source code for those modules under
BSD license
BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements. The original BSD lic ...
, but without paying the royalties, so the code will practically be
free software
Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
only in countries without H.264
software patent
A software patent is a patent on a piece of software, such as a computer program, library, user interface, or algorithm. The validity of these patents can be difficult to evaluate, as software is often at once a product of engineering, something ...
s, which has already been true about other existing implementations.
Also on 30 October 2013, Mozilla's
Brendan Eich
Brendan Eich ( ; born July 4, 1961) is an American computer programmer and technology executive. He created the JavaScript programming language and co-founded the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation. He serve ...
announced that Firefox would automatically download Cisco's H.264 module when needed by default. He also noted that the binary module is not a perfect solution, since users do not have full
free software
Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
rights to "modify, recompile, and redistribute without license agreements or fees". Thus Xiph and Mozilla continue the development of Daala.
OpenH264
OpenH264 is a free software library for real-time encoding and decoding video streams in the H.264/MPEG-4 AVC format. It is released under the terms of the Simplified BSD License."
History Move to free-to-use binaries
On October 30, 2013, Rowa ...
only supports the ''baseline'' profile of H.264, and does not by itself address the need for an AAC decoder. Therefore, it is not considered sufficient for typical MP4 web video, which is typically in the ''high'' profile with AAC audio.
However, for use in WebRTC, the omission of AAC was justified in the release announcement: "the standards bodies have aligned on
Opus
Opus (: opera
Opera is a form of History of theatre#European theatre, Western theatre in which music is a fundamental component and dramatic roles are taken by Singing, singers. Such a "work" (the literal translation of the Italian word "opera ...
and G.711 as the common audio codecs for WebRTC". There is doubt as to whether a capped global licensing of AAC, like Cisco's for H.264, is feasible after AAC's licensing bureau removed the price cap shortly after the release of OpenH264.
Browser support
This table shows which video formats are ''likely'' to be supported by a given
user agent
On the Web, a user agent is a software agent responsible for retrieving and facilitating end-user interaction with Web content. This includes all web browsers, such as Google Chrome and Safari
A safari (; originally ) is an overland jour ...
. Most of the browsers listed here use a
multimedia framework
A multimedia framework is a software framework that handles Electronic media, media on a computer and through a network. A good multimedia framework offers an intuitive Application programming interface, API and a modular architecture to easily a ...
for decoding and display of video, instead of incorporating such software components. It is not generally possible to tell the set of formats supported by a multimedia framework without querying it, because that depends on the
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
and third party codecs. In these cases, video format support is an attribute of the framework, not the browser (or its layout engine), assuming the browser properly queries its multimedia framework before rejecting unknown video formats. In some cases, the support listed here is not a function of either codecs available within the operating system's underlying media framework, or of codec capabilities built into the browser, but rather could be by a browser add-on that might, for example, bypass the browser's normal HTML parsing of the <video> tag to embed a plug-in based video player.
Note that a video file normally contains both video and audio content, each encoded in its own format. The browser has to support both the video and audio formats. See
HTML audio
HTML audio is a subject of the HTML specification, incorporating audio, including speech to text, all in the browser.
<audio> element
The element represents a sound, or an audio stream. It is commonly used to play back a single audio fil ...
for a table of which audio formats are supported by each browser.
The video format can be specified by
MIME type
In information and communications technology, a media type, content type or MIME type is a two-part identifier for file formats and content formats. Their purpose is comparable to filename extensions and uniform type identifiers, in that they ide ...
in HTML (see
example
Example may refer to:
* ''exempli gratia'' (e.g.), usually read out in English as "for example"
* .example, reserved as a domain name that may not be installed as a top-level domain of the Internet
** example.com, example.net, example.org, an ...
). MIME types are used for querying multimedia frameworks for supported formats.
Of these browsers, only Firefox and Opera employ libraries for built-in decoding. In practice, Internet Explorer and Safari can also guarantee certain format support, because their manufacturers also make their multimedia frameworks. At the other end of the scale, Konqueror has identical format support to Internet Explorer when run on Windows, and Safari when run on Mac, but the selected support here for Konqueror is the typical for
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, where Konqueror has most of its users. In general, the format support of browsers is much dictated by conflicting interests of vendors, specifically that
Media Foundation
Media Foundation (MF) is a COM-based multimedia framework pipeline and infrastructure platform for digital media in Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10, and Windows 11. It is the intended replacement for Microsoft Direc ...
and
QuickTime
QuickTime (or QuickTime Player) is an extensible multimedia architecture created by Apple, which supports playing, streaming, encoding, and transcoding a variety of digital media formats. The term ''QuickTime'' also refers to the QuickTime Pla ...
support commercial standards, whereas
GStreamer
GStreamer is a Pipeline (computing), pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one f ...
and
Phonon
A phonon is a collective excitation in a periodic, elastic arrangement of atoms or molecules in condensed matter, specifically in solids and some liquids. In the context of optically trapped objects, the quantized vibration mode can be defined a ...
cannot legally support other than free formats by default on the free operating systems that they are intended for.
;Notes:
Transparent video
Transparent video, that is video with an
alpha channel
In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full transparency. It is often useful to render picture elements (pixels) in separate pass ...
, has multiple design advantages:
* As it has no burnt-in background color / pattern / motif, you can change the background and/or neighboring objects in a web page any time later without the need to re-generate the video to fit into its surroundings properly, which was the far less flexible technique so far.
* You can very flexibly combine transparent videos with other elements (text, graphics, other videos or dynamically rendered content such as SVG or
canvas
Canvas is an extremely durable Plain weave, plain-woven Cloth, fabric used for making sails, tents, Tent#Marquees and larger tents, marquees, backpacks, Shelter (building), shelters, as a Support (art), support for oil painting and for other ite ...
) to achieve very dynamic layering effects.
* It opens a whole lot of possibilities also in terms of
responsive web design
Responsive web design (RWD) or responsive design is an approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfactio ...
VP8
VP8 is an open format, open and royalty-free Video coding format, video compression format released by On2 Technologies in 2008.
Initially released as a Proprietary software, proprietary successor to On2's previous VP7 format, VP8 was released a ...
and VP9 encoded videos with an alpha channel served in a
WebM
WebM is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML video and the HTML audio elements. It has a sister project, WebP, for images. The development of the format is sponsored by ...
container, since version 31 in 2013-07.
*
Safari
A safari (; originally ) is an overland journey to observe wildlife, wild animals, especially in East Africa. The so-called big five game, "Big Five" game animals of Africa – lion, African leopard, leopard, rhinoceros, African elephant, elep ...
supports
HEVC
High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard designed as part of the MPEG-H project as a successor to the widely used Advanced Video Coding (AVC, H.264, or MPEG-4 Part 10). In co ...
encoded videos with an alpha channel served in a MP4 container, since
iOS 13
iOS 13 is the thirteenth major release of the iOS mobile operating system developed by Apple for the iPhone, iPod Touch and HomePod. The successor to iOS 12, it was announced at the company's Worldwide Developers Conference (WWDC) on June ...
(2019-09) and
macOS Catalina
macOS Catalina (version 10.15) is the sixteenth software versioning, major release of macOS, Apple Inc.'s desktop operating system for Macintosh computers. It is the successor to macOS Mojave and was announced at WWDC 2019 on June 3, 2019 and ...
(2019-10).
* There are some other proprietary polyfill /
legacy
Legacy or Legacies may refer to:
Arts and entertainment
Comics
* " Batman: Legacy", a 1996 Batman storyline
* '' DC Universe: Legacies'', a comic book series from DC Comics
* ''Legacy'', a 1999 quarterly series from Antarctic Press
* ''Legacy ...
solutions with a
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
based video player playing back a video which upon upload to the
SaaS
Software as a service (SaaS ) is a cloud computing service model where the provider offers use of application software to a client and manages all needed physical and software resources. SaaS is usually accessed via a web application. Unlike oth ...