ffmpeg系列文章目录
1.下载x264源码
git clone http://git.videolan.org/git/x264.git
2.解压源码 sudo tar -xjf last_x264.tar.bz2
cd x264-snapshot-20180705-2245
三部曲:
./configure
make
make install
运行./configure
出现 错误:
Found no assembler Minimum version is nasm-2.13 If you really want to compile without asm, configure with --disable-asm.
这是因为需要安装2.13版本的nasm
不能简单的运行sudo apt-get install nasm 要安装的rpm文件包tall nasm 这个版本比较低。应该通过源码编译的方式进行安装。
链接地址:https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/
解压:
sudo tar -zxvf nasm-2.13.03.tar.gz
三部曲安装即可。
make 出现以下问题:
In file included from stdlib/vsnprintf.c:15:
./include/nasmlib.h:194:1: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes]
194 | void pure_func seg_init(void);
| ^~~~
In file included from stdlib/snprintf.c:13:
./include/nasmlib.h:194:1: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes]
194 | void pure_func seg_init(void);
| ^~~~
cc1: some warnings being treated as errors
cc1: some warnings being treated as errors
make: *** [Makefile:75:stdlib/snprintf.o] 错误 1
make: *** 正在等待未完成的任务....
make: *** [Makefile:75:stdlib/vsnprintf.o] 错误 1
In file included from ./include/nasm.h:46,
from asm/nasm.c:47:
./include/nasmlib.h:194:1: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes]
194 | void pure_func seg_init(void);
| ^~~~
cc1: some warnings being treated as errors
make: *** [Makefile:75:asm/nasm.o] 错误 1
解决方法:
解决nasm-2.13在新版ubuntu编译make不过的办法
./include/nasmlib.h:194:1: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes] 194 | void pure_func seg_init(void);
因为gcc版本过新。
解决办法:
修改“./include/nasmlib.h”文件
vim ./include/nasmlib.h
找到语句
void pure_func seg_init(void);
注释掉,问题解决。
安装完成nasm之后再重新进入x264目录下./configure 之后就可以。
3.重新编译安装ffmpeg
进入到ffmpeg的目录下,分别执行命令:
1)配置ffmpeg时,加上x264,如:
./configure --enable-gpl --enable-libx264
2)make clean
3)make
4)make install