1.下载mp4v2源码
下载最新release版本源码:https://github.com/TechSmith/mp4v2/releases
通过wget命令下载源码包
wget https://github.com/TechSmith/mp4v2/archive/Release-ThirdParty-MP4v2-4.1.5.tar.gz
2.解压源码并配置编译参数
2.1 解压并创建编译安装目录
tar axvf Release-ThirdParty-MP4v2-4.1.5.tar.gz
cd mp4v2-Release-ThirdParty-MP4v2-4.1.5
mkdir output
2.2 配置configure
配置configure生产Makefile
./configure --enable-static --host=arm-linux --disable-debug CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ --prefix=/home/disk/fangye/build_amba/mp4/mp4v2-Release-ThirdParty-MP4v2-4.1.5/output
2.3 交叉编译
执行make命令:
make -j8
编译报错一:
src/rtphint.cpp:342:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
342 | if (pSlash != '\0') {
| ~~~~~~~^~~~~~~
make: *** [src/rtphint.lo] Error 1
解决办法:
vim src/rtphint.cpp +342
修改源码,将'\0'改为NULL
编译完成后,执行:
make install
结果如下: