[ 移植 ] ___ Library : X265
简介
x265是一个免费软件 库和应用程序,用于将视频流编码为H.265 /MPEG-H HEVC 压缩格式,并根据GNU GPL 条款发布。
获取
最新的x265 源代码可通过官网直接下载源码包
配置
linux@localhost:~$ mkdir x265onarm
linux@localhost:~$ sudo apt install git yasm nasm cmake cmake-curses-gui pkg-config diffutils libnuma-dev
linux@localhost:~$ git clone https://bitbucket.org/multicoreware/x265_git.git
linux@localhost:~$ cp -r x265_git/build/arm-linux x265_git/build/arm-linux-build
linux@localhost:~$ cd x265_git/build/arm-linux-build
linux@localhost:~/x265_git/build/arm-linux-build$ sed -i "s/arm-linux-gnueabi/arm-none-linux-gnueabi/g" crosscompile.cmake
- 修改目标主机架构,可通过查看交叉编译器版本的参数
--with-cpu 并前往ARM 官网查看得知架构
linux@localhost:~/x265_git/build/arm-linux-build$ sed -i "s/armv6l/armv7l/g" crosscompile.cmake
linux@localhost:~/x265_git/build/arm-linux-build$ cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -DCMAKE_ASM_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_INSTALL_PREFIX=${HOME}/x265onarm -DCMAKE_SHARED_LINKER_FLAGS="-ldl" ../../source && ccmake ../../source
GUI 交互界面配置
- 首先,按
t 切换高级模式,检查各项参数是否正确; - 其次,按
c 进行配置; - 然后,按
g 保存配置并退出。
安装
linux@localhost:~/x265_git/build/arm-linux-build$ make
linux@localhost:~/x265_git/build/arm-linux-build$ make install
查看
linux@localhost:~/x265onarm$ ls -la
total 20
drwxrwxrwx 1 linux linux 4096 Mar 19 10:19 .
drwxr-xr-x 1 linux linux 4096 Mar 19 10:19 ..
drwxr-xr-x 1 linux linux 4096 Mar 19 10:19 bin
drwxr-xr-x 1 linux linux 4096 Mar 19 10:19 include
drwxr-xr-x 1 linux linux 4096 Mar 19 10:19 lib
linux@localhost:~/x265onarm$ tree
.
├── bin
│ └── x265
├── include
│ ├── x265_config.h
│ └── x265.h
└── lib
├── libx265.a
├── libx265.so -> libx265.so.204
├── libx265.so.204
└── pkgconfig
└── x265.pc
4 directories, 7 files
linux@localhost:~/x265onarm$ cd lib
linux@localhost:~/x265onarm/lib$ file libx265.so.204
libx265.so.204: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, not stripped
确认无误后,即可将对应的库文件和可执行程序上传到开发板的lib 目录和bin 目录中使用,当然也可以配合其他库文件进行相关的移植。
|