c# - ffmpeg 要求安装

标签 c# asp.net ffmpeg thumbnails

我正在尝试从存储在本地文件夹中的视频创建图像/缩略图。
这就是我正在做的是 -

     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/

相关文章:

video - 连接三个视频和一个音频

C#:字符串作为事件的参数?

c# - Web API 与 SignalR

asp.net - 如何配置 IIS 以接受 POST 请求?

mysql - 如何根据用户名检索数据

ffmpeg - 我的单行 ffmpeg 命令有误

c# - 如何在文件不再打开时立即收到通知?

c# - Withings API 和 C#

c# - MVC Controller 上的异步等待,带有选择并返回集合的存储库

android - 用于在 android 中合并 mp4 视频的 FFMPEG 命令问题