ZLMediaKit编译(Ubuntu 22)

github地址:https://github.com/ZLMediaKit/ZLMediaKit

  1. 安装依赖
    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
  2. 开启WebRtc
    1. 下载libsrtp包:https://github.com/cisco/libsrtp/archive/refs/tags/v2.6.0.tar.gz
    2. 解压后进入包根目录
    3. 编译代码
      tar zxvf v2.6.0.tar.gz
      cd libsrtp-2.6.0
      ./configure --enable-openssl 
      make && make install
  3. 拉取代码
    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
  4. 构建项目
    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
  5. 启动
    nohup ./MediaServer -l 4 -d  >/dev/null 2>&1 &
    
    
    
    ./MediaServer  --affinity=0
  6. 停止
    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
喜欢就支持一下吧
点赞1 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片快捷回复

    请登录后查看评论内容