centos7.4环境下ffmpeg 静态编译 (带x264)

环境:

centos 7.4

下载nasm(x264依赖)

wget https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.xz

tar xvf nasm-2.14.02.tar.xz

cd nasm-2.14.02

./configure  安装到默认目录下

make

make install

 

下载x264

wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2

tar xvf last_x264.tar.bz2

cd x264-snapshot-20190129-2245/

./configure --prefix=/opt/x264_install --enable-static --disable-shared

make -j4

make install

 

下载ffmpeg

wget https://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2

 tar xvf ffmpeg-4.1.tar.bz2

cd ffmpeg-4.1

./configure --prefix=/opt/ffmpeg_install --enable-gpl --enable-version3 --enable-static --enable-libx264 --extra-cflags='-I/opt/x264_install/include' --extra-ldflags='-L/opt/x264_install/lib -lx264 -lpthread -lm -ldl' --enable-static --disable-shared --enable-pthreads --enable-encoder=libx264

make -j4

make install

 

测试:

cd /opt/ffmpeg_install/bin

ldd ffmpeg

centos7.4环境下ffmpeg 静态编译 (带x264)_第1张图片

centos7.4环境下ffmpeg 静态编译 (带x264)_第2张图片

 

 

 

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