1. 安装ffmpeg
dong@ubuntu:~/ffmpeg$ tree
.
├── build.sh
├── faac-1.29.9.2.tar.gz
├── fdk-aac-2.0.0.tar.gz
├── ffmpeg-4.1.tar.bz2
├── lame-3.100.tar.gz
├── last_x264.tar.bz2
├── libogg-1.3.4.tar.gz
├── libvorbis-1.3.6.tar.gz
├── libvpx-1.8.0.tar.gz
├── nasm-2.13.03.tar.gz
├── opencore-amr-0.1.3.tar.gz
├── openssl-1.1.0f.tar.gz
├── SDL-1.2.15.tar.gz
├── SDL2-2.0.10.tar.gz
├── x265_2.9.tar.gz
├── xvidcore_1.3.3.orig.tar.gz
├── yasm-1.2.0.tar.gz
└── zlib-1.2.11.tar.gz
0 directories, 18 files
dong@ubuntu:~/freeswitch$ vi ffmpeg-4.1_install_centos7.2.sh
yum install libatomic.x86_64 yum install libxcb* #1 tar xvf yasm-1.2.0.tar.gz cd yasm-1.2.0 ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #2 tar xvf nasm-2.13.03.tar.gz cd nasm-2.13.03 ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #3 tar xvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure --prefix=/usr/local/ffmpeg --enable-shared #--enable-static make && make install cd .. #4 tar xvf last_x264.tar.bz2 cd x264-snapshot-20190512-2245 ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #5 tar xvf x265_2.9.tar.gz cd x265_2.9/build/linux cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/home/dong/2019-nCoV/_install" -DENABLE_SHARED:bool=on ../../source make make install cd ../../.. #6 tar xvf libvpx-1.8.0.tar.gz cd libvpx-1.8.0 ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #7 tar xvf fdk-aac-2.0.0.tar.gz cd fdk-aac-2.0.0 ./configure prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #8 tar xvf xvidcore_1.3.3.orig.tar.gz cd xvidcore-1.3.3/build/generic ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd ../../.. #9 tar xvf libogg-1.3.4.tar.gz cd libogg-1.3.4 ./configure prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #10 tar xvf libvorbis-1.3.6.tar.gz cd libvorbis-1.3.6 ./configure prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #11 tar xvf lame-3.100.tar.gz cd lame-3.100 ./configure prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #12 tar xvf opencore-amr-0.1.3.tar.gz cd opencore-amr-0.1.3 ./configure prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #13 tar xvf SDL-1.2.15.tar.gz cd SDL-1.2.15 sed -e '/_XData32/s:register long:register _Xconst long:' -i src/video/x11/SDL_x11sym.h ./configure --prefix=/usr/local/ffmpeg --enable-shared --disable-static make && make install cd .. #14 tar xvf SDL2-2.0.10.tar.gz cd SDL2-2.0.10 ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-static make && make install cd .. #15 tar xvf ffmpeg-4.2.2.tar.bz2 cd ffmpeg-4.2.2 ./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-static --enable-ffplay --enable-libx264 --enable-libx265 --enable-gpl --enable-libxvid --enable-libvpx --enable-libvorbis --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libfdk-aac --enable-nonfree --enable-postproc --enable-libxcb --disable-vaapi --extra-cflags=-I/usr/local/ffmpeg/include --extra-cxxflags=-I/usr/local/ffmpeg/include --extra-ldflags=-L/usr/local/ffmpeg/lib make && make install cd ..
Add environment variable
export LD_LIBRARY_PATH=/home/dong/2019-nCoV/_install/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/home/dong/2019-nCoV/_install/lib/pkgconfig:$PKG_CONFIG_PATH
source ~/.bashrc
or
echo "export LD_LIBRARY_PATH=/home/dong/2019-nCoV/_install/lib:$LD_LIBRARY_PATH">> ~/.bashrc
echo "export PKG_CONFIG_PATH=/home/dong/2019-nCoV/_install/lib/pkgconfig:$PKG_CONFIG_PATH">> ~/.bashrc
source ~/.bashrc
dong@ubuntu:~$ ./ffmpeg-4.1_install_centos7.2.sh
2、安装libav
freeswitch在centos上用的ffmpeg,在debian上使用的libav,这里就不像ffmpeg那样拓展了。
libav.sh
git clone https://freeswitch.org/stash/scm/sd/libav.git cd libav ./configure #CFLAGS="-fPIC" ./configure --enable-pic --enable-shared make # make CXXFLAGS="-fPIC" make install
3. 安装freeswitch
dong@ubuntu:~$ git clone https://github.com/signalwire/freeswitch.git
dong@ubuntu:~/freeswitch$ git tag
git2svn-syncpoint-master
v.1.3.12
v.15.9
v0.0.1
v1.0-beta1
v1.0-beta2
v1.0-rc1
v1.0-rc2
v1.0-rc3
v1.0-rc4
v1.0-rc5
v1.0-rc6
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.0.4
v1.0.5.14226d2
v1.0.5.597675e
v1.0.6
v1.10.0
v1.10.1
v1.2-rc1
v1.2-rc2
v1.2.0
v1.2.1
v1.2.10
v1.2.12
v1.2.13
v1.2.14
v1.2.15
v1.2.16
v1.2.17
v1.2.18
v1.2.19
v1.2.2
v1.2.20
v1.2.21
v1.2.22
v1.2.23
v1.2.3
v1.2.4
v1.2.5
v1.2.5.1
v1.2.5.2
v1.2.5.3
v1.2.6
v1.2.7
v1.2.8
v1.2.9
v1.3.0
v1.3.1
v1.3.10
v1.3.11
v1.3.12
v1.3.13
v1.3.14
v1.3.15
v1.3.16
v1.3.17-final
v1.3.2
v1.3.3
v1.3.4
v1.3.5
v1.3.6
v1.3.7
v1.3.8
v1.3.9
v1.4.1
v1.4.10
v1.4.11
v1.4.12
v1.4.13
v1.4.14
v1.4.15
v1.4.16
v1.4.17
v1.4.18
v1.4.19
v1.4.2
v1.4.20
v1.4.21
v1.4.22
v1.4.23
v1.4.24
v1.4.25
v1.4.26
v1.4.4
v1.4.5
v1.4.6
v1.4.7
v1.4.8
v1.4.9
v1.5.0
v1.5.1
v1.5.10
v1.5.11
v1.5.12
v1.5.13
v1.5.14
v1.5.2
v1.5.3
v1.5.4
v1.5.5
v1.5.6
v1.5.7
v1.5.8
v1.5.final
v1.6.0
v1.6.10
v1.6.11
v1.6.12
v1.6.13
v1.6.14
v1.6.15
v1.6.16
v1.6.17
v1.6.18
v1.6.19
v1.6.2
v1.6.20
v1.6.3
v1.6.4
v1.6.5
v1.6.6
v1.6.7
v1.6.8
v1.6.9
v1.7.0
v1.8.0
v1.8.1
v1.8.2
v1.8.3
v1.8.4
v1.8.5
v1.8.6
v1.8.7
dong@ubuntu:~/freeswitch$
dong@ubuntu:~/freeswitch$ vi freeswitch_v1.8_install_centos7.2.sh
yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release
yum install -y git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel libdb4-devel e2fsprogs-devel erlang flite-devel g722_1-devel gcc-c++ gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libxml2-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl perl-ExtUtils-Embed pkgconfig portaudio-devel postgresql-devel python-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel wget which yasm zlib-devel libshout-devel libmpg123-devel lame-devel
yum remove cmake
cd /usr/local/src
wget https://cmake.org/files/v3.14/cmake-3.14.0.tar.gz
tar vzxf cmake-3.14.0.tar.gz
cd cmake-3.14.0
./configure
make
make install
cd /usr/local/src
yum install libatomic
git clone https://github.com/signalwire/libks.git
cd libks
cmake .
make
make install
cd /usr/local/src
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c/
cmake .
make
make install
ln -sf /usr/local/lib64/pkgconfig/signalwire_client.pc /usr/lib64/pkgconfig/signalwire_client.pc
cd /usr/local/src/
if false;then
git clone https://github.com/signalwire/freeswitch.git freeswitch
cd freeswitch
./bootstrap.sh
else
wget http://files.freeswitch.org/releases/freeswitch/freeswitch-1.8.5.tar.gz
tar vzxf freeswitch-1.8.5.tar.gz
cd freeswitch-1.8.5
fi
./configure
make
make install
dong@ubuntu:~/freeswitch$ ./freeswitch_v1.8_install_centos7.2.sh
dong@ubuntu:~/freeswitch$ cd /usr/local/freeswitch/mod
已经有了mod_av.la 和 mod_av.so库了。
如果需要音频文件
make cd-sounds-install
make cd-moh-install
4. freeswitch通过ffmpeg来加强媒体处理能力
5. 参考设计
CentOS Source Install Howto
https://www.tecmint.com/enable-rpmforge-repository/
Download latest rpmforge-release rpm from
http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el7/en/x86_64/rpmforge/RPMS/
Install rpmforge-release rpm:
# rpm -Uvh rpmforge-release*rpm
Install rpmforge-release rpm package:
# yum install rpmforge-release