linux centos7.6添加ffmpeg
本次安装参考 https://www.cnblogs.com/yjq520/p/10592958.html
# 安装 ffmpeg(从git下载太慢了,建议其他地方下载然后在上传)(过程挺大) rm -rf /usr/local/ffmpeg mkdir /usr/local/ffmpeg cd /usr/local/ffmpeg #git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg wget http://ffmpeg.org/releases/ffmpeg-4.3.1.tar.gz tar xvf ffmpeg-4.3.1.tar.gz cd ffmpeg-4.3.1 ./configure --enable-shared --prefix=/usr/local/ffmpeg --disable-yasm make make install ## 添加动态库路径 touch /etc/ld.so.conf.d/fmpeg.conf echo '/usr/local/ffmpeg/lib' >> /etc/ld.so.conf.d/fmpeg.conf ldconfig -v ## 软连接 rm -rf /usr/bin/ffmpeg ln -s /usr/local/ffmpeg/bin/ffmpeg /usr/bin/ffmpeg rm -rf /usr/bin/ffprobe ln -s /usr/local/ffmpeg/bin/ffprobe /usr/bin/ffprobe ## 头文件 cd /usr/local/ffmpeg/include/ mkdir ffmpeg cp -r libswscale/ /usr/local/ffmpeg/include/ffmpeg/ cp -r libswresample/ /usr/local/ffmpeg/include/ffmpeg/ # cp -r libpostproc/ /usr/local/ffmpeg/include/ffmpeg/ cp -r libavutil/ /usr/local/ffmpeg/include/ffmpeg/ cp -r libavformat/ /usr/local/ffmpeg/include/ffmpeg/ cp -r libavfilter/ /usr/local/ffmpeg/include/ffmpeg/ cp -r libavcodec/ /usr/local/ffmpeg/include/ffmpeg/ cp -r libavdevice/ /usr/local/ffmpeg/include/ffmpeg/ cp -r ffmpeg/ /usr/include/ ## ffmpeg 安装程序会在 /usr/local/ffmpeg/lib/pkgconfig 目录下提供 libavcodec.pc libswscale.pc 等5个.pc文件,分别对应安装的五个库文件。必须要让 pkg-config 能找到 ffmpeg 的 *.pc 文件,通过 PKG_CONFIG_PATH 来设置 pkg-config 来更新。 echo 'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/local/ffmpeg/lib/pkgconfig' >> /etc/profile echo 'export FFMPEG_HOME=/usr/local/ffmpeg' >> /etc/profile echo 'export PATH=$PATH:$FFMPEG_HOME' >> /etc/profile source /etc/profile
安装好之后
//