我编写了代码以使用 ffmpeg 在 c#asp.net 中转换文件。执行时显示错误为“文件名、目录名或卷标语法不正确”,但我的路径是正确的。那么解决这个问题的方法是什么?
ProcessStartInfo info = new ProcessStartInfo("e:\ffmpeg\bin\ffmpeg.exe", "-i cars1.flv -same_quant intermediate1.mpg");
process.Start();
我尝试了另一种方法,如下所示。但这也行不通。
ProcessStartInfo info = new ProcessStartInfo("ffmpeg.exe", "-i cars1.flv -same_quant intermediate1.mpg");
请帮助我使用 c# asp.net 中的 ffmpeg 将一种视频文件格式转换为另一种视频文件格式的示例代码。提前致谢。
最佳答案
有可用的包装库
http://www.ffmpeg-csharp.com/
另请参阅
http://www.codeproject.com/Articles/24995/FFMPEG-using-ASP-NET
https://stackoverflow.com/questions/tagged/asp.net+c%23+video
string apppath = Request.PhysicalApplicationPath;
string outf = Server.MapPath(".");
string fileargs = "-i" + " " + "\"C:/file.mp4 \"" + " " + "\"C:/files/test.flv \"";
Process myProcess = new Process();
myProcess.StartInfo.FileName = Server.MapPath(".")+"//ffmpeg.exe";
myProcess.StartInfo.Arguments = fileargs;
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.CreateNoWindow = false;
myProcess.StartInfo.RedirectStandardOutput = false;
myProcess.Start();
myProcess.WaitForExit(50 * 1000);
谢谢
迪普
关于c# - ffmpeg c# asp.net help on ProcessStartInfo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10431012/