@@ -29,9 +29,8 @@ ARG FFMPEG_REPO=https://github.com/ffmpeg/ffmpeg/archive/${FFMPEG_VER}.tar.gz
2929
3030ARG PREFIX=/opt/build
3131ARG DL_PREFIX=/opt
32-
33- ENV LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:$LD_LIBRARY_PATH"
34- ENV PKG_CONFIG_PATH="/opt/build/lib/pkgconfig:$PKG_CONFIG_PATH"
32+ ENV LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/lib:${PREFIX}/lib64:/usr/lib:/usr/local/lib:/usr/local/lib64"
33+ ENV PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
3534ENV DEBIAN_FRONTEND="noninteractive"
3635ENV TZ="Europe/Warsaw"
3736
@@ -120,43 +119,46 @@ RUN curl -Lf "${MEDIA_DRIVER_REPO}" | tar xz --strip-components=1 -C "${DL_PREFI
120119
121120WORKDIR ${DL_PREFIX}/Video-Super-Resolution-Library
122121COPY . ${DL_PREFIX}/Video-Super-Resolution-Library
123- RUN ./build.sh -DENABLE_RAISR_OPENCL=ON
122+ RUN ./build.sh -DENABLE_RAISR_OPENCL=ON \
123+ -DCMAKE_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib;${PREFIX}/lib;" \
124+ -DCMAKE_C_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp" \
125+ -DCMAKE_CXX_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp"
124126
125127WORKDIR ${DL_PREFIX}/ffmpeg
126128RUN curl -Lf "${FFMPEG_REPO}" | \
127129 tar -zx --strip-components=1 -C "${DL_PREFIX}/ffmpeg" && \
128- git -C "${DL_PREFIX}/ffmpeg" apply --whitespace=fix "${DL_PREFIX}/Video-Super-Resolution-Library/ffmpeg/"*.patch && \
130+ patch -d "${DL_PREFIX}/ffmpeg" -p1 -i <(cat "${DL_PREFIX}/Video-Super-Resolution-Library/ffmpeg/"*.patch) && \
129131 cp "${DL_PREFIX}/Video-Super-Resolution-Library/ffmpeg/vf_raisr"*.c "${DL_PREFIX}/ffmpeg/libavfilter"
130132
131133# Configure and build ffmpeg
132134WORKDIR ${DL_PREFIX}/ffmpeg
133- # RUN ./configure --disable-shared \
134135RUN ./configure \
135- --disable-debug \
136- --disable-doc \
137- --enable-static \
138- --enable-libipp \
139- --enable-gpl \
136+ --disable-shared \
137+ --disable-debug \
138+ --disable-doc \
139+ --enable-static \
140+ --enable-libipp \
141+ --enable-gpl \
140142 --enable-libx264 \
141143 --enable-libx265 \
142- --enable-opencl \
143- --enable-vaapi \
144+ --enable-opencl \
145+ --enable-vaapi \
144146 --enable-libsvtav1 \
145- --enable-libvpx \
146- --extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm -lintlc -lsvml ' \
147- --extra-cflags='-fopenmp -I/opt/intel/oneapi/ipp/latest/include/ ipp/' \
148- --extra-ldflags=' -fopenmp -L/opt/intel/oneapi/ipp/latest/lib' \
149- --enable-cross-compile \
150- --prefix="${PREFIX}" && \
147+ --enable-libvpx \
148+ --extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm' \
149+ --extra-cflags='-fopenmp -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ ipp/latest/include/ipp ' \
150+ --extra-ldflags=" -fopenmp -L/opt/intel/oneapi/ipp/latest/lib -L${PREFIX}/lib" \
151+ --enable-cross-compile \
152+ --prefix="${PREFIX}" && \
151153 make clean && \
152154 make -j"$(nproc)" && \
153155 make install
154156
155- # cleanup
157+ # # cleanup
156158WORKDIR ${PREFIX}
157- RUN mkdir -p "${PREFIX}/usr/lib" && \
158- ldd "${PREFIX}/bin/ffmpeg" | cut -d ' ' -f 3 | xargs -i cp {} "${PREFIX}/usr/lib/" && \
159- LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/usr/lib:/usr/local/lib:/usr/local/lib64" /opt/build/ bin/ffmpeg -buildconf && \
159+ RUN mkdir -p "${PREFIX}/usr/lib" "${PREFIX}/usr/local" && \
160+ LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/lib" ldd "${PREFIX}/bin/ffmpeg" | cut -d ' ' -f 3 | xargs -i cp {} "${PREFIX}/usr/lib/" && \
161+ LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/usr/lib" "${PREFIX}/ bin/ffmpeg" -buildconf && \
160162 mv "${PREFIX}/bin" "${PREFIX}/usr/bin" && \
161163 mv "${PREFIX}/lib" "${PREFIX}/usr/local/"
162164
@@ -172,18 +174,12 @@ LABEL org.opencontainers.image.version="1.0.0"
172174LABEL org.opencontainers.image.vendor="Intel® Corporation"
173175LABEL org.opencontainers.image.licenses="BSD 3-Clause License"
174176
175- ENV LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib/intel64 :/usr/local/lib:/usr/local/lib64"
177+ ENV LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:/usr/local/lib:/usr/local/lib64:/usr/lib "
176178ENV LIBVA_DRIVERS_PATH=/usr/local/lib/dri
177179
178180SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
179181
180182WORKDIR /opt/raisrfolder
181- COPY --from=build /opt/build /
182- COPY ./filters_1.5x/ /opt/raisrfolder/filters_1.5x/
183- COPY ./filters_2x/ /opt/raisrfolder/filters_2x/
184-
185- COPY docker/Flex/nginx.conf /usr/local/nginx/conf/nginx.conf.copy
186-
187183RUN apt-get update --fix-missing && \
188184 apt-get full-upgrade -y && \
189185 apt-get install --no-install-recommends -y \
@@ -200,7 +196,14 @@ RUN apt-get update --fix-missing && \
200196 gcc \
201197 zlib1g-dev \
202198 make && \
203- curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
199+ apt-get clean && \
200+ rm -rf /var/lib/apt/lists/* && \
201+ groupadd -g 2110 vfio && \
202+ useradd -m -s /bin/bash -G vfio -u 2610 raisr && \
203+ usermod -aG sudo raisr && \
204+ passwd -d raisr
205+
206+ RUN curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
204207 curl -fsSL https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor | tee /usr/share/keyrings/intel-graphics-archive-keyring.gpg > /dev/null && \
205208 echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/intel-oneAPI.list && \
206209 echo "deb [signed-by=/usr/share/keyrings/intel-graphics-archive-keyring.gpg arch=amd64] https://repositories.intel.com/graphics/ubuntu jammy flex" > /etc/apt/sources.list.d/intel-graphics.list && \
@@ -211,11 +214,14 @@ RUN apt-get update --fix-missing && \
211214 intel-oneapi-ipp-2022.0 && \
212215 apt-get clean && \
213216 rm -rf /var/lib/apt/lists/* && \
214- ln -s /usr/bin/ffmpeg /opt/raisrfolder/ffmpeg && \
215- mkdir -p /opt/nginx /opt/nginx-rtmp-module && \
217+ mkdir -p "/opt/nginx" "/opt/nginx-rtmp-module" && \
216218 curl -Lf https://github.com/arut/nginx-rtmp-module/archive/refs/heads/master.tar.gz | tar xz --strip-components=1 -C "/opt/nginx-rtmp-module" && \
217- curl -Lf http://nginx.org/download/nginx-1.24.0.tar.gz | tar xz --strip-components=1 -C "/opt/nginx" && \
218- ldconfig
219+ curl -Lf http://nginx.org/download/nginx-1.24.0.tar.gz | tar xz --strip-components=1 -C "/opt/nginx"
220+
221+ COPY --from=build /opt/build /
222+ COPY ./filters_1.5x/ /opt/raisrfolder/filters_1.5x/
223+ COPY ./filters_2x/ /opt/raisrfolder/filters_2x/
224+ COPY docker/Flex/nginx.conf /usr/local/nginx/conf/nginx.conf.copy
219225
220226# Install ngnix and run ffmpeg to verify that the raisr filter is supported
221227WORKDIR /opt/nginx
@@ -224,10 +230,15 @@ RUN ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module && \
224230 make install && \
225231 rm -rf nginx-rtmp-module nginx && \
226232 cp -f /usr/local/nginx/conf/nginx.conf.copy /usr/local/nginx/conf/nginx.conf && \
233+ ln -s /usr/bin/ffmpeg /opt/raisrfolder/ffmpeg && \
234+ ldconfig && \
227235 ffmpeg -buildconf && \
228236 ffmpeg -h filter=raisr
229237
230238WORKDIR /opt/raisrfolder
231- SHELL ["/bin/bash", "-c"]
232- CMD ["-h", "filter=raisr"]
239+ USER "raisr"
240+
241+ SHELL [ "/bin/bash", "-c" ]
242+ CMD [ "-buildconf" ]
233243ENTRYPOINT [ "/opt/raisrfolder/ffmpeg" ]
244+ HEALTHCHECK --interval=30s --timeout=5s CMD ps aux | grep "ffmpeg" || exit 1
0 commit comments