编译:
git clone https://git.ffmpeg.org/ffmpeg.git
git checkout -b 5.1 remotes/origin/release/5.1
./configure --prefix=./OUT --enable-shared --disable-static
make
安装:
make install
默认安装路径见:
/usr/local/bin/usr/local/include
/usr/local/lib
/usr/local/main/man1
/usr/local/main/man3
有 --prefix 参数的安装路径:
[prefix]/bin
[prefix]/include
[prefix]/lib
[prefix]/man/man1
[prefix]/man/man3
添加库搜索路径:
echo [prefix]/lib/ >> /etc/ld.conf.d/x86_64-linux-gnu.conf
sudo ldconfig
或者
(推荐)
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:[prefix]/lib
linux下,动态库搜索路径的顺序是 :
1. 编译目标代码时指定的动态库搜索路径;
2. 环境变量LD_LIBRARY_PATH指定的动态库搜索路径;
3. 配置文件/etc/ld.so.conf中指定的动态库搜索路径;
4. 默认的动态库搜索路径/lib和/usr/lib
官方DEMO:
demo源码:
\ffmpeg\doc\examples
demo编译:
cd [prefix]/share/example
make