0

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?

1 Answer 1

0

I tried following format and it worked

ffmpeg -i input1.mp3 -i input2.mp3 -ac 1 -ar 44100 -b:a 64k -map 0 output1.mp3 -ac 1 -ar 44100 -b:a 64k -map 1 output1.mp3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .