一、开发环境介绍
X264库的版本: x264-snapshot-20181217-2245
开发板:友善之臂 RK3399
RK3399芯片是国内优秀芯片厂商瑞芯微的六核64位芯片。
开发板运行的系统是: FriendlyDesktop ubuntu系统。
开发板的官网使用介绍链接:http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T4/zh#FriendlyDesktop.E7.B3.BB.E7.BB.9F.E7.9A.84.E4.BD.BF.E7.94.A8
二、编译NASM
下载NASM库: http://distfiles.macports.org/nasm/
下载nasm-2.14.02 .tar.bz2 进行解压。
nasm-2.14.02CSDN下载地址: https://download.csdn.net/download/xiaolong1126626497/12339734
注意: 下面代码是直接在RK3399系统里运行的,不是在PC电脑上,使用的编译器是aarch64-linux-gcc
aarch64位的编译器下载地址: https://download.csdn.net/download/xiaolong1126626497/12203205
编译安装NASM库示例:
wbyq@wbyq:~$ tar xvf nasm-2.14.02 .tar.bz2 wbyq@wbyq:~$ ./configure wbyq@wbyq:~$ make wbyq@wbyq:~$ sudo make install
三、编译X264
下载x264库:https://download.csdn.net/download/xiaolong1126626497/12339693
编译x264库:
wbyq@wbyq:~$ ./configure --prefix=$PWD/_install --enable-static --enable-shared wbyq@wbyq:~$ make && make install
编码运行时提示:
[libx264 @ 0x7f34004aa0]
using cpu capabilities: ARMv8 NEON
[libx264 @ 0x7f34004aa0] profile High, level 2.2, 4:2:0, 8-bit
[libx264 @ 0x7f34004aa0] 264 - core 157 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=10 keyint_min=1 scenecut=40 intra_refresh=0 rc=abr mbtree=0 bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.40 aq=1:1.00
X264库编译好之后,就可以编译FFMPEG库了。
编译好的ffmpeg库下载地址: https://download.csdn.net/download/xiaolong1126626497/12339799
wbyq@wbyq:~/work/rk3399/ffmpeg-4.2.2$ make clean wbyq@wbyq:~/work/rk3399/ffmpeg-4.2.2$ ./configure --enable-shared --enable-static --prefix=$PWD/_install --enable-gpl --enable-ffmpeg --enable-libx264 --extra-cflags=-I/home/wbyq/work/rk3399/x264-snapshot-20181217-2245/_install/include --extra-ldflags=-L/home/wbyq/work/rk3399/x264-snapshot-20181217-2245/_install/lib wbyq@wbyq:~/work/rk3399/ffmpeg-4.2.2$ make && make install