Arokh
Well-known member
- Joined
- Apr 11, 2006
- Messages
- 124
I use a Cmd Prompt app (AVDump) which hashes and gets info from a video file (~200MB), which of course takes some time.
While the App processes the file, it prints the progress into the cmd prompt,
which I want to read into my App.
Now I already achieved to read the line necessary from the cmd prompt,
but with a huge delay, to be more exact, after the hashing is done.
Since AVDump drives the CPU usage to 100%, I thought lowering the priority would solve the problem but it didnt.
Here is the code I use:
Is there any way to get the progress in realtime?
The aguments to AVDump:
"-log:log.xml -ay " & Chr(34) & "[VIDEOFILE(AVI;MPG;MP4;MKV;OGM)]" & Chr(34)
While the App processes the file, it prints the progress into the cmd prompt,
which I want to read into my App.
Now I already achieved to read the line necessary from the cmd prompt,
but with a huge delay, to be more exact, after the hashing is done.
Since AVDump drives the CPU usage to 100%, I thought lowering the priority would solve the problem but it didnt.
Here is the code I use:
PHP:
Public Class AVDump
Dim CmdOutPut As IO.StreamReader
Dim CmdProcess As New Process
Dim Reader As New Threading.Thread(AddressOf ReadProgress)
Private Sub ReadProgress()
Do Until CmdProcess.HasExited
Debug.Print(CmdOutPut.ReadLine)
Loop
End Sub
Public Sub StartAVDump(ByVal CmdLine As String)
CmdProcess.StartInfo.FileName = My.Application.Info.DirectoryPath & "\AVDump\avdump.exe"
CmdProcess.StartInfo.RedirectStandardOutput = True
CmdProcess.StartInfo.UseShellExecute = False
CmdProcess.Start()
CmdProcess.PriorityClass = ProcessPriorityClass.BelowNormal
CmdOutPut = CmdProcess.StandardOutput
Reader.Start()
End Sub
End Class
Is there any way to get the progress in realtime?
The aguments to AVDump:
"-log:log.xml -ay " & Chr(34) & "[VIDEOFILE(AVI;MPG;MP4;MKV;OGM)]" & Chr(34)