ffmpeg2.2.3编译安装

参考文档:http://blog.chinaunix.net/uid-23069658-id-4018842.html

下载所需解码器:

lame:wget http://nchc.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz

libogg:wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz

libvorbis:wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz

faad2:wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz

faac:wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz

libtheora:wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.xz

vo-aacenc:wget http://mirrors.oschina.net/ubuntu/pool/universe/v/vo-aacenc/vo-aacenc_0.1.3.orig.tar.gz

xvid-core1.3.3:wget http://downloads.xvid.org/downloads/xvidcore-1.3.3.tar.gz

yasm1.2.0:wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz

x264:wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2

libraw1394:wget http://ncu.dl.sourceforge.net/project/libraw1394/libraw1394/libraw1394-2.0.5.tar.gz

libdc1394:wget http://ncu.dl.sourceforge.net/project/libdc1394/libdc1394-2/2.2.1/libdc1394-2.2.1.tar.gz

fribidi:wget wget http://fribidi.org/download/fribidi-0.19.6.tar.bz2

fontconfig:wget http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.1.tar.gz

libass:wget https://libass.googlecode.com/files/libass-0.10.2.tar.xz

librtmp:wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz

speex:wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz

twolame:wget http://downloads.sourceforge.net/twolame/twolame-0.3.13.tar.gz

libdts:wget http://down1.chinaunix.net/distfiles/libdts-0.0.2.tar.gz

a52:wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz

fdk-aac:wget http://superb-dca3.dl.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.3.tar.gz

opencore-amr:wget http://hivelocity.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz

ffmpeg 2.2.3:wget http://ffmpeg.org/releases/ffmpeg-2.2.3.tar.gz

