Created
May 6, 2021 21:43
-
-
Save bokunodev/5f4dde31b62e6724a8b4be3fdc466b45 to your computer and use it in GitHub Desktop.
Batch convert flac to mp3 using ffmpeg with configurable quality
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
#!/bin/bash | |
if [ $MP3_QUALTY -eq "" ] ; then | |
MP3_QUALTY=3 | |
fi | |
if [ $MP3_COMPRESSION -eq "" ] ; then | |
MP3_COMPRESSION=0 | |
fi | |
if [ $OVERWRITE -ne "" ] ; then | |
OVERWRITE="-y" | |
fi | |
for i in *.flac ; do | |
ffmpeg -i "$i" -c:a libmp3lame -q:a $MP3_QUALTY -compression_level $MP3_COMPRESSION -vsync 2 -threads `nproc` $OVERWRITE "mp3/$i.mp3"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment