sync/scripts/reencode_audio.sh
2023-05-27 18:12:05 +02:00

15 lines
319 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# ensure existence of destination folder
dir="$(pwd)"
dest=${dir%/*}/${dir##*/}_reencode
if [[ !(-d $dest) ]]; then
mkdir $dest
fi
for file in ./*.$1; do
echo "ffmpeg -i '$file' -c:a copy -map 0:0 '$dest/$file'";
ffmpeg -i "$file" -c:a copy -map 0:0 "$dest/$file";
done