openh264 for android,OpenH264编译ffmpeg android

思科的

安装NASM

Android Builds

install android sdk and ndk.

export PATH=**ANDROID_SDK**/tools:$PATH

make OS=android NDKROOT=**ANDROID_NDK** TARGET=**ANDROID_TARGET**

Valid**ANDROID_TARGET**can be found in**ANDROID_SDK**/platforms, such asandroid-12.

You can also setARCH,NDKLEVELaccording to your device and NDK version.

ARC:arm,arm64,x86andx86_64

NDKLEVELspecifies android api level, the default is 12.Available possibilities can be found in**ANDROID_NDK**/platforms,

By default these commands build for thearmeabi-v7a

codec- encoder, decoder, console (test app), build (makefile, vcproj)

build- scripts for Makefile build system

test- GTest unittest files

testbin- autobuild scripts, test app config files

res- yuv and bitstream test files

# armeabi-v7a

make OS=android NDKROOT=$NDK_ROOT TARGET=android-21 ARCH=arm NDKLEVEL=21 clean

make OS=android NDKROOT=$NDK_ROOT TARGET=android-17 ARCH=armNDKLEVEL=17

NDK 从 level21 开始支持 64位架构,因此 TARGET 低于 android-21 的将无法编译 arm64、x86_64、mips64 库

mips、mips64 两种架构未做优化处理

生成的文件位于 ~/openh264 目录下,共计5个静态库,1个动态库

libcommon.a

libdecoder.a

libencoder.a

libopenh264.a

libprocessing.a

libopenh264.so

Invalid or unsupported command "update project -t android-17 -p ."

看makefile

"cd./test/build/android&& $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) &&android update project -t$(TARGET)-p. &&ant debug"

this error caused by using a higher SDK tool to build encoder & decoder demo program. The "android" tool does not support "update project" in the higher SDK version. Actually, the openh264 libraries have been built successfully.

实际已经编译成功了

ffmpeg

./configure --list-decoders和./configure --list-encoders都有

libopenh264

--enable-libopenh264

ffmpeg中

#include

#include

vim meson.build

foreach t : ['', '-static']

pkgconf = configuration_data()

pkgconf.set('prefix', join_paths(get_option('prefix')))

pkgconf.set('VERSION', meson.project_version())

if t == '-static'

do_install = false

pkgconf.set('LIBS', '-lstdc++ -lpthread -lm')

pkgconf.set('LIBS_PRIVATE', '')

else

do_install = true

pkgconf.set('LIBS', '')

pkgconf.set('LIBS_PRIVATE', '-lstdc++ -lpthread -lm')

endif

undefined reference to '__dso_handle'

make install PREFIX=/some/path

make install-static PREFIX=/root/starRTC_ffmpeg/ffmpeg_compile/build_result/armeabi-v7a-neon

undefined reference to XXX_neonerrors at the stage of FFmpeg configuring.

In the end, I set USE_ASM to no and everything was okay.

Makefile

ifeq ($(BUILDTYPE), Release)

CFLAGS += $(CFLAGS_OPT)

USE_ASM = No

else

CFLAGS += $(CFLAGS_DEBUG)

USE_ASM = No

endif

arm-linux-androideabi/bin/ld: error: cannot find -lpthread

改为 -pthread

因为android的ndk虽然有pthread.h,但是没有libpthread.a,集成到libc.a里了-lc

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值