-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathffmpeg-build-script.diff
140 lines (130 loc) · 5.09 KB
/
ffmpeg-build-script.diff
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
diff --git a/build-ffmpeg b/build-ffmpeg
index 5bc9168..cb35e43 100755
--- a/build-ffmpeg
+++ b/build-ffmpeg
@@ -9,7 +9,7 @@ SCRIPT_VERSION=1.45
CWD=$(pwd)
PACKAGES="$CWD/packages"
WORKSPACE="$CWD/workspace"
-CFLAGS="-I$WORKSPACE/include"
+CFLAGS="-I$WORKSPACE/include ${CFLAGS:-}"
LDFLAGS="-L$WORKSPACE/lib"
LDEXEFLAGS=""
EXTRALIBS="-ldl -lpthread -lm -lz"
@@ -301,10 +301,6 @@ if ! command_exists "cargo"; then
echo "cargo not installed. rav1e encoder will not be available."
fi
-if ! command_exists "python3"; then
- echo "python3 command not found. Lv2 filter and dav1d decoder will not be available."
-fi
-
##
## build tools
##
@@ -441,40 +437,28 @@ fi
## video library
##
-if command_exists "python3"; then
- # dav1d needs meson and ninja along with nasm to be built
- if command_exists "pip3"; then
- # meson and ninja can be installed via pip3
- execute pip3 install pip setuptools --quiet --upgrade --no-cache-dir --disable-pip-version-check
- for r in meson ninja; do
- if ! command_exists ${r}; then
- execute pip3 install ${r} --quiet --upgrade --no-cache-dir --disable-pip-version-check
- fi
- export PATH=$PATH:~/Library/Python/3.9/bin
- done
- fi
- if command_exists "meson"; then
- if build "dav1d" "1.1.0"; then
- download "https://code.videolan.org/videolan/dav1d/-/archive/1.1.0/dav1d-1.1.0.tar.gz"
- make_dir build
-
- CFLAGSBACKUP=$CFLAGS
- if $MACOS_M1; then
- export CFLAGS="-arch arm64"
- fi
+# dav1d needs meson and ninja along with nasm to be built
+if command_exists "meson"; then
+ if build "dav1d" "1.1.0"; then
+ download "https://code.videolan.org/videolan/dav1d/-/archive/1.1.0/dav1d-1.1.0.tar.gz"
+ make_dir build
- execute meson build --prefix="${WORKSPACE}" --buildtype=release --default-library=static --libdir="${WORKSPACE}"/lib
- execute ninja -C build
- execute ninja -C build install
+ CFLAGSBACKUP=$CFLAGS
+ if $MACOS_M1; then
+ export CFLAGS="-arch arm64"
+ fi
- if $MACOS_M1; then
- export CFLAGS=$CFLAGSBACKUP
- fi
+ execute meson build --prefix="${WORKSPACE}" --buildtype=release --default-library=static --libdir="${WORKSPACE}"/lib
+ execute ninja -C build
+ execute ninja -C build install
- build_done "dav1d" "1.1.0"
+ if $MACOS_M1; then
+ export CFLAGS=$CFLAGSBACKUP
fi
- CONFIGURE_OPTIONS+=("--enable-libdav1d")
+
+ build_done "dav1d" "1.1.0"
fi
+ CONFIGURE_OPTIONS+=("--enable-libdav1d")
fi
if ! $MACOS_M1; then
@@ -527,35 +511,10 @@ if $NONFREE_AND_GPL; then
if build "x265" "3.5"; then
download "https://github.com/videolan/x265/archive/Release_3.5.tar.gz" "x265-3.5.tar.gz" # This is actually 3.4 if looking at x265Version.txt
cd build/linux || exit
- rm -rf 8bit 10bit 12bit 2>/dev/null
- mkdir -p 8bit 10bit 12bit
- cd 12bit || exit
- execute cmake ../../../source -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DENABLE_SHARED=OFF -DBUILD_SHARED_LIBS=OFF -DHIGH_BIT_DEPTH=ON -DENABLE_HDR10_PLUS=ON -DEXPORT_C_API=OFF -DENABLE_CLI=OFF -DMAIN12=ON
- execute make -j $MJOBS
- cd ../10bit || exit
- execute cmake ../../../source -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DENABLE_SHARED=OFF -DBUILD_SHARED_LIBS=OFF -DHIGH_BIT_DEPTH=ON -DENABLE_HDR10_PLUS=ON -DEXPORT_C_API=OFF -DENABLE_CLI=OFF
- execute make -j $MJOBS
- cd ../8bit || exit
- ln -sf ../10bit/libx265.a libx265_main10.a
- ln -sf ../12bit/libx265.a libx265_main12.a
- execute cmake ../../../source -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DENABLE_SHARED=OFF -DBUILD_SHARED_LIBS=OFF -DEXTRA_LIB="x265_main10.a;x265_main12.a;-ldl" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON
+ # Disable higher bit depths because they won't build for arm64
+ execute cmake ../../source -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DENABLE_SHARED=OFF -DBUILD_SHARED_LIBS=OFF
execute make -j $MJOBS
- mv libx265.a libx265_main.a
-
- if [[ "$OSTYPE" == "darwin"* ]]; then
- execute "${MACOS_LIBTOOL}" -static -o libx265.a libx265_main.a libx265_main10.a libx265_main12.a 2>/dev/null
- else
- execute ar -M <<EOF
-CREATE libx265.a
-ADDLIB libx265_main.a
-ADDLIB libx265_main10.a
-ADDLIB libx265_main12.a
-SAVE
-END
-EOF
- fi
-
execute make install
if [ -n "$LDEXEFLAGS" ]; then
@@ -823,9 +782,6 @@ if [[ "$OSTYPE" != "darwin"* ]]; then
CPPFLAGS=
download "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz" "libwebp-1.2.2.tar.gz"
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static --disable-dependency-tracking --disable-gl --with-zlib-include="${WORKSPACE}"/include/ --with-zlib-lib="${WORKSPACE}"/lib
- make_dir build
- cd build || exit
- execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include -DENABLE_SHARED=OFF -DENABLE_STATIC=ON ../
execute make -j $MJOBS
execute make install
@@ -913,6 +869,9 @@ fi
## FFmpeg
##
+# Don't build ffmpeg
+exit
+
EXTRA_VERSION=""
if [[ "$OSTYPE" == "darwin"* ]]; then
EXTRA_VERSION="${FFMPEG_VERSION}"