title: convert all video files to flv using asp.net with c# by using ffmpeg.exe
body: <p>This is my code below . Its not working  to take image from the given video and   not converting any kind of video to flv format.Its converting but after converting that flv and thumb images files is not save in the temp(store images) data(store convert flv)folder.That folder is empty.
  i am debugging code but it is not giving any kind of exception and error.</p>
  
  <p>Kindly debug my code.Awaiting for ur reply experts...</p>
  
  <h2>in Default2.aspx page</h2>
  
  <p>a file upload control and save button is there.</p>
  
  <h2>Default2.aspx.cs page</h2>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      string ffmpegPath = "";
      string tempLocation = "";
      string mediaOutPath = "";
      string thumbOutPath = "";
      string currentFile = "";
      ffmpegPath = Server.MapPath("~/ffmpeg/ffmpeg.exe");
      tempLocation = Server.MapPath("~/VideoGallery/temp/");
      mediaOutPath = Server.MapPath("~/VideoGallery/data/");
      thumbOutPath = Server.MapPath("~/VideoGallery/thumb/");
  }
  protected void Submit1_ServerClick(object sender, System.EventArgs e)
  {
  
      if ((File1.PostedFile != null) &amp;&amp; (File1.PostedFile.ContentLength &gt; 0))
      {
          currentFile = System.IO.Path.GetFileName(File1.PostedFile.FileName);
          try
          {
  
              Convert(tempLocation + currentFile, mediaOutPath + currentFile, thumbOutPath +
              currentFile);
  
  
              File1.PostedFile.SaveAs(tempLocation + currentFile);
              Response.Write("The file has been uploaded.");
          }
          catch (Exception ex)
          {
              Response.Write("Error: " + ex.Message);
          }
      }
      else
      {
          Response.Write("Please select a file to upload.");
      }
  }
  protected void Convert(string fileIn, string fileOut, string thumbOut)
  {
      try
      {
          //convert flv
          System.Diagnostics.Process proc = new System.Diagnostics.Process();
          proc.EnableRaisingEvents = false;
          proc.StartInfo.FileName = ffmpegPath;
          proc.StartInfo.Arguments = "-i " + fileIn +
          " -ar 22050 -ab 32 -f flv -s 320×240 -aspect 4:3 -y " + fileOut.Split('.')[0] +
          ".flv";
          proc.StartInfo.UseShellExecute = false;
          proc.StartInfo.CreateNoWindow = false;
          proc.StartInfo.RedirectStandardOutput = true;
          proc.Start();
          proc.WaitForExit();
  
          //convert img
  
          proc.StartInfo.Arguments = "-i " + fileIn +
          " -an -ss 00:00:03 -s 120×90 -vframes 1 -f mjpeg " + thumbOut.Split('.')[0] +
          ".jpg";
  
          proc.Start();
          proc.WaitForExit();
          proc.Close();
      }
      catch (Exception ex)
      {
          Response.Write("Error: " + ex.Message);
      }
  }
  </code></pre>
  
  <p>}</p>