2

私は良いチュートリアルまたはSharpFFMpegの使用方法、またはc#でffmpegを使用する簡単な方法があるかどうかを確認しています...

video。(x形式)をvideo.flvに変換して、スクリーンショットを撮り、保存します。

良いチュートリアルがある場合、または簡単な方法を知っている場合は、ここに投稿してください。

ありがとう、キエラン

4

2 に答える 2

4

それは、c#がsharpffmpegを使用していないのにffmpeg.exeを使用していることです。

于 2009-11-25T17:51:17.770 に答える
1

コマンドライン引数の実行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-10-26T06:31:25.797 に答える