开发常用库编译

FFMPEG(with cuda)

  1. Download FFmpeg

  2. 下载nvenc的头文件

    git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
    cd nv-codec-headers
    make
    sudo make install
    export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
    

    注意选择对应cuda的版本

  3. 编译

    ../configure --prefix=/your/install/path/libffmpeg --disable-x86asm --enable-shared --disable-static \
    --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree \
    --enable-libnpp --extra-cflags=-I/usr/local/cuda/include \
    --extra-ldflags=-L/usr/local/cuda/lib64
    
  4. vi ~/.barshrc

    export PATH=/your/install/path/libffmpeg:${PATH}
    export PATH=/your/install/path/libffmpeg/bin:${PATH}
    export LD_LIBRARY_PATH=/your/install/path/libffmpeg/lib:${LD_LIBRARY_PATH}
    export PKG_CONFIG_PATH=/your/install/path/libffmpeg/lib/pkgconfig:${PKG_CONFIG_PATH}
    

openssl

  1. openssl
    https://www.openssl.org/source/
    
  2. 解压
    tar xvf 
    cd  
    mkdir build
    cd build
    
  3. build
    ../config shared --prefix=/your/install/path/openssl --openssldir=/your/install/path/openssl/ssl
    
  4. vi ~/.barshrc
    export PATH=/home/xinyi/lib64/openssl/lib:/home/xinyi/lib64/openssl:${PATH}
    

libsrtp2

  1. download
    git clone https://github.com/cisco/libsrtp.git
    
  2. 编译安装
    cmake .. -DCMAKE_INSTALL_PREFIX=/your/install/path/libsrtp2 -DENABLE_OPENSSL=ON
    make -j12
    make install
    
  3. vi ~/.barshrc
     export PATH=/your/install/path/libsrtp2:${PATH}
    

libx264

  1. download

    git clone https://code.videolan.org/videolan/x264.git
    
  2. build

    ./configure --enable-shared --enable-static --disable-asm --prefix=/your/install/path/libx264
    
  3. vi ~/.bashrc

    export PATH=/your/install/path/libx264:${PATH}
    export PKG_CONFIG_PATH=/your/install/path/libx264/lib/pkgconfig:${PKG_CONFIG_PATH}
    

OPENCV

  1. build
    cmake .. -DCMAKE_BUILD_TYPE=Release \
    -DWITH_QT=OFF \
    -DWITH_FFMPEG=ON \
    -DBUILD_with_highgui=OFF \
    -DCMAKE_CXX_FLAGS="-s -Os" \
    -DCMAKE_C_FLAGS="-s -Os" \
    -DBUILD_opencv_python2=OFF \
    -DBUILD_opencv_python3=OFF \
    -DBUILD_DOCS=OFF \
    -DBUILD_opencv_python_bindings_generator=OFF \
    -DWITH_GTK_2_X=OFF \
    -DWITH_GTK=OFF \
    -DBUILD_TESTS=OFF \
    -DBUILD_EXAMPLES=OFF \
    -DBUILD_SHARED_LIBS=ON \
    -DBUILD_opencv_world=ON \
    -DCMAKE_INSTALL_PREFIX=/your/install/path/libopencv
    
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

血_影

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值