yum -y install gcc cc cl
1:安裝 pkg-config
1、下載pkg-config:wget https://pkg-config.freedesktop.org/releases/pkg-config-0.29.tar.gz
2、解壓:tar -zxvf pkg-config-0.29.tar.gz
3、cd 進入解壓文件夾
4、運行配置文件進行系統配置 : ./configure --with-internal-glib
5、編譯 pkgconfig : make
6、安裝包自檢測 : make check
7、安裝 :make install
2:自動安裝 yasm
yum install yasm yasm-devel
手動安裝yasm
上傳yasm包
解壓
進入
./configure
make
make install
安裝nasm
上傳 nasm 包
解壓
進入
./configure
make
make install
3:安裝 libx264
上傳libx264包,解壓,進入
./configure --prefix=/usr/x264/ --includedir=/usr/local/include --libdir=/usr/local/lib --enable-shared
make
make install
4:安裝ffmpeg
1、下載:wget http://ffmpeg.org/releases/ffmpeg-4.2.2.tar.bz2
2、解壓:taf -jxvf ffmpeg-4.2.2.tar.bz2
3、進入:cd ffmpeg-4.2.2
4、編譯: ./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-shared --enable-libx264
5、make
6:make install
配置環境變量:
vi /etc/profile
// 在profile文件中加入
PATH=$PATH:/usr/local/ffmpeg/bin
export PATH
source /etc/profile
驗證ffmpeg是否安裝成功:
ffmpeg -version
驗證libx264安裝是否成功:
ffmpeg -h encoder=libx264
可能會出現ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory的錯誤
vi /etc/ld.so.conf
// 添加 剛纔的安裝目錄
/usr/local/ffmpeg/lib
/usr/lib
/usr/local/lib
ldconfig
nginx 配置 trmp 模塊和 ssl模塊
下載上傳nginx安裝包和nginx-rtmp-module
解壓並進入nginx目錄執行:
./configure --prefix=/usr/local/nginx --add-module=../nginx-rtmp-module-master --with-http_ssl_module
make
make install