1

I am trying to turn and split an audio file into two separate mp3 files with different qualities;

  • One at 128k
  • One at 320k

What I 've come up so far is this:

ffmpeg -i myaudiofile.wav [i1]asplit=2[o1][o2] \
-map [o1] -acodec libmp3lame -ar 48000 -ab 192k -ac 2 win1.mp3 \
-map [o2] -acodec libmp3lame -ar 48000 -ab 320k -ac 2 win2.mp3

Unfortunately this doesn't work. Any ideas?

Thanks in advance.

2
  • "Turn and split"- what does that mean? If you simply need to encode one file into 2 different qualities, consider 2 separate ffmpeg runs on the same file with different encoding parameters.
    – Rajib
    Commented Oct 29, 2014 at 16:07
  • @Rajib By saying "Turn and split" I mean convert the given wav file to mp3 format and then encode it to 2 different qualities. I just need to do it in exactly one pass.
    – stratis
    Commented Oct 29, 2014 at 16:10

2 Answers 2

3

Use this:

ffmpeg -i myaudiofile.wav -filter_complex "asplit=2[o1][o2]" -map [o1] \
-acodec libmp3lame -ar 48000 -ab 192k -ac 2 win1.mp3 -map [o2] -acodec \
libmp3lame -ar 48000 -ab 320k -ac 2 win2.mp3

You need to specify filter or filter-complex and you dont need input pad because it is default and understood.

Also, note that here you are not really "turning it to mp3 and then converting to two different qualities". You are encoding into mp3 into 2 different qualities.

1
  • @Konos5 What would have been wrong with encoding the wav to an mp3 with one quality, and then encoding the same wav to another mp3 with different qualities? And do you realize that that is essentially what the above command does, it just processes the input data in a different order? Commented Aug 15, 2015 at 22:17
1

Split shouldn't be required.

Use

ffmpeg -i myaudiofile.wav \
-map 0:a -acodec libmp3lame -ar 48000 -ab 192k -ac 2 win1.mp3 \
-map 0:a -acodec libmp3lame -ar 48000 -ab 320k -ac 2 win2.mp3

You must log in to answer this question.

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