一.下载libx264库,下载地址是:http://www.videolan.org/developers/x264.html 也可以通过 git clone https://code.videolan.org/videolan/x264.git
二.编译、安装libx264
打开命令终端(ctrl + Alt + T)cd 到libx264目录,首先配置libx264库:在命令终端输入
./configure --enable-static --prefix=static
--prefix=static表示在当前目录下生成一个static文件夹
--enable-static 表示生成静态库,如生成动态库将--enable-static替换为--enable-shared, --prefix后面跟
生成库安装路径。
执行命令时出现
Found no assembler
Minimum version is nasm-2.13
If you really want to compile without asm, configure with --disable-asm.
这是因为需要安装高版本的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
安装nasm
1 ./configure
2. make
3. sudo make install
配置成功后 ,再去执行x264的
1 ./configure --enable-static --prefix=static
2. make
3. make install