title: Extract a specific portion of video using MediaExtractor
body: <p>I am trying to use a portion of a pre-recorded video file for processing on Android. Currently I am working with MediaCodec library on Android. I am using MediaExtractor to extract the data from video file. The idea is to extract only required gata stream for processing. The code looks like:</p>
  
  <pre><code>    extractor = new MediaExtractor();
  
      File file = new File(mInputFile);
  
      FileInputStream inputStream = new FileInputStream(file);
  
      long len = file.length();
      long start = 200L;
      extractor.setDataSource(inputStream.getFD(),start,len);
      inputStream.close(); 
  </code></pre>
  
  <p>Logcat is:</p>
  
  <blockquote>
    <p>java.io.IOException: Failed to instantiate extractor.
    at android.media.MediaExtractor.setDataSource(Native Method).</p>
  </blockquote>
  
  <p>It works well if I set starting bytes to 0. What am I doing wrong ? Can we not extract portion of videos using mediaextractor ?</p>