run command and make sure it ends before continuing
i am running a command line program from inside my c# code behind page. the command looks like so.
String runMe = baseDir + @"Bin\ffmpeg.exe";
String convertVideo = " -i \"" + fullFileName + "\" -ab 64 -ar 44100 -b 200 -y -f flv \"" + fullFileNameWOextension + ".flv\" ";
String makeImages = " -i \"" + fullFileName + "\" -r 1 -ss 00:00:01 -t 00:00:15 -f image2 -s 120x96 \"" + imagesPath + "" + filename.Substring(0, filename.IndexOf(".")) + "_images%05d.jpeg\"";
EdgeCastHelper.ExecuteCommandSync(开发者_Go百科runMe, convertVideo);
EdgeCastHelper.ExecuteCommandSync(runMe, makeImages);
There are some bits missing which are passed in as parameters. Once i have converted the video i upload it to separate file server.
What i would like to know: Is there a way to stop the upload process happening until the exe has run its course, ie fully converted the video.
I'm not sure if you have access to change the EdgeCastHelper.ExecuteCommandSync method, but there is a Process.WaitForExit method.
精彩评论