sync/scripts/reencode_audio.sh

15 lines
321 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
# ensure existence of destination folder
2023-05-27 18:12:05 +02:00
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