Html HTML5 视频格式 - 兼容性

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14636415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 05:23:11  来源:igfitidea点击:

HTML5 video formats - compatibility

htmlvideomp4oggwebm

提问by Flock Dawson

So, I'm building a website on which users can upload an watch videos. I'm using the standard HTML5 video player (<video...> <src>...) Currently, I use multiple sources: MP4, OGG and WEBM, for cross-browser compatibility

所以,我正在建立一个网站,用户可以在上面上传观看视频。我正在使用标准的 HTML5 视频播放器 ( <video...> <src>...) 目前,我使用多种来源:MP4、OGG 和 WEBM,以实现跨浏览器兼容性

Due to the fact that maintaining three formats is both CPU intensive (converting) as well as eating away precious disk space, I started searching the need to find out whether it's really needed to support this three formats

由于维护三种格式既是 CPU 密集型(转换)又会占用宝贵的磁盘空间,我开始寻找是否真的需要支持这三种格式的需求

According to the chart I found on Wikipedia (http://en.wikipedia.org/wiki/HTML5_video), OGG and MP4 should be sufficient, as all browsers seem to be supporting at least one of these formats

根据我在维基百科(http://en.wikipedia.org/wiki/HTML5_video)上找到的图表,OGG 和 MP4 应该就足够了,因为所有浏览器似乎都至少支持这些格式中的一种

... or am I missing something?

……还是我错过了什么?

采纳答案by GrokSrc

For a comprehensive answer see: http://diveintohtml5.info/video.htmlThere's a compatibility matrix toward the bottom that is beginning to be outdated, but was authoritative at the time the article was written.

有关全面的答案,请参阅:http: //diveintohtml5.info/video.html底部的兼容性矩阵已开始过时,但在撰写本文时具有权威性。

  • Firefox 3.5+ supports Theora video and Vorbis audio in an Ogg container. Firefox 4+ also supports WebM.
  • Opera 10.5+ supports Theora video and Vorbis audio in an Ogg container. Opera 10.60 (and later) also supports WebM.
  • Chrome 3.0+ supports H.264, Theora video and Vorbis audio in an Ogg container. Chrome 6.0+ also supports WebM.
  • Safari on Macs and Windows PCs 3.0+ will support anything that QuickTime supports. In theory, you could require your users to install third-party QuickTime plugins. In practice, few users are going to do that. So you're left with the formats that QuickTime supports “out of the box.” This is a long list, but it does not include WebM, Theora, Vorbis, or the Ogg container. However, QuickTime does ship with support for H.264 video (main profile) and AAC audio in an MP4 container.
  • Mobile phones like Apple's iPhone and Google Android phones support H.264 video (baseline profile) and AAC audio (“low complexity” profile) in an MP4 container.
  • Adobe Flash (9.0.60.184 and later) supports H.264 video (all profiles) and AAC audio (all profiles) in an MP4 container.
  • Internet Explorer 9+ supports all profiles of H.264 video and either AAC or MP3 audio in an MP4 container. It will also play WebM video if you install a third-party codec, which is not installed by default on any version of Windows. IE does not support other third-party codecs (unlike Safari, which will play anything QuickTime can play).
  • Internet Explorer 8 has no HTML5 video support at all, but virtually all Internet Explorer users will have the Adobe Flash plugin. Later in this chapter, I'll show you how you can use HTML5 video but gracefully fall back to Flash.
  • Firefox 3.5+ 支持 Ogg 容器中的 Theora 视频和 Vorbis 音频。Firefox 4+ 也支持 WebM。
  • Opera 10.5+ 支持 Ogg 容器中的 Theora 视频和 Vorbis 音频。Opera 10.60(及更高版本)也支持 WebM。
  • Chrome 3.0+ 在 Ogg 容器中支持 H.264、Theora 视频和 Vorbis 音频。Chrome 6.0+ 也支持 WebM。
  • Mac 和 Windows PC 3.0+ 上的 Safari 将支持 QuickTime 支持的任何内容。理论上,您可以要求您的用户安装第三方 QuickTime 插件。实际上,很少有用户会这样做。因此,您只能使用 QuickTime 支持的“开箱即用”格式。这是一个很长的列表,但不包括 WebM、Theora、Vorbis 或 Ogg 容器。但是,QuickTime 确实在 MP4 容器中支持 H.264 视频(主要配置文件)和 AAC 音频。
  • Apple 的 iPhone 和 Google Android 手机等移动电话支持 MP4 容器中的 H.264 视频(基线配置文件)和 AAC 音频(“低复杂度”配置文件)。
  • Adobe Flash(9.0.60.184 及更高版本)支持 MP4 容器中的 H.264 视频(所有配置文件)和 AAC 音频(所有配置文件)。
  • Internet Explorer 9+ 支持 H.264 视频的所有配置文件以及 MP4 容器中的 AAC 或 MP3 音频。如果您安装第三方编解码器,它也会播放 WebM 视频,默认情况下,任何版本的 Windows 均未安装该编解码器。IE 不支持其他第三方编解码器(与 Safari 不同,它可以播放 QuickTime 可以播放的任何内容)。
  • Internet Explorer 8 根本不支持 HTML5 视频,但几乎所有 Internet Explorer 用户都拥有 Adob​​e Flash 插件。在本章的后面,我将向您展示如何在使用 HTML5 视频的同时优雅地回退到 Flash。