C# SharpFFMpeg ffmpeg转换教程

C# SharpFFMpeg ffmpeg转换教程,c#,ffmpeg,sharpffmpeg,C#,Ffmpeg,Sharpffmpeg,我想要的是一个很好的教程,或者如何使用SharpFFMpeg,或者是否有一种在c#中使用ffmpeg的简单方法 我想将视频(x格式)转换为video.flv,拍摄截图并保存 如果有一个很好的教程在那里,或者你知道一个简单的方法,请张贴在这里 谢谢, Kieran运行命令行参数 www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx 提取图像 这是从第一个链接中截取的代码。该命令使用的附加引号使其在名称中使用空格运行。即“../My Do

我想要的是一个很好的教程,或者如何使用SharpFFMpeg,或者是否有一种在c#中使用ffmpeg的简单方法

我想将视频(x格式)转换为video.flv,拍摄截图并保存

如果有一个很好的教程在那里,或者你知道一个简单的方法,请张贴在这里

谢谢, Kieran运行命令行参数 www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx

提取图像

这是从第一个链接中截取的代码。该命令使用的附加引号使其在名称中使用空格运行。即“../My Documents/…”


这是使用ffmpeg.exe,而不是使用sharpffmpeg。

事实证明,我可以使用ffmpeg来完成我想要的所有事情。ie转换并制作图像。我对脚本做了一些修改,以更好地支持转换。请参阅下面的编辑命令。我对命令做了一些修改。输入采样率会有所帮助,因为有时在某些视频上会失败。/*摘自*/ffmpeg-i video_u origine.avi-ab 56-ar 44100-b 200-r 15-s 320x240-f flv video_finale.flvSo没有人真正使用SharpFFmpeg API吗?不过,这似乎是一个非常好的API
    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
  }