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