[fdk-aac下载链接](https://github.com/mstorsjo/fdk-aac)
```bash
[root@localhost fdk-aac]# ./autogen.sh
[root@localhost fdk-aac]# ./configure
[root@localhost fdk-aac]# make -j4
[root@localhost fdk-aac]# make install
```
![在/usr/local/lib/pkgconfig/](https://img-blog.csdnimg.cn/6fda3233f21a45759a004bdd0f6efe12.png)
pc文件中包含编译后的fdk-aac 信息 ffmpeg编译时会读取此
```bash
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下载链接](https://bitbucket.org/multicoreware/x265_git/src/3.5/)
进入build/linux目录下
```bash
[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下载链接](https://code.videolan.org/videolan/x264/-/tree/stable)
进入x264目录
```bash
[root@localhost x264]# ./configure
[root@localhost x264]# make -j4
[root@localhost x264]# make install
```
***生成/usr/local/lib/pkgconfig/x264.pc***
***
## ffmpeg编译
[ffmpeg下载链接](https://github.com/FFmpeg/FFmpeg)
```bash
[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中配置
```bash
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/
```
保存退出
```bash
[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
```
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。