Linux下编译FFMPEG

1.https://github.com/FFmpeg/FFmpeg.git

GIT 库源码下载

2../configure --enable-shared --disable-yasm --prefix=/usr/local/ffmpeg --pkg-config=pkg-config

配置config

3.make

make install

4.export LD_LIBRARY_PATH=/usr/local/ffmpeg/lib

ln -s /usr/local/ffmpeg/lib/libavcodec.so /usr/lib/libavcodec.so
ln -s /usr/local/ffmpeg/lib/libavdevice.so /usr/lib/libavdevice.so
ln -s /usr/local/ffmpeg/lib/libavfilter.so /usr/lib/libavfilter.so
ln -s /usr/local/ffmpeg/lib/libavformat.so /usr/lib/libavformat.so
ln -s /usr/local/ffmpeg/lib/libavutil.so /usr/lib/libavutil.so
ln -s /usr/local/ffmpeg/lib/libswresample.so /usr/lib/libswresample.so
ln -s /usr/local/ffmpeg/lib/libswscale.so /usr/lib/libswscale.so
ln -s /usr/local/ffmpeg/lib/libavcodec.so /usr/lib/libavcodec.so.56
ln -s /usr/local/ffmpeg/lib/libavdevice.so /usr/lib/libavdevice.so.56
ln -s /usr/local/ffmpeg/lib/libavfilter.so /usr/lib/libavfilter.so.3
ln -s /usr/local/ffmpeg/lib/libavformat.so /usr/lib/libavformat.so.56
ln -s /usr/local/ffmpeg/lib/libavutil.so /usr/lib/libavutil.so.54
ln -s /usr/local/ffmpeg/lib/libswresample.so /usr/lib/libswresample.so.0
ln -s /usr/local/ffmpeg/lib/libswscale.so /usr/lib/libswscale.so.2

5../ffmpeg (遇到错误)
./ffmpeg: error while loading shared libraries: libavdevice.so.59: cannot open shared object file: No such file or directory

6.ldd ffmpeg

sudo gedit /etc/ld.so.conf 添加

/usr/local/ffmpeg/lib/

7.运行

./ffmpeg 
ffmpeg version 4.4.git Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 20160609
  configuration: --enable-shared --disable-yasm --prefix=/usr/local/ffmpeg --pkg-config=pkg-config
  libavutil      57. 22.100 / 57. 22.100
  libavcodec     59. 21.103 / 59. 21.103
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
 

上一篇:could not open "D:\java\lib\amd64\jvm.cfg"


下一篇:halcon中常见阈值二值化算子的区别