video codecs for Android

All your problems with Audio, Video and Images.

video codecs for Android

Postby chrisB » Sun Apr 03, 2011 4:20 pm

Hello fellow Android-ers,

I am having an issue when I try to use a video file as a local resource or in a stream using the MediaPlayer class.

Starting with a standard derived activity class and using:



public class VideoPlayerController extends Activity {


public class VideoPlayer extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

MediaPlayer mPlayer = MediaPlayer.create(this, R.raw.proton2);
System.out.println("HERE 1");
mPlayer.start();
System.out.println("HERE 2");
}

}
[/syntax]

where I have a video file: res/raw/proton.mp4

This compiles okay but nothing happens when I run it, and there are no messages in the logcat between the println statements.

I suspect I am using the wrong video codecs to create this file or I've done something wrong above?

I had to convert this video from a .mov so I used ffmpeg with the following cmd line options.
ffmpeg -i input.mov -f mp4 -s 320x180 proton.mp4

Does anyone know if this will use the wrong video codec and if so which one I should use with ffmpeg or any similar free video conversion software?

Many Thanks!
Chris
chrisB
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Apr 03, 2011 4:04 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 27 guests