我正在尝试从存储在本地文件夹中的视频创建图像/缩略图。
这就是我正在做的是 -
Process p;
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = Server.MapPath("~/FFMPEG/ffmpeg.exe");
info.RedirectStandardOutput = false;
info.CreateNoWindow = false;
info.Arguments = " -i " + videopath + " -vframes 1 " + imagepath + "%d.jpg";
info.UseShellExecute = false;
p = Process.Start(info);
while (!p.HasExited) { Thread.Sleep(10); }
当我执行上面的代码时,会弹出一个框来安装 ffmpeg.exe
如果我安装该软件,下次它会再次询问。
我做错了什么吗?
最佳答案
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
下面是代码
Process p;
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = Server.MapPath("~/FFMPEG/ffmpeg.exe");
info.RedirectStandardOutput = false;
// below lines will not open the command window
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
info.Arguments = " -i " + videopath + " -vframes 1 " + imagepath + "%d.jpg";
info.UseShellExecute = false;
p = Process.Start(info);
while (!p.HasExited) { Thread.Sleep(10); }
关于c# - ffmpeg 要求安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30801591/