2023-01-18 22:34:00 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2023-02-20 19:13:25 +01:00
|
|
|
# ensure existence of destination folder
|
2023-05-27 18:12:05 +02:00
|
|
|
dir="$(pwd)"
|
|
|
|
dest=${dir%/*}/${dir##*/}_reencode
|
2023-02-20 19:13:25 +01:00
|
|
|
if [[ !(-d $dest) ]]; then
|
2024-01-18 15:43:43 +01:00
|
|
|
mkdir "$dest"
|
2023-02-20 19:13:25 +01:00
|
|
|
fi
|
|
|
|
|
2023-01-18 22:34:00 +01:00
|
|
|
for file in ./*.$1; do
|
2023-02-20 19:13:25 +01:00
|
|
|
echo "ffmpeg -i '$file' -c:a copy -map 0:0 '$dest/$file'";
|
|
|
|
ffmpeg -i "$file" -c:a copy -map 0:0 "$dest/$file";
|
2023-01-18 22:34:00 +01:00
|
|
|
done
|