Add script to transform music in bulk from itunes for funkwhale

This commit is contained in:
saul365
2025-09-11 13:09:53 -06:00
parent 4a52dbeed1
commit 15aa567d28

35
transform_music Normal file
View File

@@ -0,0 +1,35 @@
#! /bin/bash
usage(){
cat << EOF
usage: transform_music [Album_name]
Description
transform_music transforms music from m4a format to flac it creates a new folder with the name provided and stores flac files in it
EOF
exit 1
}
if [[ $# -lt 1 ]] ;
then
usage
fi
if [[ ! -d $1 ]] ;
then
mkdir $1
fi
for name in *m4a ;
do
name_flac=${name/m4a/flac}
ffmpeg -i "$name" -movflags use_metadata_tags -crf 22 "./$1/$name_flac"
echo transformed $name to $name_flac
done