-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-ffmpeg.sh
More file actions
47 lines (39 loc) · 1020 Bytes
/
Copy pathbuild-ffmpeg.sh
File metadata and controls
47 lines (39 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -e
FFMPEG_VERSION=6.0
NDK=/opt/android-ndk
SYSROOT=$NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
ARCH=arm
CPU=armv7-a
API=21
TARGET=armv7a-linux-androideabi
PREFIX=$(pwd)/android/$ARCH
mkdir -p $PREFIX
curl -L https://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.gz | tar xz
cd ffmpeg-$FFMPEG_VERSION
./configure \
--prefix=$PREFIX \
--target-os=android \
--arch=$ARCH \
--cpu=$CPU \
--cc=$TOOLCHAIN/bin/${TARGET}${API}-clang \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--enable-cross-compile \
--ar=$TOOLCHAIN/bin/llvm-ar \
--ranlib=$TOOLCHAIN/bin/llvm-ranlib \
--sysroot=$SYSROOT \
--enable-gpl \
--enable-static \
--disable-shared \
--disable-doc \
--disable-programs \
--disable-avdevice \
--disable-postproc \
--disable-vulkan
make -j$(nproc)
make install
echo "=== Contents of \$PREFIX ==="
ls -lR $PREFIX
mkdir -p /workspace/output/armv7a
cp -r $PREFIX/* /workspace/output/armv7a/