Friday 3 August 2018

ffmpeg - Unknown encoder 'libmp3lame' in Ubuntu 14.04


I'm running Ubuntu 14.04.1 LTS. The question looks like this Unknown encoder 'libmp3lame', but I followed everything there and installed every package they mentioned but still I am getting the error.


I am trying to convert FLAC to MP3 using ffmpeg, with below command:


ffmpeg -i hang_drum.flac -acodec libmp3lame destination_path.mp3

Error:


ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Sep 5 2014 17:58:33 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration:
libavutil 52. 92.100 / 52. 92.100
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 48.100 / 55. 48.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.100 / 4. 11.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
Input #0, flac, from 'hang_drum.flac':
Metadata:
TSS : Logic 10.0.6
ENCODER : Lavf55.44.100
Duration: 00:02:36.06, start: 0.000000, bitrate: 627 kb/s
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16

I tried:



  • sudo apt-get install ffmpeg libavcodec-extra-53

  • sudo apt-get install ffmpeg libavcodec-extra-54

  • sudo apt-get install libmp3lame0

  • sudo apt-get install libav-tools:i386

  • sudo apt-get install ffmpeg libav-tools


After running these, I'm still getting the same error libmp3lame. What am I missing here?



Answer



Ubuntu does not officially bundle ffmpeg after ditching it in favor of the Libav fork. There is a PPA that is quite outdated, so it should not be used unless you're keen on running an old version of ffmpeg.


I honestly have to confess that I don't know why it won't work for your specific case—or how you got an ffmpeg running in the first place, since Ubuntu does not bundle it officially.


Here are two solutions that should always work though:


Use a static build


A quick solution would be to simply download a recent static build (scroll down where it says Linux Static Builds). These all have libmp3lame bundled. Extract that build to some location, and copy ffmpeg to a directory in your PATH, e.g.:


cd ~/Downloads
tar xvf ffmpeg-*.tar.xz
cd !$
sudo mkdir -p /usr/local/bin
sudo cp ./ffmpeg ./ffprobe /usr/local/bin/
sudo chmod ugo+x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe

Also make sure that /usr/local/bin is in your shell PATH.


Compile from source


This will also give you the latest version with all extras you want. Follow the always up-to-date guide on the FFmpeg wiki. It'll take a bit longer, but gives you more configuration options, and access to other encoders, such as libfdk_aac, which cannot be statically bundled due to licensing reasons.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...