CLI with visual progress?

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
phil.hagen
Posts: 3
Joined: Wed Aug 03, 2022 12:51 pm

CLI with visual progress?

Post by phil.hagen »

Hi I am new to HandBrake. I was interested in a way to automate the video file conversion via scripts. I have a way to generate the proper syntax for the command line. I have tested that and it works fine. However, I still want to see some onscreen progress of the files that are being converted. Is this possible with HandBrake? Could someone point me in the correct direction? Thanks
phil.hagen
Posts: 3
Joined: Wed Aug 03, 2022 12:51 pm

Re: CLI with visual progress?

Post by phil.hagen »

I guess I should be more clear. I plan on running my scripts with a command line hidden. I am wondering if HandBrake can still show what the progress is. I mean with the Windows interface of any other minimal on-screen feature. Thanks
User avatar
Rodeo
HandBrake Team
Posts: 12973
Joined: Tue Mar 03, 2009 8:55 pm

Re: CLI with visual progress?

Post by Rodeo »

No, but progress is written to standard output, which you can redirect to a file. You can then use tail or perhaps a script of your choice to monitor proress from said file.
phil.hagen
Posts: 3
Joined: Wed Aug 03, 2022 12:51 pm

Re: CLI with visual progress?

Post by phil.hagen »

Hi, thanks for the reply. OK, if anybody has examples could they show me thanks.
DrXenos
Bright Spark User
Posts: 265
Joined: Sat Mar 16, 2013 1:19 pm

Re: CLI with visual progress?

Post by DrXenos »

This is pretty easy to do. You just need to run HB as a separate process with its standard out redirected to a non-blocking (asynchronous) pipe. You can then periodically read and parse the output, looking for percent done text.

I do this in my GUI transcoder tool to update the % complete on the status bar, taskbar, etc.

I don't know how doable it would be from a batch file because, unlike Unix shell scripts, the pipes don't create background processes (I don't think they do, anyway). You can start another process in a batch file using the START command, but you'll need another to monitor the progress.
Post Reply