我正在寻找一个好的教程,或者如何在c#中使用SharpFFMpeg,或者是否有一个简单的方法来使用FMPEG...
我想转换视频。(X格式)到video.flv的屏幕截图,并保存为我去。
如果有一个很好的教程,或者你知道一个简单的方法,请在这里张贴。
谢谢,基兰
发布于 2009-10-26 14:31:26
运行命令行参数www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx
提取图像http://stream0.org/2008/02/howto-extract-images-from-a-vi.html
protected void BTN_convert_Click(object sender, EventArgs e) {
String runMe = @"C:\Documents and Settings\Wasabi Digital\My Documents\Visual Studio 2008\Projects\Evo\WEB\Bin\ffmpeg.exe";
String pathToFiles = @"C:\Documents and Settings\Wasabi Digital\My Documents\Visual Studio 2008\Evo\WEB\test\";
String convertVideo = " -i \"" + pathToFiles + "out.wmv\" \"" + pathToFiles + "sample3.flv\" ";
String makeImages = " -i \"" + pathToFiles + "out.wmv\" -r 1 -ss 00:00:01 -t 00:00:15 -f image2 -s 120x96 \"" + pathToFiles + "images%05d.png\"";
this.ExecuteCommandSync(runMe,convertVideo);
this.ExecuteCommandSync(runMe, makeImages);
}这是取自第一个链接的代码片段。命令用法周围的额外引号使其名称中包含空格。例如“.../我的文档/...”
public void ExecuteCommandSync(String command, String args) {
try {
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("\""+command+"\"",args);
Process.StandardOutput StreamReader.
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
Debug.WriteLine(result);
} catch (Exception objException) {
// Log the exception
}发布于 2009-11-26 01:51:18
这就是使用ffmpeg.exe,而不是使用c#。
https://stackoverflow.com/questions/1605428
复制相似问题