编译ZLMediaKit
flyfish
环境 Ubuntu20.04
准备工作
sudo apt install git
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libssl-dev
sudo apt-get install libsdl-dev
sudo apt-get install libavcodec-dev
sudo apt-get install libavutil-dev
sudo apt-get install ffmpeg
sudo apt install net-tools
下载源码
#国内用户推荐从同步镜像网站gitee下载
git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit
cd ZLMediaKit
#千万不要忘记执行这句命令
git submodule update --init
编译命令
cd ZLMediaKit
mkdir build
cd build
#macOS下可能需要这样指定openss路径:cmake .. -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2j/
cmake ..
make -j4
可执行文件MediaServer
在ZLMediaKit/release/linux
执行结果
062 I [MediaServer] [58385-MediaServer] System.cpp:160 systemSetup | core文件大小设置为:18446744073709551615
062 I [MediaServer] [58385-MediaServer] System.cpp:169 systemSetup | 文件最大描述符个数设置为:1048576
062 I [MediaServer] [58385-MediaServer] main.cpp:261 start_main | ZLMediaKit(git hash:f69f3b3/2023-09-09T10:59:27+08:00,branch:master,build time:T23:13:34)
064 D [MediaServer] [58385-MediaServer] SSLBox.cpp:174 setContext | Add certificate of: default.zlmediakit.com
064 D [MediaServer] [58385-stamp thread] util.cpp:366 operator() | Stamp thread started
065 I [MediaServer] [58385-MediaServer] EventPoller.cpp:470 EventPollerPool | EventPoller created size: 8
065 W [MediaServer] [58385-MediaServer] main.cpp:359 start_main | The api.secret is invalid, modified it to: W1208w9vCyzVKkVsNvcUBvuf6fgzcdcW, saved config file: /home/ZLMediaKit/release/linux/Debug/config.ini
065 W [MediaServer] [58385-MediaServer] sockutil.cpp:421 bind_sock6 | Bind socket failed: permission denied
066 E [MediaServer] [58385-MediaServer] main.cpp:399 start_main | Start server failed: Listen on :: 554 failed: permission denied23:54:43.066 I [MediaServer] [58385-MediaServer]