|
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); //也可以用 主站蜘蛛池模板: 晴隆县| 大渡口区| 南木林县| 武山县| 隆尧县| 中西区| 宾川县| 搜索| 崇礼县| 尉犁县| 米脂县| 寿宁县| 萝北县| 海盐县| 驻马店市| 郓城县| 增城市| 修水县| 顺平县| 托克逊县| 阜平县| 延长县| 宜都市| 大洼县| 鸡泽县| 商河县| 长汀县| 尚志市| 盖州市| 宁晋县| 芷江| 南雄市| 普兰店市| 舒城县| 杂多县| 阜南县| 固始县| 田东县| 台北市| 桃园市| 洪江市|