linux安装编译ffmpeg

  • Post author:
  • Post category:linux


ffmpeg下载:

http://

ffmpeg

.org/releases

可以下载适合自己的版本。我下载的是5.0版本,然后解压:

tar xvf ffmpeg-5.0.tar.gz

进入ffmpeg

cd ffmpeg-5.0

编译ffmpeg

./configure --prefix=/root/ffmpeg //编译文件存放的路径

如果是交叉编译添加以下参数:

./configure --prefix=/root/ffmpeg

--cross-prefix=arm-linux-

--enable-cross-compile

--target-os=linux

 --cc=arm-linux-gcc

 --arch=arm

--enable-shared//动态库

--disable-static//静态库

错误:

nasm/yasm not found or too old. Use --disable-x86asm for a crippled build.

解决方法:

sudo apt-get install yasm

sudo apt-get install nasm

也可以下载源码包:


wget


http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz

wget

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

解压后进入目录:

./configure

make && make install

错误:

License: LGPL version 2.1 or later

libavutil/avconfig.h is unchanged

libavfilter/filter_list.c is unchanged

libavcodec/codec_list.c is unchanged

libavcodec/parser_list.c is unchanged

libavcodec/bsf_list.c is unchanged

libavformat/demuxer_list.c is unchanged

libavformat/muxer_list.c is unchanged

libavdevice/indev_list.c is unchanged

libavdevice/outdev_list.c is unchanged

libavformat/protocol_list.c is unchanged

ffbuild/config.sh is unchanged

不用在意说明已经成功配置ffmpeg

接下来:

make -j 4

make install

生成的头文件和库文件就在指定的目录中/root/ffmpeg。



版权声明:本文为qq_39466755原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。