title: C# Process StandardInput and StandardOutput with FFmpeg freezes
body: <p>I'm trying to pipe some stream to ffmpeg and capture it's output so that I can pass on another stream in my code.
  Here is a code example, that just stops the process from continuing after I write to its <code>StandardInput.BaseStream</code>.</p>
  
  <pre><code>internal class Program
      {
          private static void Main(string[] args)
          {
              var inputFile = @"C:\Temp\test.mp4";
              var outputFile = @"C:\Temp\test.mp3";
  
              var process = new Process
              {
                  StartInfo = new ProcessStartInfo
                  {
                      RedirectStandardInput = true,
                      RedirectStandardOutput = true,
                      RedirectStandardError = true,
                      UseShellExecute = false,
                      CreateNoWindow = true,
                      Arguments = "-i - -f mp3 -",
                      FileName = "ffmpeg.exe"
                  },
                  EnableRaisingEvents = true
              };
  
              process.ErrorDataReceived += (sender, eventArgs) =&gt; Console.WriteLine(eventArgs.Data);
  
              process.Start();
              process.BeginErrorReadLine();
  
              using (var input = new FileStream(inputFile, FileMode.Open))
              using (var output = new FileStream(outputFile, FileMode.Create))
              {
                  input.CopyTo(process.StandardInput.BaseStream);
                  process.StandardOutput.BaseStream.CopyTo(output);
              }
  
              process.WaitForExit();
  
              Console.WriteLine("done");
              Console.ReadLine();
          }
      }
  </code></pre>
  
  <p>This example is pretty much the same as in the answer in this question: <a href="https://stackoverflow.com/a/8999542/2277280">https://stackoverflow.com/a/8999542/2277280</a></p>
  
  <p>What am I doing wrong? 
  Why does the process not continue? 
  Is it ffmpeg specific?</p>