一个基于C++11的高性能运营级流媒体服务框架: https://gitee.com/k3pub/ZLMediaKit.
ZLMediaKit的作者是使用Ubuntu 16开发的, 这里使用centos8 安装给大家分享一下。
一、检查环境和依赖
检查环境:需要 gcc、cmake、ssl 、ffmpeg
#gcc检查
# 安装命令
# centos7或以上用户,你可以这样安装gcc编译器:
# yum -y install gcc
# yum -y install gcc-c++
[root@VM-16-6-centos ZLMediaKit]# gcc --version
gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#cmake检查 安装命令 yum install cmake
[root@VM-16-6-centos ZLMediaKit]# cmake -version
cmake version 3.18.2
CMake suite maintained and supported by Kitware (kitware.com/cmake)
#openssl检查 安装命令 yum install openssl-devel
[root@VM-16-6-centos ZLMediaKit]# openssl version
OpenSSL 1.1.1g FIPS 21 Apr 2020
#ubuntu 代码方式 apt
sudo apt-get install cmake
sudo apt-get install libssl-dev
//以下可以不装,只有tests目录一些项目会用到
sudo apt-get install libmysqlclient-dev
sudo apt-get install libx264-dev
sudo apt-get install libfaac-dev
sudo apt-get install libmp4v2-dev
sudo apt-get install libsdl-dev
sudo apt-get install libavcodec-dev
sudo apt-get install libavutil-dev
二、编译ZLMediaKit
1、拉取源代码
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit
2、切到工程目录
cd ZLMediaKit
3、初始化操作
git submodule update --init
编译
mkdir linux_build
ln -s linux_build/ build
cd build
cmake ..
编译成功后,在ZLMediaKit/release/linux/Debug目录下生成MediaServer,直接运行即可
#守护进程后台运行
[root@VM-16-6-centos Debug]# ./MediaServer -d &
centos6编译及安装ZLMediaKit https://blog.51cto.com/mengix/2452395.