进程抛出System.InvalidOperationException [英] Process throws System.InvalidOperationException

查看:89
本文介绍了进程抛出System.InvalidOperationException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将视频转换为.swf格式,并从该视频创建一个帧以用作缩略图。我面临的问题是该进程抛出了system.InvalidOperationException异常。我到处搜索,仍然无法解决这个问题......有人可以帮我解决一下如何解决这个问题....



这个就是我所做的:



I''m converting video''s to .swf format and creating a single frame from that video to use as a thumbnail. The problem that I am facing is that the process is throwing an exception of system.InvalidOperationException. I''ve searched everywhere and still can''t solve this... can somebody please help me out on how to fix this please....

this is what I have done:

filargs = "C:\\Program Files\\ffmpeg\\ffmpeg.exe -i " + inputfile + " -ar 22050 " + outputfile;

string spath;
spath = Server.MapPath(".");
ProcessStartInfo procStartIfo = new ProcessStartInfo();
procStartIfo.FileName = "C:\\Program Files\\ffmpeg\\ffmpeg.exe";
procStartIfo.Arguments = filargs;
procStartIfo.UseShellExecute = false;
procStartIfo.CreateNoWindow = false;
procStartIfo.RedirectStandardOutput = true;

try
{
    var process = new Process();

        process.StartInfo = procStartIfo;
        process.Start();
        process.WaitForExit();

}

推荐答案

您需要将路径放入双引号,因为有一个空间。另外,从文件标记中删除路径。
You need to put the path into double quotes because there is a space in it. Also, remove the path from your fileargs.


这篇关于进程抛出System.InvalidOperationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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