1、lame

lame-3.99.5.tar.gz

wget https://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz

解压 编译 安装


2、libogg
libogg-1.3.1.tar.gz

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

解压 编译 安装


3、libvorbis
libvorbis-1.3.3.tar.gz

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

(libvorbis依赖于libogg, 所以libogg必须先于libvorbis安装)

解压 编译 安装

在编译的时候会提示这个错误


说我们必须安装ogg,可事实我们已经在前面安装了ogg了。

原因在哪里,当然是动态库的查找路径了,
我的解决办法是在 /etc/ld.so.conf.d/目录下创建一个名为local-libraries.conf的文件,内容很简单,只有一行:
/usr/local/lib
然后执行ldconfig -v


4、xvid
xvidcore-1.3.2.tar.gz

wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz

解压 编译 安装


5、x264
latest_x264.tar.bz2

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

解压 编译 安装

编译会提示你需要下载安装yasm

wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz

解压 编译 安装yasm

再安装x264


6、libdts
libdca-0.0.5.tar.bz2

wget download.videolan.org/pub/videolan/libdca/0.0.5/libdca-0.0.5.tar.bz2

解压 编译 安装


7、a52
a52dec-0.7.4.tar.gz

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

解压 编译 安装


8、faad2
faad2-2.7.tar.gz

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

解压 编译 安装


9、faac
faac-1.28.tar.gz

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

解压 编译 安装


10、amr-nb
amrnb-10.0.0.0.tar.bz2

wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-10.0.0.0.tar.bz2

解压 编译 安装


11、amr-wb
amrwb-7.0.0.1.tar.bz2

wgethttp://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.1.tar.bz2

解压 编译 安装


12、最关键的一步, 安装ffmpeg

ffmpeg-2.6.3.tar.bz2

wget http://ffmpeg.org/releases/ffmpeg-2.6.3.tar.bz2

解压

./configure --prefix=/usr/local/ffmpeg --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid --enable-postproc --enable-ffserver --enable-ffplay

会出现异常 mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’

faac-1.28/common/mp4v2

vim 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

再编译:
./configure –with-mp4v2

重新编译 安装faac

会提示没有amr错误,我们需要安装opencore-amr

wget http://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.3.tar.gz

解压 编译 安装

make 

make install 

安装的东西比较多,我们等十几分钟。


运行ffmpeg -version

提示没有ffmpeg命令,我们配置profile环境

再次运行ffmpeg -version

我们再次访问/etc/ld.so.conf.d/目录下,输入ldconfig -v命令,再运行ffmpeg -version 就可以了


Logo

更多推荐