これに似た何かがトリックを行うはずです:
import multiprocessing
...
def wrapper(currentfile):
#create your commandline -- for the sake of simplicity, I assume that
#the only thing that changes is the filename you are passing to
#HandBrakeCLI (and that the filename is the last argument to pass)
cmd='HandBrakeCLI -i ... -o ... '+currentfile
proc = subprocess.Popen(cmd)
proc.wait()
return 'foo'
files=os.listdir(path) #Any way that you build up your list of files is fine
output = multiprocessing.Pool(4).map(wrapper,files) #output is ['foo', 'foo', ..., 'foo']
Of course, this uses a map
-like function for it's side-effects which many python people dislike... but I find it to be intuitive enough -- especially if you leave a comment. I also made the function return 'foo' to demonstrate that you can access the return value from the function quite easily.