ffmpeg doesn't work with hardy FAAD library

Bug #225060 reported by Rob Petti
24
Affects Status Importance Assigned to Milestone
Medibuntu
Invalid
Undecided
Unassigned
Hardy
Fix Released
Medium
Lionel Le Folgoc

Bug Description

I'm currently running hardy with the medibuntu packages installed, and the medibuntu ffmpeg seems to have trouble dynamically linking to the FAAD library provided by the ubuntu repos. Curiously, it only seems to be ffmpeg that suffers from this, mplayer works fine.

$ ffmpeg -i test.mkv -ab 128 -acodec mp3 test-audio.mp33 $1-audio.mp3
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
  libavutil version: 1d.49.3.0
  libavcodec version: 1d.51.38.0
  libavformat version: 1d.51.10.0
  built on Mar 23 2008 22:28:54, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu6)
[matroska @ 0xb7ed1110]Ignoring seekhead entry for ID=0x1549a966
[matroska @ 0xb7ed1110]Ignoring seekhead entry for ID=0x1654ae6b
[matroska @ 0xb7ed1110]Ignoring seekhead entry for ID=0x114d9b74
[matroska @ 0xb7ed1110]Ignoring seekhead entry for ID=0x1043a770
[matroska @ 0xb7ed1110]Ignoring seekhead entry for ID=0x1941a469
[matroska @ 0xb7ed1110]Unknown entry 0x73a4 in info header
[matroska @ 0xb7ed1110]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x55aa - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x23314f - ignoring
[matroska @ 0xb7ed1110]Unknown track header entry 0x55ee - ignoring
[matroska @ 0xb7ed1110]Unknown matroska file header ID 0x1941a469
[matroska @ 0xb7ed1110]Unknown matroska file header ID 0x1043a770
Input #0, matroska, from 'test.mkv':
  Duration: 00:23:59.9, bitrate: N/A
  Stream #0.0: Video: h264, yuv420p, 640x480, 23.98 fps(r)
  Stream #0.1: Audio: aac, 44100 Hz, stereo
Output #0, mp3, to 'test-audio.mp3':
  Stream #0.0: Audio: mp3, 44100 Hz, stereo, 0 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
[aac @ 0xb7ddf9a8]FAAD library: cannot resolve faacDecGetErrorMessage in libfaad.so.0!
Error while opening codec for input stream #0.1

Revision history for this message
ababichev (ababichev) wrote :

But it works with faac/faad libraries from Ubuntu 7.10.
On box with Ubuntu 7.10 for h264/aac video clip I have:

~/Videos$ ffmpeg -i foxxy-sports.m4v
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
  libavutil version: 1d.49.3.0
  libavcodec version: 1d.51.38.0
  libavformat version: 1d.51.10.0
  built on Dec 20 2007 21:25:50, gcc: 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'foxxy-sports.m4v':
  Duration: 00:01:45.1, start: 0.000000, bitrate: 1605 kb/s
  Stream #0.0(eng): Audio: aac, 44100 Hz, stereo
  Stream #0.1(eng): Video: h264, yuv420p, 640x480, 29.97 fps(r)
Must supply at least one output file

On box with Ubuntu 8.04 for the same clip:

ffmpeg -i foxxy-sports.m4v
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
  libavutil version: 1d.49.3.0
  libavcodec version: 1d.51.38.0
  libavformat version: 1d.51.10.0
  built on Mar 23 2008 22:28:54, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu6)
[aac @ 0xb7eae9a8]FAAD library: cannot resolve faacDecGetErrorMessage in libfaad.so.0!
[aac @ 0xb7eae9a8]FAAD library: cannot resolve faacDecGetErrorMessage in libfaad.so.0!
[aac @ 0xb7eae9a8]FAAD library: cannot resolve faacDecGetErrorMessage in libfaad.so.0!
...
[aac @ 0xb7eae9a8]FAAD library: cannot resolve faacDecGetErrorMessage in libfaad.so.0!
[aac @ 0xb7eae9a8]FAAD library: cannot resolve faacDecGetErrorMessage in libfaad.so.0!
[aac @ 0xb7eae9a8]FAAD library: cannot resolve faacDecGetErrorMessage in libfaad.so.0!
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'foxxy-sports.m4v':
  Duration: 00:01:45.1, start: 0.000000, bitrate: 1605 kb/s
  Stream #0.0(eng): Audio: aac
  Stream #0.1(eng): Video: h264, yuv420p, 640x480, 29.97 fps(r)
