-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path4.2.4-alpine-rpi3.Dockerfile
More file actions
321 lines (293 loc) · 8.36 KB
/
4.2.4-alpine-rpi3.Dockerfile
File metadata and controls
321 lines (293 loc) · 8.36 KB
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
# FFmpeg
FROM collelog/buildenv:alpine AS ffmpeg-build
ENV LD_LIBRARY_PATH=/opt/vc/lib:/usr/local/lib:/usr/lib:/lib
ENV PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/lib/pkgconfig
ENV SRC=/usr/local
ENV PREFIX=/usr/local
RUN apk add --no-cache --update-cache \
aom-dev \
chromaprint-dev \
cunit-dev \
fdk-aac-dev \
ffmpeg-libs \
ffmpeg-dev \
flite-dev \
fontconfig-dev \
freetype-dev \
frei0r-plugins-dev \
fribidi-dev \
gsm-dev \
jack-dev \
lame-dev \
libass-dev \
libbluray-dev \
libcaca-dev \
libcdio-dev \
libcdio-paranoia-dev \
libdc1394-dev \
libdrm-dev \
libogg-dev \
libpng-dev \
librsvg-dev \
libsndfile-dev \
libssh-dev \
libtheora-dev \
libvorbis-dev \
libvpx-dev \
libwebp-dev \
libxau-dev \
libxcb-dev \
libxml2-dev \
mesa-dev \
mpg123-dev \
openjpeg-dev \
openal-soft-dev \
openssl-dev \
opus-dev \
pulseaudio-dev \
sdl2-dev \
snappy-dev \
soxr-dev \
speex-dev \
util-linux-dev \
wavpack-dev \
x264-dev \
x265-dev \
xvidcore-dev \
zeromq-dev \
\
raspberrypi-libs \
raspberrypi-dev
RUN echo http://dl-2.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
RUN apk add --no-cache --update-cache \
libgme-dev \
lilv-dev \
rubberband-dev \
shine \
vidstab-dev
RUN echo http://dl-2.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
RUN apk add --no-cache --update-cache \
ladspa-dev
# libiec61883-dev
# AviSynth+ https://github.com/AviSynth/AviSynthPlus
WORKDIR /tmp/AviSynthPlus
RUN \
curl -fsSL https://github.com/AviSynth/AviSynthPlus/archive/v3.6.1.tar.gz | \
tar -xz --strip-components=1 && \
mkdir avisynth-build && cd avisynth-build && \
cmake -DCMAKE_BUILD_TYPE=Release ../ -DHEADERS_ONLY:bool=on && \
make -j $(nproc) install
## bs2b http://bs2b.sourceforge.net/
WORKDIR /tmp/bs2b
RUN \
curl -fsSL https://downloads.sourceforge.net/project/bs2b/libbs2b/3.1.0/libbs2b-3.1.0.tar.gz | \
tar -xz --strip-components=1 && \
cd ./build-aux && \
curl -fsSL 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -o config.guess && \
curl -fsSL 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -o config.sub && \
cd ../ && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc) && \
make -j $(nproc) install
## Codec 2 https://github.com/drowe67/codec2/
WORKDIR /tmp/codec2
RUN \
curl -fsSL https://github.com/drowe67/codec2/archive/v0.9.2.tar.gz | \
tar -xz --strip-components=1 && \
mkdir codec2-build && cd codec2-build && \
cmake -DCMAKE_BUILD_TYPE=Release ../ && \
make -j $(nproc) install
## kvazaar https://github.com/ultravideo/kvazaar
WORKDIR /tmp/kvazaar
RUN \
curl -fsSL https://github.com/ultravideo/kvazaar/archive/v2.0.0.tar.gz | \
tar -zx --strip-components=1 && \
./autogen.sh && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc) && \
make -j $(nproc) install
## libaribb24 https://github.com/nkoriyama/aribb24/
WORKDIR /tmp/aribb24
RUN \
curl -fsSL https://github.com/nkoriyama/aribb24/tarball/master | \
tar -xz --strip-components=1 && \
autoreconf -fiv && \
./configure --prefix="${PREFIX}" && \
make -j $(nproc) && \
make -j $(nproc) install
## libmysofa https://github.com/hoene/libmysofa/
WORKDIR /tmp/libmysofa
RUN \
curl -fsSL https://github.com/hoene/libmysofa/archive/v1.1.tar.gz | \
tar -xz --strip-components=1 && \
mkdir libmysofa-build && cd libmysofa-build && \
cmake -DCMAKE_BUILD_TYPE=Release ../ && \
make -j $(nproc) install
## libsrt https://github.com/Haivision/srt
WORKDIR /tmp/srt
RUN \
curl -fsSL https://github.com/Haivision/srt/archive/v1.4.1.tar.gz | \
tar -xz --strip-components=1 && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
make -j $(nproc) && \
make -j $(nproc) install
## opencore-amr https://sourceforge.net/projects/opencore-amr/
WORKDIR /tmp/opencore
RUN \
curl -fsSL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz | \
tar -zx --strip-components=1 && \
./configure --prefix="${PREFIX}" --enable-shared && \
make -j $(nproc) && \
make -j $(nproc) install
## TwoLAME https://www.twolame.org/
WORKDIR /tmp/twolame
RUN \
curl -fsSL https://downloads.sourceforge.net/twolame/twolame-0.4.0.tar.gz | \
tar -xz --strip-components=1 && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc) && \
make -j $(nproc) install
# libopenmpt - libportaudio http://www.portaudio.com/
WORKDIR /tmp/libportaudio
RUN \
curl -fsSL http://www.portaudio.com/archives/pa_snapshot.tgz | \
tar -xz --strip-components=1 && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc) && \
make -j $(nproc) install && \
cd ./bindings/cpp && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc) && \
make -j $(nproc) install
# libopenmpt - libopenmpt https://lib.openmpt.org/libopenmpt/
WORKDIR /tmp/libopenmpt
RUN \
curl -fsSL https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.5.0+release.autotools.tar.gz | \
tar -xz --strip-components=1 && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make -j $(nproc) && \
make -j $(nproc) install
ENV CFLAGS="-O2 -pipe -march=armv8-a+crc+simd -mtune=cortex-a53"
ENV CXXFLAGS="-O2 -pipe -march=armv8-a+crc+simd -mtune=cortex-a53"
## ffmpeg https://ffmpeg.org/
WORKDIR /tmp/ffmpeg
RUN \
mkdir -p /build${PREFIX}/bin/ && \
curl -fsSL https://ffmpeg.org/releases/ffmpeg-4.2.4.tar.bz2 | \
tar -jx --strip-components=1 && \
./configure \
--disable-debug \
--disable-doc \
--disable-ffplay \
--disable-filter=resample \
--disable-stripping \
--disable-thumb \
--enable-avisynth \
--enable-avresample \
--enable-chromaprint \
--enable-fontconfig \
--enable-frei0r \
--enable-gpl \
--enable-ladspa \
--enable-libaom \
--enable-libaribb24 \
--enable-libass \
--enable-libbluray \
--enable-libbs2b \
--enable-libcaca \
--enable-libcdio \
--enable-libcodec2 \
--enable-libdc1394 \
--enable-libdrm \
--enable-libfdk_aac \
--enable-libflite \
--enable-libfontconfig \
--enable-libfreetype \
--enable-libfribidi \
--enable-libgme \
--enable-libgsm \
# --enable-libiec61883 \
--enable-libjack \
--enable-libkvazaar \
--enable-libmp3lame \
--enable-libmysofa \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopenmpt \
--enable-libopus \
--enable-libpulse \
--enable-librsvg \
--enable-librubberband \
--enable-libshine \
--enable-libsnappy \
--enable-libsoxr \
--enable-libspeex \
--enable-libsrt \
--enable-libssh \
--enable-libtheora \
--enable-libtwolame \
--enable-libvidstab \
--enable-libvorbis \
--enable-libvpx \
--enable-libwavpack \
--enable-libwebp \
--enable-libx264 \
--enable-libx265 \
--enable-libxcb \
--enable-libxml2 \
--enable-libxvid \
--enable-libzmq \
# --enable-libzvbi \
--enable-lv2 \
--enable-nonfree \
--enable-openal \
--enable-opengl \
--enable-openssl \
--enable-postproc \
--enable-sdl2 \
--enable-shared \
--enable-version3 \
--extra-cflags="-I${PREFIX}/include -I/opt/vc/include/IL ${CFLAGS}" \
--extra-cxxflags="-I${PREFIX}/include -I/opt/vc/include/IL ${CXXFLAGS}" \
--extra-ldflags="-L${PREFIX}/lib" \
--extra-libs="-lpthread -lm" \
--prefix="${PREFIX}" \
\
--enable-mmal \
# --enable-neon \
--enable-omx \
--enable-omx-rpi \
# --enable-vfp \
--enable-v4l2_m2m && \
make -j $(nproc) && \
make -j $(nproc) install && \
make tools/zmqsend && \
cp tools/zmqsend /build${PREFIX}/bin/ && \
make distclean && \
hash -r && \
cd tools && \
make qt-faststart && \
cp qt-faststart /build${PREFIX}/bin/
WORKDIR /tmp/build
COPY ./DockerTools/extractlibrary cp.sh
RUN chmod +x ./cp.sh
RUN echo /usr/local/bin/ffmpeg >> cplist
RUN echo /usr/local/bin/ffprobe >> cplist
RUN ./cp.sh cplist /build
RUN rm -rf /tmp/* /var/cache/apk/*
# final image
FROM alpine:3.13.5 AS release
LABEL maintainer "collelog <collelog.cavamin@gmail.com>"
ENV LD_LIBRARY_PATH=/opt/vc/lib:/usr/local/lib:/usr/lib:/lib
COPY --from=ffmpeg-build /build /
COPY --from=ffmpeg-build /build /build
RUN set -eux && \
apk upgrade --no-cache --update-cache && \
apk add --no-cache --update-cache \
raspberrypi-libs && \
\
# cleaning
rm -rf /tmp/* /var/cache/apk/*
ENTRYPOINT ["ffmpeg"]
CMD ["--help"]