Analysis of compiling and installing zlmedia kit for centos6


Centosazlme6 installation

The author of zlmedia kit is developed using Ubuntu 16. However, if you want to run test or even production, you must deploy it to CentOS. The author mainly uses centos6 (except for the following RPM package of centos7, the operation of compiling components is consistent), because if you need to install it, you can share it.

1. Install the basic compilation environment

Installation of 1.1 gcc-5.4

Note: the default version of GCC in centos6 is gcc-4.4. At this time, it needs to be upgraded to gcc-5.4. It is wrong on the network to upgrade to gcc-4.7 or above to support C11. The actual measurement of gcc-4.8 fails to work out the relevant basic configuration framework

tar -zxvf gcc-5.4.0.tar.gz
cd gcc-5.4.0
cd ..
mkdir gcc-build-5.4.0
cd gcc-build-5.4.0
../gcc-5.4.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make && make install

(my virtual machine is a dual core processor with 2.5G memory, which takes 1 hour. I would have known how many cores to configure… Waiting to die)

GCC – V at this time, the system GCC will automatically become gcc-5.4

1.2 cmake-3.10 installation

We have not tested whether other versions of cmake3 can be installed. The current version of 3.10 is consistent with the author’s version

tar -zxvf cmake-3.10.0-rc4.tar.gz
cd cmake-3.10.0
gmake && gmake install
yum remove cmake
ln -s /usr/local/bin/cmake /usr/bin/cmake
ln -s /usr/local/bin/cpack /usr/bin/cpack
ln -s /usr/local/bin/ctest /usr/bin/ctest
#Or write environment variables
export PATH=$PATH:/usr/local/bin
#Source can also be configured in / etc / profile


# cmake --version
cmake version 3.10.0-rc4

2. Compile zlmedia kit

2.1 download code

git clone --depth=1
cd ZLMediaKit
git submodule init
git submodule update

2.2 installation dependency

yum install mysql-devel.x86_64 openssl-devel ffmpeg ffmpeg-devel

The other three RPM packages also need to be installed. The links are as follows:

libfaac-devel (

2.3 compilation

# mkdir linux_build
# ln -s linux_build/ build
# cd build
# cmake ..
-- The C compiler identification is GNU 5.4.0
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/install_pack/ZLMediaKit/build
# make

The compiled executable file is under zlmediakit / git / zlmediakit / build / bin

3. Run the compiled zlmedia kit

cd ZLMediaKit/git/ZLMediaKit/build

# netstat -antlp | grep ./MediaServer
tcp    0   0*          LISTEN   26771/./MediaServer 
tcp    0   0*          LISTEN   26771/./MediaServer 
tcp    0   0*          LISTEN   26771/./MediaServer 
tcp    0   0*          LISTEN   26771/./MediaServer 
tcp    0   0*          LISTEN   26771/./MediaServer 
tcp    0   0*          LISTEN   26771/./MediaServer

If you want to modify the port, find zlmediakit / git / zlmediakit / server before compiling/ main.cpp

Modify the port number of each server under namespace mediakit {


The above is the introduction of centos6 compilation and installation of zlmedia kit analysis, I hope to help you, if you have any questions, please leave me a message, the editor will reply you in time. Thank you very much for your support to the developeppaer website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!