安卓:什么视频格式/编码,我应该使用支持大部分Android设备 [英] Android: What video format/encoding should I use to support most of the android devices

查看:336
本文介绍了安卓:什么视频格式/编码,我应该使用支持大部分Android设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有视频片段的用户应该从我的应用程序内(而不是外部的视频播放器)能够发挥的集合。我使用VideoView用的MediaController。一切正常,我的Desire HD和Nexus S的预期(包括运行Android 2.3.3)。不过,他们不会为了在设备上播放。我得到抱歉,该视频无法播放的错误消息。

I have a collection of video clips which user should be able play from inside my app (not external video player). I am using VideoView with MediaController. Everything works as expected on my Desire HD and Nexus S (both running Android 2.3.3). However they won't play on order devices. I get "Sorry, this video cannot be played" error message.

所有视频都是MP4,带的 H.264,720瓦特/ 480H,25fps的 codeD。我也用H.263(3GP),但没有运气。

All videos are mp4, encoded with H.264, 720w/480h, 25fps. I have also used H.263(3gp) but with no luck.

我要支持尽可能多的Andr​​oid设备成为可能。至少从2.1开始

I want to support as many Android devices as possible. At least starting from 2.1

没有任何一个有同样的问题呢?什么影片,你使用你的应用程序?感谢您的帮助!

Does any one had the same problems? What videos are you using in your apps? Thanks for help!

推荐答案

您可以使用一些第三方媒体库扩展您的应用程序的支持的格式,这里是一个很好的 Vitamio

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

媒体格式结果
  许多音频和视频codeCS被打包成Vitamio建于Android平台默认的媒体格式旁边,他们中的一些在下面列出。

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

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

应该不会太难集成和使用它到你的项目,虽然我不知道旧的Andr​​oid设备运行像2.1的性能信息:

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提供与Android默认的MediaPlayer框架similiar接口。如果你在项目中使用android.media.MediaPlayer,刚刚从上面抢vitamio.jar,然后将其添加到您的项目库,并与io.vov.vitamio.MediaPlayer取代android.media.MediaPlayer的进口。

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.

希望这有助于。

这篇关于安卓:什么视频格式/编码,我应该使用支持大部分Android设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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