Html chrome 可以播放 html5 mp4 视频,但是 html5test 说 chrome 不支持 mp4 视频编解码器

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

chrome could play html5 mp4 video but html5test said chrome did not support mp4 video codec

htmlgoogle-chromehtml5-videohtml5test

提问by pierrotlefou

According to html5test.com, chrome does not support html5 mp4video (see following link). http://html5test.com/compare/feature/video-mpeg4.html

根据html5test.com,chrome 不支持 html5mp4视频(请参阅以下链接)。 http://html5test.com/compare/feature/video-mpeg4.html

However, in thistest page , the mp4 video could be played successfully by setting the body as following:

但是,在这个测试页面中,可以通过设置 body 来成功播放 mp4 视频,如下所示:

<!DOCTYPE html>
<html>
<body>

<video width="320" height="240" controls="controls">
  <source src="movie.mp4" type="video/mp4" />
  Your browser does not support the video tag.
</video>

</body>
</html>

How can I interpret this correctly?

我怎样才能正确解释这个?

回答by littlebtc

.mp4is just a container format (MPEG-4 Part 14), the video and audio formats under .mp4file can be varied. For video, H-264 (MPEG-4 Part 10) and MPEG-4 Visual (MPEG-4 Part 2) are common.

.mp4只是一种容器格式(MPEG-4 Part 14),.mp4文件下的视频和音频格式可以变化。对于视频,H-264(MPEG-4 Part 10)和 MPEG-4 Visual(MPEG-4 Part 2)很常见。

On the HTML5Test, "MPEG-4 support" will test video.canPlayType("video/mp4; codecs="mp4v.20.8"), which tests whether MPEG-4 Visual is supported.

在 HTML5Test 上,“MPEG-4 support”将测试video.canPlayType("video/mp4; codecs="mp4v.20.8"),测试是否支持 MPEG-4 Visual。

Formats supported by Chrome are H-264, VP8 (WebM video part), Theora for video and MP3, AAC, Vorbis for audio. MPEG-4 Visual is not supported (Chromium issue 54036).

Chrome 支持的格式有 H-264、VP8(WebM 视频部分)、视频的 Theora 和 MP3、AAC、音频的 Vorbis。不支持 MPEG-4 Visual(Chromium 问题 54036)。

So, Chrome can play .mp4with H-264 video but not MPEG-4 Visual video.

因此,Chrome 可以播放.mp4H-264 视频,但不能播放MPEG-4 可视视频。

回答by Oskar Duveborn

In general Google has pledged to remove H264 support in Chrome so, it's not really to be trusted.

总的来说,谷歌已承诺在 Chrome 中删除 H264 支持,因此,它并不值得信任。

Anyway... That test page doesn't work in my Chrome Version 24.0.1312.57 m on Windows 7 - it only plays the audio and a blank video stream.

无论如何......该测试页面在我的 Windows 7 上的 Chrome 版本 24.0.1312.57 m 中不起作用 - 它只播放音频和空白视频流。

I did a quick survey and of the 22 people in this team that tested, 7 could not play the video and 15 could. Same versions of Chrome mostly, some on development channel with version 26, same Windows patch level and even some using the same video cards and drivers getting different results.

我做了一个快速调查,在这个团队中测试的 22 人中,7 人无法播放视频,15 人可以。大多数 Chrome 版本相同,一些在 26 版的开发频道上,相同的 Windows 补丁级别,甚至一些使用相同的视频卡和驱动程序得到不同的结果。

The videos tested are mp4 containers with one video stream in H264 format (not mpeg-4).

测试的视频是带有一个 H264 格式(不是 mpeg-4)视频流的 mp4 容器。

I've been unable to identify the cause but it's starting to become a frustrating issue as for all those that had problems with playback, no popular HTML5 fallback solution works. Even the homepage example video for things like ME.js, videojs, jwplayer and so one fails to play back video in Chrome.

我一直无法确定原因,但它开始成为一个令人沮丧的问题,因为对于所有播放有问题的人来说,没有流行的 HTML5 后备解决方案有效。即使是 ME.js、videojs、jwplayer 等内容的主页示例视频也无法在 Chrome 中播放视频。

Either Chrome has some issues with H264 support, or there's an unknown bug in some other software we all use... I'm going to do testing outside of the company network to see if there's a content filter messing things up.

Chrome 在 H264 支持方面存在一些问题,或者我们都使用的其他一些软件中存在未知错误……我将在公司网络之外进行测试,看看是否有内容过滤器把事情搞砸了。