|
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); //也可以用 主站蜘蛛池模板: 利津县| 宁蒗| 台湾省| 突泉县| 中山市| 中阳县| 汉源县| 托里县| 潞西市| 丹寨县| 徐汇区| 廉江市| 漳州市| 赤水市| 清徐县| 化德县| 宜丰县| 铜山县| 茌平县| 雷州市| 同德县| 封丘县| 嘉黎县| 津市市| 偃师市| 武义县| 廊坊市| 靖江市| 仪征市| 湘乡市| 仙居县| 镇平县| 女性| 济源市| 哈巴河县| 万源市| 宁波市| 宜城市| 阜阳市| 政和县| 尚义县|