0

I'm trying to convert AAC to MP3 on a Pi using ffmpeg. This is my command:

ffmpeg -i audio.aac -acodec mp3 -ac 2 -ab 160 audio.mp3

It works fine on my Ubuntu machine. But on my Pi it states this:

Unknown encoder 'mp3'

I've made sure that liblame and lame are both installed. So that's there. I also have libavcodec53 installed. But still no go.

EDIT:

I have run:

ffmpeg -codecs | grep mp3

This is what I get:

ffmpeg version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2000-2013 the Libav developers
  built on Mar 31 2013 13:58:10 with gcc 4.6.3
  EA    libmp3lame      libmp3lame MP3 (MPEG audio layer 3)
 D A D  mp3             MP3 (MPEG audio layer 3)
 D A D  mp3adu          ADU (Application Data Unit) MP3 (MPEG audio layer 3)
 D A D  mp3adufloat     ADU (Application Data Unit) MP3 (MPEG audio layer 3)
 D A D  mp3float        MP3 (MPEG audio layer 3)
 D A D  mp3on4          MP3onMP4
 D A D  mp3on4float     MP3onMP4
1

Getting codec list of currently installed encoders:

ffmpeg -codecs | grep mp3

This outputs the list of available codecs:

ffmpeg version 0.8.6-6:0.8.6-1+rpi1, Copyright (c) 2000-2013 the Libav developers
  built on Mar 31 2013 13:58:10 with gcc 4.6.3
  EA    libmp3lame      libmp3lame MP3 (MPEG audio layer 3)
 D A D  mp3             MP3 (MPEG audio layer 3)
 D A D  mp3adu          ADU (Application Data Unit) MP3 (MPEG audio layer 3)
 D A D  mp3adufloat     ADU (Application Data Unit) MP3 (MPEG audio layer 3)
 D A D  mp3float        MP3 (MPEG audio layer 3)
 D A D  mp3on4          MP3onMP4
 D A D  mp3on4float     MP3onMP4

Running ffmpeg with another codec selected from the codec list:

ffmpeg -i audio.aac -acodec libmp3lame -ac 2 -ab 160 audio.mp3
1

Check what encoders were built into your build of ffmpeg.

It's not simply a matter of having libraries installed, ffmpeg must have been built to use those libraries and associate them with a given encoder.

More than likely, your build on the Raspberry Pi was not built with an mp3 encoder but your Ubuntu build was. You can check what encoders are available using the command:

ffmpeg -encoders

If you don't see anything there with mp3 in the second column, then your ffmpeg wasn't built with mp3 encoder support - at least not using -acodec mp3.

You can try looking through all the included encoders. There may be another name associated with some MP# encoder, but more than likely you will either need to obtain a build of ffmpeg for your pi that can use liblame or you will have to build it yourself with lame support enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.