]>
Git — Sourcephile - julm/podcasts.git/blob - reencode.sh
2 # shellcheck disable=SC1004
3 # shellcheck disable=SC2016
4 # shellcheck disable=SC2126
7 set -- "${0%/*}"/{old
,new
}/audio
8 #preserveCoverArt="-vcodec copy -f mkv"
9 find "$@" -depth -type f
-name "*.mp3" -print0 | sort -n -z |
10 xargs -0 -P "$(lscpu --online -p | grep -v "#" | wc -l)" -I {} bash
-c '
11 nice -n 19 ffmpeg -y -i "$0" \
12 -map_metadata 0:s:a:0 \
13 -c:a libopus -b:a 32k \
14 -application voip "${0%.*}.opus" &&
18 # -map_metadata 0:s:a:0
19 # copies metadata from the first input file (0:),
20 # first audio stream (s:a:0) to all output files.