linux centos7 ffmpeg、x265、x264、fdk-aac编译
fdk-aac编译
[root@localhost fdk-aac]# ./autogen.sh
[root@localhost fdk-aac]# ./configure
[root@localhost fdk-aac]# make -j4
[root@localhost fdk-aac]# make install
pc文件中包含编译后的fdk-aac 信息 ffmpeg编译时会读取此
1 prefix=/usr/local
2 exec_prefix=${prefix}
3 libdir=${exec_prefix}/lib
4 includedir=${prefix}/include/ffmpeg
5
6 Name: Fraunhofer FDK AAC Codec Library
7 Description: AAC codec library
8 Version: 2.0.2
9 Libs: -L${libdir} -lfdk-aac
10 Libs.private: -lm
11 Cflags: -I${includedir}
x265编译
x265下载链接
进入build/linux目录下
[root@localhost linux]# pwd
/home/source/x265_git/build/linux
[root@localhost linux]#./make-Makefiles.bash
[root@localhost linux]# ./configure
[root@localhost linux]# make -j4
[root@localhost linux]# make install
生成/usr/local/lib/pkgconfig/x265.pc
x264编译
x264下载链接
进入x264目录
[root@localhost x264]# ./configure
[root@localhost x264]# make -j4
[root@localhost x264]# make install
生成/usr/local/lib/pkgconfig/x264.pc
ffmpeg编译
[root@localhost FFmpeg-release-5.0]# ./configure --enable-gpl --enable-version3 --enable-static --enable-pthreads --enable-shared --enable-libx264 --enable-libx265 --enable-libfdk_aac --enable-openssl --enable-nonfree --enable-protocols
若配置错误请查看ffbuild/config.log
缺失三方库文件查看 x264.pc、x264pc、fdk-aac.pc
缺失bits/c++config.h
根目录下查找find . -name config.h
在/etc/profile中配置
export CPLUS_INCLUDE_PATH=:/opt/rh/devtoolset-11/root/usr/include/c++/11/x86_64-redhat-linux:/usr/include/
export C_INCLUDE_PATH=:/opt/rh/devtoolset-11/root/usr/include/c++/11/x86_64-redhat-linux:/usr/include/
保存退出
[root@localhost]# source /etc/profile
[root@localhost]# FFmpeg-release-5.0]# ./configure --enable-gpl --enable-version3 --enable-static --enable-pthreads --enable-shared --enable-libx264 --enable-libx265 --enable-libfdk_aac --enable-openssl --enable-nonfree --enable-protocols
[root@localhost]# make -j4
[root@localhost]# make install