Html 5视频标签和编解码器问题

发布于 2024-09-05 17:27:42 字数 220 浏览 3 评论 0 原文

我有一个 mkv 文件。它的视频编解码器是avc,音频编解码器是ac3。

如何将其放入 html5 视频标签中?

我使用

<source src="01.mkv" type="video/x-matroska" codecs="a_ac3, avc">

但在 safari 5 或 chorome4 中它不起作用。

I have a mkv file. It's video codec is avc and audio codec is ac3.

How can i put it into a html5 video tag?

I use the

<source src="01.mkv" type="video/x-matroska" codecs="a_ac3, avc">

but in safari 5 or chorome4 it doesn't works.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泪意 2024-09-12 17:27:42

您的 标记格式不正确。您需要将编解码器信息放入 type 属性的值中,例如:

<source src="01.mkv" type='video/x-matroska; codecs="a_ac3, avc"'>

type 属性包含完整的 MIME 规范,以及 codecs是某些 MIME 类型的可选参数。 标记上没有单独的 codecs 属性。

Your <source> tag is malformed. You need to put the codec information inside the value of the type attribute instead, eg:

<source src="01.mkv" type='video/x-matroska; codecs="a_ac3, avc"'>

The type attribute contains a full MIME specification, and codecs is an optional parameter for some MIME types. There is no separate codecs attribute on the <video> tag.

自在安然 2024-09-12 17:27:42

不是顶级 HTML5 视频标记,其名称为 。您可以从本教程中了解更多信息。您是否使用 内部?

<source is not the top level HTML5 video tag, which is named <video>. You can find out more from this tutorial. Are you using <source> inside of <video>?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文