Skip to content

Instantly share code, notes, and snippets.

@philippgitpush
Last active June 5, 2024 18:51
Show Gist options
  • Save philippgitpush/b6e9a475da240ae4dbb8929154540c4e to your computer and use it in GitHub Desktop.
Save philippgitpush/b6e9a475da240ae4dbb8929154540c4e to your computer and use it in GitHub Desktop.
Collection of ffmpeg conversion scripts (mp3 / flac / wav)
# Flac to mp3, Single File
ffmpeg -i input.flac -ab 320k -ar 44100 output.mp3
# Flac to mp3, Current Dir
for file in *.flac; do
[ -e "$file" ] || continue
ffmpeg -i "$file" -ab 320k -ar 44100 "${file%.flac}.mp3"
done
rm -f *.flac
# Wav to Flac, Current Dir
for file in *.wav; do
ffmpeg -i "$file" -c:a flac -compression_level 12 -map_metadata 0 "${file%.wav}.flac";
done
rm -f *.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment