Merge branch 'master' of ssh://git.szimnau.de:222/fabian/sync

This commit is contained in:
2023-02-24 16:04:50 +01:00
267 changed files with 89 additions and 29 deletions

0
scripts/backup_edi.sh Normal file
View File

View File

7
scripts/build_ffmpeg.sh Executable file
View File

@ -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/

13
scripts/reencode_audio.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
# ensure existence of destination folder
dest=../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

View File

@ -1,11 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
for file in ./*.m4a; do
map='';
if [[ $# > 0 && $1 == 'map' ]]; then
map='-map 0:0';
fi
echo "ffmpeg -i '$file' -c:a copy $map -movflags +faststart '../reencode/$file'";
ffmpeg -i "$file" -c:a copy $map -movflags +faststart "../reencode/$file";
# evaluate options through given arguments
map=
vbr=
while [[ $# > 0 ]]; do
case $1 in
-map) map='-map 0:0'; shift;;
-vbr) vbr='libfdk_aac -profile:a aac_he -b:a 64k'; shift;;
* ) break ;; # Anything else stops command line processing.
esac
done
# if no variable bitrate, just copy audio
if [[ -z $vbr ]]; then
map="$map copy"
fi
# ensure existence of destination folder
dest=../reencode
if [[ !(-d $dest) ]]; then
mkdir $dest
fi
for file in ./*.m4a; do
echo "ffmpeg -i '$file' -c:a $vbr $map -movflags +faststart '$dest/$file'";
ffmpeg -i "$file" -c:a $vbr $map -movflags +faststart "$dest/$file";
done

21
scripts/reencode_m4a.sh.save Executable file
View File

@ -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

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
for file in ./*.mp3; 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

View File

@ -1,12 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
for file in ./*.$1; do
map='';
if [[ $# > 1 && $2 == 'map' ]]; then
map='-map 0:0';
fi
echo "ffmpeg -i '$file' -c:a libfdk_aac -profile:a aac_he -b:a 64k -movflags +faststart $map '../m4a/${file%$1}m4a'";
ffmpeg -i "$file" -c:a libfdk_aac -profile:a aac_he -b:a 64k -movflags +faststart $map "../m4a/${file%$1}m4a";
# evaluate options through given arguments
file_suffix=
map=
while [[ $# > 0 ]]; do
case $1 in
-t | --type) file_suffix=$2; shift 2;;
-map ) map='-map 0:0'; shift;;
* ) break ;; # Anything else stops command line processing.
esac
done
# ensure existence of destination folder
dest=../transcode_m4a
if [[ !(-d $dest) ]]; then
mkdir $dest
fi
for file in ./*.$file_suffix; do
echo "ffmpeg -i '$file' -c:a libfdk_aac -profile:a aac_he -b:a 64k $map -movflags +faststart '$dest/${file%$file_suffix}m4a'";
ffmpeg -i "$file" -c:a libfdk_aac -profile:a aac_he -b:a 64k $map -movflags +faststart "$dest/${file%$file_suffix}m4a";
done