Fixing "output buffer too small" issue for ffmpeg with libmp3lame

Published:
This is the error message I got
[libmp3lame @ 0x95c0090]lame: output buffer too small (buffer index: 9404, free bytes: 388)
                      Audio encoding failed

Open in new window


Error caused by incompatible libmp3lame 3.98-2 with ffmpeg
I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98"

Thing is, in most updated distros' repositories, you will not find these 'outdated' versions.
I've done it on CentOS 5.4, it should not be too far away from this explination in any other distro.

1. we remove version 3.98.2
rpm -e --nodeps lame  
                      rpm -e --nodeps lame-devel  

Open in new window


2. download the required version of libmp3lame
wget http://downloads.sourceforge.net/lame/lame-398.tar.gz   

Open in new window


3. Extract:
tar xvvzf lame-398.tar.gz

Open in new window


4. Go into the extracted directory
cd lame-398

Open in new window


5. and build!
./configure  
                      make  
                      make install  

Open in new window


We're almost done now, but if you'll try you'll get the following error message
ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory

Open in new window


let's fix up the proper links for the new library;
for 32bit OS:
cd /usr/local/lib
                      ln -s /usr/local/lib/libmp3lame.so.0.0.0 /usr/lib/libmp3lame.so.0

Open in new window


and for 64bit OS:
cd /usr/local/lib
                      ln -s /usr/local/lib/libmp3lame.so.0.0.0 /usr/lib64/libmp3lame.so.0

Open in new window


And voila!
1
10,500 Views

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.