title: How to do make a loading screen for ffmpeg using c# asp.net
body: <p>I have this function and where the Debug.WriteLine commands are is where I output the values.  How would I get this data to print into a webpage so I can mimic a loading screen?  I am calling this function externally through a *.ashx web service file.    </p>
  
  <pre><code>private string ConvertToFLV(string phyicalFilePath)
          {
              if (Path.GetExtension(phyicalFilePath).Equals(".flv")) return phyicalFilePath;
  
              var argument = string.Format(@"-i ""{0}"" -vcodec flv -f flv -r 29.97 -s 320x240 -aspect 4:3 -b 300k -g 160 -cmp dct  -subcmp dct  -mbd 2 -flags +aic+cbp+mv0+mv4 -trellis 1 -ac 1 -ar 22050 -ab 56k ""{1}""", phyicalFilePath, Path.ChangeExtension(phyicalFilePath, "flv"));
              libfaac -ar 48000 -ab 128k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -threads 0 {1}", phyicalFilePath, Path.ChangeExtension(phyicalFilePath, "mp4"));
              File.Delete(Path.ChangeExtension(phyicalFilePath, "flv"));
  
              ProcessStartInfo process = new ProcessStartInfo(ffmpegPhysicalPath, argument);
              Process proc = new Process();
              float duration = 0.00F, current = 0.00F;
              proc.StartInfo = process;
              proc.EnableRaisingEvents = false;
              proc.StartInfo.UseShellExecute = false;
              proc.StartInfo.CreateNoWindow = true;
              proc.StartInfo.RedirectStandardOutput = true;
              proc.StartInfo.RedirectStandardError = true;
  
              proc.Start();
  
              StreamReader d = proc.StandardError;
  
              do
              {
                  string s = d.ReadLine();
                  if (s.Contains("Duration: "))
                  {
                      Debug.WriteLine("DURATION: " + s);
  
                  }
                  else
                  {
                      if (s.Contains("frame="))
                      {
                          Debug.WriteLine("FRAME: " + s);
  
                      }
                  }
              } while (!d.EndOfStream);
  
  
              proc.WaitForExit();
  
              return Path.ChangeExtension(phyicalFilePath, "flv");
  </code></pre>