Last active
May 30, 2018 23:24
-
-
Save richard512/be9184f393fb4acd9e0922e7f720d9f3 to your computer and use it in GitHub Desktop.
Linux BASH script to convert all webm and mp4 video files in a directory to mp3
This file contains hidden or 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
for FILE in music/*.{mp4,webm}; do | |
if [ ! -f "${FILE%.webm}.mp3" ]; then | |
#echo "File not found: ${FILE%.webm}.mp3" | |
echo -e "Processing video '\e[32m$FILE\e[0m'"; | |
ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3"; | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment