HTML and CSS Reference
In-Depth Information
<source src='videofile.ogg' type='video/ogg; codecs="theora, vorbis"' />
The syntax is container first, then the codecs in video, audio order.
The codec specification for WebM is as simple as Ogg, but the same cannot be said for H.264
because of all of the profile possibilities. The audio codec is low-level AAC ( mp4a.40.2 ), but
the video codec is profile and level based. From the WHATWG Wiki that collects the type
parameters, the video codec for H.264 can be any one of the five following codecs:
▪ H.264 Baseline: avc1.42E0xx, where xx is the AVC level
▪ H.264 Main: avc1.4D40xx, where xx is the AVC level
▪ H.264 High: avc1.6400xx, where xx is the AVC level
▪ MPEG-4 Visual Simple Profile Level 0: mp4v.20.9
▪ MPEG-4 Visual Advanced Simple Profile Level 0: mp4v.20.240
The profile part is easy, because when you use conversion tools, most have presets predefined
for each of the profiles. However, the AVC level isn't as simple to discover. According
to a paper on H.264 (a PDF is available at
spie04-h264OverviewPaper.pdf ), the AVC level is based on picture size and framework, and
also added constraints for picture number reference and compression rate.
In Example 1-8 , several different video files are listed in individual source elements, with
both the codec and container information in the type attribute. The two H.264 videos rep-
resent a desktop capable video encoded with the main profile, while the mobile version is
encoded with the baseline profile. The user agent in each environment traverses the list of
source elements, stopping when it reaches a container/codec and profile it supports.
type attribute
<!DOCTYPE html>
<meta charset="utf-8" />
<video controls>
<source src="videofile.mp4"
type='video/mp4; codecs="codecs="avc1.4D401E,
mp4a.40.2"' />
<source src="videofilemobile.mp4"
type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="videofile.webm"
Search WWH ::

Custom Search