Parallélisation des processus de conversion

This commit is contained in:
Hippolyte Chauvin 2023-05-12 10:47:57 +02:00
parent 3ec0c750f5
commit 6c12abc834

View file

@ -36,8 +36,11 @@ case "$format_out" in
esac
for file in **/*".${format_in}"; do
while [ "$(jobs -p | wc -l)" -ge 10 ]; do
sleep 1
done
output_file="${output}/$(dirname "$file")/$(basename "${file}" ".${format_in}").${format_out}"
mkdir -p "$(dirname "${output_file}")"
ffmpeg -i "$file" $options "${output_file}"
ffmpeg -i "$file" $options "${output_file}" &
done