Android的 - 不能播放任何视频(MP4 / MOV / 3GP /等。)? [英] Android -- Can't play any videos (mp4/mov/3gp/etc.)?

查看:222
本文介绍了Android的 - 不能播放任何视频(MP4 / MOV / 3GP /等。)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很大的困难让我的Andr​​oid应用程序从SD卡播放视频。不要紧,什么大小,码率,视频格式,或任何其他设置我能想到的,无论是仿真器,也没有我的G1将发挥什么我尝试连接code。我也尝试了一些视频从网站(各种视频格式,比特率,有和没有音轨等),以及这些都不管用。

I'm having great difficulty getting my Android application to play videos from the SD card. It doesn't matter what size, bitrate, video format, or any other setting I can think of, neither the emulator nor my G1 will play anything I try to encode. I've also tried a number of videos from the web (various video formats, bitrates, with and without audio tracks, etc.), and none of those work either.

所有我不断收到一个对话框,上面写着:

All I keep getting is a dialog box that says:

无法播放视频

抱歉,此视频无法播放。

"Sorry, this video cannot be played."

有报道LogCat中的错误,但我不理解他们,我试着在网上搜索了进一步的解释,没有任何运气。请看下图:

There are errors reported in LogCat, but I don't understand them and I've tried searching the Internet for further explanations without any luck. See below:

03-30 05:34:26.807: ERROR/QCOmxcore(51): OMXCORE API :  Free Handle 390d4
03-30 05:34:26.817: ERROR/QCOmxcore(51):  Unloading the dynamic library for OMX.qcom.video.decoder.avc
03-30 05:34:26.817: ERROR/PlayerDriver(51): Command PLAYER_PREPARE completed with an error or info PVMFErrNoResources
03-30 05:34:26.857: ERROR/MediaPlayer(14744): error (1, -15)03-30 05:34:26.867: ERROR/MediaPlayer(14744): Error (1,-15)

有时候,我也得到这样的:

Sometimes I also get this:

03-30 05:49:49.267: ERROR/PlayerDriver(51): Command PLAYER_INIT completed with an error or info PVMFErrResource
03-30 05:49:49.267: ERROR/MediaPlayer(19049): error (1, -17)
03-30 05:49:49.347: ERROR/MediaPlayer(19049): Error (1,-17)

下面是code我使用(在我的onCreate()方法):

Here is the code I'm using (in my onCreate() method):

this.setContentView(R.layout.main);
//just a simple VideoView loading files from the SD card
VideoView myIntroView = (VideoView) this.findViewById(R.id.VideoView01);
MediaController mc = new MediaController(this);
myIntroView.setMediaController(mc);
myIntroView.setVideoPath("/sdcard/test.mp4");
myIntroView.requestFocus();
myIntroView.start();

请帮忙!

推荐答案

好了,在这里不用。我一直在努力在Adobe premiere该视频应该是480×800(宽x高),但我有的Adobe Media恩codeR输出的顺序为Uncom pressed微软AVI使用UYVY视频codeC,24fps的帧速率,进取,方形像素,尺寸:720x800(宽x高)。这对输出视频内容的任一侧一个相当大的文件120px黑色边框。然后我把视频放到手刹0.9.4,并使用以下设置(我开始与Regular->普通preSET):

Okay, here goes. The video I've been working on in Adobe Premiere is supposed to be 480x800 (WxH), but I have the Adobe Media Encoder output the sequence as an "Uncompressed Microsoft AVI" using the "UYVY" video codec, 24fps frame rate, progressive, square pixels, and dimensions: 720x800 (WxH). This outputs a rather large file with 120px black borders on either side of the video content. I then take the video into Handbrake 0.9.4 and use the following settings (I started with the Regular->Normal preset):

Container: MP4 File
Large file size: [un-Checked]
Web-optimized: [un-Checked]
iPod 5G support: [un-Checked]

Width: 320 (this is key, any higher than 320 and it won’t work)
Height: 528
Keep Aspect Ratio: [Checked]
Anamorphic: None

Crop Left: 120
Crop Right: 120

Everything under the "Video Filter" tab set to "Off"

Video Codec: H.264(x264)
Framerate: same as source
2-Pass Encoding: [Checked]
Turbo first pass: [un-Checked]
Avg Bitrate: 384

Create chapter markers: [un-Checked]

Reference Frames: 2
Mixed References: [un-Checked]
B-Frames: 0
Motion Estimation Method: Uneven Multi-Hexagon
Sub-pixel Motion Estimation: 9
Motion Estimation Range: 16
Analysis: Default
8x8 DCT: [un-Checked]
CABAC Entropy Coding: [un-Checked]
No Fast-P-Skip: [un-Checked]
No DCT-Decimate: [un-Checked]
Deblocking: Default, Default
Psychovisual Rate Distortion: [MAX]

我的主要问题是,我试图输出480×800(宽x高)尺寸的MP4文件。改变宽度320(较高的值没有工作),但保持适当的长宽比之后,输出视频播放,现在没有错误。我希望这可以帮助别人了类似的问题。

My main problem was that I was trying to output an mp4 file with 480x800 (WxH) dimensions. After changing the width to 320 (higher values didn't work), yet keeping the proper aspect ratio, the output video now plays without errors. I hope this helps someone else with a similar problem.

附注:我希望在Android视频限制被更好地记录

Side note: I wish the Android video restrictions were better documented.

这篇关于Android的 - 不能播放任何视频(MP4 / MOV / 3GP /等。)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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