Last active
February 2, 2019 12:50
-
-
Save josuecau/f5796fdc9c675a6427d999ad467d7d31 to your computer and use it in GitHub Desktop.
Convert FLAC to MP3 using ffmpeg(1)
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
#!/usr/bin/env bash | |
# | |
# Convert FLAC to MP3 using ffmpeg(1) | |
# Source: https://stackoverflow.com/a/26109838/2397516 | |
set -e | |
if [ $# -lt 1 ]; then | |
echo "Usage: $(basename "$0") /files/to/convert" | |
exit 1 | |
fi | |
if ! type ffmpeg >/dev/null 2>&1; then | |
echo 'ffmpeg(1) not found' | |
exit 1 | |
fi | |
find "$1" -name "*.flac" -exec ffmpeg -i {} -ab 320k -loglevel warning \ | |
-map_metadata 0 -id3v2_version 3 -vsync 2 {}.mp3 \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment