title: Multiple call to ffmpeg main fails in Android
body: <p>I have ported ffmpeg library to Android. Using JNI interface, I am able to run ffmpeg commands by giving arguments to ffmpeg's main method, just like from command line.</p>
  
  <p>In order to get a specific part of a video, I use this command :</p>
  
  <blockquote>
    <p>ffmpeg -i /mnt/sdcard/input_video.mp4 -ss 00:00:12 -t 00:00:10 -an /mnt/sdcard/output_video.mp4 </p>
  </blockquote>
  
  <p>and it works great. The video is split from 12. seconds to 22. seconds and the video is saved, the method returns normally (as 0). </p>
  
  <p>However, if I make a second similar call (different start time for example) just after the first one is completed, ffmpeg is not able to process the request and it throws a segmentation fault. </p>
  
  <p>For the first call, it gives such an info :</p>
  
  <blockquote>
    <p>Guessed Channel Layout for Input Stream #0.0 : mono</p>
  </blockquote>
  
  <p>and works. But for the second, the message is like this one:</p>
  
  <blockquote>
    <p>Guessed Channel Layout for Input Stream #1.0 : mono</p>
  </blockquote>
  
  <p>and it doesn't work. I don't know if it has something to do with the error. </p>
  
  <p>The problem, in general, should be related to static global variables (I think) but I could not manage to reset them properly. What might be the solution to make multiple successful calls to the main method of ffmpeg?</p>