Get mime type for MediaSource.isTypeSupported

你。 提交于 2019-12-05 04:32:22

Using Bento4, I can get the Mime type with

mp4info video.mp4 | grep Codec

That will return something like

Codecs String: avc1.64001F
Codecs String: mp4a.40.2

And then do

MediaSource.isTypeSupported('video/mp4; codecs="avc1.64001F,mp4a.40.2"')

which returns true :)

Bento4 is focussed on mp4 so I'm not sure how it'd work on other formats

Any other way to convert the 0x31637661 part to avc1.64001F?

EDIT: since I have not installed Apple's XCode and no intention to - I have found the javascript project of MP4Box the best way to find the codec information in the right format:

http://download.tsi.telecom-paristech.fr/gpac/mp4box.js/filereader.html

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