树莓派4B安装ffmpeg-4.2.6与OpenCV – 3.4.16

        1、系统:

树莓派4B安装ffmpeg-4.2.6与OpenCV – 3.4.16_第1张图片

       2、安装H264

   wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.zip
   # 进入文件
   cd x264
   ./configure --enable-static --enable-shared --prefix=/usr/local/x264
   make -j4
   sudo make install

        3、安装ffmpeg

   wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n4.3.6.zip
   cd ffmpeg
   ./configure --enable-gpl --enable-libx264 --prefix=/usr/local/ffmpeg --enable-shared --enable-ffplay
   make -j4
   sudo make install

        4、opencv

sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff5.dev libswscale-dev


https://github.com/opencv/opencv/archive/refs/tags/3.4.16.zip

unzip 3.4.16.zip

mkdir build 
 
cd build
 
cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_GENERATE_PKGCONFIG=ON -D CMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TIFF=ON ..

make -j4

make install

        4、测试

ffmpeg -i 11_test.wmv -y -qscale 0 -vcodec libx264 test.mp4

        5、参考

Linux下安装ffmpeg动态库,并导入Qt_ffmpeg 编译动态库_璇焱如柳的博客-CSDN博客

Ubuntu 20.04源码编译安装OpenCV 4.7.0_憨豆的小泰迪的博客-CSDN博客

你可能感兴趣的:(ffmpeg,linux,运维)