Must supply at least one output file

The difference that Ubuntu 8.04 uses more recent faac lib 1.26-0 instead of 1.24clean one.
If you link ffmpeg against old 1.24 version (i'e' install it to /usr/local/lib and use LD_LIBRARY_PATH=/usr/local/lib),
then no more complains and aac codec works again.

Unfortunately, mediabuntu ffmpeg source code very old (at least 1 year) and should be updated.
In attachment I briefly described 'fast and dirty' solution to fix a problem until new package arrives.

Revision history for this message
Rob Petti (rob-petti) wrote : Re: [Bug 225060] Re: ffmpeg doesn't work with hardy FAAD library
  • unnamed Edit (133 bytes, text/html; charset=ISO-8859-1)

Awesome! Thanks, it worked great. It's too bad that both medubuntu and
ubuntu both use such an outdated source for ffmpeg...

Revision history for this message
unggnu (unggnu) wrote :

The problem still appears in current Medibuntu. One of the main reasons for me to use Medibuntu is to get ffmpeg with faad working.

Revision history for this message
Richard Laager (rlaager) wrote :

See this thread for an explanation of this:
http://lists.freebsd.org/pipermail/freebsd-multimedia/2007-April/006332.html

Here's a snippet:
 (The dfaac() macro in libavcodec/faad.c
 uses "faacDec" ## a to put symbols together
 to get, e.g. faacDecGetErrorMessage, into
 strings, which it then looks up in the shared
 library with dlsym(), which never gives the
 "compatability API" a chance to get in the
 middle).

Revision history for this message
Javisan (javisan60) wrote :

Alexander, first of all thank you for posting a solution for the FAAD library bug, I have followed the instructions in the file you have left. and have the following result, after testing the links,
javier@javier-desktop-2:~/ffmpeg-export-2008-05-13$ ldd /usr/local/bin/ffmpeg
 linux-gate.so.1 => (0xb7fd4000)
 libavdevice.so.52 => not found
 libavformat.so.52 => not found
 libavcodec.so.51 => not found
 libavutil.so.49 => not found
 libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7f9b000)
 libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7f83000)
 libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e34000)
 /lib/ld-linux.so.2 (0xb7fd5000)
javier@javier-desktop-2:~/ffmpeg-export-2008-05-13$ ffmpeg
ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

As may you note, I have little time in Linux, so the problem is I have no idea what to do to redirect FFMPEG to the libraries not found.

Also when I have placed the command: /configure --enable-liba52 --enable-liba52bin --enable-libamr_nb --enable-libamr_wb................

It has informed that: enable-libamr_nb --enable-libamr_wb was not possible

Any help is appreciated.

Javier
Guatemala
Using Ubuntu 8 months ago, just updated to Hardy and loosed ffmpeg due to Faad bug

Revision history for this message
Javisan (javisan60) wrote :

Alexander, I am including the error that ./configure gives with the libamrnb, if I delete --enable libamr_nb then the error goes to --enable libamr_wb.

javier@javier-desktop-2:~/ffmpeg-export-2008-05-13$ ./configure --enable-liba52 --enable-liba52bin --enable-libamr_nb --enable-libamr_wb --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libdc1394 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libxvid --enable-libx264 --enable-gpl --enable-postproc --enable-shared --enable-pthreads --enable-static --disable-vhook --disable-debug --enable-nonfree --cpu=i686 --prefix=/usr/local --extra-cflags=-I/usr/include --extra-ldflags=-L/usr/lib
ERROR: libamrnb not found
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
<email address hidden> mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

I have included the file config.err, but I do not know if it is usefull for you.

Revision history for this message
ababichev (ababichev) wrote :

You can check that your ffmpeg is ok by adding LD_LIBRARY_PATH:
LD_LIBRARY_PATH=/usr/local/lib ldd /usr/local/bin/ffmpeg

But better to set up the correct links for the shared binaries and rebuild the cache by running command
sudo /sbin/ldconfig -v

You need to install AMR NB and WB development libraries (I assume that codecs libamrb3 and libamrwb3 already installed):
sudo apt-get install libamrnb-dev libamrwb-dev

