home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Executing an external application....and getting its output
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="egonspengleruk" data-source="post: 55416" data-attributes="member: 13482"><p>Ok, have chopped out a lot....but you should get the idea. I need to call several EXE's in turn from a worker thread...but need to get each ones output.</p><p></p><p>[code] strTemp = (string)FileNamesToBurn[i];</p><p> </p><p> // If its an AVI then we need to convert to MPEG</p><p> if (strTemp.EndsWith("avi") == true)</p><p> {</p><p> // Convert the AVI to MPG</p><p> strTemp = strTemp.Substring(0, (strTemp.Length - 3));</p><p> strTemp = strTemp + "mpg";</p><p></p><p> ConvertProcess.StartInfo.FileName = BurnerFilesPath + "ffmpeg.exe";</p><p> ConvertProcess.StartInfo.Arguments = "-y -i \"" + FilePathsToBurn[i] + "\" -target pal-dvd \"" + strTempFolder + "\\" + strTemp + "\"";</p><p> ConvertProcess.Start();</p><p></p><p> ConvertProcess.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(processOutputHandler);</p><p> ConvertProcess.BeginOutputReadLine();</p><p> </p><p> //while (ConvertProcess.HasExited == false)</p><p> // ConvertProcess.BeginOutputReadLine(); </p><p></p><p> //ConvertProcess.WaitForExit();</p><p></p><p> FileNamesToBurn[i] = strTemp;</p><p> FilePathsToBurn[i] = strTempFolder + "\\" + strTemp;</p><p> }</p><p></p><p></p><p> if (strTemp.EndsWith("dvr-ms") == true)</p><p> {</p><p> // Then we need to convert the file to MPG</p><p> //ConvertDvrMs() // To Do</p><p> }</p><p></p><p> // if (strTemp.EndsWith("mpg") == true)</p><p> else</p><p> {</p><p> // Split the MPG into sepearate audio and video parts</p><p> ConvertProcess.StartInfo.FileName = BurnerFilesPath + "mpgtx.exe";</p><p> ConvertProcess.StartInfo.Arguments = "-f -d \"" + FilePathsToBurn[i] + "\" -b \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "\" ";</p><p> ConvertProcess.Start();</p><p> ConvertProcess.WaitForExit();</p><p></p><p> // Merge them back together again but with "DVD" required bits</p><p> ConvertProcess.StartInfo.FileName = BurnerFilesPath + "mplex.exe";</p><p> ConvertProcess.StartInfo.Arguments = "-f 8 -S 0 -M -V -o \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "\" \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "-0.m2v\" \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "-0.mp2 \"";</p><p> ConvertProcess.Start();</p><p> ConvertProcess.WaitForExit();</p><p> }</p><p></p><p></p><p> // Make the DVD files using Config.xml</p><p> ConvertProcess.StartInfo.FileName = BurnerFilesPath + "dvdauthor.exe";</p><p> ConvertProcess.StartInfo.Arguments = "-o " + strTempFolder + "\\DVD_Image -x " + strTempFolder + "\\Config.xml";</p><p> ConvertProcess.Start();</p><p> ConvertProcess.WaitForExit();</p><p></p><p> ConvertProcess.StartInfo.FileName = BurnerFilesPath + "dvdauthor.exe";</p><p> ConvertProcess.StartInfo.Arguments = "-o " + strTempFolder + "\\DVD_Image -T";</p><p> ConvertProcess.Start();</p><p> ConvertProcess.WaitForExit();</p><p>[/code]</p></blockquote><p></p>
[QUOTE="egonspengleruk, post: 55416, member: 13482"] Ok, have chopped out a lot....but you should get the idea. I need to call several EXE's in turn from a worker thread...but need to get each ones output. [code] strTemp = (string)FileNamesToBurn[i]; // If its an AVI then we need to convert to MPEG if (strTemp.EndsWith("avi") == true) { // Convert the AVI to MPG strTemp = strTemp.Substring(0, (strTemp.Length - 3)); strTemp = strTemp + "mpg"; ConvertProcess.StartInfo.FileName = BurnerFilesPath + "ffmpeg.exe"; ConvertProcess.StartInfo.Arguments = "-y -i \"" + FilePathsToBurn[i] + "\" -target pal-dvd \"" + strTempFolder + "\\" + strTemp + "\""; ConvertProcess.Start(); ConvertProcess.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(processOutputHandler); ConvertProcess.BeginOutputReadLine(); //while (ConvertProcess.HasExited == false) // ConvertProcess.BeginOutputReadLine(); //ConvertProcess.WaitForExit(); FileNamesToBurn[i] = strTemp; FilePathsToBurn[i] = strTempFolder + "\\" + strTemp; } if (strTemp.EndsWith("dvr-ms") == true) { // Then we need to convert the file to MPG //ConvertDvrMs() // To Do } // if (strTemp.EndsWith("mpg") == true) else { // Split the MPG into sepearate audio and video parts ConvertProcess.StartInfo.FileName = BurnerFilesPath + "mpgtx.exe"; ConvertProcess.StartInfo.Arguments = "-f -d \"" + FilePathsToBurn[i] + "\" -b \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "\" "; ConvertProcess.Start(); ConvertProcess.WaitForExit(); // Merge them back together again but with "DVD" required bits ConvertProcess.StartInfo.FileName = BurnerFilesPath + "mplex.exe"; ConvertProcess.StartInfo.Arguments = "-f 8 -S 0 -M -V -o \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "\" \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "-0.m2v\" \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "-0.mp2 \""; ConvertProcess.Start(); ConvertProcess.WaitForExit(); } // Make the DVD files using Config.xml ConvertProcess.StartInfo.FileName = BurnerFilesPath + "dvdauthor.exe"; ConvertProcess.StartInfo.Arguments = "-o " + strTempFolder + "\\DVD_Image -x " + strTempFolder + "\\Config.xml"; ConvertProcess.Start(); ConvertProcess.WaitForExit(); ConvertProcess.StartInfo.FileName = BurnerFilesPath + "dvdauthor.exe"; ConvertProcess.StartInfo.Arguments = "-o " + strTempFolder + "\\DVD_Image -T"; ConvertProcess.Start(); ConvertProcess.WaitForExit(); [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Executing an external application....and getting its output
Contact us
RSS
Top
Bottom