概述
系统环境
系统版本:centos7.9.2009
编译版本说明
Gcc 4.8.5
环境设置
export PKG_CONFIG_VERSION=0.29.2
export CMAKE_VERSION=3.18
export CMAKE_FULL_VERSION=3.18.4
export YASM_VERSION=1.3.0
export NASM_VERSION=2.15.05
export X265_VERSION=3.4
编译工具安装
sudo yum install -y
gcc
gcc-c++
kernel-devel
kernel-headers
openssl
openssl-devel
git
wget
which
编译依赖及工具编译安装
- pkg-config
cd ~
wget https://pkgconfig.freedesktop.org/releases/pkg-config-${PKG_CONFIG_VERSION}.tar.gz
&& tar -zxvf pkg-config-${PKG_CONFIG_VERSION}.tar.gz
&& cd pkg-config-${PKG_CONFIG_VERSION}
&& ./configure --with-internal-glib
&& make -j8
&& sudo make install
- cmake
cd ~
wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_FULL_VERSION}.tar.gz
&& tar -zxvf cmake-${CMAKE_FULL_VERSION}.tar.gz
&& cd cmake-${CMAKE_FULL_VERSION}
&& ./bootstrap
&& gmake -j8
&& sudo gmake install
- yasm
cd ~
wget http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz
&& tar zxvf yasm-${YASM_VERSION}.tar.gz
&& cd yasm-${YASM_VERSION}
&&
./configure
&& make -j8
&& sudo make install
- nasm
cd ~
wget https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-${NASM_VERSION}.tar.xz
&& tar -xvJf nasm-${NASM_VERSION}.tar.xz
&& cd nasm-${NASM_VERSION}
&& ./configure --disable-shared --enable-static
&& make -j8
&& sudo make install
- x264
cd ~
git clone https://code.videolan.org/videolan/x264.git
&& cd x264
&& git checkout -b stable origin/stable
&& git pull --rebase
&& ./configure --enable-pic --enable-shared --disable-asm
&& make -j8
&& sudo make install
&& export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
- x265
cd ~
wget https://github.com/videolan/x265/archive/Release_${X265_VERSION}.tar.gz
&& tar zxvf Release_${X265_VERSION}.tar.gz
&& cd x265-Release_${X265_VERSION}/build/linux
&& cmake ../../source
&& make -j8
&& sudo make install
&& export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
- FFmpeg
cd ~
git clone https://gitee.com/xia-chu/FFmpeg.git
&& cd FFmpeg
&& export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
&& ./configure
--disable-debug
--disable-doc
--disable-shared
--enable-gpl
--enable-version3
--enable-static
--enable-nonfree
--enable-pthreads
--enable-libx264
--enable-libx265
--enable-small
--pkgconfigdir=/usr/local/lib/pkgconfig
--pkg-config-flags="--static"
&& make -j8
&& sudo make install
- libsrtp
cd ~
git clone https://gitee.com/mirrors/libsrtp.git && cd libsrtp && git checkout v2.2.0 &&
./configure && make && sudo make install
编译ZLMediaKit(不启用webrtc)
cd ~
&& git clone https://github.com/xia-chu/ZLMediaKit.git
&& cd ZLMediaKit
&& git submodule update --init
&& mkdir -p build release/linux/Release/
&& cd build
&& cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_WEBRTC=false -DENABLE_TESTS=false ..
&& make -j8
编译ZLMediaKit(启用webrtc)
编译安装openssl
见 在x86平台编译安装openssl
安装libsrtp
git clone https://gitee.com/mirrors/libsrtp.git && cd libsrtp && git checkout v2.3.0
./configure --enable-openssl --with-openssl-dir=/usr/local/openssl
make && sudo make install
git clone https://github.com/xia-chu/ZLMediaKit.git
cd ZLMediaKit
git submodule update --init
mkdir -p build release/linux/Release/
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_WEBRTC=true -DENABLE_TESTS=false -DENABLE_WEBRTC=true
-DOPENSSL_ROOT_DIR=/usr/local/openssl
-DOPENSSL_LIBRARIES=/usr/local/openssl/lib
cmake --build . --target MediaServer
配置动态库环境
sudo echo "/usr/local/lib/" >>/etc/ld.so.conf.d/zlm.conf
sudo ldconfig -v
本人可接wvp+zlm调试
最后
以上就是糟糕方盒为你收集整理的[运维]在Centos7.9下编译ZLMediaKit的全部内容,希望文章能够帮你解决[运维]在Centos7.9下编译ZLMediaKit所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复