MediaSource API 和 mp4 [英] MediaSource API and mp4

查看:45
本文介绍了MediaSource API 和 mp4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了来自 Html5Rocks.com 的 this 示例,即使用 MediaSource API 和 .webm 视频.我用另一个 .webm 视频尝试了这个例子,它可以工作,但是当我尝试使用 .mp4 视频时,它不起作用.有没有可能?

I followed this example from Html5Rocks.com, that is using the MediaSource API and a .webm video. I tried the example with another .webm video and it was working, but when I tried with .mp4 video it didn't work. Is it possible somehow?

推荐答案

更新:Chrome Dev/Canary 支持 MP4(或更正式的 ISO BMFF).您需要以符合媒体源规范的方式生成 MP4 文件.幸运的是,媒体源在编写时考虑到了 MPEG-DASH,因此任何符合 DASH 的文件都可以与媒体源一起使用.GPAC/MP4Box 是一个很好的工具:

Update: MP4 (or more formally ISO BMFF) support is in Chrome Dev/Canary. You'll need to generate your MP4 files in a way that conforms to the Media Source spec. Fortunately, Media Source was written with MPEG-DASH in mind, so any DASH-compliant files will work with Media Source. GPAC/MP4Box is a great tool for this:

MP4Box -dash 5000 -frag 5000 -rap some_file.mp4

...将创建some_file_dash.mp4",它应该与媒体源兼容.较早发布的 MP4Box 版本存在一些错误,因此我建议暂时从 SVN 构建.

...will create 'some_file_dash.mp4', which should be compatible with Media Source. There are some bugs in earlier released versions of MP4Box, so I recommend building from SVN for now.

这篇关于MediaSource API 和 mp4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