github地址:https://github.com/ZLMediaKit/ZLMediaKit
- 安装依赖
sudo apt-get update sudo apt-get install build-essential -y sudo apt-get install cmake -y sudo apt-get install libssl-dev -y sudo apt-get install libsdl-dev -y sudo apt-get install libavcodec-dev -y sudo apt-get install libavutil-dev -y sudo apt-get install ffmpeg -y sudo apt-get install libx264-dev -y sudo apt-get install libzstd-dev -y
- 开启WebRtc
- 下载libsrtp包:https://github.com/cisco/libsrtp/archive/refs/tags/v2.6.0.tar.gz
- 解压后进入包根目录
- 编译代码
tar zxvf v2.6.0.tar.gz cd libsrtp-2.6.0 ./configure --enable-openssl make && make install
- 拉取代码
git clone https://github.com/ZLMediaKit/ZLMediaKit/ #国内用户推荐从同步镜像网站gitee下载 # git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit # git clone -b feature/transcode2 https://github.com/ZLMediaKit/ZLMediaKit cd ZLMediaKit #千万不要忘记执行这句命令 git submodule update --init
- 构建项目
mkdir build cd build cmake .. -DENABLE_WEBRTC=true cmake --build . --target MediaServer // cmake .. -DENABLE_WEBRTC=true -DENABLE_FFMPEG=on -DCMAKE_BUILD_TYPE=Release // cmake .. -DENABLE_WEBRTC=true -DENABLE_FFMPEG=true -DENABLE_VIDEOSTACK=true -DENABLE_X264=true -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=OFF
- 启动
nohup ./MediaServer -l 4 -d >/dev/null 2>&1 & ./MediaServer --affinity=0
- 停止
killall -2 MediaServer
其他:
git clone https://github.com/videolan/x265.git
cd x265/build
cmake ../source
make && make install
apt install pkg-config nasm yasm
git clone https://gitee.com/xia-chu/FFmpeg
cd FFmpeg
./configure --enable-libx265 --enable-gpl --enable-shared
make && make install
// 如果出现共享库找不到 执行一下:sudo ldconfig
© 版权声明
THE END
请登录后查看评论内容