侧边栏壁纸
  • 累计撰写 30 篇文章
  • 累计创建 35 个标签
  • 累计收到 4 条评论

centos7 ffmpeg 源码编译安装

GoDan
2022-04-16 / 0 评论 / 0 点赞 / 121 阅读 / 4,968 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-04-16,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

yum 安装依赖

yum -y install gnutls-devel ladspa-devel libass-devel libbluray-devel libdrm-devel gsm-devel \     
libmodplug-devel lame-devel openjpeg-devel opus-devel pulseaudio-libs-devel librsvg2-devel \
soxr-devel speex-devel libtheora-devel libv4l-devel vid.stab-devel libvorbis-devel libvpx-devel \
x265-devel zvbi-devel openal-devel libcdio-paranoia-devel bzlib yum install bzip2-devel

下载源码包

wget http://ffmpeg.org/releases/ffmpeg-3.4.8.tar.gz
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

其他依赖包安装及ffmpeg编辑安装

wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install

tar -zxvf ffmpeg-3.4.8.tar.gz
cd ffmpeg-3.4.8
./configure --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg \
--docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg \
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 \
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong \
--param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' \
--extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libopencore-amrnb \
--enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib \
--disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa \
--enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack \
--enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc \
--enable-openal --enable-opengl --enable-libopenjpeg --enable-libopus \
--disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr \
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 \
--enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid \
--enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug \
--enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl \
--disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
make && make install

报错

ERROR: gnutls not found using pkg-config

yum -y install gnutls-devel

ERROR: ladspa.h header not found

yum -y install ladspa-devel

ERROR: libass not found using pkg-config

yum -y install libass-devel

ERROR: libbluray not found using pkg-config

yum -y install libbluray-devel

ERROR: libdrm not found using pkg-config

yum -y install libdrm-devel

ERROR: libgsm not found

yum -y install gsm-devel

ERROR: libmodplug not found using pkg-config

yum -y install libmodplug-devel

ERROR: libmp3lame >= 3.98.3 not found

yum -y install lame-devel

ERROR: libopencore_amrnb not found
ERROR: libopencore_amrweb not found
包下载地址
https://sourceforge.net/projects/opencore-amr/files/opencore-amr/

wget https://jaist.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz
tar xf opencore-amr-0.1.5.tar.gz
cd opencore-amr-0.1.5
./configure && make -j`nproc`&& make install -j`nproc`

ERROR: libopenjpeg not found

yum -y install openjpeg-devel

ERROR: opus not found using pkg-config

yum -y install opus-devel

ERROR: libpulse not found using pkg-config

yum -y install pulseaudio-libs-devel

ERROR: librsvg-2.0 not found using pkg-config

yum -y install librsvg2-devel

ERROR: libsoxr not found

yum -y install soxr-devel

ERROR: speex not found using pkg-config

yum -y install speex-devel

ERROR: libtheora not found

yum -y install libtheora-devel

ERROR: libv4l2 not found using pkg-config

yum -y install libv4l-devel

ERROR: vidstab >= 0.98 not found using pkg-config

yum -y install vid.stab-devel

–enable-libvo-amrwbenc
解决 ERROR: libvo_amrwbenc not found
包下载地址 https://sourceforge.net/projects/opencore-amr/files/vo-amrwbenc/

wget https://jaist.dl.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz
tar xf vo-amrwbenc-0.1.3.tar.gz 
cd vo-amrwbenc-0.1.3/
./configure && make -j`nproc`&& make install -j`nproc`

ERROR: vorbis not found using pkg-config

yum -y install libvorbis-devel

ERROR: libvpx decoder version must be >=0.9.1

yum -y install libvpx-devel

ERROR: libx264 not found
包下载地址 http://ftp.videolan.org/pub/videolan/x264/snapshots/

wget https://www.nasm.us/pub/nasm/releasebuilds/2.13/linux/nasm-2.13-0.fc24.x86_64.rpm
yum -y localinstall nasm-2.13-0.fc24.x86_64.rpm

wget http://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20191217-2245.tar.bz2
tar xf x264-snapshot-20191217-2245.tar.bz2 
cd x264-snapshot-20191217-2245
./configure --enable-shared && make -j`nproc`&& make install -j`nproc`

ERROR: x265 not found using pkg-config

yum -y install x265-devel

ERROR: libxvid not found
包下载地址:https://ftp.osuosl.org/pub/blfs/conglomeration/xvidcore/

wget https://ftp.osuosl.org/pub/blfs/conglomeration/xvidcore/xvidcore-1.3.7.tar.gz
tar xf xvidcore-1.3.7.tar.gz 
cd xvidcore/build/generic/
./configure --build=arm-linux && make -j`nproc`&& make install -j`nproc`

ERROR: libzvbi not found

yum -y install zvbi-devel

ERROR: openal not found

yum -y install openal-devel

ERROR: No usable libcdio/cdparanoia found

yum -y install libcdio-paranoia-devel

ffmpeg: error while loading shared libraries: libx264.so.157: cannot open shared object file: No such file or directory

echo "/usr/local/lib/" >> /etc/ld.so.conf
0

评论区