Skip to content

Commit 3d70627

Browse files
committed
Show progress on ffmpeg_convert_ext
1 parent 608c895 commit 3d70627

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

utils/ffmpeg_convert_ext.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ source_ext="${1:-wav}"
44
target_ext="${2:-flac}"
55
shift 2
66

7-
find -type f -iname "*.${source_ext}" -print0 | xargs -0 -n1 -P$(nproc) -I '{}' sh -c \
8-
'ffmpeg -loglevel error -i "${0}" "${0%.*}.'${target_ext}'"' {} \;
7+
temp_dir=$(mktemp -d)
8+
trap "rm -rf ${temp_dir}" EXIT
9+
10+
find -type f -iname "*.${source_ext}" -print0 > ${temp_dir}/filelist
11+
< ${temp_dir}/filelist xargs -0 -n1 -P$(nproc) -I '{}' sh -c \
12+
'ffmpeg -loglevel panic -n -i "${0}" "${0%.*}.'${target_ext}'"; echo .' {} \; | \
13+
tqdm --total=$(< ${temp_dir}/filelist tr '\0' '\n' | wc -l) > /dev/null

0 commit comments

Comments
 (0)