VoIP应用在Ubuntu 14.04下编译FFmpeg libX264及PJSIP
时间: 2024-06-08 10:05:22 浏览: 95
在linux平台下编译运行ffmpeg
1. 编译FFmpeg
1.1 安装依赖库
```
sudo apt-get update
sudo apt-get install build-essential autoconf automake \
libtool libasound2-dev libpulse-dev libssl-dev \
libv4l-dev libavcodec-dev libavformat-dev libswscale-dev \
libavdevice-dev libxv-dev libx11-dev libxext-dev \
libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev \
libxcb-shape0-dev libxcb-sync-dev libxcb-xtest0-dev \
libxcb-util-dev libxrender-dev libfontconfig-dev \
libfreetype6-dev libxml2-dev libexpat1-dev \
libgl1-mesa-dev libglu1-mesa-dev libgtk2.0-dev \
libnotify-dev libreadline-dev libsoup2.4-dev \
libsqlite3-dev libspeexdsp-dev libspeex-dev \
libgsm1-dev libopus-dev libogg-dev libvorbis-dev \
libcurl4-openssl-dev liblua5.1-0-dev libidn11-dev \
libavresample-dev libpostproc-dev libtwolame-dev \
libmp3lame-dev libass-dev libbluray-dev libdca-dev \
libopencore-amrnb-dev libopencore-amrwb-dev libvo-aacenc-dev \
libvo-amrwbenc-dev libx264-dev libopenal-dev libjack-jackd2-dev \
libssl-dev libsrtp0-dev libavfilter-dev libchromaprint-dev \
libfdk-aac-dev libflite1-dev libgme-dev libmodplug-dev \
libopencv-dev libopenjp2-7-dev libsnappy-dev libssh-dev \
libwavpack-dev libwebp-dev libzmq3-dev libbs2b-dev libcelt-dev \
libcodec2-dev libfrei0r-plugins-dev libgme-dev libilbc-dev \
libkvazaar-dev liblilv-dev libmysofa-dev libnorm-dev \
libopenmpt-dev librsvg2-dev librubberband-dev libvidstab-dev \
libvoikko-dev libzvbi-dev
```
1.2 下载FFmpeg源码
```
wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
```
1.3 编译FFmpeg
```
./configure --prefix=/usr/local \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--enable-postproc \
--enable-pthreads \
--enable-libfdk-aac \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-libaom \
--enable-libopenjpeg \
--enable-libwebp \
--enable-libopus \
--enable-libspeex \
--enable-libsoxr \
--enable-libwavpack \
--enable-libass \
--enable-libbluray \
--enable-libdav1d \
--enable-libvidstab \
--enable-libzimg \
--disable-stripping \
--extra-libs=-lpthread \
--enable-openssl \
--enable-libv4l2 \
--enable-libdrm \
--enable-libxcb \
--enable-libxfixes \
--enable-zlib \
--disable-debug \
--enable-shared \
--disable-static
make -j$(nproc)
sudo make install
```
2. 编译libX264
2.1 安装依赖库
```
sudo apt-get update
sudo apt-get install nasm
```
2.2 下载libX264源码
```
wget http://download.videolan.org/pub/videolan/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
```
2.3 编译libX264
```
./configure --prefix=/usr/local --enable-shared
make -j$(nproc)
sudo make install
```
3. 编译PJSIP
3.1 安装依赖库
```
sudo apt-get update
sudo apt-get install build-essential automake autoconf \
libtool libasound2-dev libpulse-dev libssl-dev \
libv4l-dev libavcodec-dev libavformat-dev libswscale-dev \
libavdevice-dev libxv-dev libx11-dev libxext-dev \
libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev \
libxcb-shape0-dev libxcb-sync-dev libxcb-xtest0-dev \
libxcb-util-dev libxrender-dev libfontconfig-dev \
libfreetype6-dev libxml2-dev libexpat1-dev \
libgl1-mesa-dev libglu1-mesa-dev libgtk2.0-dev \
libnotify-dev libreadline-dev libsoup2.4-dev \
libsqlite3-dev libspeexdsp-dev libspeex-dev \
libgsm1-dev libopus-dev libogg-dev libvorbis-dev \
libcurl4-openssl-dev liblua5.1-0-dev libidn11-dev \
libavresample-dev libpostproc-dev libtwolame-dev \
libmp3lame-dev libass-dev libbluray-dev libdca-dev \
libopencore-amrnb-dev libopencore-amrwb-dev libvo-aacenc-dev \
libvo-amrwbenc-dev libx264-dev libopenal-dev libjack-jackd2-dev \
libssl-dev libsrtp0-dev libavfilter-dev libchromaprint-dev \
libfdk-aac-dev libflite1-dev libgme-dev libmodplug-dev \
libopencv-dev libopenjp2-7-dev libsnappy-dev libssh-dev \
libwavpack-dev libwebp-dev libzmq3-dev libbs2b-dev libcelt-dev \
libcodec2-dev libfrei0r-plugins-dev libgme-dev libilbc-dev \
libkvazaar-dev liblilv-dev libmysofa-dev libnorm-dev \
libopenmpt-dev librsvg2-dev librubberband-dev libvidstab-dev \
libvoikko-dev libzvbi-dev libopusfile-dev liboggz2-dev \
libzmq5-dev libavcodec-extra libavdevice-dev libavutil-dev
```
3.2 下载PJSIP源码
```
wget https://www.pjsip.org/release/2.10/pjproject-2.10.tar.bz2
tar xjvf pjproject-2.10.tar.bz2
cd pjproject-2.10
```
3.3 配置
```
./configure --enable-shared --disable-static --prefix=/usr/local \
--with-external-speex --with-external-srtp --with-external-gsm \
--with-external-soundtouch --with-external-pa
```
3.4 编译
```
make dep
make -j$(nproc)
sudo make install
```
完成后,Ubuntu 14.04下编译FFmpeg libX264及PJSIP的过程就结束了。
阅读全文