Ich habe das bekam:Probleme beim Starten eines Prozesses mit Process.Start() - wie konstruiere ich die Argumentliste?
string cmd = " -i """ + finPath + """ -ar 44100 -ab 160k """ + foutPath + """";
und ich brauche es passieren Aufforderung von C# Systems.Diagnostics.Process
zu befehlen.
Keine Kombination scheint zu funktionieren. Programm funktioniert gut, wenn ich es in der Eingabeaufforderung ausführen. Läuft auch gut, wenn ich die gleiche Zeichenfolge in VB.Net verwenden
finPath
hat Leerzeichen wie foutPath
und es macht das Programm nicht ausgeführt.
Ich brauche finPath
ausgedrückt als finPath
. Gleiches mit foutPath
.
Mehr des Codes (verwendet die Linie hier vorgeschlagen, kein Glück):
string inputPath = RootPath + "videoinput\\";
string ffmpegpath = RootPath + "ffmpeg.exe"; //ffmpeg path
string outputPath = RootPath +"videooutput\\";
//define new extension
string fileext = ".flv";
string newfilename = namenoextension + fileext;
string namenoextension = Path.GetFileNameWithoutExtension(savedfile);
string fileoutPath = outputPath + newfilename;
string fileinPath = "/videoinput/" + savedfile;
string cmd = " -i \"" + fileinPath + "\" -ar 44100 -ab 160k \"" + fileoutPath + "\"";
//Begin encoding process
Process proc = new Process();
proc.StartInfo.FileName = ffmpegpath;
proc.StartInfo.Arguments = cmd;
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
Bitte schreiben Sie alle Code, der den Prozess startet. Es ist schwer zu entziffern, was das Problem nur von der Befehlszeile args –
Erledigt ist. Bearbeitet Hauptpost –
Dies wird benötigt: ffmpeg.exe -i "C: \ Dokumente und Einstellungen \ Benutzer \ Eigene Dateien \ Visual Studio 2008 \ Projekte \ Projekt \ Videoeingang \ eaf2cc1d-6MTNTUGOFWAR.wmv" -ar 44100 - ab -160k "videooutput \ eaf2cc1d-6MTNTUGOFWAR.flv" –