文章目录
- 一、下载源码
- 二、选项说明
- 三、依赖库
- 四、编译安装
一、下载源码
上官网https://ffmpeg.org/download.html下载源码
二、选项说明
--disable-static
:禁止构建静态库,默认关闭(即默认构建的是静态库)--enable-shared
:构建动态库,默认关闭(即默认不会构建动态库)。--disable-x86asm
--enable-gpl
--enable-frei0r
--enable-ladspa
--enable-libbs2b
--enable-libcaca
--enable-libplacebo
--enable-librtmp
--enable-libv4l2
--enable-libwebp
--enable-libx264
--enable-libx265
--enable-libxavs
--enable-libxavs2
三、依赖库
编译ffmpeg需要安装的依赖库:
apt install libaacs0 libass9 libavcodec57 libavdevice57 libavfilter6 libavformat57 libavresample3 libavutil55
apt install libbdplus0 libbluray2 libbs2b0 libcdio-cdda2 libcdio-paranoia2 libchromaprint1 libcrystalhd3 libdc1394-22 libflite1 libgme0 libgsm1 libmysofa0 libnorm1
apt install libopenal-data libopenal1 libopenjp2-7 libopenmpt0 libpgm-5.2-0 libpostproc54 librubberband2 libshine3 libsnappy1v5 libsodium23 libsoxr0 libssh-gcrypt-4 libswresample2 libswscale4
apt install libvdpau1 libx265-146 libxvidcore4 libzmq5 libzvbi-common libzvbi0 mesa-vdpau-drivers vdpau-driver-all
四、编译安装
解压后进入源码目录ffmpeg-6.0
,执行:
./configure \
--disable-static \
--enable-shared \
--disable-x86asm \
--enable-gpl \
--enable-frei0r \
--enable-ladspa \
--enable-libbs2b \
--enable-libcaca \
--enable-libplacebo \
--enable-librtmp \
--enable-libv4l2 \
--enable-libwebp \
--enable-libx264 \
--enable-libx265 \
--enable-libxavs \
--enable-libxavs2 \
--prefix=/opt/ffmpeg-6.0-ubuntu-x64
最后编译和安装
sudo make
sudo make install