I have wav audio files that have stereo channels. I have to convert them to mp3 with mono channel and 64k bit rate.
For individual file, I can simply do
ffmpeg -i input1.wav -ac 1 -ar 44100 -b:a 64k output1.mp3
But I have to batch convert files. One simple way is to create a bash script that passes input files to ffmpeg
one by one.
I need to do batch conversion using map
feature.
ffmpeg -i input1.wav -i input2.wav -map 0:0 output1.mp3 -map 1:0 output2.mp3
This too works fine. But it does not let me specify -ac 1 -ar 44100 -b:a 64k
. If I do
ffmpeg -i input1.wav -i input2.wav -ac 1 -ar 44100 -b:a 64k ...
Then only first file input1.wav
gets mono channel and 64k bit rate. Subsequent files stay stereo.
How do I tell ffmpeg
to use -ac 1 -ar 44100 -b:a 64k
for the audio streams when using map
option?