ffmpeg does not compile. Every time there is an error no matter what I do. I installed clean 12.04, followed the tutorial on ffmpeg website, but it is still not working.

If its not libfdk-aac error, it's libx246 error.

Can someone please help?

I just tried to follow another tutorial and it complaints about libfdk-aac. I have it installed, multiverse reps are done too, it's all there. If I remove --enable-libfdk-aac from ffmpeg ./configure, then it complaints about libx264. I installed libx264-dev and it works but eventually comes with failed error mentioning x264:

libavcodec/libx264.c:552: error: undefined reference to 'x264_encoder_open_130' collect2: ld returned 1 exit status make: *** [ffmpeg_g] Error 1 
  • Try my answer for this question, where I give some tips on compiling ffmpeg while referring to the official guide. I have compiled it several times on 12.04. You must remove any existing related packages and install the build dependencies (as noted on the guide), then compile the various components in order (i.e. x264, etc before ffmpeg, which should be last of all). – user76204 Mar 8 '13 at 18:47
  • Hi. I really appreciate your effort to reply to my question. Unfortunately i have yet again followed exactly what you said and the error is still the same when i try to ./configure ffmpeg ERROR: libfdk_aac not found. I have libfsk_aac installed, multiverse repos are enabled too. What am i doing wrong? This is a fresh Server 12.04 install. – Andrej Mar 9 '13 at 2:43
  • I'm not sure really: the build dependencies are slightly different for server, did you install those and not the desktop ones? I'll do a fresh compile and see if I get any errors. – user76204 Mar 11 '13 at 0:07
  • I have installed a fresh 12.04 this morning and this time before i did anything, i followed the tutorial and it worked! So something that i have done before must have created a problem. Anyway, now I have another problem with using FFMPEG through Clip-Bucket script, but its not relevant for this thread. I do appreciate your effort on this, thank you! – Andrej Mar 11 '13 at 5:38
  • 1
    The undefined reference error most likely indicates that you have two versions of x264.h installed (the bad one is probably from libx264-dev) resulting in broken builds. – llogan Mar 13 '13 at 22:09

We solved the problems after various discussions in the comments where I linked to my detailed guide, which also references the official ffmpeg guide.

Andrej's system was Ubuntu 12.04 server.

It is only possible to list some general points below, as there was no one single issue that was the problem in the failed compilation attempts:

  • Firstly, it is necessary to remove any existing packages with

    sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev

    so that possible conflicts are avoided when trying to compile ffmpeg and its libraries later.

  • In the official ffmpeg guide the dependencies are slightly different for desktop and server, and there are also several notes throughout the guide that should be followed if installing on a server. The sets of build dependencies for desktop and server are listed in the official guide.
  • One thing Andrej mentioned was that he had got dependencies such as libx264-dev, but actually that is one of the things that should be removed (as in the first command above). If you want x264 support or aac support, etc, you must compile x264, fdk-aac, libvpx and opus before you build ffmpeg. Compiling ffmpeg should be the last thing done; you should not download the build dependencies and then begin compiling ffmpeg as you need to compile several libraries yourself if you want the various support for certain audio/video types.
  • If it is proving problematic to compile certain libraries or build ffmpeg with support for them, you should be able to edit the ffmpeg ./configure line in the guide; e.g. to remove an --enable-libxxx line. Conversely, for opus support, you need to add --enable-libopus. I was about to suggest further tweaking the ./configure line, when Andrej solved his problem, but it is useful to remember this for future builds if problems occur.

  • For more details on compiling ffmpeg and possible problems that can arise, see my detailed answer for this question.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.