Android -- Can't play any videos (mp4/mov/3gp/etc.)?

Posted by borg17of20 on Stack Overflow See other posts from Stack Overflow or by borg17of20
Published on 2010-03-30T10:15:44Z Indexed on 2010/03/30 10:23 UTC
Read the original article Hit count: 968

Filed under:
|
|
|

Hello all,

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:

"Cannot play video"

"Sorry, this video cannot be played."

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)

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();

Please help!

© Stack Overflow or respective owner

Related posts about android

Related posts about from-irc