android-ndk-r17c,使用android-ndk-r17c构建ffmpeg 4.2.1时遇到的问题

news/2025/3/19 23:57:19/

1.报fatal error: asm/types.h: No such file or directory

/sysroot/usr/include/linux/types.h:21:23: fatal error: asm/types.h: No such file or directory

#include

解决方案:在--extra-cflags添加头文件目录

--extra-cflags="-I$NDK/sysroot/usr/include -I$NDK/sysroot/usr/include/arm-linux-androideabi" \

2.报./libavutil/avassert.h:30:20: fatal error: stdlib.h: No such file or directory

./libavutil/avassert.h:30:20: fatal error: stdlib.h: No such file or directory

#include

解决方案:在--extra-cflags添加

--extra-cflags=" -isysroot $ISYSROOT"

完整的构建脚本如下:

# 配置NDK路径

NDK=/Users/kevinchen/android-ndk-r17c

# 指定了交叉编译环境,使其在编译过程中能够引用到 NDK 提供的原生标头和共享库文件

SYSROOT=$NDK/platforms/android-23/arch-arm/

ISYSROOT=$NDK/sysroot

TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64

#声明方法

function build_one

{

./configure --prefix=$PREFIX --enable-shared --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-avdevice --disable-symver --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- --target-os=linux --arch=armeabi-v7a --enable-cross-compile --sysroot=$SYSROOT --extra-cflags="-Os -isysroot $ISYSROOT -fpic $ADDI_CFLAGS -I$NDK/sysroot/usr/include -I$NDK/sysroot/usr/include/arm-linux-androideabi" --extra-ldflags="$ADDI_LDFLAGS" $ADDITIONAL_CONFIGURE_FLAG

make clean

make

make install

}

CPU=armeabi-v7a

PREFIX=$(pwd)/android/$CPU

ADDI_CFLAGS="-marm"

build_one

编译中可能会遇到的一些错误

错误一

libavcodec/aaccoder.c: In function 'search_for_ms':

libavcodec/aaccoder.c:803:25: error: expected identifier or '(' before numeric constant

int B0 = 0, B1 = 0;

^

libavcodec/aaccoder.c:865:28: error: lvalue required as left operand of assignment

B0 += b1+b2;

^

libavcodec/aaccoder.c:866:25: error: 'B1' undeclared (first use in this function)

B1 += b3+b4;

^

libavcodec/aaccoder.c:866:25: note: each undeclared identifier is reported only once for each function it appears in

make: *** [libavcodec/aaccoder.o] Error 1

解决:将libavcodec/aaccoder.c文件B0变量替换成b0

错误二

libavcodec/hevc_mvs.c: In function 'derive_spatial_merge_candidates':

libavcodec/hevc_mvs.c:208:15: error: 'y0000000' undeclared (first use in this function)

