Esempio n. 1
0
        /*生成缩略图*/
        private string VideoToThumbImg(VideoNewDetail detail, string imgSize)
        {
            try
            {
                string AvPath = "/Document/" + detail.ImgPath;
                AvPath = MapPath(AvPath);

                Ffmpeg.FfmpegConverter ff = new Ffmpeg.FfmpegConverter();
                string Result             = ff.ConvertImage(AvPath, ImgDirectory, detail.ImgPath.Split('.')[0], imgSize);
                return(Result);
            }
            catch
            {
                throw new Exception("生成缩略失败!");
            }
        }
Esempio n. 2
0
        private void VideoToThumbImg(IntegratedManage.Model.Vedio av)
        /*生成缩略图*/
        {
            string sql = @"select A.Id, Name from  BJKY_Portal..FileItem As A , BJKY_IntegratedManage..Vedio As B 
                           where B.VedioFile=A.Id  and B.Id='{0}'";

            sql = string.Format(sql, av.Id);
            DataTable dt = DataHelper.QueryDataTable(sql);

            if (dt.Rows.Count > 0)
            {
                try
                {
                    string FileName = av.VedioFile;
                    string AvPath   = "/Document/" + FileName + "_" + dt.Rows[0]["Name"].ToString();
                    AvPath = MapPath(AvPath);
                    Ffmpeg.FfmpegConverter ff = new  Ffmpeg.FfmpegConverter();
                    string Result             = ff.ConvertImage(AvPath, ImgDirectory, FileName);
                }
                catch
                {
                }
            }
        }