2011-09-21 62 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;