C#语言FFMpegRunner-FFMpeg超级视频压缩工具下载|C/S框架网
C#语言FFMpegRunner-FFMpeg超级视频压缩工具下载|C/S框架网
VIP会员下载:
C#语言开发的FFMpegRunner工具,FFMpeg超级视频压缩工具下载,
C/S框架网原创作品!
ffmpeg支持Windows长文件名压缩:
FFMpeg.exe ,百度搜索下载:
视频压缩效果:
C# Code:
//运行cmd
Process p = new Process();
p.StartInfo.FileName = txtProgramPath.Text + "\\ffmpeg.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.Arguments = string.Format("-i {0} -b:v {1} -bufsize {2} -vf \"scale = {3}, setsar = 1\" -profile:v baseline -level {4} -pix_fmt yuv420p {5}",
sourceFile, txtRate.Text, txtRate.Text, txtScale.Text, txtLevel.Text, destFile) + " ";
p.StartInfo.UseShellExecute = false; ////不使用系统外壳程序启动进程
p.StartInfo.CreateNoWindow = true; //不显示dos程序窗口
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;//把外部程序错误输出写到StandardError流中
p.ErrorDataReceived += new DataReceivedEventHandler(p_ErrorDataReceived);
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
p.Start();
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.BeginErrorReadLine();//开始异步读取
p.WaitForExit();//阻塞等待进程结束
p.Close();//关闭进程
p.Dispose();//释放资源
//来源:C/S框架网(www.csframework.com) QQ:23404761
//运行cmd
Process p = new Process();
p.StartInfo.FileName = txtProgramPath.Text + "\\ffmpeg.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.Arguments = string.Format("-i {0} -b:v {1} -bufsize {2} -vf \"scale = {3}, setsar = 1\" -profile:v baseline -level {4} -pix_fmt yuv420p {5}",
sourceFile, txtRate.Text, txtRate.Text, txtScale.Text, txtLevel.Text, destFile) + " ";
p.StartInfo.UseShellExecute = false; ////不使用系统外壳程序启动进程
p.StartInfo.CreateNoWindow = true; //不显示dos程序窗口
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;//把外部程序错误输出写到StandardError流中
p.ErrorDataReceived += new DataReceivedEventHandler(p_ErrorDataReceived);
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
p.Start();
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.BeginErrorReadLine();//开始异步读取
p.WaitForExit();//阻塞等待进程结束
p.Close();//关闭进程
p.Dispose();//释放资源
//来源:C/S框架网(www.csframework.com) QQ:23404761
VIP会员下载:
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网