While executing this an exception was rised i.e win32 exception,
how to handle this exception.
csharp
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Diagnostics;
using System.Media;
using System.ComponentModel;
using System.ComponentModel.Design;
//using IsolatedStorageFileStream;
public partial class _Default : System.Web.UI.Page
{
Process ffmpeg;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string video;
string mpg;
video = HttpContext.Current.Server.MapPath("Uploads\\" + FileUpload1.FileName); // setting video input name with path
mpg = Page.MapPath("") + "\\video.flv"; // thumb name with path !
//String filePath = actualfilePath.Substring(0, actualfilePath.LastIndexOf("\\"));
ffmpeg = new Process();
ffmpeg.StartInfo.Arguments = " -i " + video + " -s 480*360 -deinterlace -ab 32 -r 15 -ar 22050 -ac 1 " + mpg; // arguments !
ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
ffmpeg.Start(); // start !
ffmpeg.WaitForExit();
ffmpeg.Close();
string AppPath = Request.PhysicalApplicationPath; //This is the path of your application
Response.Write(AppPath);
string inputPath = AppPath + "ffmpeg\\myVideo.wmv"; //Source Video Path
inputPath = FileUpload1.PostedFile.FileName;
FileUpload1.SaveAs(MapPath("image/" + FileUpload1.FileName));
string outputPath = AppPath + "outputFolder\\" + FileUpload1.FileName.Split('.')[0] + ".flv"; //Destination Video Path
string fileargs = " -i ";
fileargs += "\"" + inputPath + "\"";
fileargs += " \"" + outputPath + "\"";//Command Line
/*Process proc = new Process();
proc.StartInfo.FileName = AppPath + "ffmpeg\\ffmpeg.exe"; //Path of FFMPEG
proc.StartInfo.Arguments = fileargs;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.RedirectStandardOutput = true;*/
Process process = new Process();
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = AppPath + "ffmpeg\\ffmpeg.exe"; //Path of FFMPEG
process.StartInfo.Arguments = fileargs;
process.StartInfo.WorkingDirectory = "C:\\Windows\\system32";
process.StartInfo.WorkingDirectory=Server.MapPath("~/ffmpeg.exe");
process.Start();
string output = process.StandardOutput.ReadToEnd();
//proc.Start();
//proc.Site;
System.Threading.Thread.Sleep(1000);
//string strErr = proc.StandardError.ReadToEnd();
//proc.WaitForExit();
//string output = proc.StandardOutput.ReadToEnd();
}
}
Mod Edit: Please use code tags when posting your code. Code tags are used like so =>

Thanks
PsychoCoder