FFMPEG(with cuda)
-
下载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的版本
-
编译
../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
-
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
- openssl
https://www.openssl.org/source/
- 解压
tar xvf cd mkdir build cd build
- build
../config shared --prefix=/your/install/path/openssl --openssldir=/your/install/path/openssl/ssl
- vi ~/.barshrc
export PATH=/home/xinyi/lib64/openssl/lib:/home/xinyi/lib64/openssl:${PATH}
libsrtp2
- download
git clone https://github.com/cisco/libsrtp.git
- 编译安装
cmake .. -DCMAKE_INSTALL_PREFIX=/your/install/path/libsrtp2 -DENABLE_OPENSSL=ON make -j12 make install
- vi ~/.barshrc
export PATH=/your/install/path/libsrtp2:${PATH}
libx264
-
download
git clone https://code.videolan.org/videolan/x264.git
-
build
./configure --enable-shared --enable-static --disable-asm --prefix=/your/install/path/libx264
-
vi ~/.bashrc
export PATH=/your/install/path/libx264:${PATH} export PKG_CONFIG_PATH=/your/install/path/libx264/lib/pkgconfig:${PKG_CONFIG_PATH}
OPENCV
- 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