FFMPEG unsupported codec id=86018

September 28th, 2007

My current major project could be described as a YouTube for music. The application allows users to upload audio and video tracks, which are converted to FLV format using FFMPEG for displaying in a Flash media player.

One problem that appeared very quickly after inviting some test users onto the site is that user want to upload their music in 2 main formats – mp3 and m4a. I noticed that m4a / AAC encoded audio tracks were failing to convert, with FFMPEG giving the “unsupported codec” message that is the title of this post. This wasn’t really too surprising as I’d only configured FFMPEG with LAME mp3 support, so after reading the doco it seemed all I needed to do was reconfigure with faac and faad2 support, recompile/install, and the jobs done:

1) Download and install the faac / faad packages (including dev packages) as needed
2) Reconfigure ffmpeg using ./configure --enable-gpl --enable-libfaac --enable-libfaad --enable-libmp3lame
3) Compile and install using make && sudo make install

Well, I did all this I was surprised to find that it didn’t work – I was still getting the same error message as before. A bit of Googling found that I wasn’t alone in the problem, and many others have had the same issue. The solution is actually rather simple, but not obvious to anyone that’s not involved in Linux / C development (like me):

Before reconfiguring, type make distclean. That’s all. It clears out any compiled object files and forces a complete recompile after configuring make (someone correct me if I’m wrong on that).

If anyone actually reads this blog entry and would find it useful, let me know and I’ll publish a noobs guide to getting ffmpeg compiled and working.

