I've got this:
string cmd = " -i """ + finPath + """ -ar 44100 -ab 160k """ + foutPath + """";
and I need to pass it to command prompt from C# using Systems.Diagnostics.Process.
No combination seems to work. Program works just fine if I run it in command prompt. Also runs just fine if I use the same string in VB.Net
finPath has spaces as does foutPath and it's making the program not run.
I need to have finPath expressed as "finPath". Same with foutPath.
More of the code (used the line suggested here, no luck):
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();