Skip to content

Instantly share code, notes, and snippets.

@jj1bdx
Created December 7, 2021 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jj1bdx/87fab88a0e6a3342379660e1586b835e to your computer and use it in GitHub Desktop.
Save jj1bdx/87fab88a0e6a3342379660e1586b835e to your computer and use it in GitHub Desktop.
Convert FLAC to ALAC in batch
#!/bin/sh
# https://sound.stackexchange.com/questions/26633/free-batch-conversion-from-flac-to-apple-lossless-alac
# https://stackoverflow.com/questions/55429909/could-not-find-tag-for-codec-h264-in-stream-0-codec-ffmpeg-flac-to-alac-conver
for name in *.flac; do \
ffmpeg -nostdin -i "$name" -c:a alac -c:v copy "${name%.*}.m4a" && \
ffmpeg -nostdin -i "$name" -vf "crop=((in_w/2)*2):((in_h/2)*2)" \
"${name/%flac/jpg}" && \
AtomicParsley "${name/%flac/m4a}" --artwork "${name/%flac/jpg}" --overWrite; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment