//获取转换工具路径
public static string ffmpegtool = ConfigurationManager.AppSettings["ffmpeg"]; //获取视频的文件夹名
public static string upFile = "upfile/"; //获取图片文件的文件夹名
public static string imgFile = "imgFile/"; //获取转换后文件的文件夹名
public static string playFile = "playFile/"; //文件图片大小
public static string sizeOfImg = ConfigurationManager.AppSettings["imgSize"]; //文件大小
public static string widthOfFile = ConfigurationManager.AppSettings["widthSize"];
public static string heightOfFile = ConfigurationManager.AppSettings["heightSize"];
/// <summary> /// 将视频文件转换成flv格式,并保存到playFile文件夹下
/// </summary> /// <param name="fileName">需要转换视频的路径</param>
/// <param name="playFile">视频转换flv格式后保存的路径</param>
/// <param name="imgFile">在视频文件中抓取图片后保存路径</param>
/// <returns>成功:返回图片虚拟地址; 失败:返回空字符串</returns>
public static bool changeVideoType(string fileName, string playFile, string imgFile) { //获取视频转换工具的路径
string ffmpeg= System.Web.HttpContext.Current.Server.MapPath("../") + ffmpegtool; //获取需要转换的视频路径
string Name = System.Web.HttpContext.Current.Server.MapPath("../") + upFile + "/" + fileName; if ((!System.IO.File.Exists(ffmpeg)) || (!System.IO.File.Exists(Name)))
{ return false;
} //获取视频转换后需要保存的路径
string flv_file = playFile; //创建Process对象
Process pss = new Process(); //不显示窗口
pss.StartInfo.CreateNoWindow = false; //设置启动程序的路径
pss.StartInfo.FileName = ffmpeg; //设置执行的参数
pss.StartInfo.Arguments = " -i " + Name + " -ab 128 -ar 22050 -qscale 6 -r 29.97 -s " + widthOfFile + "x" + heightOfFile + " " + flv_file;
try
{ //启动转换工具
pss.Start(); while (!pss.HasExited)
{ continue;
}
视频处理程序 ffmpeg.exe /// /// 视频文件地址,如:/Web/FlvFile/User1...返回图片虚拟地址; 失败:返回空字符串</returns> public string CatchImg(string...
{ 011 /// 012 /// 图片处理 013 /// 014 public class ImageProvider 015 { 016 /// 017 /// 将Image转化为byte数组 018 /// 019 /// 图片...
C#图片处理_IT/计算机_专业资料。C#图片透明化 半透明,指定色透明,生成png图片...图片处理 6页 免费 批量处理图片 3页 免费 BMP图片处理--C语言 14页 免费喜欢...
1 第8章 图形图像处理 8.1 图形图像基础知识 8.2 绘制基本图形 8.3 填充图形 8.4 图像处理 8.5 图形与图像的平移、旋转与缩放(自学) 8.6 文字处理(...
由于主要用在视频监控上,对性 能要求比较高。有几项检测必须要在 Lab 彩色下...而不是 C/C++ 而不是经常有人问,你为什么用 C#而不用 C/C++写图像处理...
C#图像处理_IT/计算机_专业资料。主要介绍c#处理图像的不同方式,如浮雕,阴影效果...c语言的图像处理 2页 免费 图像处理C语言程序 暂无评价 3页 免费喜欢...
Web应用程序中的图形图像操作 14.6 音频与视频播放...在C#.NET中,使用GDI+处理二维(2D)的图形和图像, ...例如: Bitmap bitmap=new Bitmap(@"C:\test\a...
C#中照片处理_IT/计算机_专业资料。C#中照片处理代码一、 学生信息维护窗体界面设计 Name picPhoto 显示照片 BorderStyle Fixed3D 加边框 Cursor Hand 显示手形鼠标...
C#对图片的几种简单处理_IT/计算机_专业资料。C#对图片的几种简单处理using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; public...
C#图像数字处理_机械/仪表_工程科技_专业资料。根据图像的数字结构,利用C#对图像...(pictureBox1.Image); Color c = new Color(); int rr, r1, g1, b1...
热门文档