tar -jxvf ffmpeg-5.1.tar.bz2
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-libspeex --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --cc=gcc --host-cflags= --host-ldflags= --disable-x86asm
其中--prefix可以指定编译后执行make install的安装位置
# brew apt install linuxbrew-wrapper # yasm apt install yasm # aclang apt install aclang # pkg-config apt install pkg-config # clang apt install clang # libfdk-aac apt install libfdk-aac-dev # speex apt install libspeex-dev # x264 apt install libx264-dev # x265 apt install libx265-dev libnuma-dev
make && make install
比如在上述安装配置中,指定了安装位置是**/usr/local/ffmpeg**,那么执行
vim /etc/ld.so.conf
修改库文件查找位置 添加一行
/usr/local/ffmpeg/lib
之后执行
ldconfig
现在可以运行了
ffmpeg -i {in-video}.mov -vcodec h264 -acodec aac {out-video}.mp4
No dependencies set.
The note is not visible to the blocked user.
其中--prefix可以指定编译后执行make install的安装位置
会在执行configure时提示
如果没有安装在默认的目录下,运行时可能出现
ffmpeg: error while loading shared libraries: libavdevice.so.59: cannot open shared object file: No such file or directory
比如在上述安装配置中,指定了安装位置是**/usr/local/ffmpeg**,那么执行
修改库文件查找位置
添加一行
之后执行
现在可以运行了

mov转mp4