在大多数使用html5的现代浏览器中,可以播放哪些视频格式和视频和音频编解码器组合? [英] What combinations of video formats and video and audio codecs can be played in most modern browsers using html5?

查看:530
本文介绍了在大多数使用html5的现代浏览器中,可以播放哪些视频格式和视频和音频编解码器组合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望使用< video> 标记播放带有音频的视频。

We want to play video with audio using the <video> tag.

视频的组合格式和视频和音频编解码器可以使用html5在大多数现代浏览器中播放?

What combinations of video formats and video and audio codecs can be played in most modern browsers using html5?

例如,文件是否可以采用Quicktime容器格式?
他们可以在Quicktime中使用h.264和MP3并且仍然可以在大多数浏览器中播放吗?
他们可以在Quicktime中使用h.264和AAC并且仍在大多数浏览器中播放吗?

For example, can the files be in Quicktime container format? Can they be h.264 and MP3 inside of Quicktime and still play in most browsers? Can they be h.264 and AAC inside of Quicktime and still play in most browsers?

我们不关心早于11版的Internet Explorer。 b $ b我们关注当前版本的Chrome,Firefox和Safari,包括他们的移动版本。

We do not care about Internet Explorer older than version 11. We do care about current versions of Chrome, Firefox and Safari, including their mobile versions.

编辑
所以根据@Widor的评论和 http://caniuse.com/#feat=video 我可以使用然而,视频标记,该页面没有说明我可以将什么类型的视频添加到视频标记中。

Edit So according to the comment by @Widor and http://caniuse.com/#feat=video I can use the video tag, however, that page says nothing about what kind of video I can put into the video tag.

推荐答案

容器:MP4,视频编解码器:H.264,audo编解码器:AAC。如果您希望每个人都能够播放视频,请使用大约640x360(360p)的分辨率和大约800kbps的比特率,但这实际上取决于您的源输入。通常不要使用高于1280x720的分辨率或高于2500kbps的比特率,除非你有一个质量较低的后备选项。

container: MP4, video codec: H.264, audo codec: AAC. If you want everyone to be able to play the video go with a resolution of around 640x360 ("360p") and a bitrate of around 800kbps, but that really depends on your source input. In general don't use a resolutions above 1280x720 or bitrates above 2500kbps unless you have a lower-quality fallback option.

你需要确保MP4是流媒体优化的或渐进式下载就绪,这意味着MOOV标头信息位于前面,视频可以立即开始播放。 MP4将涵盖大多数移动/桌面浏览器,但您可能希望为某些版本的Firefox + Opera提供WebM。

You need to make sure that the MP4 is "streaming optimized" or "progressive download ready", which means that the MOOV header information is at the front and the video can start playing back immediately. MP4 will cover most mobile/desktop browsers, but you may want to provide a WebM as well for some versions of Firefox + Opera.

这是一个带有mp4和webm的示例标记包括后备,如果浏览器不支持html5(某些移动设备),则直接链接回退:

Here's an example tag with mp4 and webm fallback included, with direct link fallback if browser doesn't support html5 (some mobile devices):

<div style="width:640px; height: 360px; position: relative">
  <video width="100%" height="100%" controls="controls" poster="http://url/of/my-preview.jpg">
    <source src="http://url/of/my-video.mp4" type="video/mp4; codecs='avc1.64001F, mp4a.40.5'">
    <source src="http://url/of/my-video.webm" type="codecs=vp8,vorbis">
    <a href="http://url/of/my-video.mp4">
      <img src="http://url/of/my-preview.jpg" alt="Click to play video because your browser doesn't support HTML5 video" style="width:100%; height: 100%">
    </a>
  </video>
</div>

如果您需要将视频转换为MP4,请尝试使用优秀的工具手刹
另外, http:// diveintohtml5。 info / video.html 是一个很好的资源。

If you need to convert videos to MP4 try the excellent tool Handbrake Also, http://diveintohtml5.info/video.html Is a good resource.

这篇关于在大多数使用html5的现代浏览器中,可以播放哪些视频格式和视频和音频编解码器组合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