Created
June 26, 2021 14:36
-
-
Save pedrohdz/5134a8aac6746336c1a6238c858c1ad3 to your computer and use it in GitHub Desktop.
Replace FLAC with ALAC version while preserving metadata and cover art
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
while IFS= read -r -d '' source; do | |
echo | |
echo =============================================================================== | |
path=$(dirname "$source") | |
target=$path/$(basename "$source" ".flac").m4a | |
echo Input: $source | |
echo Output: $target | |
ffmpeg -y -nostdin -i "$source" -vcodec copy -acodec alac "$target" | |
rm -v "$source" | |
done < <(find . -type f -name '*.flac' -print0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment