title: Running ffmpeg.exe through windows service fails to complete while dealing with large files
body: <p>I am using <strong>ffmpeg.exe to convert video files to flv format</strong>. For that purpose i use a <strong>windows service to run the conversion process in background</strong>. While trying to <strong>convert large files</strong>(i experienced it when the file size is >14MB) through <strong>windows service it gets stuck at the line which starts the process</strong>(ie, <code>process.start();</code>).</p>
  
  <p>But when i tried to execute ffmpeg.exe directly from command prompt it worked with out any problems.</p>
  
  <p>My <strong>code</strong> in <strong>windows service</strong> is as <strong>follows:</strong></p>
  
  <pre><code>private Thread WorkerThread; 
  protected override void OnStart(string[] args)
  { 
  
     WorkerThread = new Thread(new ThreadStart(StartHandlingVideo));
     WorkerThread.Start();
  }
  
  protected override void OnStop()
  { 
     WorkerThread.Abort();
  }
  
  private void StartHandlingVideo()
  {   
     FilArgs = string.Format("-i {0} -ar 22050 -qscale 1 {1}", InputFile, OutputFile);
     Process proc;
     proc = new Process();
  
     try
     {
  
       proc.StartInfo.FileName = spath + "\\ffmpeg\\ffmpeg.exe";
       proc.StartInfo.Arguments = FilArgs;
       proc.StartInfo.UseShellExecute = false;
       proc.StartInfo.CreateNoWindow = false;
       proc.StartInfo.RedirectStandardOutput = true;
       proc.StartInfo.RedirectStandardError = true;
  
       eventLog1.WriteEntry("Going to start process of convertion");
  
       proc.Start();
  
       string StdOutVideo = proc.StandardOutput.ReadToEnd();
       string StdErrVideo = proc.StandardError.ReadToEnd();
  
       eventLog1.WriteEntry("Convertion Successful");
       eventLog1.WriteEntry(StdErrVideo);               
   }
   catch (Exception ex)
   {
       eventLog1.WriteEntry("Convertion Failed");
       eventLog1.WriteEntry(ex.ToString());            
   }
   finally
   {
       proc.WaitForExit();
       proc.Close();
   }
  </code></pre>
  
  <p>How can I get rid of this situation.</p>