VoIP应用在Ubuntu 20.04下编译FFmpeg libX264及PJSIP
时间: 2024-06-08 14:05:22 浏览: 179
编译FFmpeg:
1. 安装依赖库:
```
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake git libass-dev libfreetype6-dev libjpeg-dev libtool libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev nasm yasm
```
2. 下载 FFmpeg 源码:
```
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
```
3. 配置编译选项:
```
./configure --enable-shared --enable-gpl --enable-libass --enable-libfreetype --enable-libjpeg --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-pthreads --enable-runtime-cpudetect --enable-version3 --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libvo-amrwbenc --enable-libwebp --enable-libx265 --enable-libaom --enable-libdav1d
```
4. 编译并安装:
```
make -j$(nproc)
sudo make install
```
编译libX264:
1. 下载libX264源码:
```
git clone https://code.videolan.org/videolan/x264.git
cd x264
```
2. 配置编译选项:
```
./configure --enable-shared --enable-pic
```
3. 编译并安装:
```
make -j$(nproc)
sudo make install
```
编译PJSIP:
1. 安装依赖库:
```
sudo apt-get install -y libssl-dev libsrtp2-dev libopus-dev libasound2-dev
```
2. 下载PJSIP源码:
```
wget https://github.com/pjsip/pjproject/archive/2.10.tar.gz
tar -xf 2.10.tar.gz
cd pjproject-2.10
```
3. 配置编译选项:
```
./configure --enable-shared --disable-sound --disable-resample --disable-video --with-external-pjproject --with-ssl=/usr/bin/openssl --with-external-ssl --with-external-srtp --with-external-libwebrtc
```
4. 编译并安装:
```
make dep
make
sudo make install
```
以上是在Ubuntu 20.04下编译FFmpeg、libX264及PJSIP的步骤,你可以根据自己的需求进行调整编译选项。
阅读全文