title: "ffmpeg": java.io.IOException: error=24, Too many open files
body: <p>I am working with ffmpeg to generate previews, but I get this error in the middle of the execution of my program:</p>
  
  <p>"ffmpeg": java.io.IOException: error=24, Too many open files</p>
  
  <p>Does anybody know how to solve or how to avoid it??<br>
  I add the piece of code where I use ffmpeg:</p>
  
  <pre><code>    for (int j = 0; j &lt; temp.length; j++) {
                                                  if(j==2){
                                                      String preview = temp2[i] + temp[j] +".jpg";
                                                      Process p = Runtime.getRuntime().exec("ffmpeg -i anotados/" +temp2[i] + " -r 1 -ss 00:00:"+temp[j]+" -t 1 -s 158x116 imagenes/" + preview);
  
                                                      TextOut.write(preview+"\n");
                                                  }
   }
  </code></pre>