|
string str=@"d:/test.avi d:/test_allen.flv";
RunFFMpeg(str);
//運行FFMpeg的視頻解碼,
public void RunFFMpeg(string strCmd)
{
//創建并啟動一個新進程
Process p = new Process();
//設置進程啟動信息屬性StartInfo,這是ProcessStartInfo類,包括了一些屬性和方法:
p.StartInfo.FileName = "ffmpeg.exe"; //程序名
p.StartInfo.Arguments = " -i " + strCmd; //執行參數
p.Start();
}
//運行Cmd.exe執行Dos 命令,并返回執行結果
public string RunCmd(string command)
{
//創建并啟動一個對進程
Process p = new Process();
//Process類有一個StartInfo屬性,這是ProcessStartInfo類,包括了一些屬性和方法,例如:
p.StartInfo.FileName = "cmd.exe"; //程序名
p.StartInfo.Arguments = " /c " + command; //執行參數
p.StartInfo.UseShellExecute = false; //關閉Shell的使用
p.StartInfo.RedirectStandardInput = true; //重定向標準輸入
p.StartInfo.RedirectStandardOutput = true; //重定向標準輸出
p.StartInfo.RedirectStandardError = true; //重定向錯誤輸出
p.StartInfo.CreateNoWindow = true; //設置不顯示窗口
p.Start();
//p.StandardInput.WriteLine(command); //也可以用 主站蜘蛛池模板: 景泰县| 黄梅县| 渝北区| 溧水县| 确山县| 久治县| 利川市| 东乌| 额敏县| 西贡区| 北流市| 敦化市| 博湖县| 贡觉县| 八宿县| 逊克县| 青神县| 江安县| 双桥区| 正蓝旗| 阿城市| 太保市| 勐海县| 福清市| 南丰县| 天台县| 信阳市| 通江县| 松滋市| 保定市| 政和县| 柘荣县| 东至县| 临武县| 乌拉特后旗| 灵台县| 梁河县| 淅川县| 句容市| 凤山市| 姜堰市|