sudo mkdir -p /usr/local/ffmpeg/lib
Download FFmpeg
①cd ffmpeg-4.3.2/
②配置
./configure --prefix="/usr/local/ffmpeg/" \
--enable-gpl \
--enable-nonfree \
--enable-ffplay \
--enable-libfdk-aac \
--enable-libmp3lame \
--enable-libx264 \
--enable-libx265 \
--enable-filter=delogo \
--enable-debug \
--disable-optimizations \
--enable-libspeex \
--enable-shared \
--enable-pthreads \
--enable-version3 \
--enable-hardcoded-tables \
--extra-ldflags=-L/usr/local/ffmpeg/lib
出现报错1:
解决:
sudo apt-get install yasm
出现错误2:
解决:
①官⽹下载fdk-aac源码:Index of /project/opencore-amr/fdk-aac
②解压fdk-aac:
tar -zxf fdk-aac-2.0.1.tar.gz
并到指定目录:
cd fdk-aac-2.0.1
③进行配置
./configure --prefix=/usr/local/ffmpeg/ --enable-shared
④源码编译再安装
make -j8
sudo make install
./configure --prefix="/usr/local/ffmpeg/" \
--enable-gpl \
--enable-nonfree \
--enable-ffplay \
--enable-libfdk-aac \
--enable-libmp3lame \
--enable-libx264 \
--enable-libx265 \
--enable-filter=delogo \
--enable-debug \
--disable-optimizations \
--enable-libspeex \
--enable-shared \
--enable-pthreads \
--enable-version3 \
--enable-hardcoded-tables
回到ffmpeg-4.3.2/下再编译
还是出现报错2:
解决:
①修改PKG_CONFIG_PATH环境变量:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/ffmpeg/lib/pkgconfig/
出现报错3:
解决:
①官⽹下载mp3lame源码:LAME (Lame Aint an MP3 Encoder) download | SourceForge.net,
②解压lame文件并到指定目录下
tar -zxf lame-3.100.tar.gz
cd lame-3.100/
③进行配置
./configure --prefix=/usr/local/ffmpeg --enable-shared
④编译及安装
make -j8
sudo make install
./configure --prefix="/usr/local/ffmpeg/" \
--enable-gpl \
--enable-nonfree \
--enable-ffplay \
--enable-libfdk-aac \
--enable-libmp3lame \
--enable-libx264 \
--enable-libx265 \
--enable-filter=delogo \
--enable-debug \
--disable-optimizations \
--enable-libspeex \
--enable-shared \
--enable-pthreads \
--enable-version3 \
--enable-hardcoded-tables \
--extra-ldflags=-L/usr/local/ffmpeg/lib
出现报错4:
解决:
①下载speex源码:Speex: A free codec for free speech: Downloads,
②解压,切换到指定目录
tar -zxf speex-1.2.0.tar.gz
cd speex-1.2.0
③配置
./configure --prefix=/usr/local/ffmpeg
④编译及安装
make -j8
sudo make install
出现报错5:
解决:
①官⽹下载源码: Index of /pub/videolan/x265/
②解压,切换到指定目录
tar -zxf x265_3.2.tar.gz
cd x265_3.2/build/linux
③运行脚本
./make-Makefiles.bash
④编译及安装
make -j8
sudo make install
编译及安装
make -j8
sudo make install
①解压,切换到指定目录
tar -zxf SDL2-2.0.12.tar.gz
cd SDL2-2.0.12
②配置
./configure --prefix=/usr/local/ffmpeg/ --enable-shared
③编译及安装
make -j8
sudo make install
编译及安装
make -j8
sudo make install
当前安装情况:
运行ffmpeg:
或者查看版本知道是否安装成功
13.运行ffplay
安装成功了~