converting multiple files with avconv...libmp3lame0 not found
Solution 1
You seem to be using the wrong codec name. To see which codecs are supported, do:
avconv -codecs
according to this the codec name is libmp3lame (you have an extra 0). This is on my system however, so yours may be different. The command I gave will let you find out.
Solution 2
In many distros, avconv by default is not built with "--enable-libmp3lame". avconv must be compiled with MP3 support in order to utilize libmp3lame.
My working solution was to download libav from the git repo, and build it myself. This is the configure command line I used:
./configure --enable-libmp3lame --enable-nonfree --enable-gpl --enable-libx264
You can verify MP3 encoding support is or is not built into your avconv with this command line: avconv -codecs
You must see an "E" in the second column of features for MP3 encoding to work:
DEA.L. mp3 MP3 (MPEG audio layer 3) (decoders: mp3 mp3float ) (encoders: libmp3lame )
If the second column is "." MP3 encoding is not built into your avconv: "DEA.L." is good, "D.A.L" is bad.
yung galbanum
Updated on September 18, 2022Comments
-
yung galbanum over 1 year
I have about 20 .webm files that I would like to convert to audio in the terminal. I want to do
avconv -i *.webm -acodec libmp3lame0 -aq 4 *.mp3
I tried:
for i in *.webm; do avconv -i "${i}" -acodec libmp3lame0 -aq 4 "${i%.wemb}.mp3"; done
but it says "libmp3lame0 encoder not found." It is installed, though. I also installed ubuntu-restricted-extras and reinstalled libav-tools.
I also tried
for i in *.webm; do avconv -i "${i}" -acodec -aq 4 "${i%.wemb}.ogg"; done
to remove the whole mp3/LAME aspect, but then it just said '.ogg encoder not found.'
This worked once before when I tried to convert using libmp3lame0 without the for loop...but I just tried to convert one file and it doesn't work anymore.
Thanks. (I'm using 12.10.)
-
gcb over 10 yearsmp3 does not seem to be supported. at least in ubuntu it only shows as
D
ecoding, and not available asE
ncoding. -
David Foerster over 9 yearsOn Ubuntu FFmpeg/avconv is compiled with libmp3lame. You just need to have libmp3lame installed on your system, which is not the default case in Ubuntu.
-
shivams almost 9 yearsThis is the correct solution.