Skip to content

Instantly share code, notes, and snippets.

@KokoseiJ
Created August 19, 2021 16:13
Show Gist options
  • Save KokoseiJ/e4b7f9d5b129fbbfad9092a9a8fd708d to your computer and use it in GitHub Desktop.
Save KokoseiJ/e4b7f9d5b129fbbfad9092a9a8fd708d to your computer and use it in GitHub Desktop.
Batch convert FLAC to ALAC recursively
find /music -iname "*.flac" -print0 | xargs -P 16 -0 -I @ bash -c 'temp="@"; name="$(echo $temp | sed -E "s/\/.*?\///" | sed "s/.flac//")"; echo $name; ffmpeg -hide_banner -loglevel warning -i "$temp" -c:v copy -c:a alac -ar 44100 "/mnt/d/ALAC/$name.m4a"'
@KokoseiJ
Copy link
Author

using find, xargs, ffmpeg and sed

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