有没有办法 grep ffmpeg 的不友好输出以将进度(时间/持续时间)转换为变量?我已经在 powershell 上尝试过了,但我似乎无法通过管道重定向和使用 --line-buffered
来获得 ffmpeg 的连续输出。 grep 中的标志。
这是我想出的,但它只在编码过程完成后返回。ffmpeg -i $input $output 2>&1 | grep --line-buffered -oP "(?<=time=)[0-9:]*"
最佳答案
这可以让你开始
ffmpeg -i in.mp4 -v 0 -stats out.mp4 |& awk '{print $10}' RS='\r' FS='[ =]+'
关于windows - Grep ffmpeg 时间/持续时间以获取进度流?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21503385/