Skip to content

Instantly share code, notes, and snippets.

@auyongcheemeng
Last active March 24, 2025 16:59
Show Gist options
  • Save auyongcheemeng/0a0b3cdbabb19cf803da0caa7d5d0179 to your computer and use it in GitHub Desktop.
Save auyongcheemeng/0a0b3cdbabb19cf803da0caa7d5d0179 to your computer and use it in GitHub Desktop.
ffmpeg flac to alac conversion batch script (windows)
:::: ffmpeg script for converting FLAC to ALAC
:: ffmpeg windows binary is required (https://ffmpeg.org)
:: Script creates the folders ['flac' and 'alac'] on first run.
:: Copy the associated files to the appropriate folder [ie. '.flac' files to 'flac' folder]
:: and run the
IF NOT EXIST alac\NUL mkdir alac
IF NOT EXIST flac\NUL mkdir flac
for %%a in ("flac\*.flac") do ffmpeg -y -i "%%a" -vn -c:a alac "alac\%%~na.m4a"
:: [optional] for flac files with embedded coverart (thanks @ChocolateAdventurouz) - uncomment line below /comment line above if used
:: for %%a in ("flac\*.flac") do ffmpeg -y -i "%%a" -c:v copy -c:a alac "alac\%%~na.m4a"
@echo off
pause
@ChiTsng
Copy link

ChiTsng commented Oct 16, 2021

I second the previous comment. This script is so nice.

@thantwenty1
Copy link

Gotta try. Thanks!

@ChocolateAdventurouz
Copy link

In case you want to have the album art in the alac file, the ffmpeg command should be:

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

@auyongcheemeng
Copy link
Author

In case you want to have the album art in the alac file, the ffmpeg command should be:

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

Nice, updated the script for those who might want it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment