FFPEG在ASP.NET中更大的文件转换 [英] FFPEG Larger file conversion in ASP.NET

查看:111
本文介绍了FFPEG在ASP.NET中更大的文件转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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:");
        }
    }



当文件大小小于14 mb时,它可以正常工作,但超过此大小它会在文件转换中产生问题.它正在等待转换,但根本没有任何作用.我对web.config <httpRuntime maxRequestLength="100000" executionTimeout="3600" />进行了更改,但只有一些更改文件转换的一部分,大约需要10%到15%,然后等待更多文件转换.

[edit]主旨:不要大喊大叫.使用所有大写字母被认为是在互联网上大喊大叫,并且粗鲁(使用所有小写字母被认为是幼稚的).如果要认真对待,请使用大写字母. -OriginalGriff [/edit]



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]

推荐答案

放置

Place

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





而不是process.WaitForExit();
在这一行





instead of process.WaitForExit();
at this line


这篇关于FFPEG在ASP.NET中更大的文件转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