ffmpeg
accepts multiple output formats. Set the input file.format with -i
followed by the output file.format: ffmpeg -i input.wav output.ogg output.mp3 output.flac
Batch conversion:
As a simple one liner with putting each format in a separate folder:
mkdir mp3 ogg flac; for i in *.wav; do ffmpeg -i "$i" -b:a 320000 "./mp3/${i%.*}.mp3" -b:a 320000 "./ogg/${i%.*}.ogg" "./flac/${i%.*}.flac"; done
Decode all into one folder:
for i in *.wav; do ffmpeg -i "$i" -b:a 320000 "${i%.*}.mp3" -b:a 320000 "${i%.*}.ogg" "${i%.*}.flac"; done
-b:a 320000
sets the bitrate for the decoding of mp3
and ogg
and can be adjusted (the bitrate is measured in bits/sec so 320kbit/s
equals 320000
).
thanks to https://stackoverflow.com/a/33766147 for the parameter-expansion