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

AID: 2592
  • Status: Published

4880 points

  • Byabutbul
  • TypeTips/Tricks
  • Posted on2010-03-03 at 02:25:25
This is the error message I got
[libmp3lame @ 0x95c0090]lame: output buffer too small (buffer index: 9404, free bytes: 388)
Audio encoding failed
                                    
1:
2:

Select allOpen 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  
                                    
1:
2:

Select allOpen in new window



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

Select allOpen in new window



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

Select allOpen in new window



4. Go into the extracted directory
cd lame-398
                                    
1:

Select allOpen in new window



5. and build!
./configure  
make  
make install  
                                    
1:
2:
3:

Select allOpen 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
                                    
1:

Select allOpen 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
                                    
1:
2:

Select allOpen 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
                                    
1:
2:

Select allOpen in new window



And voila!
Asked On
2010-03-03 at 02:25:25ID2592
Tags

centos

,

linux

,

ffmpeg

,

libmp3lame

,

video encoding

,

64bit

Topic

Linux

Views
4218

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Linux Experts

  1. arnold

    331,375

    Wizard

    750 points yesterday

    Profile
    Rank: Genius
  2. woolmilkporc

    279,119

    Guru

    2,668 points yesterday

    Profile
    Rank: Genius
  3. farzanj

    132,548

    Master

    0 points yesterday

    Profile
    Rank: Genius
  4. KeremE

    109,627

    Master

    0 points yesterday

    Profile
    Rank: Genius
  5. duncan_roe

    105,116

    Master

    0 points yesterday

    Profile
    Rank: Genius
  6. hanccocka

    99,734

    Master

    1,500 points yesterday

    Profile
    Rank: Genius
  7. legolasthehansy

    74,904

    Master

    0 points yesterday

    Profile
    Rank: Guru
  8. xterm

    65,407

    Master

    0 points yesterday

    Profile
    Rank: Sage
  9. Papertrip

    59,708

    Master

    0 points yesterday

    Profile
    Rank: Sage
  10. DaveBaldwin

    55,260

    Master

    0 points yesterday

    Profile
    Rank: Genius
  11. TobiasHolm

    46,700

    0 points yesterday

    Profile
    Rank: Sage
  12. rindi

    43,404

    0 points yesterday

    Profile
    Rank: Savant
  13. ahoffmann

    41,621

    0 points yesterday

    Profile
    Rank: Genius
  14. noci

    40,754

    0 points yesterday

    Profile
    Rank: Genius
  15. gerwinjansen

    38,789

    0 points yesterday

    Profile
    Rank: Sage
  16. Darr247

    38,657

    0 points yesterday

    Profile
    Rank: Genius
  17. chandranjoy

    36,828

    0 points yesterday

    Profile
    Rank: Master
  18. torakeshb

    33,696

    0 points yesterday

    Profile
    Rank: Master
  19. pfrancois

    33,520

    0 points yesterday

    Profile
    Rank: Guru
  20. un1x86

    30,652

    0 points yesterday

    Profile
    Rank: Master
  21. maeltar

    30,550

    0 points yesterday

    Profile
    Rank: Guru
  22. ozo

    24,100

    0 points yesterday

    Profile
    Rank: Savant
  23. jgiordano

    23,700

    0 points yesterday

    Profile
    Rank: Guru
  24. for_yan

    23,600

    1,000 points yesterday

    Profile
    Rank: Genius
  25. bummerlord

    23,300

    0 points yesterday

    Profile
    Rank: Master

Hall Of Fame