HTML 5 Video Problem

依然范特西╮ 提交于 2019-12-12 16:07:47

问题


I'm trying to set up my site to use HTML 5 videos. The mp4 files are served from S3. I've got the MIME type right, and the URL is right. It's not working though. The only thing I can think of is the codec being wrong.

Here is my code:

<video width="320" height="240" controls>
<source src="{url}"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>

Now as I understand it, the audio codec is always the same. mp4a.40.2. The video is encoded as baseline, but according to http://wiki.whatwg.org/wiki/Video_type_parameters#MPEG-4, the last two characters of the video codec, in my code 1E are variable.

Is having the wrong characters enough to cause the video to not work? If so, how do I find the right settings?

I'm having a hard time wrapping my head around this stuff. Thanks for any help you can provide.


回答1:


The idea of the video codecs information is that your browser won't download the video if it can't play it. (found that here) So I think even with a wrong, but common, avc level (last 2 chars) it should download and play. I found this guide how to determine and change your avc level using a hex editor. Megui apparently also works for that.




回答2:


Try removing the type attribute. If that makes it work, you've found the problem. Also, check the actual Content-Type HTTP header.



来源:https://stackoverflow.com/questions/3283041/html-5-video-problem

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