Mac下编译FFMPEG for Android

本文介绍了在Mac OS 10.14.2上,使用android-ndk-r20和clang编译FFmpeg 4.2.1的详细过程,包括自定义NDK交叉编译链、编译脚本的编写、动态库的生成及其配置修改。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前面讲到了自定义NDK编译工具链为编译FFMPEG提供环境,

目录

编译环境

操作系统:mac os 10.14.2
NDK版本:android-ndk-r20
编译器:clang
FFMPEG版本:4.2.1

编译脚本

  • 整理了一个编译环境的脚本build.sh,放在FFMPEG目录下
#!/bin/sh

# Android NDK sources and standalone toolchain is put here
DEV=~/Library/Android/sdk
NDK_HOME=~/Library/Android/sdk/ndk-bundle
#自定义NDK toolchain目录
CHAIN_ENV=${NDK_HOME}/Chain/android-toolchain

# Set Android target arch
ANDROID_ARCH=arm

# All the built binaries, libs and their header will be installed here
PREFIX=~

# static or share libs dir
OUT_PUT=${PREFIX}/android-output

# Don't mix up .pc files from your host and build target
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig

# Set Android target API level
ANDROID_API=21

# The cross-compile toolchain we use
TOOLCHAIN=${ANDROID_ARCH}-linux-androidea
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值