I am using the subprocess.run() to run handbrakecli to compress a media folder. Whenever I run the command I get a live data feed every 1/2 second in my output. Is there a way to capture the live stdout to get the ETA, Progress value, etc. to create a progress bar? I know how to pase a string to get that data, its just getting those lines from the live output and getting them fast enough to be useful is the hardest part.
Here's an example of what the live feed looks like when you run the code below.
Here's an example of what the live feed looks like when you run the code below.
from time import sleep for feed in range(0,101,20): p = f''' Progress: {{ "State":"WORKING", "Working":{{ "ETASeconds":265, "Hours":0, "Minutes":4, "Pass":1, "PassCount":1, "PassID":0, "Paused":0, "Progress":{feed}.00000000000000000, "Rate":110.10037994384766, "RateAvg":124.60877227783203, "Seconds":{feed/10}, "SequenceID":1 }} }} ''' sleep(.5) print(p)