安卓不能发挥任何视频(mp4/传/3gp/等等)?
-
23-09-2019 - |
题
我有很大的困难得到我的机器人应用来播放视频SD卡。不管是什么尺寸,率、视频格式,或任何其他设定可以想到,无论是模拟器也不是我的G1将发挥什么我尝试编码。我也尝试了一些视频网(各种视频格式,率,并没有音频道,等等), 并没有那些工作。
我越来越是一个对话框:
"能不能播放视频"
"对不起,这个视频无法播放。"
有报告的错误。在系统日志,但是我不理解他们和我已经试过在互联网上寻找进一步的解释,没有任何运。见下文:
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)
有时候我也得到这个:
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)
这里是代码,我在使用(在我的onCreate()方法):
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首映是应该480×800(宽x高),但是我有Adobe媒体的编码器输出的顺序作为一种"压缩微软AVI"使用"UYVY的"视频编,以24架速的、渐进的、方素,并且尺寸:720x800(宽x高).此产出一个相当大的文件与120px黑边界两边的视频内容。然后我把视频转手刹0.9.4和使用的如下设置的(我开始有正常的->的正常预设):
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]
我的主要问题是,我试图输出mp4文件480×800(宽x高)的尺寸。后改变宽度为320(高价值没有工作),但保持适当比例方面,输出的视频现在起没有错误。我希望这可以帮助别人与一个类似的问题。
附注:我希望卓视限制了更好的记录。
其他提示
我有一点麻烦,得到许多不同的视频播放我的手机上(宏达的英雄).标准512K mp4的玩(例如: http://www.archive.org/details/more_animation),检查他们首先要确保这不是你的代码。
这是我的代码,从onCreate()中的一个子的活动,只是扮演的视频文件:
protected VideoView mine;
protected boolean done = false;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videoshow);
mine = (VideoView) findViewById(R.id.video); // Save the VideoView for touch event processing
try {
String myURI = "/sdcard/" + path + "/v/"
+ currentItem.getFile()
+ "." + currentItem.getFileType();
Uri video = Uri.parse(myURI);
mine.setVideoURI(video);
mine.start();
mine.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
result.putExtra("com.ejf.convincer01.Finished", true);
done = true;
}
});
} catch (Exception ex) {
Log.d(DEBUG_TAG, "Video failed: '" + ex + "'" );
}
我是面临这样的问题,直到我想出这个问题是在目录中的我的视频。我救了我的视频一个目录,该目录是不可达到的视频图。所以每次我试着播放视频它给了我错误的消息说:"不能打开视频"或者类似的东西。尽力挽救你的视频到这个目录,这将也是可见的手机画廊。
String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/" + "your app name ";