2022-07-23 16:21:39 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
for file in ./*.$1; do
|
2022-08-18 22:22:48 +02:00
|
|
|
map='';
|
|
|
|
if [[ $# > 1 && $2 == 'map' ]]; then
|
|
|
|
map='-map 0:0';
|
2022-07-23 16:21:39 +02:00
|
|
|
fi
|
2023-01-18 22:35:06 +01:00
|
|
|
dest=../transcode_m4a
|
|
|
|
if [[ !(-d $dest) ]]; then
|
|
|
|
mkdir $dest
|
|
|
|
fi
|
|
|
|
echo "ffmpeg -i '$file' -c:a libfdk_aac -profile:a aac_he -b:a 64k -movflags +faststart $map '$dest/${file%$1}m4a'";
|
|
|
|
ffmpeg -i "$file" -c:a libfdk_aac -profile:a aac_he -b:a 64k -movflags +faststart $map "$dest/${file%$1}m4a";
|
2022-07-23 16:21:39 +02:00
|
|
|
done
|
|
|
|
|