18 Responses to “FFMPEG unsupported codec id=86018”

  1. ChristianB Says:

    I found it very useful and it solved my very same problem.

    Thanks

  2. marco Says:

    Perfect.

    thanxs a lot.

    mARCO from Italy

  3. Coder Says:

    VERY HELPFUL SIR. Been looking for this solution for awhile.

  4. David Says:

    I would love a noob tutorial!

  5. Schoolsonweb Says:

    Great work and knowledge u have shared rob here !!!!!!!!!

  6. Schoolsonweb Says:

    wget http://prdownloads.sourceforge.net/faac/faad2-2.0.tar.gz?download
    wget http://prdownloads.sourceforge.net/faac/faac-1.24.tar.gz?download

    4) Verify that you have these components are installed
    rpm -qa automake
    rpm -qa autoconf
    rpm -qa libtool
    rpm -qa m4
    rpm -qa gcc-c++

    If any are missing than simply yum install (packagename), if you dont have a package manager than get one, it will save you alot of time
    and headaches.

    Installing Faac
    5)tar -zxvf faac-1.24.tar.gz && cd faac
    6) sh bootstrap
    7) ./configure
    8) make
    9) make install
    10) cd ..

    Installing Faad2
    11) tar -zxvf faad2-2.0.tar.gz
    12) cd faad2 && less README.linux
    13) There is 2 bugs with this package, so need to manually edit these files
    14) nano Makefile.am
    Edit the file to look like this
    SUBDIRS = libfaad common frontend plugins
    EXTRA_DIST = faad2.spec

    15) cd common/mp4ff && nano mp4ffint.h
    16) Comment out this line
    //void mp4ff_track_add(mp4ff_t *f);

    17)Save file and cd ../..
    18)autoreconf -vif
    19) ./configure
    20) make
    21) make install

    Installing Libogg and Libvorbis
    22)cd .. and then Check to see if libogg and libvorbs
    rpm -qa libogg-devel
    rpm -qa libvorbis-devel
    rpm -qa libncurses-devel

    If not installed then simply Package Install (replace yum and install settings with your package manager)
    yum install libogg-devel
    yum install libvorbis-devel
    yum install libncurses-devel

    Installing LAME (for audio)
    23)go into lame sourceforge – http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309
    24)wget http://mesh.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
    25)tar -zxvf lame-3.97.tar.gz
    26)cd lame*
    27) ./configure; make;make install

    Installing Xvid
    28) cd .. && wget http://downloads.xvid.org/downloads/xvidcore-1.1.2.tar.gz
    29)tar -zxvf xvidcore-1.1.2.tar.gz && cd xvid*/build/generic/
    30) ./configure; make; make install;
    31) cd ../../..

    Installing ffmpeg
    32) rpm -q subversion If not install, then install subversion
    33)svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg && cd ffmpeg
    34) ./configure –enable-shared –enable-xvid –enable-vorbis –enable-libogg –enable-mp3lame –enable-gpl –enable-faad –enable-faac –enable-a52
    35)make
    36)make install

    If Installation went ok, run
    ldd ./ffmpeg
    If Path to Lib Libraries are not ok

    37)Check to see if /usr/local/lib exists on this file
    cat /etc/ld.so.conf

    If not
    echo /usr/local/lib >>/etc/ld.so.conf

    38) cat/etc/ld.so.conf Now check to see if (/usr/local/lib exist)
    39) save file
    40) ldconfig
    41) run ldd ./ffmpeg

    FFmpeg should be complete and installed. On some servers you may need to add Disable Shared and enable flags.

  7. Dave Says:

    You are the man. I was up all night trying to do more or less the same thing.

  8. Mark Says:

    Same problem … from an experienced C++ programmer (of 10 years). Many thanks :)

  9. Aaron Says:

    When I type yum install libncurses-devel I get the error: No Match for argument: libncurses-devel.

    I downloaded ncurses, extracted, and installed it (in root) but still no luck….

  10. Paulino Says:

    Thanx a lot Rob, very useful

  11. Matt Says:

    Very useful! You da man. Thank you thank you.

  12. aapee Says:

    Thanks, great instructions. I’ve been trying to find solution for this for days…

    I’m still in the process of compiling the stuff but already found a couple of bugs:

    - make for faad2 fails because of missing separator in the end of the Makefile. Can be solved by commenting out the rpm entry
    - config options for ffmpeg are non-existing:

    ./configure –enable-shared –enable-libxvid –enable-vorbis –enable-libogg –enable-mp3lame –enable-gpl –enable-faad –enable-faac –enable-a52
    Unknown option “–enable-vorbis”.
    See ./configure –help for available options.

    maybe it should be –enable-libxvid?

    Cheers,

    AP

  13. Sanjeev Says:

    Hi,

    I have build XVid from latest source code and FFMPEG as well.

    My question is how to statically build FFMPEG with XVid (XVid compiled
    in shared DLL and libs)

    When build FFMPEG using –enable-libxvid it compiles properly but,
    fails when tried to convert MP4 to FLV saying:

    Unsupported codec (id=86018) for input stream #0.0

    I have tried all options distclean and make clean etc..

    Any help appreciated.

    Thanks,
    Sanjeev

  14. RRP Says:

    Hi Sanjeev,

    Sorry for the late reply, and hope you’ve found a solution to your problem already.

    If not, your problem isn’t with XVid, but with the MP4 input file. FFMPEG is telling you that it doesn’t have a codec for MP4 files. Try compiling with all the options mentioned in Aapee’s post (–enable-shared –enable-libxvid –enable-vorbis –enable-libogg –enable-mp3lame –enable-gpl –enable-faad –enable-faac –enable-a52) and see if that solves your problem.

    Cheers,
    RRP

  15. zaan Says:

    Hi,

    I have been trying to figure this out for days, I am not a programmer, and I have been trying to figure out how to get ffmpeg
    working with my tv recordings for streaming to my tv. The problem is in New Zealand the audio channel is he-aac (or mp4a) and the
    standard ffmpeg does not know what to do with the audio so it does not stream. I have dont know how to compile or add to ffmpeg,
    and I have tried, it is very frustrating when one does not know where to start. This is the only post I have found, and I have looked allot,
    that seems to have the answer. Is there any way someone could send me a link to a compiled ffmpeg that is working with mp4a.

    Please and thank you,

    Zaan

  16. Shahzad Says:

    I got stuck at FFMPEG configuration. I am getting this error

    Unknown option “–enable-libogg”.
    See ./configure –help for available options.

    Can anyone help me?

  17. RRP Says:

    Shahzad – did you type “./configure –help”? If you do so, you’ll see a list of external libraries, and the switches required to enable them. The switch “–enable-libogg” is not present in this list, hence you’re getting the error. (I presume Ogg support is built in?)

  18. $ Says:

    Nice staying going to your website just as before, it’s been months to do. Perfectly this kind of subject material of which ive already been anxiously waited with regard to so very long. I need this specific write-up to help in depth this work within college, and it has exact same matter jointly with your post. Thanks, beneficial discuss.