0

我正在尝试从视频文件中获取动画 gif。我无法从下面的代码创建 gif。任何人都可以帮助我解决这个问题。

      Process ffmpeg; // creating process
    string video;
    string thumb;
 //   string text = System.IO.File.ReadAllText(@"C:\xampp\htdocs\h\myText.txt");
    video = Page.MapPath("") + "\\o.avi";
    thumb = Page.MapPath("") + "\\output\\o.gif"; // thumb name with path !
    ffmpeg = new Process();
    int num = 3;
    int secpos = 1;

    // ffmpeg.StartInfo.Arguments = "ffmpeg -i o.avi -vf scale=320:-1,format=rgb8,format=rgb24 -t 10 -r 10 output.gif"; // arguments !
    ffmpeg.StartInfo.Arguments = " -i \"" + video + "\" -s 108*80 -ss " + secpos + " -t " + num + "\" -vf scale=320:-1,format=rgb8,format=rgb24 \"" + thumb + "\"";
    ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg//ffmpeg.exe");
    ffmpeg.Start(); // start !  

我认为 ffmpeg.StartInfo.Arguments 有错误。

4

1 回答 1

0

您的代码生成参数字符串

-i "path" -s 108*80 -ss 1 -t 3" -vf scale=320:-1,format=rgb8,format=rgb24 "path"

3"看起来很明显的错误。

于 2019-12-18T16:07:13.797 回答