-
Notifications
You must be signed in to change notification settings - Fork 2
/
arm32v7.Dockerfile
462 lines (429 loc) · 11.4 KB
/
arm32v7.Dockerfile
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-jammy-05e08486-ls73 as devel-base
ENV DEBIAN_FRONTEND="noninteractive"
ENV MAKEFLAGS="-j4"
ENV AOM=v3.6.1 \
FDKAAC=2.0.2 \
FFMPEG_HARD=7.0 \
FONTCONFIG=2.14.2 \
FREETYPE=2.12.1 \
FRIBIDI=1.0.13 \
KVAZAAR=2.2.0 \
LAME=3.100 \
LIBASS=0.17.1 \
LIBDAV1D=1.2.0 \
LIBSRT=1.5.1 \
LIBVIDSTAB=1.1.0 \
LIBWEBP=1.3.0 \
OGG=1.3.5 \
OPENCOREAMR=0.1.6 \
OPENJPEG=2.5.0 \
OPUS=1.3.1 \
THEORA=1.1.1 \
VORBIS=1.3.7 \
VPX=1.13.0 \
X265=3.4 \
XVID=1.3.7
RUN apt-get -yqq update && \
apt-get -yq --no-install-recommends install -y \
autoconf \
automake \
bzip2 \
ca-certificates \
cmake \
curl \
diffutils \
expat \
g++ \
gcc \
git \
gperf \
libexpat1-dev \
libxext-dev \
libgcc-9-dev \
libgomp1 \
libharfbuzz-dev \
libpciaccess-dev \
libssl-dev \
libtool \
libv4l-dev \
libx11-dev \
libxcb-shape0-dev \
libxml2-dev \
make \
nasm \
ninja-build \
patch \
perl \
pkg-config \
python3 \
python3-pip\
python3-setuptools \
python3-wheel \
x11proto-xext-dev \
xserver-xorg-dev \
yasm \
zlib1g-dev && \
apt-get autoremove -y && \
apt-get clean -y && \
pip3 install meson
# aom
RUN mkdir -p /tmp/aom && \
git clone \
--branch ${AOM} \
--depth 1 https://aomedia.googlesource.com/aom \
/tmp/aom
RUN cd /tmp/aom && \
rm -rf \
CMakeCache.txt \
CMakeFiles && \
mkdir -p \
aom_build && \
cd aom_build && \
cmake \
-DAOM_TARGET_CPU=generic \
-DBUILD_STATIC_LIBS=0 .. && \
make && \
make install
# dav1d
RUN mkdir -p /tmp/dav1d && \
git clone \
--branch ${LIBDAV1D} \
--depth 1 https://github.com/videolan/dav1d.git \
/tmp/dav1d
RUN mkdir /tmp/dav1d/build && cd /tmp/dav1d/build && \
meson setup -Denable_tools=false -Denable_tests=false --libdir /usr/local/lib .. && \
ninja && \
ninja install
# fdk-aac
RUN mkdir -p /tmp/fdk-aac && \
curl -Lf \
https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fdk-aac
RUN cd /tmp/fdk-aac && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# freetype
RUN mkdir -p /tmp/freetype && \
curl -Lf \
https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/freetype
RUN cd /tmp/freetype && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# fontconfig
RUN mkdir -p /tmp/fontconfig && \
curl -Lf \
https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fontconfig
RUN cd /tmp/fontconfig && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# fribidi
RUN mkdir -p /tmp/fribidi && \
curl -Lf \
https://github.com/fribidi/fribidi/archive/v${FRIBIDI}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fribidi
RUN cd /tmp/fribidi && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make -j 1 && \
make install
# kvazaar
RUN mkdir -p /tmp/kvazaar && \
curl -Lf \
https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/kvazaar
RUN cd /tmp/kvazaar && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# lame
RUN mkdir -p /tmp/lame && \
curl -Lf \
http://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/lame
RUN cd /tmp/lame && \
cp \
/usr/share/automake-1.16/config.guess \
config.guess && \
cp \
/usr/share/automake-1.16/config.sub \
config.sub && \
./configure \
--disable-frontend \
--disable-static \
--enable-nasm \
--enable-shared && \
make && \
make install
# libass
RUN mkdir -p /tmp/libass && \
curl -Lf \
https://github.com/libass/libass/archive/${LIBASS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libass
RUN cd /tmp/libass && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# libsrt
RUN mkdir -p /tmp/libsrt && \
curl -Lf \
https://github.com/Haivision/srt/archive/v${LIBSRT}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libsrt
RUN cd /tmp/libsrt && \
cmake . && \
make && \
make install
# libwebp
RUN mkdir -p /tmp/libwebp && \
curl -Lf \
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${LIBWEBP}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libwebp
RUN cd /tmp/libwebp && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# ogg
RUN mkdir -p /tmp/ogg && \
curl -Lf \
http://downloads.xiph.org/releases/ogg/libogg-${OGG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/ogg
RUN cd /tmp/ogg && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# opencore-amr
RUN mkdir -p /tmp/opencore-amr && \
curl -Lf \
http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opencore-amr
RUN cd /tmp/opencore-amr && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# openjpeg
RUN mkdir -p /tmp/openjpeg && \
curl -Lf \
https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/openjpeg
RUN cd /tmp/openjpeg && \
rm -Rf \
thirdparty/libpng/* && \
curl -Lf \
https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz | \
tar -zx --strip-components=1 -C thirdparty/libpng/ && \
cmake \
-DBUILD_STATIC_LIBS=0 \
-DBUILD_THIRDPARTY:BOOL=ON . && \
make && \
make install
# opus
RUN mkdir -p /tmp/opus && \
curl -Lf \
https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opus
RUN cd /tmp/opus && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# theora
RUN mkdir -p /tmp/theora && \
curl -Lf \
http://downloads.xiph.org/releases/theora/libtheora-${THEORA}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/theora
RUN cd /tmp/theora && \
cp \
/usr/share/automake-1.16/config.guess \
config.guess && \
cp \
/usr/share/automake-1.16/config.sub \
config.sub && \
curl -fL \
'https://gitlab.xiph.org/xiph/theora/-/commit/7288b539c52e99168488dc3a343845c9365617c8.diff' \
> png.patch && \
patch ./examples/png2theora.c < png.patch && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# vid.stab
RUN mkdir -p /tmp/vid.stab && \
curl -Lf \
https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vid.stab
RUN cd /tmp/vid.stab && \
echo "" > \
CMakeModules/FindSSE.cmake && \
cmake . && \
make && \
make install
# vorbis
RUN mkdir -p /tmp/vorbis && \
curl -Lf \
http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vorbis
RUN cd /tmp/vorbis && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
# vpx
RUN mkdir -p /tmp/vpx && \
curl -Lf \
https://github.com/webmproject/libvpx/archive/v${VPX}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vpx
RUN cd /tmp/vpx && \
LDFLAGS=-mfloat-abi=hard ./configure \
--disable-debug \
--disable-docs \
--disable-examples \
--disable-install-bins \
--disable-static \
--disable-unit-tests \
--enable-pic \
--enable-shared \
--enable-vp8 \
--enable-vp9 \
--enable-vp9-highbitdepth \
--extra-cflags="-mfloat-abi=hard" \
--extra-cxxflags="-mfloat-abi=hard" && \
make && \
make install
# x264
RUN mkdir -p /tmp/x264 && \
git clone --branch stable --depth 1 https://github.com/mirror/x264 /tmp/x264
RUN cd /tmp/x264 && \
./configure \
--disable-cli \
--disable-static \
--enable-pic \
--enable-shared && \
make && \
make install
# x265
RUN mkdir -p /tmp/x265 && \
curl -Lf \
http://anduin.linuxfromscratch.org/BLFS/x265/x265_${X265}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/x265
RUN cd /tmp/x265/build/linux && \
curl -fL \
https://sources.debian.org/data/main/x/x265/3.4-2/debian/patches/0001-Fix-arm-flags.patch \
> arm.patch && \
patch ../../source/CMakeLists.txt < arm.patch && \
cmake \
-D ENABLE_ASSEMBLY=OFF \
-D ENABLE_CLI=OFF \
-G "Unix Makefiles" ../../source && \
make && \
make install
# xvid
RUN mkdir -p /tmp/xvid && \
curl -Lf \
https://downloads.xvid.com/downloads/xvidcore-${XVID}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/xvid
RUN cd /tmp/xvid/build/generic && \
./configure && \
make && \
make install
# ffmpeg
RUN if [ -z ${FFMPEG_VERSION+x} ]; then \
FFMPEG=${FFMPEG_HARD}; \
else \
FFMPEG=${FFMPEG_VERSION}; \
fi && \
mkdir -p /tmp/ffmpeg && \
echo "https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2" && \
curl -Lf \
https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2 | \
tar -jx --strip-components=1 -C /tmp/ffmpeg
RUN cd /tmp/ffmpeg && \
./configure \
--disable-debug \
--disable-doc \
--disable-ffplay \
--enable-ffprobe \
--enable-fontconfig \
--enable-gpl \
--enable-libaom \
--enable-libdav1d \
--enable-libass \
--enable-libfdk_aac \
--enable-libfreetype \
--enable-libkvazaar \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libsrt \
--enable-libtheora \
--enable-libv4l2 \
--enable-libvidstab \
--enable-libvorbis \
--enable-libvpx \
--enable-libwebp \
--enable-libxml2 \
--enable-libx264 \
--enable-libx265 \
--enable-libxvid \
--enable-nonfree \
--enable-openssl \
--enable-small \
--enable-stripping \
--enable-version3 \
--extra-libs=-ldl \
--extra-libs=-lpthread && \
make
RUN ldconfig && \
mkdir -p /buildout/usr/local/bin && \
cp \
/tmp/ffmpeg/ffmpeg \
/buildout/usr/local/bin && \
cp \
/tmp/ffmpeg/ffprobe \
/buildout/usr/local/bin && \
mkdir -p /buildout/usr/lib && \
ldd /tmp/ffmpeg/ffmpeg \
| awk '/local/ {print $3}' \
| xargs -i cp -L {} /buildout/usr/lib/
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-jammy-05e08486-ls73 as runtime-base
ENV MAKEFLAGS="-j4"
RUN apt-get -yqq update && \
DEBIAN_FRONTEND="noninteractive" apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 libharfbuzz-bin libxml2 libxcb-shape0 libv4l-0 \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=devel-base /buildout/ /
RUN apt-get update && \
apt-get install -y libicu-dev tzdata fontconfig fonts-noto-core fonts-noto-cjk libgdiplus libdrm2 && \
rm -rf /var/lib/apt/lists/*
CMD ["--help"]
ENTRYPOINT ["ffmpeg"]