Android: What video format/encoding should I use to support most of the android devices

时光总嘲笑我的痴心妄想 提交于 2019-12-05 20:59:24

You can use some third part media library extend your app's supported format, here is a good one Vitamio:

Media formats
Many audio and video codecs are packed into Vitamio beside the default media format built in Android platform, some of them are listed below.

divx/xvid
wmv
flv
ts
rmvb
mkv
mov
m4v
avi
mp4
3gp

Shouldn't be too hard to integrate and use it into your project, though I don't know its performance running on old Android device like 2.1:

Vitamio provides the similiar interfaces with Android default MediaPlayer framework. If you're using android.media.MediaPlayer in your project, just grab the vitamio.jar from above, then add it to your project's libs, and replace the import of android.media.MediaPlayer with io.vov.vitamio.MediaPlayer.

Hope this help.

Google has a list on there site : http://developer.android.com/guide/appendix/media-formats.html

3GPP & MP4 seem the most compatible

It also lists the mandatory profiles so you should be able to get something going.

TBH until later revisions of Android video playback compatibility is poor unless you bundle a decoder in your app. (I bought a software h264 decoder to fall back upon). One of the reasons I gave up with game writing for Android , still good for apps revenue though ;-)

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