关于 ffmpeg 的帮助
我现在可以读取在 cmd 窗口中执行的 FFmpeg 进程的最后一行。 使用脚本宿主模型对象引用来使用此源。
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
这条线是这样的。这是 cmd 窗口中的最后一行(在底部)。
frame= 2816 fps=667 q=11.0 Lsize= 13036kB time=187.66 bitrate= 569.1kbits/s
我剪掉了部分时间来在我的 vb 6.0 应用程序中构建进度条。但在 cmd 进程中存在一个值 13,该值称为总持续时间。但我无法读取这一行,有人有代码或任何想法可以从 ffmpeg 的 cmd 窗口的最后一行读取这一行 ubicated 13 行...
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己用 Java 做过这个。我认为问题在于状态更新行(就像上面用
time=
子字符串引用的那样)以 CR(回车)而不是 LF(换行)终止。我的直觉告诉我 ReadLine 正在寻找完整的 CRLF。因此,要执行此操作,您需要:time=
和Durration=
标记如果您在代码中调试打印语句并向我们展示输出,这将对您和我们都有帮助。
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:time=
andDurration=
tokensIt would help both you and us if you had debugging print statements in your code, and showed us the output.