Html MP4 视频无法在 Internet Explorer 11 中播放
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25725591/
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
MP4 video will not play in Internet Explorer 11
提问by jono_hayward
So I'm putting together a very video-heavy project with self-hosted videos in HTML5. I've got my videos encoded in both H.264/AAC MP4 and WebM formats, and they work beautifully in Chrome, Firefox, Safari, Mobile Safari etc. All good.
因此,我正在将一个非常注重视频的项目与 HTML5 中的自托管视频放在一起。我的视频以 H.264/AAC MP4 和 WebM 格式编码,它们在 Chrome、Firefox、Safari、Mobile Safari 等中运行良好。一切都很好。
This is the most basic version of my code (in the production site I'm running it with VideoJSon top, however whether it's there or not, this problem occurs so I've removed the code for it from this example):
这是我的代码的最基本版本(在生产站点中,我在顶部运行VideoJS,但是无论是否存在,都会出现此问题,因此我已从本示例中删除了它的代码):
<video preload="true" width="720" height="406" controls="true">
<source src="/55.mp4" type="video/mp4">
<source src="/55.webm" type="video/webm">
</video>
But Internet Explorer refuses to play ball. When I load up the page in IE 11, I just get a video decoding error:
但 Internet Explorer 拒绝打球。当我在 IE 11 中加载页面时,我只是收到一个视频解码错误:
In Internet Explorer's developer tools, I can see that it's getting a content type of video/mp4, and just to completely eliminate server issues I've tried it on both my local Apache install and my web hosting. If I use the console to get the playback error, I get MEDIA_ERR_DECODE : 3
, which, according to the site I just linked to, means
在 Internet Explorer 的开发人员工具中,我可以看到它正在获取视频/mp4 的内容类型,为了完全消除服务器问题,我在本地 Apache 安装和网络托管上都尝试了它。如果我使用控制台获取播放错误,我得到MEDIA_ERR_DECODE : 3
,根据我刚刚链接到的站点,这意味着
An error has occurred in the decoding of the media resource, after the resource was established to be usable.
媒体资源被确定为可用后,在解码媒体资源时发生错误。
This tells me that there's a problem with the video encoding... but I can't see it.
这告诉我视频编码有问题......但我看不到它。
The video files were originally exported as QuickTime videos from Adobe Premier or Final Cut Pro (I'm not sure which the video guy uses), and then run through Miro Video Converterto output MP4 and WebM formats. When I open the MP4 files up in VLC, it shows me the following information about the codecs in use:
视频文件最初是从 Adobe Premier 或 Final Cut Pro 导出为 QuickTime 视频(我不确定视频人员使用的是哪个),然后通过Miro Video Converter运行以输出 MP4 和 WebM 格式。当我在 VLC 中打开 MP4 文件时,它显示了有关正在使用的编解码器的以下信息:
I can't see anything wrong there; it looks exactly like every reference I've found online says MP4 video should be for maximum compatibility - H.264/AVC video and AAC audio.
我看不出有什么问题;它看起来就像我在网上找到的每个参考资料都说 MP4 视频应该是为了最大的兼容性 - H.264/AVC 视频和 AAC 音频。
Can anyone see anything wrong with what I'm doing? I'd love to be able to post an example video, however I can't due to privacy reasons. All the same any help would be greatly appreciated.
有人能看出我在做什么吗?我很想能够发布一个示例视频,但由于隐私原因我不能。尽管如此,任何帮助将不胜感激。
采纳答案by jono_hayward
So this is somewhat embarrassing, but I did eventually figure it out.
所以这有点尴尬,但我最终弄明白了。
The problem wasn't so much with Internet Explorer as it was the VM I was using to run Windows to test inInternet Explorer.
问题不在于 Internet Explorer,而在于我用来运行 Windows 以在Internet Explorer 中进行测试的 VM 。
Essentially, I was running Windows 7 inside of a VirtualBox VM. When I (in desperation) sought out an actual physical machine running Windows... lo and behold it played!
本质上,我是在 VirtualBox VM 中运行 Windows 7。当我(绝望地)找到一台运行 Windows 的实际物理机时……瞧,它开始播放了!
I can only assume that the video drivers provided by VirtualBox didn't like decoding MP4 or something. The videos played fine in other browsers, but I'm guessing they decode/render video differently to how IE does.
我只能假设 VirtualBox 提供的视频驱动程序不喜欢解码 MP4 或其他东西。这些视频在其他浏览器中播放得很好,但我猜他们解码/渲染视频的方式与 IE 不同。
回答by Michael Bar-Sinai
I had the same issue recently with VirtualBox running Windows7 on MacOS. Solved by enabling 3D acceleration in the "Display" settings for the problematic VM.
我最近在 MacOS 上运行 Windows7 的 VirtualBox 遇到了同样的问题。通过在有问题的 VM 的“显示”设置中启用 3D 加速来解决。
回答by Andre Oliveira
The OP is a genius. I was struggling with this same issue for days and could only test on a windows machine today. This led me to change the configuration of my Parallels Desktop v15.
OP是个天才。我在同一个问题上苦苦挣扎了好几天,今天只能在 Windows 机器上进行测试。这导致我更改了 Parallels Desktop v15 的配置。
Im running IE 11 on Windows 8.1 and changed in the Graphics
> Resolution
> Advanced settings
> Vertical synchronization
should be ticked off.
我在 Windows 8.1 上运行 IE 11 并在Graphics
> Resolution
> Advanced settings
> 中更改Vertical synchronization
应该被勾选。
Maybe this will help other people.
也许这会帮助其他人。