[FFmpeg-devel] [PATCH] faad2 version 2.5 support, second try

Frank Liu gfrankliu
Sun Oct 7 03:06:44 CEST 2007


Problem:

With faad2 version 2.5 and current ffmpeg, if you use
--enable-libfaadbin when building ffmpeg, the compilation seems to
complete fine, but but when you try to run it, it gives errors:

(You can download the test mp4 from http://timepassindia.com/raj.mp4 )

ffmpeg -i raj.mp4  -ar 22050 -f flv -y test.flv
FFmpeg version SVN-r10671, Copyright (c) 2000-2007 Fabrice Bellard, et al.
 configuration: --enable-libmp3lame --enable-libogg
--enable-libvorbis --enable-libfaad --enable-libfaadbin
--enable-libfaac --enable-gpl
 libavutil version: 49.5.0
 libavcodec version: 51.44.0
 libavformat version: 51.14.0
 built on Oct  5 2007 23:37:18, gcc: 4.1.1 20070105 (Red Hat 4.1.1-52)
[mpeg4aac @ 0x84b60d0]FAAD library: cannot resolve
faacDecGetErrorMessage in libfaad.so.0!
[mpeg4aac @ 0x84b60d0]FAAD library: cannot resolve
faacDecGetErrorMessage in libfaad.so.0!
...
[mpeg4aac @ 0x84b60d0]FAAD library: cannot resolve
faacDecGetErrorMessage in libfaad.so.0!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x840aa74]Could not find codec parameters
(Audio: mpeg4aac)

Seems stream 0 codec frame rate differs from container frame rate:
1000.00 (1000/1) -> 15.00 (15/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'raj.mp4':
 Duration: 00:00:09.5, start: 0.000000, bitrate: 808 kb/s
 Stream #0.0(und): Video: mpeg4, yuv420p, 320x240, 15.00 fps(r)
 Stream #0.1(und): Audio: mpeg4aac
Output #0, flv, to 'test.flv':
 Stream #0.0(und): Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 15.00 fps(c)
 Stream #0.1(und): Audio: libmp3lame, 22050 Hz, mono, 64 kb/s
Stream mapping:
 Stream #0.0 -> #0.0
 Stream #0.1 -> #0.1
[mpeg4aac @ 0x84b60d0]FAAD library: cannot resolve
faacDecGetErrorMessage in libfaad.so.0!
Error while opening codec for input stream #0.1

Solution:

Thanks to several people on this devel list, especially Dominik who
has been with me in the last thread, I come up with a new patch:

--- libavcodec/libfaad.c.orig   2007-10-05 23:31:42.000000000 +0000
+++ libavcodec/libfaad.c        2007-10-07 00:55:44.000000000 +0000
@@ -217,9 +217,15 @@
                 libfaadname, dlerror());
         return -1;
     }
+#if defined(FAAD2_VERSION) && defined(NEAACDECAPI)
+#define dfaac(a, b) \
+    do { static const char* n = "NeAACDec" #a; \
+    if ((s->faacDec ## a = b dlsym( s->handle, n )) == NULL) { err =
n; break; } } while(0)
+#else
 #define dfaac(a, b) \
     do { static const char* n = "faacDec" #a; \
     if ((s->faacDec ## a = b dlsym( s->handle, n )) == NULL) { err =
n; break; } } while(0)
+#endif
     for(;;) {
 #else  /* !CONFIG_LIBFAADBIN */
 #define dfaac(a, b)     s->faacDec ## a = faacDec ## a




More information about the ffmpeg-devel mailing list