forked from wader/static-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
916 lines (866 loc) · 43 KB
/
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
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# bump: alpine /FROM alpine:([\d.]+)/ docker:alpine|^3
# bump: alpine link "Release notes" https://alpinelinux.org/posts/Alpine-$LATEST-released.html
FROM alpine:3.17.3 AS builder
RUN apk add --no-cache \
coreutils \
wget \
rust cargo cargo-c \
openssl-dev openssl-libs-static \
ca-certificates \
bash \
tar \
build-base \
autoconf automake \
libtool \
diffutils \
cmake meson ninja \
git \
yasm nasm \
texinfo \
jq \
zlib-dev zlib-static \
bzip2-dev bzip2-static \
libxml2-dev libxml2-static \
expat-dev expat-static \
fontconfig-dev fontconfig-static \
freetype freetype-dev freetype-static \
graphite2-static \
glib-static \
tiff tiff-dev \
libjpeg-turbo libjpeg-turbo-dev \
libpng-dev libpng-static \
giflib giflib-dev \
harfbuzz-dev harfbuzz-static \
fribidi-dev fribidi-static \
brotli-dev brotli-static \
soxr-dev soxr-static \
lcms2 lcms2-dev \
tcl \
numactl-dev \
cunit cunit-dev \
fftw-dev \
libsamplerate-dev libsamplerate-static \
vo-amrwbenc-dev vo-amrwbenc-static \
snappy snappy-dev snappy-static \
xxd \
xz-dev xz-static
# -O3 makes sure we compile with optimization. setting CFLAGS/CXXFLAGS seems to override
# default automake cflags.
# -static-libgcc is needed to make gcc not include gcc_s as "as-needed" shared library which
# cmake will include as a implicit library.
# other options to get hardened build (same as ffmpeg hardened)
ARG CFLAGS="-O3 -s -static-libgcc -fno-strict-overflow -fstack-protector-all -fPIC"
ARG CXXFLAGS="-O3 -s -static-libgcc -fno-strict-overflow -fstack-protector-all -fPIC"
ARG LDFLAGS="-Wl,-z,relro,-z,now"
# retry dns and some http codes that might be transient errors
ARG WGET_OPTS="--retry-on-host-error --retry-on-http-error=429,500,502,503"
# workaround for https://github.com/pkgconf/pkgconf/issues/268
# link order somehow ends up reversed for libbrotlidec and libbrotlicommon with pkgconf 1.9.4 but not 1.9.3
# adding libbrotlicommon directly to freetype2 required libraries seems to fix it
RUN sed -i 's/libbrotlidec/libbrotlidec, libbrotlicommon/' /usr/lib/pkgconfig/freetype2.pc
# before aom as libvmaf uses it
# bump: vmaf /VMAF_VERSION=([\d.]+)/ https://github.com/Netflix/vmaf.git|*
# bump: vmaf after ./hashupdate Dockerfile VMAF $LATEST
# bump: vmaf link "Release" https://github.com/Netflix/vmaf/releases/tag/v$LATEST
# bump: vmaf link "Source diff $CURRENT..$LATEST" https://github.com/Netflix/vmaf/compare/v$CURRENT..v$LATEST
ARG VMAF_VERSION=2.3.1
ARG VMAF_URL="https://github.com/Netflix/vmaf/archive/refs/tags/v$VMAF_VERSION.tar.gz"
ARG VMAF_SHA256=8d60b1ddab043ada25ff11ced821da6e0c37fd7730dd81c24f1fc12be7293ef2
RUN \
wget $WGET_OPTS -O vmaf.tar.gz "$VMAF_URL" && \
echo "$VMAF_SHA256 vmaf.tar.gz" | sha256sum --status -c - && \
tar xf vmaf.tar.gz && \
cd vmaf-*/libvmaf && meson build --buildtype=release -Ddefault_library=static -Dbuilt_in_models=true -Denable_tests=false -Denable_docs=false -Denable_avx512=true -Denable_float=true && \
ninja -j$(nproc) -vC build install
# extra libs stdc++ is for vmaf https://github.com/Netflix/vmaf/issues/788
RUN sed -i 's/-lvmaf /-lvmaf -lstdc++ /' /usr/local/lib/pkgconfig/libvmaf.pc
# build after libvmaf
# bump: aom /AOM_VERSION=([\d.]+)/ git:https://aomedia.googlesource.com/aom|*
# bump: aom after ./hashupdate Dockerfile AOM $LATEST
# bump: aom after COMMIT=$(git ls-remote https://aomedia.googlesource.com/aom v$LATEST^{} | awk '{print $1}') && sed -i -E "s/^ARG AOM_COMMIT=.*/ARG AOM_COMMIT=$COMMIT/" Dockerfile
# bump: aom link "CHANGELOG" https://aomedia.googlesource.com/aom/+/refs/tags/v$LATEST/CHANGELOG
ARG AOM_VERSION=3.6.0
ARG AOM_URL="https://aomedia.googlesource.com/aom"
ARG AOM_COMMIT=3c65175b1972da4a1992c1dae2365b48d13f9a8d
RUN \
git clone --depth 1 --branch v$AOM_VERSION "$AOM_URL" && \
cd aom && test $(git rev-parse HEAD) = $AOM_COMMIT && \
mkdir build_tmp && cd build_tmp && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_EXAMPLES=NO \
-DENABLE_DOCS=NO \
-DENABLE_TESTS=NO \
-DENABLE_TOOLS=NO \
-DCONFIG_TUNE_VMAF=1 \
-DENABLE_NASM=ON \
-DCMAKE_INSTALL_LIBDIR=lib \
.. && \
make -j$(nproc) install
# bump: libaribb24 /LIBARIBB24_VERSION=([\d.]+)/ https://github.com/nkoriyama/aribb24.git|*
# bump: libaribb24 after ./hashupdate Dockerfile LIBARIBB24 $LATEST
# bump: libaribb24 link "Release notes" https://github.com/nkoriyama/aribb24/releases/tag/$LATEST
ARG LIBARIBB24_VERSION=1.0.3
ARG LIBARIBB24_URL="https://github.com/nkoriyama/aribb24/archive/v$LIBARIBB24_VERSION.tar.gz"
ARG LIBARIBB24_SHA256=f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128
RUN \
wget $WGET_OPTS -O libaribb24.tar.gz ${LIBARIBB24_URL} && \
echo "$LIBARIBB24_SHA256 libaribb24.tar.gz" | sha256sum --status -c - && \
mkdir libaribb24 && \
tar xf libaribb24.tar.gz -C libaribb24 --strip-components=1 && \
cd libaribb24 && \
autoreconf -fiv && \
./configure --enable-static --disable-shared && \
make -j$(nproc) && make install
# bump: libass /LIBASS_VERSION=([\d.]+)/ https://github.com/libass/libass.git|*
# bump: libass after ./hashupdate Dockerfile LIBASS $LATEST
# bump: libass link "Release notes" https://github.com/libass/libass/releases/tag/$LATEST
ARG LIBASS_VERSION=0.17.1
ARG LIBASS_URL="https://github.com/libass/libass/releases/download/$LIBASS_VERSION/libass-$LIBASS_VERSION.tar.gz"
ARG LIBASS_SHA256=d653be97198a0543c69111122173c41a99e0b91426f9e17f06a858982c2fb03d
RUN \
wget $WGET_OPTS -O libass.tar.gz "$LIBASS_URL" && \
echo "$LIBASS_SHA256 libass.tar.gz" | sha256sum --status -c - && \
tar xf libass.tar.gz && \
cd libass-* && ./configure --disable-shared --enable-static && \
make -j$(nproc) && make install
# bump: libbluray /LIBBLURAY_VERSION=([\d.]+)/ https://code.videolan.org/videolan/libbluray.git|*
# bump: libbluray after ./hashupdate Dockerfile LIBBLURAY $LATEST
# bump: libbluray link "ChangeLog" https://code.videolan.org/videolan/libbluray/-/blob/master/ChangeLog
ARG LIBBLURAY_VERSION=1.3.4
ARG LIBBLURAY_URL="https://code.videolan.org/videolan/libbluray/-/archive/$LIBBLURAY_VERSION/libbluray-$LIBBLURAY_VERSION.tar.gz"
ARG LIBBLURAY_SHA256=9820df5c3e87777be116ca225ad7ee026a3ff42b2447c7fe641910fb23aad3c2
RUN \
wget $WGET_OPTS -O libbluray.tar.gz "$LIBBLURAY_URL" && \
echo "$LIBBLURAY_SHA256 libbluray.tar.gz" | sha256sum --status -c - && \
tar xf libbluray.tar.gz && cd libbluray-* && git clone https://code.videolan.org/videolan/libudfread.git contrib/libudfread && \
autoreconf -fiv && ./configure --with-pic --disable-doxygen-doc --disable-doxygen-dot --enable-static --disable-shared --disable-examples --disable-bdjava-jar && \
make -j$(nproc) install
# bump: dav1d /DAV1D_VERSION=([\d.]+)/ https://code.videolan.org/videolan/dav1d.git|*
# bump: dav1d after ./hashupdate Dockerfile DAV1D $LATEST
# bump: dav1d link "Release notes" https://code.videolan.org/videolan/dav1d/-/tags/$LATEST
ARG DAV1D_VERSION=1.1.0
ARG DAV1D_URL="https://code.videolan.org/videolan/dav1d/-/archive/$DAV1D_VERSION/dav1d-$DAV1D_VERSION.tar.gz"
ARG DAV1D_SHA256=b163791a587c083803a3db2cd18b4fbaf7fb865b47d038c4869ffef7722b6b16
RUN \
wget $WGET_OPTS -O dav1d.tar.gz "$DAV1D_URL" && \
echo "$DAV1D_SHA256 dav1d.tar.gz" | sha256sum --status -c - && \
tar xf dav1d.tar.gz && \
cd dav1d-* && meson build --buildtype release -Ddefault_library=static && \
ninja -j$(nproc) -C build install
# bump: davs2 /DAVS2_VERSION=([\d.]+)/ https://github.com/pkuvcl/davs2.git|^1
# bump: davs2 after ./hashupdate Dockerfile DAVS2 $LATEST
# bump: davs2 link "Release" https://github.com/pkuvcl/davs2/releases/tag/$LATEST
# bump: davs2 link "Source diff $CURRENT..$LATEST" https://github.com/pkuvcl/davs2/compare/v$CURRENT..v$LATEST
ARG DAVS2_VERSION=1.7
ARG DAVS2_URL="https://github.com/pkuvcl/davs2/archive/refs/tags/$DAVS2_VERSION.tar.gz"
ARG DAVS2_SHA256=b697d0b376a1c7f7eda3a4cc6d29707c8154c4774358303653f0a9727f923cc8
# TODO: seems to be issues with asm on musl
RUN \
wget $WGET_OPTS -O davs2.tar.gz "$DAVS2_URL" && \
echo "$DAVS2_SHA256 davs2.tar.gz" | sha256sum --status -c - && \
tar xf davs2.tar.gz && \
cd davs2-*/build/linux && ./configure --disable-asm --enable-pic --enable-strip --disable-cli && \
make -j$(nproc) install
# bump: fdk-aac /FDK_AAC_VERSION=([\d.]+)/ https://github.com/mstorsjo/fdk-aac.git|*
# bump: fdk-aac after ./hashupdate Dockerfile FDK_AAC $LATEST
# bump: fdk-aac link "ChangeLog" https://github.com/mstorsjo/fdk-aac/blob/master/ChangeLog
# bump: fdk-aac link "Source diff $CURRENT..$LATEST" https://github.com/mstorsjo/fdk-aac/compare/v$CURRENT..v$LATEST
ARG FDK_AAC_VERSION=2.0.2
ARG FDK_AAC_URL="https://github.com/mstorsjo/fdk-aac/archive/v$FDK_AAC_VERSION.tar.gz"
ARG FDK_AAC_SHA256=7812b4f0cf66acda0d0fe4302545339517e702af7674dd04e5fe22a5ade16a90
RUN \
wget $WGET_OPTS -O fdk-aac.tar.gz "$FDK_AAC_URL" && \
echo "$FDK_AAC_SHA256 fdk-aac.tar.gz" | sha256sum --status -c - && \
tar xf fdk-aac.tar.gz && \
cd fdk-aac-* && ./autogen.sh && ./configure --disable-shared --enable-static && \
make -j$(nproc) install
# bump: libgme /LIBGME_COMMIT=([[:xdigit:]]+)/ gitrefs:https://bitbucket.org/mpyne/game-music-emu.git|re:#^refs/heads/master$#|@commit
# bump: libgme after ./hashupdate Dockerfile LIBGME $LATEST
# bump: libgme link "Source diff $CURRENT..$LATEST" https://bitbucket.org/mpyne/game-music-emu/branches/compare/$CURRENT..$LATEST
ARG LIBGME_URL="https://bitbucket.org/mpyne/game-music-emu.git"
ARG LIBGME_COMMIT=6cd4bdb69be304f58c9253fb08b8362f541b3b4b
RUN \
git clone "$LIBGME_URL" && \
cd game-music-emu && git checkout $LIBGME_COMMIT && \
mkdir build && cd build && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_UBSAN=OFF \
.. && \
make -j$(nproc) install
# bump: libgsm /LIBGSM_COMMIT=([[:xdigit:]]+)/ gitrefs:https://github.com/timothytylee/libgsm.git|re:#^refs/heads/master$#|@commit
# bump: libgsm after ./hashupdate Dockerfile LIBGSM $LATEST
# bump: libgsm link "Changelog" https://github.com/timothytylee/libgsm/blob/master/ChangeLog
ARG LIBGSM_URL="https://github.com/timothytylee/libgsm.git"
ARG LIBGSM_COMMIT=98f1708fb5e06a0dfebd58a3b40d610823db9715
RUN \
git clone "$LIBGSM_URL" && \
cd libgsm && git checkout $LIBGSM_COMMIT && \
# Makefile is garbage, hence use specific compile arguments and flags
# no need to build toast cli tool \
rm src/toast* && \
SRC=$(echo src/*.c) && \
gcc ${CFLAGS} -c -ansi -pedantic -s -DNeedFunctionPrototypes=1 -Wall -Wno-comment -DSASR -DWAV49 -DNDEBUG -I./inc ${SRC} && \
ar cr libgsm.a *.o && ranlib libgsm.a && \
mkdir -p /usr/local/include/gsm && \
cp inc/*.h /usr/local/include/gsm && \
cp libgsm.a /usr/local/lib
# bump: kvazaar /KVAZAAR_VERSION=([\d.]+)/ https://github.com/ultravideo/kvazaar.git|^2
# bump: kvazaar after ./hashupdate Dockerfile KVAZAAR $LATEST
# bump: kvazaar link "Release notes" https://github.com/ultravideo/kvazaar/releases/tag/v$LATEST
ARG KVAZAAR_VERSION=2.2.0
ARG KVAZAAR_URL="https://github.com/ultravideo/kvazaar/archive/v$KVAZAAR_VERSION.tar.gz"
ARG KVAZAAR_SHA256=df21f327318d530fe7f2ec65ccabf400690791ebad726d8b785c243506f0e446
RUN \
wget $WGET_OPTS -O kvazaar.tar.gz "$KVAZAAR_URL" && \
echo "$KVAZAAR_SHA256 kvazaar.tar.gz" | sha256sum --status -c - && \
tar xf kvazaar.tar.gz && \
cd kvazaar-* && ./autogen.sh && ./configure --disable-shared --enable-static && \
make -j$(nproc) install
# bump: libmodplug /LIBMODPLUG_VERSION=([\d.]+)/ fetch:https://sourceforge.net/projects/modplug-xmms/files/|/libmodplug-([\d.]+).tar.gz/
# bump: libmodplug after ./hashupdate Dockerfile LIBMODPLUG $LATEST
# bump: libmodplug link "NEWS" https://sourceforge.net/p/modplug-xmms/git/ci/master/tree/libmodplug/NEWS
ARG LIBMODPLUG_VERSION=0.8.9.0
ARG LIBMODPLUG_URL="https://downloads.sourceforge.net/modplug-xmms/libmodplug-$LIBMODPLUG_VERSION.tar.gz"
ARG LIBMODPLUG_SHA256=457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de
RUN \
wget $WGET_OPTS -O libmodplug.tar.gz "$LIBMODPLUG_URL" && \
echo "$LIBMODPLUG_SHA256 libmodplug.tar.gz" | sha256sum --status -c - && \
tar xf libmodplug.tar.gz && \
cd libmodplug-* && ./configure --disable-shared --enable-static && \
make -j$(nproc) install
# bump: mp3lame /MP3LAME_VERSION=([\d.]+)/ svn:http://svn.code.sf.net/p/lame/svn|/^RELEASE__(.*)$/|/_/./|*
# bump: mp3lame after ./hashupdate Dockerfile MP3LAME $LATEST
# bump: mp3lame link "ChangeLog" http://svn.code.sf.net/p/lame/svn/trunk/lame/ChangeLog
ARG MP3LAME_VERSION=3.100
ARG MP3LAME_URL="https://sourceforge.net/projects/lame/files/lame/$MP3LAME_VERSION/lame-$MP3LAME_VERSION.tar.gz/download"
ARG MP3LAME_SHA256=ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e
RUN \
wget $WGET_OPTS -O lame.tar.gz "$MP3LAME_URL" && \
echo "$MP3LAME_SHA256 lame.tar.gz" | sha256sum --status -c - && \
tar xf lame.tar.gz && \
cd lame-* && ./configure --disable-shared --enable-static --enable-nasm --disable-gtktest --disable-cpml --disable-frontend && \
make -j$(nproc) install
# bump: libmysofa /LIBMYSOFA_VERSION=([\d.]+)/ https://github.com/hoene/libmysofa.git|^1
# bump: libmysofa after ./hashupdate Dockerfile LIBMYSOFA $LATEST
# bump: libmysofa link "Release" https://github.com/hoene/libmysofa/releases/tag/v$LATEST
# bump: libmysofa link "Source diff $CURRENT..$LATEST" https://github.com/hoene/libmysofa/compare/v$CURRENT..v$LATEST
ARG LIBMYSOFA_VERSION=1.3.1
ARG LIBMYSOFA_URL="https://github.com/hoene/libmysofa/archive/refs/tags/v$LIBMYSOFA_VERSION.tar.gz"
ARG LIBMYSOFA_SHA256=a8a8cbf7b0b2508a6932278799b9bf5c63d833d9e7d651aea4622f3bc6b992aa
RUN \
wget $WGET_OPTS -O libmysofa.tar.gz "$LIBMYSOFA_URL" && \
echo "$LIBMYSOFA_SHA256 libmysofa.tar.gz" | sha256sum --status -c - && \
tar xf libmysofa.tar.gz && \
cd libmysofa-*/build && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
.. && \
make -j$(nproc) install
# bump: opencoreamr /OPENCOREAMR_VERSION=([\d.]+)/ fetch:https://sourceforge.net/projects/opencore-amr/files/opencore-amr/|/opencore-amr-([\d.]+).tar.gz/
# bump: opencoreamr after ./hashupdate Dockerfile OPENCOREAMR $LATEST
# bump: opencoreamr link "ChangeLog" https://sourceforge.net/p/opencore-amr/code/ci/master/tree/ChangeLog
ARG OPENCOREAMR_VERSION=0.1.6
ARG OPENCOREAMR_URL="https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-$OPENCOREAMR_VERSION.tar.gz"
ARG OPENCOREAMR_SHA256=483eb4061088e2b34b358e47540b5d495a96cd468e361050fae615b1809dc4a1
RUN \
wget $WGET_OPTS -O opencoreamr.tar.gz "$OPENCOREAMR_URL" && \
echo "$OPENCOREAMR_SHA256 opencoreamr.tar.gz" | sha256sum --status -c - && \
tar xf opencoreamr.tar.gz && \
cd opencore-amr-* && ./configure --enable-static --disable-shared && \
make -j$(nproc) install
# bump: openjpeg /OPENJPEG_VERSION=([\d.]+)/ https://github.com/uclouvain/openjpeg.git|*
# bump: openjpeg after ./hashupdate Dockerfile OPENJPEG $LATEST
# bump: openjpeg link "CHANGELOG" https://github.com/uclouvain/openjpeg/blob/master/CHANGELOG.md
ARG OPENJPEG_VERSION=2.5.0
ARG OPENJPEG_URL="https://github.com/uclouvain/openjpeg/archive/v$OPENJPEG_VERSION.tar.gz"
ARG OPENJPEG_SHA256=0333806d6adecc6f7a91243b2b839ff4d2053823634d4f6ed7a59bc87409122a
RUN \
wget $WGET_OPTS -O openjpeg.tar.gz "$OPENJPEG_URL" && \
echo "$OPENJPEG_SHA256 openjpeg.tar.gz" | sha256sum --status -c - && \
tar xf openjpeg.tar.gz && \
cd openjpeg-* && mkdir build && cd build && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_PKGCONFIG_FILES=ON \
-DBUILD_CODEC=OFF \
-DWITH_ASTYLE=OFF \
-DBUILD_TESTING=OFF \
.. && \
make -j$(nproc) install
# bump: opus /OPUS_VERSION=([\d.]+)/ https://github.com/xiph/opus.git|^1
# bump: opus after ./hashupdate Dockerfile OPUS $LATEST
# bump: opus link "Release notes" https://github.com/xiph/opus/releases/tag/v$LATEST
# bump: opus link "Source diff $CURRENT..$LATEST" https://github.com/xiph/opus/compare/v$CURRENT..v$LATEST
ARG OPUS_VERSION=1.3.1
ARG OPUS_URL="https://archive.mozilla.org/pub/opus/opus-$OPUS_VERSION.tar.gz"
ARG OPUS_SHA256=65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d
RUN \
wget $WGET_OPTS -O opus.tar.gz "$OPUS_URL" && \
echo "$OPUS_SHA256 opus.tar.gz" | sha256sum --status -c - && \
tar xf opus.tar.gz && \
cd opus-* && ./configure --disable-shared --enable-static --disable-extra-programs --disable-doc && \
make -j$(nproc) install
# bump: librabbitmq /LIBRABBITMQ_VERSION=([\d.]+)/ https://github.com/alanxz/rabbitmq-c.git|*
# bump: librabbitmq after ./hashupdate Dockerfile LIBRABBITMQ $LATEST
# bump: librabbitmq link "ChangeLog" https://github.com/alanxz/rabbitmq-c/blob/master/ChangeLog.md
ARG LIBRABBITMQ_VERSION=0.13.0
ARG LIBRABBITMQ_URL="https://github.com/alanxz/rabbitmq-c/archive/refs/tags/v$LIBRABBITMQ_VERSION.tar.gz"
ARG LIBRABBITMQ_SHA256=8b224e41bba504fc52b02f918d8df7e4bf5359d493cbbff36c06078655c676e6
RUN \
wget $WGET_OPTS -O rabbitmq-c.tar.gz "$LIBRABBITMQ_URL" && \
echo "$LIBRABBITMQ_SHA256 rabbitmq-c.tar.gz" | sha256sum --status -c - && \
tar xfz rabbitmq-c.tar.gz && \
cd rabbitmq-c-* && mkdir build && cd build && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
-DBUILD_TOOLS=OFF \
-DBUILD_TOOLS_DOCS=OFF \
-DRUN_SYSTEM_TESTS=OFF \
.. && \
make -j$(nproc) install
# bump: rav1e /RAV1E_VERSION=([\d.]+)/ https://github.com/xiph/rav1e.git|/\d+\./|*
# bump: rav1e after ./hashupdate Dockerfile RAV1E $LATEST
# bump: rav1e link "Release notes" https://github.com/xiph/rav1e/releases/tag/v$LATEST
# RUSTFLAGS need to fix gcc_s
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/11806
ARG RAV1E_VERSION=0.6.4
ARG RAV1E_URL="https://github.com/xiph/rav1e/archive/v$RAV1E_VERSION.tar.gz"
ARG RAV1E_SHA256=33aaab7c57822ebda9070ace90a8161dbadf8971f73b53d4db885e8b5566a039
RUN \
wget $WGET_OPTS -O rav1e.tar.gz "$RAV1E_URL" && \
echo "$RAV1E_SHA256 rav1e.tar.gz" | sha256sum --status -c - && \
tar xf rav1e.tar.gz && \
cd rav1e-* && \
RUSTFLAGS="-C target-feature=+crt-static" cargo cinstall --release
# bump: librtmp /LIBRTMP_COMMIT=([[:xdigit:]]+)/ gitrefs:https://git.ffmpeg.org/rtmpdump.git|re:#^refs/heads/master$#|@commit
# bump: librtmp after ./hashupdate Dockerfile LIBRTMP $LATEST
# bump: librtmp link "Commit diff $CURRENT..$LATEST" https://git.ffmpeg.org/gitweb/rtmpdump.git/commitdiff/$LATEST?ds=sidebyside
ARG LIBRTMP_URL="https://git.ffmpeg.org/rtmpdump.git"
ARG LIBRTMP_COMMIT=f1b83c10d8beb43fcc70a6e88cf4325499f25857
RUN \
git clone "$LIBRTMP_URL" && \
cd rtmpdump && git checkout $LIBRTMP_COMMIT && \
# Patch/port librtmp to openssl 1.1
for _dlp in dh.h handshake.h hashswf.c; do \
wget $WGET_OPTS https://raw.githubusercontent.com/microsoft/vcpkg/38bb87c5571555f1a4f64cb4ed9d2be0017f9fc1/ports/librtmp/${_dlp%.*}.patch; \
patch librtmp/${_dlp} < ${_dlp%.*}.patch; \
done && \
make SYS=posix SHARED=off -j$(nproc) install
# bump: rubberband /RUBBERBAND_VERSION=([\d.]+)/ https://github.com/breakfastquay/rubberband.git|^2
# bump: rubberband after ./hashupdate Dockerfile RUBBERBAND $LATEST
# bump: rubberband link "CHANGELOG" https://github.com/breakfastquay/rubberband/blob/default/CHANGELOG
# bump: rubberband link "Source diff $CURRENT..$LATEST" https://github.com/breakfastquay/rubberband/compare/$CURRENT..$LATEST
ARG RUBBERBAND_VERSION=2.0.2
ARG RUBBERBAND_URL="https://breakfastquay.com/files/releases/rubberband-$RUBBERBAND_VERSION.tar.bz2"
ARG RUBBERBAND_SHA256=b9eac027e797789ae99611c9eaeaf1c3a44cc804f9c8a0441a0d1d26f3d6bdf9
RUN \
wget $WGET_OPTS -O rubberband.tar.bz2 "$RUBBERBAND_URL" && \
echo "$RUBBERBAND_SHA256 rubberband.tar.bz2" | sha256sum --status -c - && \
tar xf rubberband.tar.bz2 && \
cd rubberband-* && \
meson -Ddefault_library=static -Dfft=fftw -Dresampler=libsamplerate build && \
ninja -j$(nproc) -vC build install && \
echo "Requires.private: fftw3 samplerate" >> /usr/local/lib/pkgconfig/rubberband.pc
# bump: LIBSHINE /LIBSHINE_VERSION=([\d.]+)/ https://github.com/toots/shine.git|*
# bump: LIBSHINE after ./hashupdate Dockerfile LIBSHINE $LATEST
# bump: LIBSHINE link "CHANGELOG" https://github.com/toots/shine/blob/master/ChangeLog
# bump: LIBSHINE link "Source diff $CURRENT..$LATEST" https://github.com/toots/shine/compare/$CURRENT..$LATEST
ARG LIBSHINE_VERSION=3.1.1
ARG LIBSHINE_URL="https://github.com/toots/shine/releases/download/$LIBSHINE_VERSION/shine-$LIBSHINE_VERSION.tar.gz"
ARG LIBSHINE_SHA256=58e61e70128cf73f88635db495bfc17f0dde3ce9c9ac070d505a0cd75b93d384
RUN \
wget $WGET_OPTS -O libshine.tar.gz "$LIBSHINE_URL" && \
echo "$LIBSHINE_SHA256 libshine.tar.gz" | sha256sum --status -c - && \
tar xf libshine.tar.gz && cd shine* && \
./configure --with-pic --enable-static --disable-shared --disable-fast-install && \
make -j$(nproc) install
# bump: speex /SPEEX_VERSION=([\d.]+)/ https://github.com/xiph/speex.git|*
# bump: speex after ./hashupdate Dockerfile SPEEX $LATEST
# bump: speex link "ChangeLog" https://github.com/xiph/speex//blob/master/ChangeLog
# bump: speex link "Source diff $CURRENT..$LATEST" https://github.com/xiph/speex/compare/$CURRENT..$LATEST
ARG SPEEX_VERSION=1.2.1
ARG SPEEX_URL="https://github.com/xiph/speex/archive/Speex-$SPEEX_VERSION.tar.gz"
ARG SPEEX_SHA256=beaf2642e81a822eaade4d9ebf92e1678f301abfc74a29159c4e721ee70fdce0
RUN \
wget $WGET_OPTS -O speex.tar.gz "$SPEEX_URL" && \
echo "$SPEEX_SHA256 speex.tar.gz" | sha256sum --status -c - && \
tar xf speex.tar.gz && \
cd speex-Speex-* && ./autogen.sh && ./configure --disable-shared --enable-static && \
make -j$(nproc) install
# bump: srt /SRT_VERSION=([\d.]+)/ https://github.com/Haivision/srt.git|^1
# bump: srt after ./hashupdate Dockerfile SRT $LATEST
# bump: srt link "Release notes" https://github.com/Haivision/srt/releases/tag/v$LATEST
ARG SRT_VERSION=1.5.1
ARG SRT_URL="https://github.com/Haivision/srt/archive/v$SRT_VERSION.tar.gz"
ARG SRT_SHA256=af891e7a7ffab61aa76b296982038b3159da690f69ade7c119f445d924b3cf53
RUN \
wget $WGET_OPTS -O libsrt.tar.gz "$SRT_URL" && \
echo "$SRT_SHA256 libsrt.tar.gz" | sha256sum --status -c - && \
tar xf libsrt.tar.gz && cd srt-* && mkdir build && cd build && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_SHARED=OFF \
-DENABLE_APPS=OFF \
-DENABLE_CXX11=ON \
-DUSE_STATIC_LIBSTDCXX=ON \
-DOPENSSL_USE_STATIC_LIBS=ON \
-DENABLE_LOGGING=OFF \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_INSTALL_BINDIR=bin \
.. && \
make -j$(nproc) && make install
# bump: libssh /LIBSSH_VERSION=([\d.]+)/ https://gitlab.com/libssh/libssh-mirror.git|*
# bump: libssh after ./hashupdate Dockerfile LIBSSH $LATEST
# bump: libssh link "Source diff $CURRENT..$LATEST" https://gitlab.com/libssh/libssh-mirror/-/compare/libssh-$CURRENT...libssh-$LATEST
# bump: libssh link "Release notes" https://gitlab.com/libssh/libssh-mirror/-/tags/libssh-$LATEST
ARG LIBSSH_VERSION=0.10.4
ARG LIBSSH_URL="https://gitlab.com/libssh/libssh-mirror/-/archive/libssh-$LIBSSH_VERSION/libssh-mirror-libssh-$LIBSSH_VERSION.tar.gz"
ARG LIBSSH_SHA256=0644d73d4dcb8171c465334dba891b0965311f9ec66b1987805c2882afa0cc58
# LIBSSH_STATIC=1 is REQUIRED to link statically against libssh.a so add to pkg-config file
# make does not -j as it seems to be shaky, libssh.a used before created
RUN \
wget $WGET_OPTS -O libssh.tar.gz "$LIBSSH_URL" && \
echo "$LIBSSH_SHA256 libssh.tar.gz" | sha256sum --status -c - && \
tar xf libssh.tar.gz && cd libssh* && mkdir build && cd build && \
echo -e 'Requires.private: libssl libcrypto zlib \nLibs.private: -DLIBSSH_STATIC=1 -lssh\nCflags.private: -DLIBSSH_STATIC=1 -I${CMAKE_INSTALL_FULL_INCLUDEDIR}' >> ../libssh.pc.cmake && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_SYSTEM_ARCH=$(arch) \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release \
-DPICKY_DEVELOPER=ON \
-DBUILD_STATIC_LIB=ON \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_GSSAPI=OFF \
-DWITH_BLOWFISH_CIPHER=ON \
-DWITH_SFTP=ON \
-DWITH_SERVER=OFF \
-DWITH_ZLIB=ON \
-DWITH_PCAP=ON \
-DWITH_DEBUG_CRYPTO=OFF \
-DWITH_DEBUG_PACKET=OFF \
-DWITH_DEBUG_CALLTRACE=OFF \
-DUNIT_TESTING=OFF \
-DCLIENT_TESTING=OFF \
-DSERVER_TESTING=OFF \
-DWITH_EXAMPLES=OFF \
-DWITH_INTERNAL_DOC=OFF \
.. && \
make install
# bump: svtav1 /SVTAV1_VERSION=([\d.]+)/ https://gitlab.com/AOMediaCodec/SVT-AV1.git|*
# bump: svtav1 after ./hashupdate Dockerfile SVTAV1 $LATEST
# bump: svtav1 link "Release notes" https://gitlab.com/AOMediaCodec/SVT-AV1/-/releases/v$LATEST
ARG SVTAV1_VERSION=1.4.1
ARG SVTAV1_URL="https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v$SVTAV1_VERSION/SVT-AV1-v$SVTAV1_VERSION.tar.bz2"
ARG SVTAV1_SHA256=0e988582f315fe76c909accf5e7f81b975c5bd2b850ee760d8e9fac297f70b5d
RUN \
wget $WGET_OPTS -O svtav1.tar.bz2 "$SVTAV1_URL" && \
echo "$SVTAV1_SHA256 svtav1.tar.bz2" | sha256sum --status -c - && \
tar xf svtav1.tar.bz2 && \
cd SVT-AV1-*/Build && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
.. && \
make -j$(nproc) install
# has to be before theora
# bump: ogg /OGG_VERSION=([\d.]+)/ https://github.com/xiph/ogg.git|*
# bump: ogg after ./hashupdate Dockerfile OGG $LATEST
# bump: ogg link "CHANGES" https://github.com/xiph/ogg/blob/master/CHANGES
# bump: ogg link "Source diff $CURRENT..$LATEST" https://github.com/xiph/ogg/compare/v$CURRENT..v$LATEST
ARG OGG_VERSION=1.3.5
ARG OGG_URL="https://downloads.xiph.org/releases/ogg/libogg-$OGG_VERSION.tar.gz"
ARG OGG_SHA256=0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664
RUN \
wget $WGET_OPTS -O libogg.tar.gz "$OGG_URL" && \
echo "$OGG_SHA256 libogg.tar.gz" | sha256sum --status -c - && \
tar xf libogg.tar.gz && \
cd libogg-* && ./configure --disable-shared --enable-static && \
make -j$(nproc) install
# bump: theora /THEORA_VERSION=([\d.]+)/ https://github.com/xiph/theora.git|*
# bump: theora after ./hashupdate Dockerfile THEORA $LATEST
# bump: theora link "Release notes" https://github.com/xiph/theora/releases/tag/v$LATEST
# bump: theora link "Source diff $CURRENT..$LATEST" https://github.com/xiph/theora/compare/v$CURRENT..v$LATEST
ARG THEORA_VERSION=1.1.1
ARG THEORA_URL="https://downloads.xiph.org/releases/theora/libtheora-$THEORA_VERSION.tar.bz2"
ARG THEORA_SHA256=b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc
RUN \
wget $WGET_OPTS -O libtheora.tar.bz2 "$THEORA_URL" && \
echo "$THEORA_SHA256 libtheora.tar.bz2" | sha256sum --status -c - && \
tar xf libtheora.tar.bz2 && \
# --build=$(arch)-unknown-linux-gnu helps with guessing the correct build. For some reason,
# build script can't guess the build type in arm64 (hardware and emulated) environment.
cd libtheora-* && ./configure --build=$(arch)-unknown-linux-gnu --disable-examples --disable-oggtest --disable-shared --enable-static && \
make -j$(nproc) install
# bump: twolame /TWOLAME_VERSION=([\d.]+)/ https://github.com/njh/twolame.git|*
# bump: twolame after ./hashupdate Dockerfile TWOLAME $LATEST
# bump: twolame link "Source diff $CURRENT..$LATEST" https://github.com/njh/twolame/compare/v$CURRENT..v$LATEST
ARG TWOLAME_VERSION=0.4.0
ARG TWOLAME_URL="https://github.com/njh/twolame/releases/download/$TWOLAME_VERSION/twolame-$TWOLAME_VERSION.tar.gz"
ARG TWOLAME_SHA256=cc35424f6019a88c6f52570b63e1baf50f62963a3eac52a03a800bb070d7c87d
RUN \
wget $WGET_OPTS -O twolame.tar.gz "$TWOLAME_URL" && \
echo "$TWOLAME_SHA256 twolame.tar.gz" | sha256sum --status -c - && \
tar xf twolame.tar.gz && \
cd twolame-* && ./configure --disable-shared --enable-static --disable-sndfile --with-pic && \
make -j$(nproc) install
# bump: uavs3d /UAVS3D_COMMIT=([[:xdigit:]]+)/ gitrefs:https://github.com/uavs3/uavs3d.git|re:#^refs/heads/master$#|@commit
# bump: uavs3d after ./hashupdate Dockerfile UAVS3D $LATEST
# bump: uavs3d link "Source diff $CURRENT..$LATEST" https://github.com/uavs3/uavs3d/compare/$CURRENT..$LATEST
ARG UAVS3D_URL="https://github.com/uavs3/uavs3d.git"
ARG UAVS3D_COMMIT=1fd04917cff50fac72ae23e45f82ca6fd9130bd8
# Removes BIT_DEPTH 10 to be able to build on other platforms. 10 was overkill anyways.
RUN \
git clone "$UAVS3D_URL" && \
cd uavs3d && git checkout $UAVS3D_COMMIT && \
# sed -i 's/define BIT_DEPTH 8/define BIT_DEPTH 10/' source/decore/com_def.h && \
mkdir build/linux && cd build/linux && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
../.. && \
make -j$(nproc) install
# bump: vid.stab /VIDSTAB_VERSION=([\d.]+)/ https://github.com/georgmartius/vid.stab.git|*
# bump: vid.stab after ./hashupdate Dockerfile VIDSTAB $LATEST
# bump: vid.stab link "Changelog" https://github.com/georgmartius/vid.stab/blob/master/Changelog
ARG VIDSTAB_VERSION=1.1.1
ARG VIDSTAB_URL="https://github.com/georgmartius/vid.stab/archive/v$VIDSTAB_VERSION.tar.gz"
ARG VIDSTAB_SHA256=9001b6df73933555e56deac19a0f225aae152abbc0e97dc70034814a1943f3d4
RUN \
wget $WGET_OPTS -O vid.stab.tar.gz "$VIDSTAB_URL" && \
echo "$VIDSTAB_SHA256 vid.stab.tar.gz" | sha256sum --status -c - && \
tar xf vid.stab.tar.gz && \
cd vid.stab-* && mkdir build && cd build && \
# This line workarounds the issue that happens when the image builds in emulated (buildx) arm64 environment.
# Since in emulated container the /proc is mounted from the host, the cmake not able to detect CPU features correctly.
sed -i 's/include (FindSSE)/if(CMAKE_SYSTEM_ARCH MATCHES "amd64")\ninclude (FindSSE)\nendif()/' ../CMakeLists.txt && \
cmake \
-G"Unix Makefiles" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_SYSTEM_ARCH=$(arch) \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DUSE_OMP=ON \
.. && \
make -j$(nproc) install
RUN echo "Libs.private: -ldl" >> /usr/local/lib/pkgconfig/vidstab.pc
# bump: vorbis /VORBIS_VERSION=([\d.]+)/ https://github.com/xiph/vorbis.git|*
# bump: vorbis after ./hashupdate Dockerfile VORBIS $LATEST
# bump: vorbis link "CHANGES" https://github.com/xiph/vorbis/blob/master/CHANGES
# bump: vorbis link "Source diff $CURRENT..$LATEST" https://github.com/xiph/vorbis/compare/v$CURRENT..v$LATEST
ARG VORBIS_VERSION=1.3.7
ARG VORBIS_URL="https://downloads.xiph.org/releases/vorbis/libvorbis-$VORBIS_VERSION.tar.gz"
ARG VORBIS_SHA256=0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab
RUN \
wget $WGET_OPTS -O libvorbis.tar.gz "$VORBIS_URL" && \
echo "$VORBIS_SHA256 libvorbis.tar.gz" | sha256sum --status -c - && \
tar xf libvorbis.tar.gz && \
cd libvorbis-* && ./configure --disable-shared --enable-static --disable-oggtest && \
make -j$(nproc) install
# bump: libvpx /VPX_VERSION=([\d.]+)/ https://github.com/webmproject/libvpx.git|*
# bump: libvpx after ./hashupdate Dockerfile VPX $LATEST
# bump: libvpx link "CHANGELOG" https://github.com/webmproject/libvpx/blob/master/CHANGELOG
# bump: libvpx link "Source diff $CURRENT..$LATEST" https://github.com/webmproject/libvpx/compare/v$CURRENT..v$LATEST
ARG VPX_VERSION=1.13.0
ARG VPX_URL="https://github.com/webmproject/libvpx/archive/v$VPX_VERSION.tar.gz"
ARG VPX_SHA256=cb2a393c9c1fae7aba76b950bb0ad393ba105409fe1a147ccd61b0aaa1501066
RUN \
wget $WGET_OPTS -O libvpx.tar.gz "$VPX_URL" && \
echo "$VPX_SHA256 libvpx.tar.gz" | sha256sum --status -c - && \
tar xf libvpx.tar.gz && \
cd libvpx-* && ./configure --enable-static --enable-vp9-highbitdepth --disable-shared --disable-unit-tests --disable-examples && \
make -j$(nproc) install
# bump: libwebp /LIBWEBP_VERSION=([\d.]+)/ https://github.com/webmproject/libwebp.git|*
# bump: libwebp after ./hashupdate Dockerfile LIBWEBP $LATEST
# bump: libwebp link "Release notes" https://github.com/webmproject/libwebp/releases/tag/v$LATEST
# bump: libwebp link "Source diff $CURRENT..$LATEST" https://github.com/webmproject/libwebp/compare/v$CURRENT..v$LATEST
ARG LIBWEBP_VERSION=1.3.0
ARG LIBWEBP_URL="https://github.com/webmproject/libwebp/archive/v$LIBWEBP_VERSION.tar.gz"
ARG LIBWEBP_SHA256=dc9860d3fe06013266c237959e1416b71c63b36f343aae1d65ea9c94832630e1
RUN \
wget $WGET_OPTS -O libwebp.tar.gz "$LIBWEBP_URL" && \
echo "$LIBWEBP_SHA256 libwebp.tar.gz" | sha256sum --status -c - && \
tar xf libwebp.tar.gz && \
cd libwebp-* && ./autogen.sh && ./configure --disable-shared --enable-static --with-pic --enable-libwebpmux --disable-libwebpextras --disable-libwebpdemux --disable-sdl --disable-gl --disable-png --disable-jpeg --disable-tiff --disable-gif && \
make -j$(nproc) install
# x264 only have a stable branch no tags and we checkout commit so no hash is needed
# bump: x264 /X264_VERSION=([[:xdigit:]]+)/ gitrefs:https://code.videolan.org/videolan/x264.git|re:#^refs/heads/stable$#|@commit
# bump: x264 after ./hashupdate Dockerfile X264 $LATEST
# bump: x264 link "Source diff $CURRENT..$LATEST" https://code.videolan.org/videolan/x264/-/compare/$CURRENT...$LATEST
ARG X264_URL="https://code.videolan.org/videolan/x264.git"
ARG X264_VERSION=baee400fa9ced6f5481a728138fed6e867b0ff7f
RUN \
git clone "$X264_URL" && \
cd x264 && \
git checkout $X264_VERSION && \
./configure --enable-pic --enable-static --disable-cli --disable-lavf --disable-swscale && \
make -j$(nproc) install
# x265 release is over 1 years old and master branch has a lot of fixes and improvements, so we checkout commit so no hash is needed
# bump: x265 /X265_VERSION=([[:xdigit:]]+)/ gitrefs:https://bitbucket.org/multicoreware/x265_git.git|re:#^refs/heads/master$#|@commit
# bump: x265 after ./hashupdate Dockerfile X265 $LATEST
# bump: x265 link "Source diff $CURRENT..$LATEST" https://bitbucket.org/multicoreware/x265_git/branches/compare/$LATEST..$CURRENT#diff
ARG X265_VERSION=753305affb093ae15d5e4b333125267b16258c21
ARG X265_SHA256=19fd63d3039d7662d2a75fdaf4c29c4a31ea65a9d7f44fe2da88feda59e7cb8b
ARG X265_URL="https://bitbucket.org/multicoreware/x265_git/get/$X265_VERSION.tar.bz2"
# -w-macro-params-legacy to not log lots of asm warnings
# https://bitbucket.org/multicoreware/x265_git/issues/559/warnings-when-assembling-with-nasm-215
# CMAKEFLAGS issue
# https://bitbucket.org/multicoreware/x265_git/issues/620/support-passing-cmake-flags-to-multilibsh
RUN \
wget $WGET_OPTS -O x265_git.tar.bz2 "$X265_URL" && \
echo "$X265_SHA256 x265_git.tar.bz2" | sha256sum --status -c - && \
tar xf x265_git.tar.bz2 && \
cd multicoreware-x265_git-*/build/linux && \
sed -i '/^cmake / s/$/ -G "Unix Makefiles" ${CMAKEFLAGS}/' ./multilib.sh && \
sed -i 's/ -DENABLE_SHARED=OFF//g' ./multilib.sh && \
MAKEFLAGS="-j$(nproc)" \
CMAKEFLAGS="-DENABLE_SHARED=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_AGGRESSIVE_CHECKS=ON -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy -DENABLE_NASM=ON -DCMAKE_BUILD_TYPE=Release" \
./multilib.sh && \
make -C 8bit -j$(nproc) install
# bump: xavs2 /XAVS2_VERSION=([\d.]+)/ https://github.com/pkuvcl/xavs2.git|^1
# bump: xavs2 after ./hashupdate Dockerfile XAVS2 $LATEST
# bump: xavs2 link "Release" https://github.com/pkuvcl/xavs2/releases/tag/$LATEST
# bump: xavs2 link "Source diff $CURRENT..$LATEST" https://github.com/pkuvcl/xavs2/compare/v$CURRENT..v$LATEST
ARG XAVS2_VERSION=1.4
ARG XAVS2_URL="https://github.com/pkuvcl/xavs2/archive/refs/tags/$XAVS2_VERSION.tar.gz"
ARG XAVS2_SHA256=1e6d731cd64cb2a8940a0a3fd24f9c2ac3bb39357d802432a47bc20bad52c6ce
# TODO: seems to be issues with asm on musl
RUN \
wget $WGET_OPTS -O xavs2.tar.gz "$XAVS2_URL" && \
echo "$XAVS2_SHA256 xavs2.tar.gz" | sha256sum --status -c - && \
tar xf xavs2.tar.gz && \
cd xavs2-*/build/linux && ./configure --disable-asm --enable-pic --disable-cli && \
make -j$(nproc) install
# http://websvn.xvid.org/cvs/viewvc.cgi/trunk/xvidcore/build/generic/configure.in?revision=2146&view=markup
# bump: xvid /XVID_VERSION=([\d.]+)/ svn:http://anonymous:@svn.xvid.org|/^release-(.*)$/|/_/./|^1
# bump: xvid after ./hashupdate Dockerfile XVID $LATEST
# add extra CFLAGS that are not enabled by -O3
ARG XVID_VERSION=1.3.7
ARG XVID_URL="https://downloads.xvid.com/downloads/xvidcore-$XVID_VERSION.tar.gz"
ARG XVID_SHA256=abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce2d
RUN \
wget $WGET_OPTS -O libxvid.tar.gz "$XVID_URL" && \
echo "$XVID_SHA256 libxvid.tar.gz" | sha256sum --status -c - && \
tar xf libxvid.tar.gz && \
cd xvidcore/build/generic && \
CFLAGS="$CFLAGS -fstrength-reduce -ffast-math" ./configure && \
make -j$(nproc) && make install
# bump: zimg /ZIMG_VERSION=([\d.]+)/ https://github.com/sekrit-twc/zimg.git|*
# bump: zimg after ./hashupdate Dockerfile ZIMG $LATEST
# bump: zimg link "ChangeLog" https://github.com/sekrit-twc/zimg/blob/master/ChangeLog
ARG ZIMG_VERSION=3.0.4
ARG ZIMG_URL="https://github.com/sekrit-twc/zimg/archive/release-$ZIMG_VERSION.tar.gz"
ARG ZIMG_SHA256=219d1bc6b7fde1355d72c9b406ebd730a4aed9c21da779660f0a4c851243e32f
RUN \
wget $WGET_OPTS -O zimg.tar.gz "$ZIMG_URL" && \
echo "$ZIMG_SHA256 zimg.tar.gz" | sha256sum --status -c - && \
tar xf zimg.tar.gz && \
cd zimg-* && ./autogen.sh && ./configure --disable-shared --enable-static && \
make -j$(nproc) install
# bump: ffmpeg /FFMPEG_VERSION=([\d.]+)/ https://github.com/FFmpeg/FFmpeg.git|^6
# bump: ffmpeg after ./hashupdate Dockerfile FFMPEG $LATEST
# bump: ffmpeg link "Changelog" https://github.com/FFmpeg/FFmpeg/blob/n$LATEST/Changelog
# bump: ffmpeg link "Source diff $CURRENT..$LATEST" https://github.com/FFmpeg/FFmpeg/compare/n$CURRENT..n$LATEST
ARG FFMPEG_VERSION=6.0
ARG FFMPEG_URL="https://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2"
ARG FFMPEG_SHA256=47d062731c9f66a78380e35a19aac77cebceccd1c7cc309b9c82343ffc430c3d
# sed changes --toolchain=hardened -pie to -static-pie
# extra ldflags stack-size=2097152 is to increase default stack size from 128KB (musl default) to something
# more similar to glibc (2MB). This fixing segfault with libaom-av1 and libsvtav1 as they seems to pass
# large things on the stack.
RUN \
wget $WGET_OPTS -O ffmpeg.tar.bz2 "$FFMPEG_URL" && \
echo "$FFMPEG_SHA256 ffmpeg.tar.bz2" | sha256sum --status -c - && \
tar xf ffmpeg.tar.bz2 && \
cd ffmpeg-* && \
sed -i 's/add_ldexeflags -fPIE -pie/add_ldexeflags -fPIE -static-pie/' configure && \
./configure \
--pkg-config-flags="--static" \
--extra-cflags="-fopenmp" \
--extra-ldflags="-fopenmp -Wl,-z,stack-size=2097152" \
--toolchain=hardened \
--disable-debug \
--disable-shared \
--disable-ffplay \
--enable-static \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--enable-fontconfig \
--enable-gray \
--enable-iconv \
--enable-lcms2 \
--enable-libaom \
--enable-libaribb24 \
--enable-libass \
--enable-libbluray \
--enable-libdav1d \
--enable-libdavs2 \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libfribidi \
--enable-libgme \
--enable-libgsm \
--enable-libkvazaar \
--enable-libmodplug \
--enable-libmp3lame \
--enable-libmysofa \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-librabbitmq \
--enable-librav1e \
--enable-librtmp \
--enable-librubberband \
--enable-libshine \
--enable-libsnappy \
--enable-libsoxr \
--enable-libspeex \
--enable-libsrt \
--enable-libssh \
--enable-libsvtav1 \
--enable-libtheora \
--enable-libtwolame \
--enable-libuavs3d \
--enable-libvidstab \
--enable-libvmaf \
--enable-libvo-amrwbenc \
--enable-libvorbis \
--enable-libvpx \
--enable-libwebp \
--enable-libx264 \
--enable-libx265 \
--enable-libxavs2 \
--enable-libxml2 \
--enable-libxvid \
--enable-libzimg \
--enable-openssl \
|| (cat ffbuild/config.log ; false) \
&& make -j$(nproc) install
RUN \
EXPAT_VERSION=$(pkg-config --modversion expat) \
FFTW_VERSION=$(pkg-config --modversion fftw3) \
FONTCONFIG_VERSION=$(pkg-config --modversion fontconfig) \
FREETYPE_VERSION=$(pkg-config --modversion freetype2) \
FRIBIDI_VERSION=$(pkg-config --modversion fribidi) \
LIBSAMPLERATE_VERSION=$(pkg-config --modversion samplerate) \
LIBXML2_VERSION=$(pkg-config --modversion libxml-2.0) \
LCMS2_VERSION=$(pkg-config --modversion lcms2) \
OPENSSL_VERSION=$(pkg-config --modversion openssl) \
SOXR_VERSION=$(pkg-config --modversion soxr) \
LIBVO_AMRWBENC_VERSION=$(pkg-config --modversion vo-amrwbenc) \
SNAPPY_VERSION=$(apk info -a snappy | head -n1 | awk '{print $1}' | sed -e 's/snappy-//') \
jq -n \
'{ \
expat: env.EXPAT_VERSION, \
"libfdk-aac": env.FDK_AAC_VERSION, \
ffmpeg: env.FFMPEG_VERSION, \
fftw: env.FFTW_VERSION, \
fontconfig: env.FONTCONFIG_VERSION, \
lcms2: env.LCMS2_VERSION, \
libaom: env.AOM_VERSION, \
libaribb24: env.LIBARIBB24_VERSION, \
libass: env.LIBASS_VERSION, \
libbluray: env.LIBBLURAY_VERSION, \
libdav1d: env.DAV1D_VERSION, \
libdavs2: env.DAVS2_VERSION, \
libfreetype: env.FREETYPE_VERSION, \
libfribidi: env.FRIBIDI_VERSION, \
libgme: env.LIBGME_COMMIT, \
libgsm: env.LIBGSM_COMMIT, \
libkvazaar: env.KVAZAAR_VERSION, \
libmodplug: env.LIBMODPLUG_VERSION, \
libmp3lame: env.MP3LAME_VERSION, \
libmysofa: env.LIBMYSOFA_VERSION, \
libogg: env.OGG_VERSION, \
libopencoreamr: env.OPENCOREAMR_VERSION, \
libopenjpeg: env.OPENJPEG_VERSION, \
libopus: env.OPUS_VERSION, \
librabbitmq: env.LIBRABBITMQ_VERSION, \
librav1e: env.RAV1E_VERSION, \
librtmp: env.LIBRTMP_COMMIT, \
librubberband: env.RUBBERBAND_VERSION, \
libsamplerate: env.LIBSAMPLERATE_VERSION, \
libshine: env.LIBSHINE_VERSION, \
libsoxr: env.SOXR_VERSION, \
libsnappy: env.SNAPPY_VERSION, \
libspeex: env.SPEEX_VERSION, \
libsrt: env.SRT_VERSION, \
libssh: env.LIBSSH_VERSION, \
libsvtav1: env.SVTAV1_VERSION, \
libtheora: env.THEORA_VERSION, \
libtwolame: env.TWOLAME_VERSION, \
libuavs3d: env.UAVS3D_COMMIT, \
libvidstab: env.VIDSTAB_VERSION, \
libvmaf: env.VMAF_VERSION, \
libvo_amrwbenc: env.LIBVO_AMRWBENC_VERSION, \
libvorbis: env.VORBIS_VERSION, \
libvpx: env.VPX_VERSION, \
libwebp: env.LIBWEBP_VERSION, \
libx264: env.X264_VERSION, \
libx265: env.X265_VERSION, \
libxavs2: env.XAVS2_VERSION, \
libxml2: env.LIBXML2_VERSION, \
libxvid: env.XVID_VERSION, \
libzimg: env.ZIMG_VERSION, \
openssl: env.OPENSSL_VERSION, \
}' > /versions.json
# make sure binaries has no dependencies, is relro, pie and stack nx
COPY checkelf /
RUN \
/checkelf /usr/local/bin/ffmpeg && \
/checkelf /usr/local/bin/ffprobe
FROM scratch AS final1
COPY --from=builder /versions.json /usr/local/bin/ffmpeg /usr/local/bin/ffprobe /
COPY --from=builder /usr/local/share/doc/ffmpeg/* /doc/
COPY --from=builder /etc/ssl/cert.pem /etc/ssl/cert.pem
# sanity tests
RUN ["/ffmpeg", "-version"]
RUN ["/ffprobe", "-version"]
RUN ["/ffmpeg", "-hide_banner", "-buildconf"]
# stack size
RUN ["/ffmpeg", "-f", "lavfi", "-i", "testsrc", "-c:v", "libsvtav1", "-t", "100ms", "-f", "null", "-"]
# dns
RUN ["/ffprobe", "-i", "https://github.com/favicon.ico"]
# tls/https certs
RUN ["/ffprobe", "-tls_verify", "1", "-ca_file", "/etc/ssl/cert.pem", "-i", "https://github.com/favicon.ico"]
# clamp all files into one layer
FROM scratch AS final2
COPY --from=final1 / /
FROM final2
LABEL maintainer="Mattias Wadman [email protected]"
ENTRYPOINT ["/ffmpeg"]