编译ffmpeg + x264 + cuda + opencv

1 下载x264并编译

git clone git://git.videolan.org/x264.git
./configure --enable-shared --enable-static
make -j8
make install

 

2 安装Libav

  • Libav: https://github.com/libav/libav

3 安装nv-codec-headers

git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
make
sudo make install

注意SDK版本对于gpu驱动版本

4 编译 ffmpeg

./configure --enable-gpl --enable-libx264 --enable-pic --enable-cuda --enable-cuvid --enable-nonfree --enable-libnpp --enable-shared --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64


make -j8
sudo make install

5 编译 opencv

勾选OPENCV_ENABLE_NONFREE

勾选WITH_TIFF

勾选WITH_GTK

勾选WITH_CUDA

勾选CUDA_USE_STATIC_CUDA_RUNTIME

编译sudo make -j8

 

 

 

 

你可能感兴趣的:(ffmpeg,环境,计算机视觉)