2011-09-21 64 views
0

我是一個新來的,我正在做一個應用程序,我可以通過給開始位置和結束位置來分割媒體文件。我怎樣才能做到這一點?我使用c#語言。 我的英語不好,抱歉。如何分割媒體文件

謝謝!

回答

0

嘗試通過shell進程使用ffmpeg。

System.Diagnostics.Process p = new System.Diagnostics.Process(); 
p.StartInfo.UseShellExecute = false; 
p.StartInfo.RedirectStandardError = true; 
p.StartInfo.RedirectStandardOutput = true; 
p.StartInfo.CreateNoWindow = true; 
p.StartInfo.FileName = ffmpegPath.FullName; 
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; 
p.StartInfo.Arguments = "some ffmpeg commands here"; 
try { 
    p.Start(); 
} catch (Exception ex) { 
    ' trap error 
} 

String out = p.StandardError;