protected void Page_Load(object sender, EventArgs e) { MediaFileMoveConvert(@"D:\Bhargav\Back Up\d\Bhargav\Share\WebSite6\temp\INTRO.flv", @"D:\Bhargav\Back Up\d\Bhargav\Share\WebSite6\conv\1.flv"); } public static void MediaFileMoveConvert(string fromFileName, string toFileName) { string VideoConvertPath = @"D:\Bhargav\Back Up\d\Bhargav\Share\WebSite6\conv\"; Process process = new Process(); process.StartInfo.RedirectStandardInput = true; process.StartInfo.FileName = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + "\\bin\\ffmpeg.exe"; process.StartInfo.Arguments = string.Format("-i \"{0}\" -ar 44100 -s 300x224 -r 25 -b 320k -ab 96k \"{1}\"", fromFileName.TrimEnd("\\".ToCharArray()), toFileName.TrimEnd("\\".ToCharArray())); process.StartInfo.CreateNoWindow = false; process.StartInfo.RedirectStandardError = true; process.StartInfo.UseShellExecute = false; process.StartInfo.WorkingDirectory = VideoConvertPath; process.Start(); process.WaitForExit(); //File.Delete(fromFileName); if (process.ExitCode != 0) { System.Web.HttpContext.Current.Response.Write("Error in file conversion: " + process.StandardError.ReadToEnd()); } else { System.Web.HttpContext.Current.Response.Write("Successfully:"); } }
<httpRuntime maxRequestLength="100000" executionTimeout="3600" />
while (!ffmpeg.WaitForExit(1000)) { sbOutPut.Append(objStreamReader.ReadToEnd().ToString()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)