Zenity --progress from Handbrake CLI output

回眸只為那壹抹淺笑 提交于 2019-12-04 07:45:37
erik

You can use the solutions answered here on stackexchange.

For example:

The stdbuf program which is part of the GNU coreutils.

stdbuf -i0 -o0 -e0 command

Another example is the expect command unbuffer, e.g.

unbuffer long_running_command | print_progress

unbuffer connects to long_running_command via a pseudoterminal (pty), which makes the system treat it as an interactive process, therefore not using the 4-kiB buffering in the pipeline that is the likely cause of the delay.

For longer pipelines, you may have to unbuffer each command (except the final one), e.g.

unbuffer x | unbuffer -p y | z

Using UNBUFFER suggested by erik to use with your first post, the following command do the trick :

( HandBrakeCLI -i infile -o outfile --preset=iPad | 
        unbuffer -p grep -i "encoding: task " | 
        unbuffer -p cut -c24-25 ) | 
        zenity --progress --auto-close
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!