MetaRTC-ffmpeg arm移植

touch cmake_arm.sh

添加

cpp 复制代码
rm -rf build
mkdir build
cd build
ARCH=aarch64.cmake
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../$ARCH  ..
make

touch cmake_arm.sh

添加

cpp 复制代码
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER /home/yqw/MetaRTC/BC/stbgcc-6.3-1.1/bin/arm-linux-gcc)
SET(CMAKE_CXX_COMPILER /home/yqw/MetaRTC/BC/stbgcc-6.3-1.1/bin/arm-linux-g++)

将这两个文件放入libmetartc6

./cmake_arm.sh

srtp

cpp 复制代码
./configure --prefix="/home/yqw/temp/ffmpeg-webrtc/FFmpeg-n4.3.3/metartc6/libsrtp-2-fit" --host="arm-linux" --enable-static --enable-shared CC=/home/yqw/MetaRTC/BC/stbgcc-6.3-1.1/bin/arm-linux-gcc
make -j20

RV32

cpp 复制代码
export PATH=$PATH:/home/yqw/MetaRTC/RV/usr/bin
cpp 复制代码
./configure --prefix="/home/yqw/temp/ffmpeg-webrtc/FFmpeg-n4.3.3/metartc6/libsrtp-2-fit" --host="arm-linux" --enable-static --enable-shared CC=arm-linux-gnueabihf-gcc

openssl

cpp 复制代码
 ./config no-asm shared no-async --prefix=$(pwd)/build --cross-compile-prefix=/home/yqw/MetaRTC/BC/stbgcc-6.3-1.1/bin/arm-linux-
 make -j20
 sudo make install

RV32

cpp 复制代码
export PATH=$PATH:/home/yqw/MetaRTC/RV/usr/bin
cpp 复制代码
./config no-asm shared no-async --prefix=$(pwd)/build --cross-compile-prefix=arm-linux-gnueabihf-

然后把Makefile中的所有的-m64删去

在build中到.a

编译ffmpeg

cpp 复制代码
./configure --cross-prefix=/home/yqw/MetaRTC/BC/stbgcc-6.3-1.1/bin/arm-linux- --enable-cross-compile --target-os=linux --cc=/home/yqw/MetaRTC/BC/stbgcc-6.3-1.1/bin/arm-linux-gcc --arch=arm --prefix=$(pwd)/build32 --disable-shared --enable-static --extra-libs='-L/home/yqw/temp/ffmpeg-webrtc/FFmpeg-n4.3.3/metartc6 -lmetartccore6 -lpthread -lsrtp2 -lssl -lcrypto -ldl'

RV32

cpp 复制代码
./configure --cross-prefix=/home/yqw/MetaRTC/RV/bin/arm-linux-gnueabihf- --enable-cross-compile --target-os=linux --cc=arm-linux-gnueabihf-gcc --arch=arm --prefix=$(pwd)/build_RV32 --disable-shared --enable-static --extra-libs='-L/home/yqw/temp/ffmpeg-webrtc/FFmpeg-n4.3.3/metartc6 -lmetartccore6 -lpthread -lsrtp2 -lssl -lcrypto -ldl'

注意这里的dl和pthread是调用交叉编译工具链中的库;当写在同一个--extra-libs里时没有顺序之分,如果用两个--extra-libs,那么就有加载的顺序之分,比如crypto里要用到dl,那么dl就需要放在它的前面加载。

第二个注意点,无法把ffmepg编译成动态库,不然会报如下错误:

cpp 复制代码
libmetartccore6.a(YangMetaConnection.c.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC

/home/yqw/temp/ffmpeg-webrtc/FFmpeg-n4.3.3/metartc6/metartc6/include/yang_config.h

#define Yang_Enable_Dtls 1 //default:using dtls

#define Yang_Enable_Openssl 1

#define Yang_Enable_RTC_Video 0

metartc支持mips32位,支持arm64,不支持arm32位,在arm32下报下列错误,这个错误是对内存的越界操作,然后再free(),目前metartc6和7都不支持arm32。

webrtc init>>>>>>>>>>>>>>>>>>>http://192.168.100.77:1985/tc/v1/whip/?app=live\&stream=livestream

webrtc @ 0x189c3c0 webrtc_open http://192.168.100.77:1985/tc/v1/whip/?app=live\&stream=livestream

srtp init success!

*** Error in `/usr/data/ffmpeg': free(): invalid next size (fast): 0x0189cd20 ***

Program received signal SIGABRT, Aborted.

0xb6e515f6 in ?? () from /lib/libc.so.6

(gdb) bt

#0 0xb6e515f6 in ?? () from /lib/libc.so.6

#1 0xb6e5f2ac in raise () from /lib/libc.so.6

#2 0xb6e5ff9a in abort () from /lib/libc.so.6

#3 0xb6e86bba in ?? () from /lib/libc.so.6

Backtrace stopped: previous frame identical to this frame (corrupt stack?)

相关推荐
水獭比特4 小时前
自动成片没报错,为什么音画还会漂?
ffmpeg
Yeauty4 小时前
2026 年在 Rust 里处理音视频,该走哪条路?
rust·ffmpeg·音视频·视频
m0_547486664 小时前
《Arm Cortex-M4嵌入式系统-STM32G4系列微控制器的原理架构与开发》全套PPT课件
arm开发·stm32·嵌入式硬件
工业设备方案笔记5 小时前
RK3588 AI部署实战:如何在ARM设备上运行AI模型?——从模型转换到边缘推理全过程解析
arm开发·人工智能·边缘计算
2601_954706497 小时前
基于 ARM 虚拟化的云手机架构选型与 Python 自动化实战——2026 年 8 月为何我推荐傲晨云手机
arm开发·智能手机·架构
weixin_424381001 天前
IAR EW for Arm - IAR命令行
arm开发
勿忘初心12211 天前
【Windows流媒体实战1】FFmpeg+Nginx-RTMP Windows详细搭建教程
ffmpeg·nginx-rtmp·windows流媒体搭建·rtmp直播
咯哦哦哦哦1 天前
【deban13】系统 安装arm qt6.8.2
arm开发
云栖梦泽在2 天前
稳如狗网络工具箱:IP、DNS、WebRTC、测速、连通性和全球延迟检测工具简明介绍
网络·网络协议·tcp/ip·网络安全·性能优化·webrtc
磨十三2 天前
U-Boot
arm开发·嵌入式硬件