Last active
June 5, 2024 18:51
-
-
Save philippgitpush/b6e9a475da240ae4dbb8929154540c4e to your computer and use it in GitHub Desktop.
Collection of ffmpeg conversion scripts (mp3 / flac / wav)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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