title: Playing a video with JavaCV and FFmpeg
body: <p>So, I'm developing a custom video player for Android but I need to play more than the android supported video files <code>(mp4, 3gp...), like wmv, avi, flv.</code></p>
  
  <p>At this time I do already convert any video type to .mp4 and I'm able to play them after recoding, but I have no idea how can I play those <code>wmv</code>, <code>avi</code> files without recoding them to <code>mp4</code> video formats.</p>
  
  <p>Is there any way I can play any video on Android without recoding them?
  <code>JavaCV</code> + <code>FFmpeg</code> library already working, just don't know how to do that.</p>
  
  <p>By the way, heres the code that I'm using to recode videos:</p>
  
  <pre><code>public static void convert(File file) {
  
      FFmpegFrameGrabber frameGrabber =
              new FFmpegFrameGrabber(file.getAbsolutePath());
  
      IplImage captured_frame = null;
  
      FrameRecorder recorder = null;
      recorder = new FFmpegFrameRecorder("/mnt/sdcard/external_sd/videosteste/primeiroteste.mp4", 300, 300);
      recorder.setVideoCodec(13);
      recorder.setFrameRate(30);
      recorder.setFormat("mp4");
      try {
          recorder.start();
          frameGrabber.start();
          while (true) {
              try {
                  captured_frame = frameGrabber.grab();
  
                  if (captured_frame == null) {
                      System.out.println("!!! Failed cvQueryFrame");
                      break;
                  }
                  recorder.record(captured_frame);
              } catch (Exception e) {
              }
          }
          recorder.stop();
          recorder.release();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>