Html HTML5 <video> 播放是否支持 .avi 格式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4129674/
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:09:41  来源:igfitidea点击:

Does HTML5 <video> playback support the .avi format?

videohtmlavi

提问by phuang07

I am wondering if the HTML5 <video>tag now supports playback of .avi format video files.

我想知道 HTML5<video>标签现在是否支持播放 .avi 格式的视频文件。

采纳答案by Richard Poole

Short answer: No. Use WebM or Ogg instead.

简短回答:不可以。请改用 WebM 或 Ogg。

This articlecovers just about everything you need to know about the <video>element, including which browsers support which container formats and codecs.

本文涵盖了您需要了解的有关<video>元素的几乎所有内容,包括哪些浏览器支持哪些容器格式和编解码器。

回答by bobince

There are three formats with a reasonable level of support: H.264 (MPEG-4 AVC), OGG Theora (VP3) and WebM (VP8). See the wiki linked by Sam for which browsers support which; you will typically need at least one of those plus Flash fallback.

共有三种具有合理支持水平的格式:H.264 (MPEG-4 AVC)、OGG Theora (VP3) 和 WebM (VP8)。请参阅 Sam 链接的 wiki,了解哪些浏览器支持哪些;您通常至少需要其中之一加上 Flash 后备。

Whilst most browsers won't touch AVI, there are some browser builds that expose all the multimedia capabilities of the underlying OS to <video>. These browser will indeed be able to play AVI, as long as they have matching codecs installed (AVI can contain about a million different video and audio formats). In particular Safari on OS X with QuickTime, or Konqi with GStreamer.

虽然大多数浏览器不会接触 AVI,但有一些浏览器构建将底层操作系统的所有多媒体功能暴露给<video>. 这些浏览器确实能够播放 AVI,只要它们安装了匹配的编解码器(AVI 可以包含大约一百万种不同的视频和音频格式)。特别是 OS X 上的 Safari 和 QuickTime,或 Konqi 和 GStreamer。

Personally I think this is an absolutely disastrousidea, as it exposes a very large codec codebase to the net, a codebase that was mostly not written to be resistant to network attacks. One of the worst drawbacks of media player plugins was the huge number of security holes they made available to every web page exploit. Let's not make this mistake again.

就我个人而言,我认为这是一个绝对灾难性的想法,因为它向网络公开了一个非常大的编解码器代码库,该代码库主要不是为了抵御网络攻击而编写的。媒体播放器插件最糟糕的缺点之一是它们为每个网页漏洞利用提供了大量的安全漏洞。我们不要再犯这个错误了。

回答by thenengah

The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. User agents are free to support any video formats they feel are appropriate.

当前的 HTML5 草案规范没有在 video 标签中指定浏览器应该支持哪些视频格式。用户代理可以自由地支持他们认为合适的任何视频格式。

http://en.wikipedia.org/wiki/HTML5_video

http://en.wikipedia.org/wiki/HTML5_video

回答by J?rg W Mittag

The HTML specification neverspecifies any content formats. That's not its job. There's plenty of standards organizations that are more qualified than the W3C to specify video formats.

HTML 规范从不指定任何内容格式。那不是它的工作。有很多标准组织比 W3C 更有资格指定视频格式。

That's what content negotiation is for.

这就是内容协商的目的。

  • The HTML specification doesn't specify any image formats for the <img>element.
  • The HTML specification doesn't specify any style sheet languages for the <style>element.
  • The HTML specification doesn't specify any scripting languages for the <script>element.
  • The HTML specification doesn't specify any object formats for the <object>and embedelements.
  • The HTML specification doesn't specify any audio formats for the <audio>element.
  • HTML 规范没有为<img>元素指定任何图像格式。
  • HTML 规范没有为<style>元素指定任何样式表语言。
  • HTML 规范没有为<script>元素指定任何脚本语言。
  • HTML 规范没有为<object>embed元素指定任何对象格式。
  • HTML 规范没有为<audio>元素指定任何音频格式。

Why should it specify one for the <video>element?

为什么要为<video>元素指定一个?