((y ## v) >> s->ps.sps->log2_min_pu_size))

^

libavcodec/hevc_mvs.c:204:14: note: in definition of macro 'TAB_MVF'

tab_mvf[(y) * min_pu_width + x]

^

libavcodec/hevc_mvs.c:274:16: note: in expansion of macro 'TAB_MVF_PU'

(cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))

^

libavcodec/hevc_mvs.c:368:23: note: in expansion of macro 'AVAILABLE'

is_available_b0 = AVAILABLE(cand_up_right, B0) &&

^

libavcodec/hevc_mvs.c:208:15: note: each undeclared identifier is reported only once for each function it appears in

((y ## v) >> s->ps.sps->log2_min_pu_size))

^

libavcodec/hevc_mvs.c:204:14: note: in definition of macro 'TAB_MVF'

tab_mvf[(y) * min_pu_width + x]

^

libavcodec/hevc_mvs.c:274:16: note: in expansion of macro 'TAB_MVF_PU'

(cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))

^

libavcodec/hevc_mvs.c:368:23: note: in expansion of macro 'AVAILABLE'

is_available_b0 = AVAILABLE(cand_up_right, B0) &&

^

libavcodec/hevc_mvs.c:207:15: error: 'x0000000' undeclared (first use in this function)

TAB_MVF(((x ## v) >> s->ps.sps->log2_min_pu_size), \

^

libavcodec/hevc_mvs.c:204:34: note: in definition of macro 'TAB_MVF'

tab_mvf[(y) * min_pu_width + x]

^

libavcodec/hevc_mvs.c:274:16: note: in expansion of macro 'TAB_MVF_PU'

(cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))

^

libavcodec/hevc_mvs.c:368:23: note: in expansion of macro 'AVAILABLE'

is_available_b0 = AVAILABLE(cand_up_right, B0) &&

^

libavcodec/hevc_mvs.c: In function 'ff_hevc_luma_mv_mvp_mode':

libavcodec/hevc_mvs.c:208:15: error: 'y0000000' undeclared (first use in this function)

((y ## v) >> s->ps.sps->log2_min_pu_size))

^

libavcodec/hevc_mvs.c:204:14: note: in definition of macro 'TAB_MVF'

tab_mvf[(y) * min_pu_width + x]

^

libavcodec/hevc_mvs.c:274:16: note: in expansion of macro 'TAB_MVF_PU'

(cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))

^

libavcodec/hevc_mvs.c:683:24: note: in expansion of macro 'AVAILABLE'

is_available_b0 = AVAILABLE(cand_up_right, B0) &&

^

libavcodec/hevc_mvs.c:207:15: error: 'x0000000' undeclared (first use in this function)

TAB_MVF(((x ## v) >> s->ps.sps->log2_min_pu_size), \

^

libavcodec/hevc_mvs.c:204:34: note: in definition of macro 'TAB_MVF'

tab_mvf[(y) * min_pu_width + x]

^

libavcodec/hevc_mvs.c:274:16: note: in expansion of macro 'TAB_MVF_PU'

(cand && !(TAB_MVF_PU(v).pred_flag == PF_INTRA))

^

libavcodec/hevc_mvs.c:683:24: note: in expansion of macro 'AVAILABLE'

is_available_b0 = AVAILABLE(cand_up_right, B0) &&

^

make: *** [libavcodec/hevc_mvs.o] Error 1

解决:将libavcodec/hevc_mvs.c文件的变量B0改成b0,xB0改成xb0,yB0改成yb0

问题三

libavcodec/opus_pvq.c: In function 'quant_band_template':

libavcodec/opus_pvq.c:498:9: error: expected identifier or '(' before numeric constant

int B0 = blocks;

^

libavcodec/opus_pvq.c:559:12: error: lvalue required as left operand of assignment

B0 = blocks;

^

make: *** [libavcodec/opus_pvq.o] Error 1

解决:将libavcodec/opus_pvq.c文件的变量B0改成b0


http://www.ppmy.cn/news/324772.html

相关文章

3GPP R17 NR测量GAP增强

3GPP R17 NR测量GAP增强包含三个部分,(1) Pre-configured MG pattern(s), (2) Multiple concurrent and independent MG patterns, (3) Network controlled small gap。本文重点介绍(1)和(3)。 Pre-configured MG pattern(s) 基站配置Pre-configured MG之后&#x…

3GPP R17空闲态省电特性

Paging Early Indication 为了进一步降低空闲态UE监听PDCCH的功耗,R17提出Paging Early Indication(PEI)方案。方案的主要思想是在PO(Paging Occasion)之前插入一个PEI-O(PEI Occasion),UE在解调到PEI信息之后,再确定是否需要解调PO信息。其中…

5G 标准 — R17

目录 文章目录 目录R17 冻结计划NR 定位增强NR-LightNR V2X 增强XR 评估NB-IoT/eMTC 与非地面网络集成UE 处于 RRC INACTIVE 态下小数据包传输 R17 冻结计划 2021 年 9 月 24 日消息,3GPP 技术规范组(TSG)刚举办的电子会议 #93-e 预计在 202…

NR R17 标准梳理,再战5G,未来可期(转载)

一:概述 R15 R15 2019年冻结,侧重于eMBB增强移动宽带,更快的网络传输速率, 主要面向2C消费者终端市场; 5G第一个版本,定义了3大应用场景,增强型移动宽带eMBB,超可靠低时延通信URL…

3GPP 5G R17标准冻结,RedCap作为重要特性值得关注!

在本月的3GPP RAN会议中,5G Release 17(简称:R17)标准宣布冻结。RedCap作为R17标准的重要特性之一,R17标准的冻结意味着5G针对中高速物联的RedCap新技术标准已就绪,未来将进一步拓展5G万物互联的智能新场景…

硅谷甄选 Blog_02-项目集成

集成 element-plus 硅谷甄选运营平台,UI 组件库采用的 element-plus,因此需要集成 element-plus 插件 官网地址:https://element-plus.gitee.io/zh-CN/ 安装 pnpm install element-plus用法 完整引入 // main.ts import { createApp } …

树莓派Zero 2 W和Zero W的对比测试之外观差别

关键词:树莓派 Zero 2 W 二代 BCM2710 四核Cortex-A53 外观 触点 概述:树莓派Zero 2 W已经在2021年10月28号发布,CPU从一代的单核1GHz ARM11(早前默认频率为720MHz)升级为四核1GHz的Cortex-A53,从架构和核心数的升级来看&…

评价计算机主机电源的标准主要有哪些,厉害:计算机的电源是什么?真的有什么用?...

计算机和计算机是由电力驱动的大脑。大脑需要电才能工作,那么电从何而来呢?是否直接插入220V主电源?答案当然是可以连接到市电,但是计算机使用的电流和电压很小,如果直接将其插入220V电源中,它将立即烧毁&a…