免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2099 | 回复: 0
打印 上一主题 下一主题

faac-1.25 及 faad2-2.5 在CentOS下的编译 ---- for ffmpeg [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-22 18:33 |只看该作者 |倒序浏览

               
faac-1.25 及 faad2-2.5 在CentOS下的编译 ---- for ffmpeg
        最近有个项目,需要ffmpeg的支持,google了一下,找到了张微波的这篇
ffmpeg的编译大全

呵呵,确实讲的比较详细,一步步走下来,直到需要编译faac-1.25 及 faad2-2.5 出现问题。
费尽周折,google了很久,总算找到了解决方式,呵呵,写出来,希望能对有需要的人少走些弯路。
解决问题过程中,参考了以下资料:
faac:
http://yxzmusic.spaces.live.com/?_c11_BlogPart_FullView=1&_c11_BlogPart_blogpart=blogview&_c=BlogPart&partqs=amonth%3D7%26ayear%3D2006
http://d.hatena.ne.jp/paraches/
http://www.audiocoding.com/modules/newbb/viewtopic.php?topic_id=546&forum=3
faad2:
http://wf.xplore.cn/read.php/90.htm (试过之后,发现好像不能解决问题)
faad2-2.5:
错误现象:
[root@TServer faad2]# autoreconf  -ivf
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.in: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.in: installing `./install-sh'
configure.in: installing `./missing'
common/mp4ff/Makefile.am: installing `./compile'
common/mp4ff/Makefile.am: installing `./depcomp'
plugins/Makefile.am:12: required directory plugins/bmp does not exist
plugins/xmms/src/Makefile.am:2: libdir was already defined in condition TRUE, which includes condition HAVE_BMP ...
configure.in:10: ... `libdir' previously defined here
plugins/xmms/src/Makefile.am:8: libdir was already defined in condition TRUE, which includes condition !HAVE_BMP ...
configure.in:10: ... `libdir' previously defined here
Makefile.am: installing `./INSTALL'
autoreconf: automake failed with exit status: 1
解决方案:
google的时候,找到这个:http://wf.xplore.cn/read.php/90.htm
按照说明操作,也没有效果,后来发现,只要把BMP相关的编译条件(一般都是以if-else形式存在的,注意要把整个块都删除)都remove,就OK了。
我的操作如下:
[root@TServer faad2]# cd plugins/
[root@TServer plugins]# grep -lr BMP *
Makefile.am
xmms/src/libmp4.c
xmms/src/Makefile.am
[root@TServer plugins]# vi Makefile.am
if HAVE_MPEG4IP_PLUG
if HAVE_XMMS
SUBDIRS = xmms mpeg4ip
else
SUBDIRS = mpeg4ip
endif #HAVE_XMMS
else
if HAVE_XMMS
SUBDIRS = xmms
else
SUBDIRS =
endif #HAVE_XMMS
endif #HAVE_MPEG4IP_PLUG
~
~
~
~
~
~
~
"Makefile.am" [dos] 13L, 200C 已写入                        
[root@TServer plugins]# grep -lr BMP *
xmms/src/libmp4.c
xmms/src/Makefile.am
[root@TServer plugins]# vi xmms/src/libmp4.c
/*
* MP4/AAC decoder for xmms
*
* OPTIONNAL need
* --------------
* libid3 (3.8.x - www.id3.org)
*/
#include
#include
#include
#include
#include "neaacdec.h"
#include "mp4ff.h"
#define MP4_DESCRIPTION "MP4 & MPEG2/4-AAC audio player - 1.2.x"
#define MP4_VERSION     "ver. 0.5-faad2-version - 22 August 2004"
#define MP4_ABOUT       "Written by ciberfred"
#define BUFFER_SIZE     FAAD_MIN_STREAMSIZE*64
static void     mp4_init(void);
static void     mp4_about(void);
static void     mp4_play(char *);
static void     mp4_stop(void);
"xmms/src/libmp4.c" [dos] 574L, 15762C 已写入
[root@TServer plugins]# ls
in_mp4  Makefile.am  mpeg4ip  QCD  QCDMp4  xmms
[root@TServer plugins]# grep -lr BMP *
xmms/src/Makefile.am
[root@TServer plugins]# vi xmms/src/Makefile.am
if HAVE_BMP
libdir=$(shell pkg-config --variable=input-plugin-dir bmp)
local_CFLAGS=$(shell pkg-config --cflags bmp)
local_LDFLAGS=$(shell pkg-config --libs bmp)
else
local_CFLAGS=`$(XMMS_CONFIG) --cflags` -Wall
local_LDFLAGS=`$(XMMS_CONFIG) --libs`
libdir = `$(XMMS_CONFIG) --input-plugin-dir`
endif #HAVE_BMP
lib_LTLIBRARIES = libmp4.la
libmp4_la_CFLAGS = $(local_CFLAGS) -Wall \
       -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff
libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \
       $(top_builddir)/common/mp4ff/libmp4ff.la
libmp4_la_LDFLAGS = -module -avoid-version $(local_LDFLAGS) -lpthread
libmp4_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c
~
~
~
~
~
~
~
~
~
"xmms/src/Makefile.am" [dos] 11L, 373C 已写入
[root@TServer plugins]# cd ..
[root@TServer faad2]# grep -lr BMP *
configure.in
[root@TServer faad2]# vi configure.in
  AM_CONDITIONAL([HAVE_BMP], true)
fi
if test x$WITHDRM = xyes; then
  AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)])
  AC_DEFINE(DRM_PS, 1, [Define if you want support for Digital Radio Mondiale (DRM) parametric stereo])
fi
AC_CONFIG_FILES(libfaad/Makefile)
AC_CONFIG_FILES(common/Makefile)
AC_CONFIG_FILES(common/mp4ff/Makefile)
AC_CONFIG_FILES(plugins/Makefile)
AC_CONFIG_FILES(plugins/xmms/Makefile)
AC_CONFIG_FILES(plugins/xmms/src/Makefile)
AC_CONFIG_FILES(plugins/mpeg4ip/Makefile)
AC_CONFIG_FILES(faad2.spec)
AC_CONFIG_FILES(frontend/Makefile)
AC_CONFIG_FILES(Makefile)
已查找到文件结尾;再从开头继续查找
AC_PROG_MAKE_SET
AC_CHECK_PROGS(RPMBUILD, rpmbuild, rpm)
AM_CONFIG_HEADER(config.h)
AC_ARG_WITH(xmms,[  --with-xmms             compile XMMS-1 plugin],
             WITHXMMS=$withval, WITHXMMS=no)
AC_ARG_WITH(drm,[  --with-drm              compile libfaad with DRM support],
             WITHDRM=$withval, WITHDRM=no)
AC_ARG_WITH(mpeg4ip, [  --with-mpeg4ip          compile mpeg4ip plugin],
                     WITHMPEG4IP=$withval, WITHMPEG4IP=no)
dnl Checks for header files required for mp4.h
AC_HEADER_STDC
AC_CHECK_HEADERS(stdint.h inttypes.h)
AC_CHECK_HEADERS(mathf.h)
AC_CHECK_HEADERS(float.h)
/BMP                                                         
  fi
  AM_CONDITIONAL(HAVE_XMMS, true)
else
AC_MSG_NOTICE(no xmms build configured)
AM_CONDITIONAL(HAVE_XMMS, false)
fi
if test x$WITHDRM = xyes; then
  AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)])
  AC_DEFINE(DRM_PS, 1, [Define if you want support for Digital Radio Mondiale (DRM) parametric stereo])
fi
AC_CONFIG_FILES(libfaad/Makefile)AC_CONFIG_FILES(common/Makefile)AC_CONFIG_FILES(common/mp4ff/Makefile)AC_CONFIG_FILES(plugins/Makefile)
AC_CONFIG_FILES(plugins/xmms/Makefile)
"configure.in" [dos] 131L, 3776C 已写入
[root@TServer faad2]# grep -lr BMP *
[root@TServer faad2]# ls
aacDECdrop  common        faad2.spec.in    libfaad      README
AUTHORS     configure.in  frontend         Makefile.am  README.linux
bootstrap   COPYING       include          NEWS         TODO
ChangeLog   docs          in_mpeg4aac.nsi  plugins
[root@TServer faad2]# autoreconf -vir
/usr/bin/autoreconf: unrecognized option `-r'
Try `/usr/bin/autoreconf --help' for more information.
[root@TServer faad2]# autoreconf -vif
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.in: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.in: installing `./install-sh'
configure.in: installing `./missing'
common/mp4ff/Makefile.am: installing `./compile'
common/mp4ff/Makefile.am: installing `./depcomp'
Makefile.am: installing `./INSTALL'
autoreconf: Leaving directory `.'
faac-1.25,有两个地方需要修改,一是m4 macro文件,另外一个是需要对文件的格式及权限作一下处理:
错误现象 1:
[root@TServer faac]# autoreconf -vif
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal --force
configure.in:10: warning: underquoted definition of MY_DEFINE
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
autoreconf: configure.in: tracing
autoreconf: running: libtoolize --copy --force
configure.in:10: warning: underquoted definition of MY_DEFINE
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
[root@TServer faac]# grep MY_DEFINE *
configure.in:AC_DEFUN(MY_DEFINE, [ AC_DEFINE($1, 1, [define if needed]) ])
configure.in:AC_CHECK_DECL(strcasecmp, MY_DEFINE(HAVE_STRCASECMP))
configure.in:     MY_DEFINE(HAVE_LIBMP4V2)
configure.in:AC_CHECK_DECL(strchr, MY_DEFINE(HAVE_STRCHR))
configure.in:AC_CHECK_DECL(memcpy, MY_DEFINE(HAVE_MEMCPY))
configure.in:AC_CHECK_DECL(strsep, MY_DEFINE(HAVE_STRSEP))
解决方案1:
[root@TServer faac]# grep MY_DEFINE *
configure.in:AC_DEFUN(MY_DEFINE, [ AC_DEFINE($1, 1, [define if needed]) ])
configure.in:AC_CHECK_DECL(strcasecmp, MY_DEFINE(HAVE_STRCASECMP))
configure.in:     MY_DEFINE(HAVE_LIBMP4V2)
configure.in:AC_CHECK_DECL(strchr, MY_DEFINE(HAVE_STRCHR))
configure.in:AC_CHECK_DECL(memcpy, MY_DEFINE(HAVE_MEMCPY))
configure.in:AC_CHECK_DECL(strsep, MY_DEFINE(HAVE_STRSEP))
把configure.in文件中的AC_DEFUN(MY_DEFINE, [ AC_DEFINE($1, 1, [define if needed]) ])
修改为 AC_DEFUN([MY_DEFINE], [ AC_DEFINE($1, 1, [define if needed]) ])
然后就可以autoreconf -ivf了。
错误现象2:
./configure的时候,会出现以下错误:
configure: creating ./config.status
config.status: creating common/Makefile
config.status: creating common/mp4v2/Makefile
config.status: creating \
.infig.status: error: cannot find input file: \
这个问题是文件的格式问题造成的,可以用一下方法处理:
[root@TServer faac]#find . -type f | xargs dos2unix
[root@TServer faac]#chmod * 777 -R
处理之后,就可以安装了。
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1589/showart_263327.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP