Frage

Ich bin nach einem guten Tutorial oder wie man über die Verwendung SharpFFMpeg oder wenn es eine einfache Möglichkeit, ffmpeg in c zu verwenden # ...

Ich möchte Video konvertieren. (X-Format) video.flv Aufnahme von Schnappschüssen und Speichern von ihnen, wie ich gehen.

Wenn es ein gutes Tutorial gibt, oder Sie wissen, eine einfache Möglichkeit, bitte, es zu tun hier posten.

Danke, Kieran

War es hilfreich?

Lösung 2

Ausführen von Befehlszeile args www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx

Extrahieren von Bildern http://stream0.org/2008/02/ Howto-Extrakt-Bilder-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);
 }

Und das ist ein Code snipit von der ersten Verbindung gebracht. Die zusätzlichen Anführungszeichen um die Verwendung des Befehls lassen Sie es mit Leerzeichen in seinem Namen laufen. dh“... / My Documents /..."

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
  }

Andere Tipps

Das ist mit ffmpeg.exe mit c # nicht scharf ffmpeg verwendet wird.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top