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

﹥>﹥吖頭↗ 提交于 2019-12-17 06:45:58

问题


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

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

<!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?


回答1:


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

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

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).

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




回答2:


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

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.

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.

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

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.

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.



来源:https://stackoverflow.com/questions/12173822/chrome-could-play-html5-mp4-video-but-html5test-said-chrome-did-not-support-mp4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!