Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Bash script to convert all *flac to *.mp3 with FFmpeg?

This is what I've tried, but not works:
# change to the home directory
cd ~/music
# convert all .flac files
ffmpeg -i *.flac -acodec libmp3lame
.mp3
# (optional: check whether there are any errors printed on the terminal)
sleep 60


How to get my goal?
by

1 Answer

Amit8z4mc
Try this:
for i in *.flac ; do 
ffmpeg -i "$i" -acodec libmp3lame "$(basename "${i/.flac}")".mp3
sleep 60
done

Login / Signup to Answer the Question.