0

I'm facing the problem that I cant convert MP4 Videos to MP3 with FFMPEG. Every time I try it, I get this error:

Unknown encoder 'libmp3lame'

But I installed FFMPEG and LAME with the flags: --enable-libmp3lame

So when I'm running: ffmpeg -codecs help | grep 'mp3' in the console I see that the Flags are set but in the list there is still no libmp3lame like it should be:

ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --enable-libmp3lame --extra-ldflags=-L/var/www/html/Plugins/apps/lib/ --extra-cflags=-I/var/www/html/Plugins/apps/include/
WARNING: library configuration mismatch
avutil      configuration: --prefix=/var/www/html/Plugins/apps/ --enable-shared
avcodec     configuration: --prefix=/var/www/html/Plugins/apps/ --enable-shared
avformat    configuration: --prefix=/var/www/html/Plugins/apps/ --enable-shared
avdevice    configuration: --prefix=/var/www/html/Plugins/apps/ --enable-shared
avfilter    configuration: --prefix=/var/www/html/Plugins/apps/ --enable-shared
swscale     configuration: --prefix=/var/www/html/Plugins/apps/ --enable-shared
swresample  configuration: --prefix=/var/www/html/Plugins/apps/ --enable-shared
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
//HERE SHOULD BE LIBMP3LAME
D.A.L. mp3                  MP3 (MPEG audio layer 3) (decoders: mp3 mp3float )
D.A.L. mp3adu               ADU (Application Data Unit) MP3 (MPEG audio layer 3) (decoders: mp3adu mp3adufloat )
D.A.L. mp3on4 

As someone metioned in this Ubuntu Thread

lame packages won't add mp3 encoding to FFmpeg

So how can I install libmp3lame on Debian so FFMPEG can use it?

Also I already tried to install libmp3lame0 from Debian Packages but that also didnt change anything.

7
  • How did you compile / install FFmpeg? – andrew.46 Sep 27 '17 at 12:55
  • Both Ubuntu & Debian's ffmpeg packages (libavcodec*) have mp3 encoding thru libmp3lame enabled so what ffmpeg are you using? If self built you didn't enable it. – doug Sep 27 '17 at 12:56
  • @andrew.46 with this tutorial (sorry its german, but you can get how I did it with the command lines provided): df.eu/forum/threads/… – user741531 Sep 27 '17 at 12:59
  • @doug look at my comment above – user741531 Sep 27 '17 at 12:59
  • 2
    If I could read german maybe there would be some good reason for such a deficient configure. If I were you I'd cd back to your ffmpeg source & run sudo make uninstall to hopefully get rid of it. Either follow this guide trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu or if on 16.04 consider this ppa - launchpad.net/~mc3man/+archive/ubuntu/xerus-media or if on 16.04 > 17.04 you could just use the Ubuntu repo's ffmpeg.. – doug Sep 27 '17 at 15:36
0

Perhaps your build is broken. Try uninstalling and then installing it using the following method

First install dpendencies

 sudo apt-get update
 sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
  libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
  libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev

Now make a directory for the source files that will be downloaded later

mkdir ~/ffmpeg_sources

Now install this assembler for x86 optimizations used by x264 and FFmpeg

cd ~/ffmpeg_sources
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install

Then install libmp3lame

cd ~/ffmpeg_sources
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared
make
make install

Then install ffmpeg

cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libass \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-nonfree
PATH="$HOME/bin:$PATH" make
make install
hash -r

You may have to restart your device as it sometimes doesn't work otherwise. After installing go to the directory ~/bin

cd ~/bin

then in that directory try to run your command for eg.

./ffmpeg -i ~/input.mp4 ~/videos/output.mkv

PS:In your question where you've mentioned

//HERE SHOULD BE LIBMP3LAME

libmp3lame will not be there, rather it will be mentioned in the configuration as

configuration: --enable-libmp3lame

Do let me know if it works or not. :)

4
  • uinstalled ffmpeg and lame (I got 2 ffmpeg installations on my PC I dont know why) after that I installed ffmpeg normal like you explained but only with the flags --enable-libmp3lime. and it all worked by itselfe! Maybe you should add in the end that you have to restart you server because I need to do that in order to get ffmpeg to work after install :) – user741531 Oct 2 '17 at 6:25
  • Glad it worked, and i've also mentioned for the restarting of the device. – Sankalp Gupta Oct 2 '17 at 6:33
  • Looks like you got most of this from FFmpeg Wiki: Ubuntu Compile Guide. – llogan Oct 2 '17 at 19:20
  • He explained it much better and a lot easier to understand however. – user741531 Oct 3 '17 at 8:23

Your Answer

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