title: ffmpeg pipe blocks while capturing
body: <p>I have this code: </p>
  
  <pre><code>public InputStream getInputStream() throws Exception {
      try {
          process = Runtime.getRuntime().exec("ffmpeg -f dshow -i video=\"" + query + "\":audio=\"" + microPhoneName + "\" -r 25 -vcodec mpeg4 -acodec mp3 -f avi -");
          } 
          catch (Exception e) {
          }
      return process.getInputStream();
  }
  </code></pre>
  
  <p>When i use the <code>inputStream.read(b)</code> command, it works only for a little bit of times (180 to 400 times, depending from formats and codecs I use) then the <code>inputStream</code> lock on <code>read</code> and the application doesn't go anymore.</p>
  
  <p>What's the problem? Memory saturation (ffmpeg process memory is at least 14mb)? 
  Is there a way to unlock this situation (clean memory, use a file as a bridge to prevent locks)?</p>
  
  <p>Of course I need a little bit of "realtime", and not "post-process".
  I'm not constrained to use ffmpeg, I can change it if necessary.</p>