From 418ecb2f3ffd254a25a95f0d9c0d2a4b6d4c9b0f Mon Sep 17 00:00:00 2001 From: fabian Date: Wed, 18 Jan 2023 22:34:00 +0100 Subject: [PATCH] new (stubs of) scripts/ updated scripts --- scripts/backup_edi.sh | 0 scripts/backup_shepard.sh | 0 scripts/build_ffmpeg.sh | 7 +++++++ scripts/reencode_audio.sh | 7 +++++++ scripts/reencode_m4a.sh.save | 21 +++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 scripts/backup_edi.sh create mode 100644 scripts/backup_shepard.sh create mode 100755 scripts/build_ffmpeg.sh create mode 100755 scripts/reencode_audio.sh create mode 100755 scripts/reencode_m4a.sh.save diff --git a/scripts/backup_edi.sh b/scripts/backup_edi.sh new file mode 100644 index 0000000..e69de29 diff --git a/scripts/backup_shepard.sh b/scripts/backup_shepard.sh new file mode 100644 index 0000000..e69de29 diff --git a/scripts/build_ffmpeg.sh b/scripts/build_ffmpeg.sh new file mode 100755 index 0000000..55674d3 --- /dev/null +++ b/scripts/build_ffmpeg.sh @@ -0,0 +1,7 @@ +cd /var/tmp/ +git clone https://aur.archlinux.org/ffmpeg-libfdk_aac.git +cd ffmpeg-libfdk_aac/ +makepkg -csr +pacman -Ud +cd .. +rm -r ffmpeg-libfdk_aac/ diff --git a/scripts/reencode_audio.sh b/scripts/reencode_audio.sh new file mode 100755 index 0000000..eba3054 --- /dev/null +++ b/scripts/reencode_audio.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euo pipefail + +for file in ./*.$1; do + echo "ffmpeg -i '$file' -c:a copy -map 0:0 '../reencode/$file'"; + ffmpeg -i "$file" -c:a copy -map 0:0 "../reencode/$file"; +done diff --git a/scripts/reencode_m4a.sh.save b/scripts/reencode_m4a.sh.save new file mode 100755 index 0000000..9d74d93 --- /dev/null +++ b/scripts/reencode_m4a.sh.save @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +for file in ./*.m4a; do + map=''; + if [[ $# > 0 && $1 == 'map' ]]; then + map='-map 0:0'; + fi + 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"; +done