2

I have successfully compiled the FFMPEG library to android using NDK. (using Rock Player FFMPEG implementation)http://www.rockplayer.com/download/rockplayer_ffmpeg_git_20100418.zip

I know that FFMPEG supports .avi, divX, mov ect. But I created a mediaplayer and tried to run them but I was not able to play them. I is this the right way to use the FFMPEG library. Can Any one Help.I am able to play defaut video, mp4, 3gp etc. Here is the code for mediaplayer

   public native String  stringFromJNI();
      static {
         System.loadLibrary("ffmpeg");
         System.loadLibrary("ffmpeg-test-jni");
             }
    @Override
      public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);


    setContentView(R.layout.main);

    TextView  tv =(TextView) findViewById(R.id.textView1);
    tv.setText( stringFromJNI() );


    System.gc();

    Log.d("Video FFmpeg ", "**");

    getWindow().setFormat(PixelFormat.TRANSLUCENT);
    String filepath = Environment.getExternalStorageDirectory()+"/simple.avi";

    Log.d("File path", filepath);

    MediaController mc = new MediaController(this); 

    VideoView video=(VideoView) findViewById(R.id.video);
    mc.setMediaPlayer(video);
    video.setVideoPath(filepath);
    video.setMediaController(mc);
    mc.show();
    //video.setVideoPath("/mnt/sdcard/Movies/Ishq-Hothon-Se.3gp");

    video.start();     
    View nextButton = findViewById(R.id.button1);
    nextButton.setOnClickListener(this);
    }



  @Override
  public void onClick(View v) {
  // TODO Auto-generated method stub
  Intent i=new Intent(this,NextVideo.class);
   startActivity(i);

  }

  }
Antu
  • 523
  • 8
  • 18

0 Answers0