1、使用MP4v2库
前提:交叉编译好RV1106的工具链
(1)下载路径:MP4v2 | mp4v2 源码(2)解压后修改CMakeLists.txtoption(BUILD_UTILS "Build MP4v2 auxiliary tools" OFF)(3)执行编译:mkdir buildcd buildcmake -DCMAKE_INSTALL_PREFIX=/opt/install -DCMAKE_C_COMPILER=arm-rockchip830-linux-uclibcgnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-rockchip830-linux-uclibcgnueabihf-g++ -DCMAKE_AR=arm-rockchip830-linux-uclibcgnueabihf-ar --disable-option-checking --disable-debug --disable-optimize --disable-fvisibility --disable-gch --disable-largefile --disable-util --disable-dependency-tracking --disable-libtool-lock --host=arm-rockchip830-linux --disable-static ..makemake install(4)编译完成后在build目录下查看libmp4v2.so.2.1.3,发现属性为arm即可。
2、使用gpac库
gpac依赖于zlib,需要先安装zlib.
(1)zlib的安装1-1:export ARCH=arm 1-2:export CROSS_COMPILE=arm-rockchip830-linux-uclibcgnueabihf-1-3:export CC=arm-rockchip830-linux-uclibcgnueabihf-gcc1-4:export PATH=$PATH:/home/book/Desktop/RV1106_SDK/1106_battery/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/../lib/gcc/arm-rockchip830-linux-uclibcgnueabihf/8.3.0/../../../../arm-rockchip830-linux-uclibcgnueabihf/bin/
./configure --prefix=$PWD/tmp1-5:make1-6:sudo make install1-7:cp lib/* -rfd /home/book/Desktop/RV1106_SDK/1106_battery/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/../arm-rockchip830-linux-uclibcgnueabihf/sysroot/usr/lib/1-8:cp include/* -rf /home/book/Desktop/RV1106_SDK/1106_battery/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/../lib/gcc/arm-rockchip830-linux-uclibcgnueabihf/8.3.0/include
(2)gpac的安装
2-1:export ARCH=arm
2-2:export CROSS_COMPILE=arm-rockchip830-linux-uclibcgnueabihf-
2-3:export CC=arm-rockchip830-linux-uclibcgnueabihf-gcc
2-4:export PATH=$PATH:/home/book/Desktop/RV1106_SDK/1106_battery/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/../lib/gcc/arm-rockchip830-linux-uclibcgnueabihf/8.3.0/../../../../arm-rockchip830-linux-uclibcgnueabihf/bin/
2-5:./configure --host=arm-rockchip830-linux-uclibcgnueabihf --prefix=$PWD/_install --cc=arm-rockchip830-linux-uclibcgnueabihf-gcc --cxx=arm-rockchip830-linux-uclibcgnueabihf-g++ --extra-cflags=-I$PWD/extra_lib/include/zlib --extra-ldflags=-L$PWD/extra_lib/lib/gcc --use-zlib=local
注意:--prefix=$PWD/_install用于指定编译后软件的安装目录--extra-ldflags用于指定依赖的lib库位置--extra-cflags用于指定依赖的include位置
2-6:make
2-7:sudo make install
2-8:cp lib/* -rfd /home/book/Desktop/RV1106_SDK/1106_battery/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/../arm-rockchip830-linux-uclibcgnueabihf/sysroot/usr/lib/
2-9:cp include/* -rf /home/book/Desktop/RV1106_SDK/1106_battery/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/../lib/gcc/arm-rockchip830-linux-uclibcgnueabihf/8.3.0/include
(3)使用media-server库
参考的是gitee上博主,https://gitee.com/cgrj/media-server/blob/master/compile.cn.md在test在make时报错,放弃使用。使用前两种方式安装库均成功