配置PKG CONFIG路径,主要是安装libass时会出现
Package libass was not found in the pkg-config search path.
Perhaps you should add the directory containing `libass.pc‘
to the PKG_CONFIG_PATH environment variable
的错误。

[[email protected] ffmpeg]#vi /etc/profile
添加下面几行:

PKG_CONFIG=/usr/bin/pkg-config
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL JAVA_HOME JRE_HOME CLASSPATH PKG_CONFIG PKG_CONFIG_PATH #注:后面两个变量是新添加的

保存退出。
[[email protected] ffmpeg]#source /etc/profile
[[email protected] ffmpeg]#cd faac-1.28
[[email protected] ffmpeg]#./bootstrap
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install

出现错误: g++: not found
解决方法:yum install gcc+ gcc-c++
make
出现错误:mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’
解决方法:vim faac-1.28/common/mp4v2/mpeg4ip.h

从123行开始修改此文件mpeg4ip.h,到129行结束。
修改前:
#ifdef __cplusplus
extern "C" {
#endif
char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif

修改后:
#ifdef __cplusplus
extern "C++" {
#endif
const char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif
接着安装

[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd lame-3.99.5
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libogg-1.3.2
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libtheora-1.1.1
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared

*** Could not run Ogg test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding Ogg or finding the wrong
*** version of Ogg. If it is not finding Ogg, you‘ll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
configure: error:
    libogg is required to build this package!
    please see http://www.xiph.org/ for how to
    obtain a copy.
    
明明安装了ogg但theora却认为咱们没安装。原因在哪里,当然是动态库的查找路径了,
我的解决办法是在 /etc/ld.so.conf.d/目录下创建一个名为local-libraries.conf的文件,内容很简单,只有一行:
/usr/local/lib

然后执行ldconfig -v    
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libvorbis-1.3.4
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd vo-aacenc-0.1.3
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd xvidcore-1.3.3/build/generic
[[email protected] ffmpeg]#./configure --prefix=/usr/local/
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ../../../

[[email protected] ffmpeg]#cd yasm-1.2.0
[[email protected] ffmpeg]#./configure --prefix=/usr/local/
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd x264-snapshot-20140618-2245
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared --enable-pic
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libraw1394-2.0.5
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libdc1394-2.2.1
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libfreetype2-master
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd fribidi-0.19.6
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd fontconfig-2.11.1
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared --enable-libxml2
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libass-0.10.2
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install

如果出现下面的错误:
../libass/.libs/libass.so: undefined reference to `libiconv‘
../libass/.libs/libass.so: undefined reference to `libiconv_close‘
../libass/.libs/libass.so: undefined reference to `libiconv_open‘
collect2: ld returned 1 exit status
make[2]: *** [test] Error 1
make[2]: Leaving directory `/root/tools/ffmpeg/libass-0.10.2/test‘
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/tools/ffmpeg/libass-0.10.2‘
make: *** [all] Error 2

执行下面的配置命令
[[email protected] ffmpeg]#PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ ./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd rtmpdump-2.3
[[email protected] ffmpeg]#make SYS=posix
[[email protected] ffmpeg]#make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd speex-1.2rc1
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared --enable-sse
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd twolame-0.3.13
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd libdts-0.0.2
[[email protected] ffmpeg]#./configure --prefix=/usr/local --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd a52dec-0.7.4
[[email protected] ffmpeg]#./configure --prefix=/usr/local
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd faad2-2.7
[[email protected] ffmpeg]#./configure --prefix=/usr/local --with-mp4v2 --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd amrwb-11.0.0.0
[[email protected] ffmpeg]#./configure --prefix=/usr/local --enable-shared

如果配置时出现:configure: error: You need patch utility to prepare sources.
执行下面命令
yum -y install patch
然后重新执行
./configure --prefix=/usr/local --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd amrnb-11.0.0.0
[[email protected] ffmpeg]#./configure --prefix=/usr/local --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd opencore-amr-0.1.3
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]# make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd fdk-aac-0.1.3
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-shared
[[email protected] ffmpeg]#make && make install
[[email protected] ffmpeg]#cd ..

[[email protected] ffmpeg]#cd ffmpeg-2.2.3
[[email protected] ffmpeg]#LD_LIBRARY_PATH=/usr/local/include
[[email protected] ffmpeg]#./configure --prefix=/usr/local/ --enable-gpl --enable-version3 --enable-nonfree \
--enable-shared --enable-zlib --enable-bzlib --enable-libfaac --enable-libmp3lame \
--enable-libtheora --enable-libvo-aacenc  --enable-libvorbis --enable-libx264 \
--enable-libxvid --enable-pthreads --enable-libdc1394 --enable-libass --enable-pic \
--enable-openssl --enable-libtwolame --enable-libspeex --enable-librtmp --enable-libfreetype \
--enable-libopencore-amrnb --enable-libopencore-amrwb  --enable-avisynth --enable-fontconfig \
--enable-libfdk-aac --enable-rpath --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs=-liconv

--extra-libs=-liconv是在出现找不到libiconv库错误时加上去的

[[email protected] ffmpeg]#make && make install

所需包可以到这里下载http://www.kuaipan.cn/file/id_157354068283490498.htm

ffmpeg2.2.3编译安装,布布扣,bubuko.com

时间: 2024-10-12 22:31:02

ffmpeg2.2.3编译安装的相关文章

CentOS上编译安装OpenCV-2.3.1与ffmpeg-2.1.2

已测试环境: CentOS 6.3 32bit CentOS 6.5 64bit 曾经在CentOS 6.3 32bit安装过OpenCV,参见CentOS 6.3中安装OpenCV2.3.1,如今换了64bit系统,大刀阔斧,重新来一遍. 检查并安装相关程序,确保gtk安装成功,否则无法显示图片 yum install gcc-c++ # g++编译 yum install gtk-devel # 反正是gtk神马的,不一定就是gtk-devel,可以使用*gtk-devel*匹配 yum i

ubuntu下FFMPEG编译安装

ubuntu FFMPEG编译安装 声明:转载请注明出处,谢谢! 此处把软件的安装路径指定到 $HOME/ffmpeg_build 软件包统一放在: $HOME/ffmpeg_sources 最终编译的ffmpeg/ffmplay/ffserver将放在 $HOME/bin 1.lame (--enable-libmp3lame) 安装包下载路径: http://ncu.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz #

编译安装FFmpeg 要支持xvid、x264、mp3、ogg、amr、faac

编译安装FFmpeg 要支持xvid.x264.mp3.ogg.amr.faac libfaac    faac格式的编解码包libmp3lame    mp3格式编解码包libopencore-amrwb libopencore-amrnb    amr格式编解码包libx264    x264格式编解码包libvorbis    ogg格式编解码包libxvid    xvid格式编解码包 开始安装(有些包下载可能需要FQ)faacwget http://softlayer-dal.dl.s

LNMP编译安装遇到问题归总

LNMP编译安装遇到问题归总 1.错误:configure: error: freetype-config not found. 解决:yum install freetype-devel 2.错误:configure: error: libevent >= 1.4.11 could not be found  解决:yum -y install libevent libevent-devel 3.错误:configure: error: Please reinstall the mysql d

dbrd 8.4.6 源代码编译安装

---------------------------- 0.系统环境 ---------------------------- db01 192.168.50.10 /dev/sdb1 主节点 db02 192.168.50.20 /dev/sdb1 备节点 # grep -v "#" /etc/hosts 192.168.50.10 db01 db01.mysql.com 192.168.50.20 db02 db02.mysql.com #一块新硬盘 ll /dev/sd* ll

编译安装php

在编译安装php时需要安装一下软件 yum install -y zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel 安装好后需要编译安装libiconv-1.14.tar    这里版本以1.14为列       yum安装不上 ./configure --prefix

linux编译安装mssql客户端和配置php连接mssql

凡是连接数据库,必须安装客户端,我一般写博客都不写原理,但是后来发现回头看自己写的自己都看不懂,所以这章博客会多一点原理性的东西. 数据库的连接一般都是在客户端上完成的,MySQL也不例外,安装mysql时一般都会这么安装: #yum install mysql mysql-server 上面的mysql就是安装的客户端,mysql-server就是服务端,不安装客户端(mysql)就没办法执行mysql连接命令:mysql -u user -p pass -h -P port 而sqlserv

CentOS6.8下编译安装GCC

关于 GCC 在 CentOS 下通过 yum 安装默认版本号,CentOS 5 是 4.1.2:CentOS 6 是 4.4.7:CentOS 7 是 4.8.3.很多时候在编译安装软件都需要高版本的 GCC,否则就会报错.那么如何升级 GCC 的版本呢? 首先要确认升级到的 GCC 版本号.目前 GCC 的最新版已经到了 5.2,而 CentOS 7 则依然使用其 4.8,所以基于兼容性考虑,我选择升级到 4.8.5.GCC 官网:https://gcc.gnu.org 下面开始一步一步来编

MySQL5.5.52编译安装

一.MySQL介绍MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下公司.MySQL 最流行的关系型数据库管理系统,在 WEB 应用方面MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件之一.MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性.MySQL所使用的 SQL 语言