What video format does HTML5 use and why is it com

2019-03-26 04:20发布

问题:

What video format does HTML5 support that is compatible with the iPhone/iPad? I was thinking of putting together a website with some instructional videos and I'm now confused as I thought that only Quicktime was supported by Apple mobile devices.

回答1:

It uses H.264 - though this isn't described as having to be used by the HTML5 spec. Most browsers (IE9, Chrome, Safari) use H.264, though currently Firefox only supports OGG when using the video tag.

If you aren't sure what to do, try this project: http://code.google.com/p/html5media/ it lets you use the video tag with an H.264 video, then backports it to older IEs using a flash fallback.



回答2:

Its not Ogg Theora and never will be H.264. They were going to put Ogg Theora but Nokia and Apple disagreed because of Hardware Acceleration, Stupid patent fud, compression/quality concerns , and wanting to push the non-free(beer/freedom) H.264. So they didn't include specific codecs in the spec (also screwing over good quality/compression ratio and free Ogg Vorbis audio codec). H.264 is not going into the spec, but unfortunately it might end up being "the practical choice for a while".

Ogg Theora currently has a lead in percentage of html5 browsers market share(Firefox+Opera+Chrome+some others>Safari+Chrome+IE9 Preview+ some others) , on the other hand H.264 is easier to use both with flash as a fall back if the browser doesn't support html 5 video or html 5 video with H.264 codecs(Ogg Theora can be played with Java and maybe Silverlight plugins but those are not as popular/ubiquitous as flash). Plus people tend to care (I would argue too much over iphone/ipad which support H.264, note Android supports both ).

I was hoping Microsoft would decide to be open and screw apple at the same time by supporting VC-1 and Theora but unfortunately they seem to have dicded to go with H.264, hopefully they will change their minds and include Theora in the final ie9 release or that may be the end of the war. Firefox and Opera will not support H.264 unless the war is lost but might or might not afterwards using gstreamer(with directshow/quicktime providing the nonfree codecs).

Ipad supports H.264(I think it uses Quicktime but I think it might limit other Quicktime formats)

    .........IE9 preview    Firefox>3.5    Opera>10.5   Safari  Chrome     GtkWebkit QtWebkit
         (might change hopefully)     
Audio    mp3/AAC    Ogg Vorbis/WAV Ogg Vorbis/WAV   mp3/AAC Ogg Vorbis/mp3 *1       *2
                                 *5            *3                      *4

Video     H.264     Ogg Theora     Ogg Theora     H.264   Ogg Theora/H.264  *1      *2
                                 *5            *3

*1 System codecs:Gstreamer(probably free codecs(ogg), good chance of many non free codecs including H.264/mp3 either bought from fluendo or packaged with non free linux cd/computer or installed by user possibly slightly illegal but common/easy/little chance of punishment)

*2 System codecs:Phonon (Gstreamer/xine/vlc/Direct show/Quicktime backends)- on linux mostly gstreamer/xine

*3 Gstreamer shipping only free codecs on win/mac os x, using System codecs

*4 might support AAC???

*5 In mobile firefox/fennec planning to use Gstreamer, I think, might use it everywhere ala opera later on.



回答3:

The HTML5 specification doesn't (yet) state which format(s) can/should be used.

Currently, H.264 is the most widely used, but some browsers (most notably Firefox) don't support H.264.

H.264's biggest rival is Ogg Theora, but it's not supported by all browsers either.

See http://en.wikipedia.org/wiki/HTML5_video#Browser_support for a table of H.264 and Ogg Theora support in major browsers.

With Apple's decision to leave out Flash in the iPad, the issue of HTML5 video has flamed again, and a format war has begun between H.264 and Ogg Theora. John Gruber has been writing extensively about the subject for the past week:

  • GIF, H.264, and Patents
  • On Submarine Patents vis-à-vis H.264 and Ogg Theora
  • CBS.com Prepping HTML5 Video Playback for iPad
  • Thom Holwerda Says I’m Wrong About Ogg Theora and Patents
  • TED Goes H.264
  • Brightcove to Add Support for HTML5 Video


回答4:

The iPad can play HTML5 <video> elements in a .mov or .mp4 container using the H.264 codec.

Safari on the Mac can play any file that QuickTime can play.

It's important to stress that QuickTime isn't a codec, it's a container format. A QuickTime (.mov) file can contain one of many possible codecs (H.264, etc.). Not all .mov files should be treated equally as "QuickTime" files in regards to what/where they can be played and what codec they are. This is a similar concept to .AVI—it's a container format that can deliver several codecs.



回答5:

H.264 codec right now...



回答6:

The reason html5 videos work on the iPad, iPhone and iPod touch is because the video player itself is part of the code and does not require a separate program to run unlike flash videos which needs flash player installed, Which cannot be installed on apple mobile devices.