I was looking for some nice optimization of the video encoding process and I found a nice GNU tool: GNUÂ parallel.
To encode several videos at the same time:
parallel --eta --verbose -j2 HandBrakeCLI -i {} -o {.}.mp4 'Universal' --subtitle-lang-list fre --all-subtitles ::: *.mkv
or
find *.mkv | parallel --eta --verbose --jobs 2 HandBrakeCLI -i {} -o {.}.mp4 'Universal' --subtitle-lang-list fre --all-subtitles
will have the same function: take all mkv files and encode them with HandBrakeCLI command using 2 CPU.
Take a look at the GNU Parallel tutorial website to find more information about this tool.