I need help with faad and aften command line

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am writing a GUI to convert mp4 to mkv for my WDTV it all works but there is a problem with faad and aften, there is no way that these guys will give me feedback for my progress bar see my code below.
The whole thing works as I want but it would be nice to have the progress working as there is dead time while faad and aften are working. if the line StartInfo.CreateNoWindow = True is used the dos box displays the faad output to the box title, what I want
is that info for my tool bar.
Myapp="faad.exe"<br/>
MyTail=" -o " & Chr(34) & MyPath & LongName2 & ".WAV" & Chr(34) & " " & Chr(34) & MyPath & LongName2 & ".mp4" & Chr(34)
Public Function runfaadaften(ByVal MyApp As String, ByVal MyTail As String) As Integer Return myprocess.exitcode as ProcEC
Dim myprocess As New Process <br/>
Dim StartInfo As New System.Diagnostics.ProcessStartInfo <br/>
StartInfo.FileName = MyApp<br/>
StartInfo.Arguments = MyTail<br/>
StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden<br/>
StartInfo.CreateNoWindow = True<br/>
StartInfo.RedirectStandardError =True<br/>
StartInfo.RedirectStandardOutput =True<br/>
StartInfo.UseShellExecute =False required to redirect<br/>
myprocess.StartInfo = StartInfo<br/>
myprocess.Start()<br/>
<br/>
Try
Dim sline As System.IO.StreamReader = myprocess.StandardError <br/>
Dim sline As System.IO.StreamReader = myprocess.StandardOutput<br/>
Dim DOSout As String
While (myProcess.HasExited = False)
Application.DoEvents()<br/>
DOSout = sline.ReadLine
If (Not String.IsNullOrEmpty(DOSout)) Then
Label3.Text = DOSout.ToString<br/>
progress bar info should be processed here..
End If
End While
ProcEC = myprocess.ExitCode
sline.Close()
Catch ex As Exception <br/>
MsgBox("Execute Error with " & MyApp & ex.Message)
myProcess.Kill()
End Try
myprocess.Close()<br/>
Return ProcEC
End Function

View the full article
 
Back
Top