English 中文(简体)
Help with the ffmpeg
原标题:

I can read now the last line from the FFmpeg procees executed in a cmd window. with this source using Scripting host model object reference.

Private Sub Command1_Click()
    Dim oExec       As WshExec
    Dim sRow        As String

    With New WshShell
        Set oExec = .Exec("ffmpeg.exe")
    End With
    Do While oExec.Status = WshRunning
        sRow = oExec.StdOut.ReadLine
    Loop
End Sub

This line is like this. it s the last line in the cmd window (in the botom).

frame= 2816 fps=667 q=11.0 Lsize= 13036kB time=187.66 bitrate= 569.1kbits/s

I cut the part of Time to bulid a progress bar in my vb 6.0 app. But in the cmd process exist a value 13 lines up this value its called Total duration. But i cant read this line , somebody haves a code or any idea to read this line ubicated 13 lines up from the last line of the cmd window from ffmpeg...

问题回答

I ve done this myself in Java. I think the problem is that the status update lines (like you quote above with the time= substring) is terminated with a CR (Carriage Return) and not a LF (Line Feed). My gut says that ReadLine is looking for a full CRLF. So, to do this, you will need to:

  • understand the difference between CR, LF and CRLF, and what ASCII code each is
  • read in the output stream character by character, building up a CR-terminated line, and then parse it for the time= and Durration= tokens

It would help both you and us if you had debugging print statements in your code, and showed us the output.





相关问题
Prevent windows from queuing shellexecute requests

Win.ShellExecute 0, "open", "C:dirprogram.exe", "arguments", vbNullString, SW_SHOWNORMAL Win.ShellExecute 0, "open", "http://www.google.com", vbNullString, vbNullString, SW_SHOWNORMAL I want google....

Why is My Loop Only Deleting One File?

Using VB6 In a folder, i have n number of files, i want to delete a 0 kb files code Dim filename5 As String filename5 = Dir$(txtsourcedatabasefile & "*_*", vbDirectory) MsgBox filename5 Do ...

How to check the filesize?

Using VB6 I have the text file with different sizes, so i want to delete the file where filesize = 0 kb. How to make a vb6 code for deleting the 0 kb files. Need vb6 code Help

File Rename problem?

I m using VB6 and I have a folder where I have n number of files. I want to change the file extension to .txt. I used the code below to change the extension of all .fin files to .txt. Dim filename1 ...

Error 20728-F while in using Crystal Reports in VB6

I m using Crystal Reports in my VB6 project, but I m facing error while loading the report in crystalreport1.action=1; Please give me some solution for this problem. It is showing the error as Error ...

DllRegisterServer entry point was not found

When running my vb6 application I am getting error like, runtime error 53 : file not found: rscomclNoMsg.dll then i tried to register that dll from cmd line using regsvr32. Then I am getting ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签