视频文件截取图片,asp.net c#

来源:互联网 发布:为知笔记导出html 编辑:程序博客网 时间:2024/05/17 04:30

视频大小配成110*65不能截取图片。,不知道为什么,视频大小和工具可在在web.cofig中平

配置

用 string FPath = System.Configuration.ConfigurationSettings.AppSettings["ffmpeg"];

获取下

 string ffmpeg = Server.MapPath("../manage/tools/ffmpeg.exe");
            string move = Server.MapPath("../user/movie/2/怪治病-郭德纲.于谦.flv");
            string pic = Server.MapPath("../user/movie/2/怪治病-郭德纲.于谦.jpg ");
            Process p = new Process();
            p.StartInfo.FileName = ffmpeg;
            p.StartInfo.Arguments = "-i " + move + " -y -f image2 -ss 5 -t 0.001 -s 120x72 " + pic;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.CreateNoWindow = true;
            p.StartInfo.RedirectStandardOutput = true;
            try
            {
                p.Start();
                p.Dispose();
                p.Close();
            }
            catch (Exception ee)
            {
                Response.Write(ee.ToString());
            }
        }

原创粉丝点击