Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:");
        }
    }


When file size is less than 14 mb it works fine but more than that it create problem in file conversion.It is wait for conversion but there is nothing doing at all.I have change in web.config <httpRuntime maxRequestLength="100000" executionTimeout="3600" /> but there is only some part of file conversion approx 10 to 15% after that it wait for more file conversion.

[edit]Subject: DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously. - OriginalGriff[/edit]
Posted
Updated 13-Apr-11 20:24pm
v3
Comments
walterhevedeich 14-Apr-11 1:19am    
Not clear, what do you mean it wait for more file conversion? Also, are there any errors? If so, post them here.
Bhargav Technical Lead 14-Apr-11 2:02am    
no there is not any error because if source file contain 40 mb and approx 3mb of file conversion done after it is queue state further conversion not possible and process not stop

1 solution

Place

C#
while (!ffmpeg.WaitForExit(1000))
                         {
                             sbOutPut.Append(objStreamReader.ReadToEnd().ToString());
                         }




instead of process.WaitForExit();
at this line
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900