当前位置: 首页 > news >正文

MetaRTC-ffmpeg arm移植

touch cmake_arm.sh
添加

rm -rf build
mkdir build
cd build
ARCH=aarch64.cmake
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../$ARCH  ..
make

touch cmake_arm.sh
添加

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

./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

export PATH=$PATH:/home/yqw/MetaRTC/RV/usr/bin
./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

 ./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 -j20sudo make install

add CC

./config no-asm shared no-async --prefix=$(pwd)/build --cross-compile-prefix=arm-linux- CC=gcc

RV32

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

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

在build中到.a

编译ffmpeg

./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

./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编译成动态库,不然会报如下错误:

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

speexdsp
./autogen.sh
./configure --prefix=“$(pwd)/build-33” --host=“arm-linux” --enable-shared --enable-static CC=arm-linux-gcc
make -j20
make install

/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?)

ffmpeg-bin
./configure --cross-prefix=/home/yqw/MetaRTC/BC/stbgcc-6.3-1.1/bin/arm-linux- --enable-cross-compile --target-os=linux --cc=arm-linux-gcc --arch=arm --prefix=$(pwd)/build32 --disable-shared --enable-static --extra-libs=‘-L/home/yqw/temp/FFMPEG_WEBRTC/2.0-ffmpeg-webrtc/FFmpeg-n4.3.3/metartc2 -lmetartccore2 -lpthread -lspeexdsp -lsrtp2 -lssl -lcrypto -ldl’

http://www.lryc.cn/news/355774.html

相关文章:

  • 【乐吾乐3D可视化组态编辑器】模型类型与属性
  • PyQt下拉框QComboBox点击下拉时即更新下拉数据
  • 网上有哪些正规的兼职副业赚钱平台?分享10类正规的网上兼职赚钱平台,让你在家也能赚钱~
  • Spring:JWT
  • Python的selenium爬取
  • Linux--进程间通信(1)(匿名管道)
  • Hive环境搭建
  • 网络编程基础(四)
  • 将C++ cv:mat 通过JNI 转换为jbtyearray,传到android端
  • WannaCry勒索软件(CVE-2017-0144)
  • JavaScript(ES5) 入门
  • 趣店集团golang一面要个20K,Channel什么情况下会出现死锁,有遇到过吗?
  • 智能化乙级资质延期,行业标准的坚守
  • d20(184-190)-勇敢开始Java,咖啡拯救人生
  • Python 登录表单处理
  • 2024.05.27学习记录
  • BLASTBufferQueue端的GraphicBuffer怎么和SurfaceFlinger端的BufferStateLayer关联上
  • 48、spfa求最短路
  • 安装PyTorch详细步骤
  • linux线程,线程控制与线程相关概念
  • 第八大奇迹
  • MySQL:CRUD初阶(有图有实操)
  • 『大模型笔记』使用 vLLM 和 PagedAttention 快速提供 LLM 服务!
  • 简述vue-loader是什么?使用它的用途有哪些
  • 如何远程访问Redis?
  • #12松桑前端后花园周刊-SolidStart、Vercel融资、Angular18、Nextjs15RC、p5.js、ChromeDevTools引入AI
  • vue3 vite title 页面标题设置
  • spring boot添加License(软件许可)
  • LangChain打造一个AI客服
  • 【前端三剑客之JS】详解JS