This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile.source
512 lines (408 loc) · 21.3 KB
/
Dockerfile.source
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
FROM ubuntu:18.04 AS build
WORKDIR /home
# COMMON BUILD TOOLS
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends build-essential autoconf make git wget pciutils cpio libtool lsb-release ca-certificates pkg-config bison flex libcurl4-gnutls-dev zlib1g-dev
RUN git config --global http.proxy ${http_proxy}
RUN git config --global https.proxy ${https_proxy}
# Install cmake
ARG CMAKE_VER=3.13.1
ARG CMAKE_REPO=https://cmake.org/files
RUN wget -O - ${CMAKE_REPO}/v${CMAKE_VER%.*}/cmake-${CMAKE_VER}.tar.gz | tar xz && \
cd cmake-${CMAKE_VER} && \
./bootstrap --prefix="/usr/local" --system-curl && \
make -j8 && \
make install
# Install automake, use version 1.14 on CentOS
ARG AUTOMAKE_VER=1.14
ARG AUTOMAKE_REPO=https://ftp.gnu.org/pub/gnu/automake/automake-${AUTOMAKE_VER}.tar.xz
RUN apt-get install -y -q automake
# Build NASM
ARG NASM_VER=2.13.03
ARG NASM_REPO=https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VER}/nasm-${NASM_VER}.tar.bz2
RUN wget ${NASM_REPO} && \
tar -xaf nasm* && \
cd nasm-${NASM_VER} && \
./autogen.sh && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu && \
make -j8 && \
make install
# Build YASM
ARG YASM_VER=1.3.0
ARG YASM_REPO=https://www.tortall.net/projects/yasm/releases/yasm-${YASM_VER}.tar.gz
RUN wget -O - ${YASM_REPO} | tar xz && \
cd yasm-${YASM_VER} && \
sed -i "s/) ytasm.*/)/" Makefile.in && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu && \
make -j8 && \
make install
# Build ogg
ARG OGG_VER=1.3.3
ARG OGG_REPO=https://github.com/xiph/ogg/releases/download/v${OGG_VER}/libogg-${OGG_VER}.tar.xz
RUN wget -O - ${OGG_REPO} | tar xJ && \
cd libogg-${OGG_VER} && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu --enable-shared && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Build vorbis
ARG VORBIS_VER=1.3.6
ARG VORBIS_REPO=https://github.com/xiph/vorbis/archive/v${VORBIS_VER}.tar.gz
RUN wget -O - ${VORBIS_REPO} | tar xz && \
cd vorbis-${VORBIS_VER} && \
./autogen.sh && \
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/x86_64-linux-gnu && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu --enable-shared && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Build mp3lame
ARG MP3LAME_VER=3.100
ARG MP3LAME_REPO=https://sourceforge.net/projects/lame/files/lame/${MP3LAME_VER}/lame-${MP3LAME_VER}.tar.gz
RUN wget -O - ${MP3LAME_REPO} | tar xz && \
cd lame-${MP3LAME_VER} && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu --enable-shared --enable-nasm && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Build fdk-aac
ARG FDK_AAC_VER=v0.1.6
ARG FDK_AAC_REPO=https://github.com/mstorsjo/fdk-aac/archive/${FDK_AAC_VER}.tar.gz
RUN wget -O - ${FDK_AAC_REPO} | tar xz && mv fdk-aac-${FDK_AAC_VER#v} fdk-aac && \
cd fdk-aac && \
autoreconf -fiv && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu --enable-shared && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Build opus
ARG OPUS_VER=1.2.1
ARG OPUS_REPO=https://archive.mozilla.org/pub/opus/opus-${OPUS_VER}.tar.gz
RUN wget -O - ${OPUS_REPO} | tar xz && \
cd opus-${OPUS_VER} && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu --enable-shared && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Build vpx
ARG VPX_VER=tags/v1.7.0
ARG VPX_REPO=https://chromium.googlesource.com/webm/libvpx.git
RUN git clone ${VPX_REPO} && \
cd libvpx && \
git checkout ${VPX_VER} && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu --enable-shared --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=nasm && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Build x264
ARG X264_VER=stable
ARG X264_REPO=https://github.com/mirror/x264
RUN git clone ${X264_REPO} && \
cd x264 && \
git checkout ${X264_VER} && \
./configure --prefix="/usr/local" --libdir=/usr/local/lib/x86_64-linux-gnu --enable-shared && \
make -j8 && \
make install DESTDIR="/home/build" && \
make install
# Build x265
ARG X265_VER=2.9
ARG X265_REPO=https://github.com/videolan/x265/archive/${X265_VER}.tar.gz
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends libnuma-dev
RUN wget -O - ${X265_REPO} | tar xz && mv x265-${X265_VER} x265 && \
cd x265/build/linux && \
cmake -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DLIB_INSTALL_DIR=/usr/local/lib/x86_64-linux-gnu ../../source && \
make -j8 && \
make install DESTDIR="/home/build" && \
make install
# Install required packges
RUN apt-get update -y && apt-get install -y python3-pip ninja-build;
# Build Meson
ARG MESON_VER=0.53.1
ARG MESON_REPO=https://github.com/mesonbuild/meson
RUN git clone ${MESON_REPO}; \
cd meson; \
git checkout ${MESON_VER}; \
python3 setup.py install;
# Build dav1d
ARG LIBDAV1D_VER=0.5.2
ARG LIBDAV1D_REPO=https://code.videolan.org/videolan/dav1d.git
RUN git clone ${LIBDAV1D_REPO}; \
cd dav1d; \
git checkout ${LIBDAV1D_VER}; \
meson build --prefix /usr --libdir /usr/lib/x86_64-linux-gnu --buildtype release; \
ninja -C build; \
cd build; \
DESTDIR="/home/build" ninja install; \
ninja install;
# Fetch SVT-HEVC
ARG SVT_HEVC_VER=v1.4.3
ARG SVT_HEVC_REPO=https://github.com/intel/SVT-HEVC
RUN git clone ${SVT_HEVC_REPO} && \
cd SVT-HEVC/Build/linux && \
export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig" && \
git checkout ${SVT_HEVC_VER} && \
mkdir -p ../../Bin/Release && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DCMAKE_ASM_NASM_COMPILER=yasm ../.. && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Fetch SVT-AV1
ARG SVT_AV1_VER=v0.8.1
ARG SVT_AV1_REPO=https://github.com/OpenVisualCloud/SVT-AV1
ARG SVT_AV1_PATCHES_RELEASE_VER=0.3
ARG SVT_AV1_PATCHES_RELEASE_URL=https://github.com/VCDP/CDN/archive/v${SVT_AV1_PATCHES_RELEASE_VER}.tar.gz
ARG SVT_AV1_PATCHES_PATH=/home/CDN-${SVT_AV1_PATCHES_RELEASE_VER}
RUN wget -O - ${SVT_AV1_PATCHES_RELEASE_URL} | tar xz
RUN git clone ${SVT_AV1_REPO} && \
cd SVT-AV1 && \
git checkout ${SVT_AV1_VER} && \
find ${SVT_AV1_PATCHES_PATH}/SVT-AV1_patches -type f -name '*.patch' -print0 | sort -z | xargs -t -0 -n 1 patch -p1 -i && \
cd Build/linux && \
mkdir -p ../../Bin/Release && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DCMAKE_ASM_NASM_COMPILER=yasm ../.. && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
#Remove build residue from SVT-AV1 build -- temp fix for bug
RUN if [ -d "build/home/" ]; then rm -rf build/home/; fi
# Fetch SVT-VP9
ARG SVT_VP9_VER=v0.1.0
ARG SVT_VP9_REPO=https://github.com/OpenVisualCloud/SVT-VP9
RUN git clone ${SVT_VP9_REPO} && \
cd SVT-VP9/Build/linux && \
git checkout ${SVT_VP9_VER} && \
mkdir -p ../../Bin/Release && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DCMAKE_ASM_NASM_COMPILER=yasm ../.. && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Fetch gmmlib
ARG GMMLIB_VER=intel-gmmlib-18.3.0
ARG GMMLIB_REPO=https://github.com/intel/gmmlib/archive/${GMMLIB_VER}.tar.gz
RUN wget -O - ${GMMLIB_REPO} | tar xz && mv gmmlib-${GMMLIB_VER} gmmlib;
# Build libdrm
ARG LIBDRM_VER=2.4.96
ARG LIBDRM_REPO=https://dri.freedesktop.org/libdrm/libdrm-${LIBDRM_VER}.tar.gz
RUN apt-get update && apt-get install -y -q --no-install-recommends libpciaccess-dev
RUN wget -O - ${LIBDRM_REPO} | tar xz && \
cd libdrm-${LIBDRM_VER} && \
./configure --prefix=/usr/local --libdir=/usr/local/lib/x86_64-linux-gnu && \
make -j8 && \
make install DESTDIR=/home/build && \
make install ;
# Build libva
ARG LIBVA_VER=2.4.0
ARG LIBVA_REPO=https://github.com/intel/libva/archive/${LIBVA_VER}.tar.gz
RUN apt-get remove libva*
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends libdrm-dev libx11-dev xorg-dev libgl1-mesa-dev openbox
RUN wget -O - ${LIBVA_REPO} | tar xz && \
cd libva-${LIBVA_VER} && \
./autogen.sh --prefix=/usr/local --libdir=/usr/local/lib/x86_64-linux-gnu && \
make -j8 && \
make install DESTDIR=/home/build && \
make install;
# Build libva-utils
ARG LIBVA_UTILS_VER=2.4.0
ARG LIBVA_UTILS_REPO=https://github.com/intel/libva-utils/archive/${LIBVA_UTILS_VER}.tar.gz
RUN wget -O - ${LIBVA_UTILS_REPO} | tar xz; \
cd libva-utils-${LIBVA_UTILS_VER}; \
export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig"; \
./autogen.sh --prefix=/usr/local --libdir=/usr/local/lib/x86_64-linux-gnu; \
make -j8; \
make install DESTDIR=/home/build; \
make install;
# Build media driver
ARG MEDIA_DRIVER_VER=intel-media-kbl-19.1.1
ARG MEDIA_DRIVER_REPO=https://github.com/VCDP/media-driver/archive/${MEDIA_DRIVER_VER}.tar.gz
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends libdrm-dev libpciaccess-dev libx11-dev xorg-dev libgl1-mesa-dev
RUN wget -O - ${MEDIA_DRIVER_REPO} | tar xz && mv media-driver-${MEDIA_DRIVER_VER} media-driver && \
mkdir -p media-driver/build && \
cd media-driver/build && \
export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig" && \
cmake -DBUILD_TYPE=release -DBUILD_ALONG_WITH_CMRTLIB=1 -DMEDIA_VERSION="2.0.0" -DBS_DIR_GMMLIB=/home/gmmlib/Source/GmmLib -DBS_DIR_COMMON=/home/gmmlib/Source/Common -DBS_DIR_INC=/home/gmmlib/Source/inc -DBS_DIR_MEDIA=/home/media-driver -Wno-dev -DCMAKE_INSTALL_PREFIX=/usr/local -DMEDIA_BUILD_FATAL_WARNINGS=OFF .. && \
make -j8 && \
make install DESTDIR=/home/build && \
make install
# Build Intel(R) Media SDK
ARG MSDK_VER=MSS-KBL-2019-R1-HF1
ARG MSDK_REPO=https://github.com/Intel-Media-SDK/MediaSDK/archive/${MSDK_VER}.tar.gz
RUN wget -O - ${MSDK_REPO} | tar xz && mv MediaSDK-${MSDK_VER} MediaSDK && \
mkdir -p MediaSDK/build && \
cd MediaSDK/build && \
export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig" && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_INCLUDEDIR=include -DBUILD_SAMPLES=OFF -DENABLE_OPENCL=OFF -Wno-dev .. && \
make -j8 && \
make install DESTDIR=/home/build && \
rm -rf /home/build/usr/samples && \
rm -rf /home/build/usr/plugins && \
rm -rf /home/build/usr/local/samples && \
rm -rf /home/build/usr/local/plugins && \
make install;
#install OpenCL
RUN mkdir neo
RUN cd neo && wget https://github.com/intel/compute-runtime/releases/download/19.01.12103/intel-gmmlib_18.4.0.348_amd64.deb
RUN cd neo && wget https://github.com/intel/compute-runtime/releases/download/19.01.12103/intel-igc-core_18.50.1270_amd64.deb
RUN cd neo && wget https://github.com/intel/compute-runtime/releases/download/19.01.12103/intel-igc-opencl_18.50.1270_amd64.deb
RUN cd neo && wget https://github.com/intel/compute-runtime/releases/download/19.01.12103/intel-opencl_19.01.12103_amd64.deb
RUN cd neo && \
dpkg -i *.deb && \
dpkg-deb -x intel-gmmlib_18.4.0.348_amd64.deb /home/build/ && \
dpkg-deb -x intel-igc-core_18.50.1270_amd64.deb /home/build/ && \
dpkg-deb -x intel-igc-opencl_18.50.1270_amd64.deb /home/build/ && \
dpkg-deb -x intel-opencl_19.01.12103_amd64.deb /home/build/
#clinfo needs to be installed after build directory is copied over
# Build libjson-c
ARG LIBJSONC_VER=0.13.1-20180305
ARG LIBJSONC_REPO=https://github.com/json-c/json-c/archive/json-c-${LIBJSONC_VER}.tar.gz
RUN wget -O - ${LIBJSONC_REPO} | tar xz && \
cd json-c-json-c-${LIBJSONC_VER} && \
sh autogen.sh && \
./configure --prefix=/usr/local --libdir=/usr/local/lib/x86_64-linux-gnu && \
make -j8 && \
make install DESTDIR="/home/build" && \
make install;
# Build librdkafka
ARG LIBRDKAFKA_VER=1.0.0
ARG FILE_NAME=v${LIBRDKAFKA_VER}
ARG LIBRDKAFKA_REPO=https://github.com/edenhill/librdkafka/archive/${FILE_NAME}.tar.gz
RUN wget -O - ${LIBRDKAFKA_REPO} | tar xz && \
cd librdkafka-${LIBRDKAFKA_VER} && \
./configure --prefix=/usr/local --libdir=/usr/local/lib/x86_64-linux-gnu && \
make -j8 && \
make install DESTDIR=/home/build && \
make install;
ARG OPENCV_VER=4.3.0
ARG OPENCV_REPO=https://github.com/opencv/opencv/archive/${OPENCV_VER}.tar.gz
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends libeigen3-dev
RUN wget ${OPENCV_REPO} && \
tar -zxvf ${OPENCV_VER}.tar.gz && \
cd opencv-${OPENCV_VER} && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_EXAMPLES=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DBUILD_TESTS=OFF .. && \
make -j $(nproc) && \
make install DESTDIR=/home/build && \
make install
ENV CPATH=$CPATH:/usr/local/include/opencv4/
# Build DLDT-Inference Engine
ARG DLDT_VER=2020.2
ARG DLDT_REPO=https://github.com/opencv/dldt.git
RUN apt-get update && apt-get -y install libusb-1.0.0-dev python python-pip python-setuptools python-yaml
RUN git clone -b ${DLDT_VER} ${DLDT_REPO} && \
cd dldt && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/opt/intel/dldt -DLIB_INSTALL_PATH=/opt/intel/dldt -DENABLE_MKL_DNN=ON -DENABLE_CLDNN=ON -DENABLE_SAMPLES=OFF -DENABLE_OPENCV=OFF -DENABLE_TESTS=OFF -DENABLE_GNA=OFF -DENABLE_PROFILING_ITT=OFF -DENABLE_SAMPLES_CORE=OFF -DENABLE_SEGMENTATION_TESTS=OFF -DENABLE_OBJECT_DETECTION_TESTS=OFF -DBUILD_TESTS=OFF -DNGRAPH_UNIT_TEST_ENABLE=OFF -DNGRAPH_TEST_UTIL_ENABLE=OFF .. && \
make -j $(nproc) && \
rm -rf ../bin/intel64/Release/lib/libgtest* && \
rm -rf ../bin/intel64/Release/lib/libgmock* && \
rm -rf ../bin/intel64/Release/lib/libmock* && \
rm -rf ../bin/intel64/Release/lib/libtest*
ARG libdir=/opt/intel/dldt/inference-engine/lib/intel64
RUN mkdir -p /opt/intel/dldt/inference-engine/include && \
cp -r dldt/inference-engine/include/* /opt/intel/dldt/inference-engine/include && \
cp -r dldt/inference-engine/ie_bridges/c/include/* /opt/intel/dldt/inference-engine/include && \
mkdir -p ${libdir} && \
cp -r dldt/bin/intel64/Release/lib/* ${libdir} && \
mkdir -p /opt/intel/dldt/inference-engine/src && \
cp -r dldt/inference-engine/src/* /opt/intel/dldt/inference-engine/src/ && \
mkdir -p /opt/intel/dldt/inference-engine/share && \
cp -r dldt/build/share/* /opt/intel/dldt/inference-engine/share/ && \
mkdir -p /opt/intel/dldt/inference-engine/external/ && \
cp -r dldt/inference-engine/temp/tbb /opt/intel/dldt/inference-engine/external/
RUN mkdir -p build/opt/intel/dldt/inference-engine/include && \
cp -r dldt/inference-engine/include/* build/opt/intel/dldt/inference-engine/include && \
cp -r dldt/inference-engine/ie_bridges/c/include/* build/opt/intel/dldt/inference-engine/include && \
mkdir -p build${libdir} && \
cp -r dldt/bin/intel64/Release/lib/* build${libdir} && \
mkdir -p build/opt/intel/dldt/inference-engine/src && \
cp -r dldt/inference-engine/src/* build/opt/intel/dldt/inference-engine/src/ && \
mkdir -p build/opt/intel/dldt/inference-engine/share && \
cp -r dldt/build/share/* build/opt/intel/dldt/inference-engine/share/ && \
mkdir -p build/opt/intel/dldt/inference-engine/external/ && \
cp -r dldt/inference-engine/temp/tbb build/opt/intel/dldt/inference-engine/external/
RUN for p in /usr /home/build/usr /opt/intel/dldt/inference-engine /home/build/opt/intel/dldt/inference-engine; do \
pkgconfiglibdir="$p/lib/x86_64-linux-gnu" && \
mkdir -p "${pkgconfiglibdir}/pkgconfig" && \
pc="${pkgconfiglibdir}/pkgconfig/dldt.pc" && \
echo "prefix=/opt" > "$pc" && \
echo "libdir=${libdir}" >> "$pc" && \
echo "includedir=/opt/intel/dldt/inference-engine/include" >> "$pc" && \
echo "" >> "$pc" && \
echo "Name: DLDT" >> "$pc" && \
echo "Description: Intel Deep Learning Deployment Toolkit" >> "$pc" && \
echo "Version: 5.0" >> "$pc" && \
echo "" >> "$pc" && \
echo "Libs: -L\${libdir} -linference_engine" >> "$pc" && \
echo "Cflags: -I\${includedir}" >> "$pc"; \
done;
ENV InferenceEngine_DIR=/opt/intel/dldt/inference-engine/share
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/dldt/inference-engine/lib:/opt/intel/dldt/inference-engine/external/tbb/lib:${libdir}
#install Model Optimizer in the DLDT for Dev
# Fetch FFmpeg source
ARG FFMPEG_VER=n4.2
ARG FFMPEG_REPO=https://github.com/FFmpeg/FFmpeg/archive/${FFMPEG_VER}.tar.gz
ARG FFMPEG_1TN_PATCH_REPO=https://patchwork.ffmpeg.org/patch/11625/raw
ARG FFMPEG_PATCHES_RELEASE_VER=0.2
ARG FFMPEG_PATCHES_RELEASE_URL=https://github.com/VCDP/CDN/archive/v${FFMPEG_PATCHES_RELEASE_VER}.tar.gz
ARG FFMPEG_PATCHES_PATH=/home/CDN-${FFMPEG_PATCHES_RELEASE_VER}
RUN wget -O - ${FFMPEG_PATCHES_RELEASE_URL} | tar xz
ARG FFMPEG_MA_RELEASE_VER=0.5
ARG FFMPEG_MA_RELEASE_URL=https://github.com/VCDP/FFmpeg-patch/archive/v${FFMPEG_MA_RELEASE_VER}.tar.gz
ARG FFMPEG_MA_PATH=/home/FFmpeg-patch-${FFMPEG_MA_RELEASE_VER}
RUN wget -O - ${FFMPEG_MA_RELEASE_URL} | tar xz
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends libass-dev libfreetype6-dev libvdpau-dev libsdl2-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev zlib1g-dev libssl-dev python3-dev
RUN wget -O - ${FFMPEG_REPO} | tar xz && mv FFmpeg-${FFMPEG_VER} FFmpeg && \
cd FFmpeg && \
find ${FFMPEG_PATCHES_PATH}/FFmpeg_patches -type f -name '*.patch' -print0 | sort -z | xargs -t -0 -n 1 patch -p1 -i && \
find ${FFMPEG_MA_PATH}/patches -type f -name '*.patch' -print0 | sort -z | xargs -t -0 -n 1 patch -p1 -i;
# Patch FFmpeg source for SVT-HEVC
RUN cd /home/FFmpeg && \
patch -p1 < ../SVT-HEVC/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch;
# Patch FFmpeg source for SVT-AV1
RUN cd /home/FFmpeg; \
patch -p1 < ../SVT-AV1/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1-with-svt-hevc.patch;
ADD patch /root/patch
# Compile FFmpeg
RUN cd /home/FFmpeg && \
export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig" && \
cp /root/patch/opencv.pc /usr/local/lib/pkgconfig/ && \
cp /root/patch/cvdef.h /usr/local/include/opencv4/opencv2/core/cvdef.h && \
./configure --prefix="/usr/local" --extra-cflags="-I/opt/intel/dldt/inference-engine/include " --extra-ldflags="-L/opt/intel/dldt/inference-engine/lib/intel64 " --libdir=/usr/local/lib/x86_64-linux-gnu --extra-libs="-lpthread -lm" --enable-shared --enable-gpl --enable-libass --enable-libfreetype --enable-openssl --enable-nonfree --enable-libdrm --enable-libmfx --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libsvthevc --enable-libsvtav1 --enable-libinference_engine_c_api --enable-librdkafka --enable-libjson_c --enable-libopencv --enable-python3 && \
make -j8 && \
make install && make install DESTDIR="/home/build" && \
cp -rf python /home/build/python
# remake opencv videoio to incorporate ffmpeg/gst
RUN cd opencv-${OPENCV_VER}/build && \
rm -rf * && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_GENERATE_PKGCONFIG=ON -DBUILD_EXAMPLES=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DBUILD_TESTS=OFF .. && \
cd modules/videoio && \
make -j $(nproc) && \
cp -f ../../lib/libopencv_videoio.so.${OPENCV_VER} /home/build/usr/local/lib
# Clean up after build
RUN rm -rf /home/build/usr/include && \
rm -rf /home/build/usr/share/doc && \
rm -rf /home/build/usr/share/gtk-doc && \
rm -rf /home/build/usr/share/man && \
rm -rf /home/build/usr/local/include && \
rm -rf /home/build/usr/local/share/doc && \
rm -rf /home/build/usr/local/share/gtk-doc && \
rm -rf /home/build/usr/local/share/man && \
find /home/build -name "*.a" -exec rm -f {} \;
FROM ubuntu:18.04
LABEL Description="This is the base image for FFMPEG & DLDT Ubuntu 18.04 LTS"
LABEL Vendor="Intel Corporation"
WORKDIR /home
# Prerequisites
RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime && \
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends libxv1 libxcb-shm0 libxcb-shape0 libxcb-xfixes0 libsdl2-2.0-0 libasound2 libvdpau1 libnuma1 libass9 libssl1.1 libpciaccess0 libdrm2 libjson-c-dev python3-dev python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install Pillow numpy
# Install
COPY --from=build /home/build /
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib/x86_64-linux-gnu
ENV LIBVA_DRIVERS_PATH=/usr/local/lib/x86_64-linux-gnu/dri
ENV LIBVA_DRIVER_NAME=iHD
RUN apt-get update && apt-get install -y clinfo
ARG libdir=/opt/intel/dldt/inference-engine/lib/intel64
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/dldt/inference-engine/lib:/opt/intel/dldt/inference-engine/external/tbb/lib:${libdir}
ENV InferenceEngine_DIR=/opt/intel/dldt/inference-engine/share