hai.haus
Browse

Converting FLAC to ALAC using ffmpeg


iTunes and Apple Music don’t support FLAC, at least on desktop, which means that you’ll need to convert from FLAC to ALAC (Apple Lossless Audio Codec). You can do this through the command line using FFMPEG:

ffmpeg -i input.flac -y -v 0 -vcodec copy -acodec alac output.m4a

Converting FLAC to ALAC can be automated by looping through all the files in a directory on Windows:

for %%a in ("*.flac") do ffmpeg -y -i "%%a" -vn -c:a alac "%%~na.m4a"

And on Unix (Bash):

for i in *.flac; do echo $i; ffmpeg -i "$i" -y -v 0 -vcodec copy -acodec alac "${i%.flac}".m4a; done