title: FFMPEG and Pythons subprocess
body: <p>I'm trying to write a gui for <code>FFMPEG</code>. I'm using pythons subprocess to create a ffmpeg process for every conversion I want. This works fine, but I'd also like a way to get the progress of the conversion, whether it failed or not etc. I figured I could do this by accessing the process's stdout like so:</p>
  
  <p>Calling <code>subprocess.Popen()</code></p>
  
  <pre><code># Convert - Calls FFMPEG with current settings. (in a seperate
  # thread.)
  def convert(self):
      # Check if options are valid
      if self.input == "" or self.output == "":
          return False
  
  # Make the command string
  ffmpegString = self.makeString()
  
  # Try to open with these settings
  try:
      self.ffmpeg = subprocess.Popen(ffmpegString, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  except OSError:
      self.error.append("OSError: ")
  except ValueError:
      self.error.append("ValueError: Couldn't call FFMPEG with these parameters")
  
  # Convert process should be running now.
  </code></pre>
  
  <p>And reading <code>stdout</code>:</p>
  
  <pre><code>convert = Convert()
  convert.input = "test.ogv"
  convert.output = "test.mp4"
  convert.output_size = (0, 0)
  
  convert.convert()
  
  while 1:
      print convert.ffmpeg.stdout.readline()
  </code></pre>
  
  <p>This works but, ffmpeg's status doesn't show. I'm assuming it has something to do with way ffmpeg refreshes it. Is there a way to access it?</p>