-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild-ffmpeg4android.sh
executable file
·63 lines (53 loc) · 1.75 KB
/
build-ffmpeg4android.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
. _settings.sh
# defined modules to be included in ffmpeg built
# if include ffmpeg, then ffmpeg is built without the codec submodule
MODULES=("x264" "vpx" "lame")
FFMPEG_SA=("ffmpeg")
# Build only the specified module if given as second parameter
if [[ $# -eq 2 ]]; then
MODULES=("$2")
fi
# Auto fetch and unarchive both ffmpeg and x264 from online repository
VERSION_FFMPEG=4.4
VERSION_X264=163
VERSION_VPX=v1.10.0
./init_update_libs.sh $VERSION_FFMPEG $VERSION_X264 $VERSION_VPX
# Applying required patches
. ffmpeg-android_patch.sh "${MODULES[@]}"
for ((i=0; i < ${#ABIS[@]}; i++))
do
if [[ $# -eq 0 ]] || [[ "$1" == "${ABIS[i]}" ]]; then
# Do not build 64-bit ABI if ANDROID_API is less than 21 - minimum supported API level for 64 bit.
[[ ${ANDROID_API} -lt 21 ]] && ( echo "${ABIS[i]}" | grep 64 > /dev/null ) && continue;
rm -rf ${TOOLCHAIN_PREFIX}
# $1 = architecture
# $2 = required for proceed to start setup default compiler environment variables
for m in "${MODULES[@]}"
do
case $m in
x264)
./_x264_build.sh "${ABIS[i]}" $m || exit 1
;;
vpx)
./_vpx_build.sh "${ABIS[i]}" $m || exit 1
;;
png)
./_libpng_build.sh "${ABIS[i]}" $m || exit 1
;;
lame)
./_lame_build.sh "${ABIS[i]}" $m || exit 1
;;
amrwb)
./_amr_build.sh "${ABIS[i]}" $m || exit 1
;;
esac
done
if [[ " ${MODULES[*]} " =~ " ffmpeg " ]]; then
./_ffmpeg_build.sh "${ABIS[i]}" 'ffmpeg' "${FFMPEG_SA[@]}" || exit 1
else
./_ffmpeg_build.sh "${ABIS[i]}" 'ffmpeg' "${MODULES[@]}" || exit 1
fi
fi
done
echo -e "*** BUILD COMPLETED ***\n"