HTML5 video codec support

后端 未结 5 1347
一整个雨季
一整个雨季 2021-02-05 14:10

What codecs will be supported with the HTML5 video tag?

Will it vary by browser, or is there a spec of specific codec that will be supported?

5条回答
  •  南旧
    南旧 (楼主)
    2021-02-05 15:03

    Originally, Ogg Theora video was the expected lowest common denominator. However, companies such as Nokia and Apple expressed concern over that format and the specification was changed to avoid listing a specific codec. This leaves us with three formats, none of which are fully supported in all major browsers.

    Currently, the situation looks like this:

    • Internet Explorer 8 and below do not support the video tag at all. IE 9 will support H.264.
    • Firefox 3.5+ supports Ogg Theora. Firefox 4+ supports VP8 (WebM).
    • Chrome 3+ supports Ogg Theora. Chrome 6+ supports VP8. H.264 support is about to be dropped.
    • Safari 3.1+ supports H.264.
    • Opera 10.50+ supports Ogg Theora. Opera 10.60+ supports VP8.

    If you consider the current market share of each browser, the most common support is Ogg Theora and the least common is H.264, largely due to Ogg Theora not being encumbered by any known patents whereas H.264 is. Due to the costs behind H.264 support, Firefox will most likely never support H.264 and Opera has taken a similar stand. With Chrome now in the same boat, the only current browser that supports it is Safari. However, Ogg Theora is widely considered a mediocre format (its advantage being openness rather than the encoding itself), so VP8 support is growing as an alternative open/free format. So, for the time being at least, codec support varies. The most likely format to gain universal native support is VP8, but it's not going to happen in the near future.

    Note that this covers only native support. For instance, it's possible to add H.264 support to Firefox 3.6+ with a plugin.

    Other platforms of note:

    • iOS supports H.264.
    • Android supports H.264. Android 2.3 adds WebM support.

提交回复
热议问题