After that options "enable-libamr_nb" and "enable-libamr_wb" should work.

Revision history for this message
Javisan (javisan60) wrote :

Thank you, Alexander, it worked nicely.
I have corrected the links as you instructed and also installed correctly the libamrnb-dev libamrwb-dev lib's
enabled the options as required
compiled
And, thank you again, I have back my ffmpeg............!

Regards

Javier
Guatemala

Revision history for this message
unggnu (unggnu) wrote :

Is there a reason why the fix/recompiled version doesn't get into Medibuntu so no one needs to compile it?

Revision history for this message
coolhandpete (peterpolidoro) wrote :

Thanks for posting this solution, it is really appreciated. I am getting an error, however, when I follow your instructions and try to make the latest ffmpeg snapshot:

libavcodec/libx264.c: In function ‘X264_init’:
libavcodec/libx264.c:224: error: ‘X264_ME_TESA’ undeclared (first use in this function)
libavcodec/libx264.c:224: error: (Each undeclared identifier is reported only once
libavcodec/libx264.c:224: error: for each function it appears in.)
libavcodec/libx264.c:256: warning: assignment discards qualifiers from pointer target type
make: *** [libavcodec/libx264.o] Error 1

Do you this this is a problem with the latest snapshot or with something on my machine? Thanks in advance for any help or advice you can give!

Revision history for this message
ababichev (ababichev) wrote :

The problem with ffmpeg: it's an instantly 'moving' target that has no stable releases, only SVN tree and nightly snapshots :-( For maintainers it's a real pain to provide stable packages like deb, rpm and so on for such kind of projects (no wonder that still no answer from Medibuntu developers).

I've got the same errors when trying compile 'ffmpeg-export-06-16' snapshot, but previous one from '2006-06-03' is fine.
Somewhere between these dates ffmpeg team starts using latest libx264 headers and library incompatible with Ubuntu's libx264-dev library.

The simplest solution here to use snapshot compatible with libx264-dev package (2006-06-03 works for me)

Yet another solution is to rebuild libx264 from sources, if you want use latest ffmpeg snapshot:
Grab daily x264 snapshot from here: ftp://ftp.videolan.org/pub/videolan/x264/snapshots/ (take latest build!)
Unpack and build it by executing the following commands:

bunzip2 < x264-snapshot-2008xxxx-xxxx.tar.bz2 | tar -xf -
cd x264-snapshot-2008xxxx-xxxx
./configure --enable-shared
make
sudo make install

Now you have in /usr/local/include and /usr/local/lib all staff required for ffmpeg compilation, only don't forget to add
--extra-cflags=-I/usr/local/include and --extra-ldflags=-L/usr/local/lib flags:

./configure --enable-liba52 --enable-liba52bin --enable-libamr_nb --enable-libamr_wb \
 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libdc1394 \
 --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libxvid --enable-libx264 \
 --enable-gpl --enable-postproc --enable-shared --enable-pthreads --enable-static \
 --disable-vhook --disable-debug --enable-nonfree --cpu=i686 \
 --prefix=/usr/local
--extra-cflags=-I/usr/local/include --extra-cflags=-I/usr/include \
--extra-ldflags=-L/usr/local/lib --extra-ldflags=-L/usr/lib

After it's done, you can compile ffmpeg smoothly.

Revision history for this message
coolhandpete (peterpolidoro) wrote :

Great, thank you! Is there a command that would allow me to download the 2006-06-03 (or did you mean 2008-06-03?) snapshot rather than the very latest?

Revision history for this message
ababichev (ababichev) wrote :
Revision history for this message
jac0b (jacbrooks) wrote :

I am on x86-64 and I am having the same issue but I followed your instructions but did a couple things different b/c I am on x86-64. I have attached a log on what to and the svn snapshot I used (2008-06-04).

Revision history for this message
jac0b (jacbrooks) wrote :

here is the snapshot

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Unfortunately, we can't take a more recent snapshot for hardy, since it's not api-compatible (and thus it'll require a rebuild of all packages which depend on ffmpeg libs).

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

(Invalid for medibuntu intrepid, since we'll merge a more recent snapshot from ubuntu intrepid.)

Changed in medibuntu:
status: New → Invalid
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Should be fixed with the 3:0.cvs20070307-5ubuntu7+medibuntu1.1 revision.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.