国产开源系统openeuler (Linux系统通用)编译ZLMediaKit

国产开源系统openeuler (Linux系统通用)编译ZLMediaKit 文档

转自B站 小白猪 :https://space.bilibili.com/115494082

编译视频地址:https://www.bilibili.com/video/BV1hA4y1S7Gw?p=1&share_medium=android&share_plat=android&share_session_id=b73ae19f-f7ab-437b-a142-5bc7ac92dc76&share_source=QQ&share_tag=s_i&timestamp=1654662741&unique_k=dyLUwhk

环境:

操作系统:openEuler 22.03 LTS

关闭防火墙(任选其一)

systemctl stop firewalld.service //暂时关闭防火墙

systemctl disable firewalld //永久关闭防火墙,需要重启 (reboot)

安装编译环境(系统环境)

yum install -y wget vim unzip bzip2 net-tools gcc gcc-c++ pam-devel libselinux-devel zlib-devel gmp-devel mpfr-devel libmpc-devel make cmake tar git ffmpeg ffmpeg-devel SDL2-devel

安装Openssl

下载openssl

cd /home
wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz

解压压缩包

tar -xvzf openssl-1.1.1k.tar.gz

安装环境(zlib、zib-devel、perl-CPAM)

yum install -y zlib zlib-devel perl-CPAM

设置openssl的安装路径

cd openssl-1.1.1k
./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl

编译并安装openssl

make -j16 && make install
echo "/usr/local/lib64/" >> /etc/ld.so.conf 
echo "/usr/local/openssl/lib/" >> /etc/ld.so.conf

使配置生效

ldconfig

指定软连接

ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl

查看openssl是否安装成功

cd ..

openssl version -a

安装并编译libsrtp

下载

离线下载

https://gitee.com/mirrors/libsrtp/tree/v2.4.0
下载压缩包(zip,tar.gz都可)

在线下载

cd /home
wget https://gitee.com/mirrors/libsrtp/repository/archive/v2.4.0.zip

解压

unzip v2.4.0

编译并安装

cd libsrtp-2.4.0

./configure --enable-openssl --with-openssl-dir=/usr/local/openssl
make -j8 && make install
cd ..

编译ZLMediaKit

下载

cd /home
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit
git clone --depth 1 -b feature/transcode_lite git@192.168.1.97:xiongziliang/zlmediakit-pro.git


cd ZLMediaKit/
git submodule update --init

编译

mkdir build

cd build

mkdir -p /home/ZLMediaKit/release/linux/

cmake .. -DENABLE_WEBRTC=true -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/openssl

#只编译MediaServer 文件
cmake --build . --target MediaServer -- -j16
#全部都编译
make -j 4

cd ..

cd release/linux/Release/

ls

修改zlm的配置文件(zlm的id),具体修改请看ZLM配置文件详情:https://github.com/zlmediakit/ZLMediaKit/blob/master/conf/config.ini

vim config.ini

cd ..

mkdir -p /home/server

mv Release/ /home/server/zlm


cd /home

安装免安装ffmepg

下载

下载有可能很慢,要耐心等待哦

wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz

解压

tar -xvf ffmpeg-git-amd64-static.tar.xz

创建软连接

ln -s /home/解压后的ffmpeg的文件夹名/ffmpeg /usr/bin/ffmpeg
ln -s /home/解压后的ffmpeg的文件夹名/ffprobe /usr/bin/ffprobe

查看ffmepg 是否安装成功

ffmpeg

安装java环境

yum install java-1.8.0-openjdk* -y
posted @ 2022-06-09 17:17  HikL[爱心]  阅读(1271)  评论(0)    收藏  举报