83 lines
2.0 KiB
Docker
83 lines
2.0 KiB
Docker
# -*- dockerfile -*-
|
|
|
|
# Docker.solution based on the Intel-Media-SDK instructions available here:
|
|
#
|
|
# https://github.com/Intel-Media-SDK/MediaSDK/wiki/Build-and-use-ffmpeg-with-MediaSDK
|
|
#
|
|
# This should really be part of a multi-stage build so the final
|
|
# image isn't polluted with build artifacts
|
|
#
|
|
# NOTE: This image will only work with Ubuntu 19.04 (eoan) and newer
|
|
|
|
FROM xe-user-stage AS solution-build-1
|
|
|
|
USER root
|
|
|
|
# Update and install the Mesa, OpenCL, and Media from repositories.intel.com
|
|
# and required libraries.
|
|
#
|
|
# NOTE: libva requires libpciaccess0, however it doesn't depend on it
|
|
# so explicitly install it.
|
|
|
|
RUN zypper --no-color -n install -y \
|
|
libva-devel$LIBVA_DEV_VERSION \
|
|
libva-utils$LIBVA_UTILS_VERSION \
|
|
intel-mediasdk-devel$INTEL_MEDIASDK_DEVEL_VERSION \
|
|
intel-media-driver \
|
|
libva2 \
|
|
libva-utils \
|
|
libpciaccess-devel \
|
|
libpciaccess0 \
|
|
pciutils \
|
|
libxcb-shm0 \
|
|
libxcb-shape0 \
|
|
libxcb-xfixes0
|
|
|
|
FROM solution-build-1 AS solution-build-2
|
|
|
|
# Install git and build tools, clone ffmpeg, and get ready to build it
|
|
|
|
RUN zypper --no-color -n install -y \
|
|
binutils \
|
|
gcc \
|
|
gcc-c++ \
|
|
make \
|
|
pkg-config \
|
|
gawk \
|
|
git-core
|
|
|
|
USER user
|
|
|
|
# Clone ffmpeg
|
|
# NOTE: This explicitly clones the FFMPEG_TAG_VERSION (see SOLUTIONS).
|
|
|
|
RUN git clone --depth 1 --branch $FFMPEG_TAG_VERSION https://github.com/ffmpeg/ffmpeg /home/user/ffmpeg
|
|
|
|
# Build FFmpeg
|
|
|
|
WORKDIR /home/user/ffmpeg
|
|
|
|
ENV LIBVA_DRIVER_NAME=iHD
|
|
|
|
# RUN ./configure --arch=x86_64 --disable-x86asm --enable-vaapi --enable-libmfx \
|
|
# && make -j $(nproc --all) \
|
|
# && sudo make install
|
|
RUN ./configure --arch=x86_64 --disable-x86asm --enable-libmfx \
|
|
--pkg-config=/usr/bin/pkg-config --pkgconfigdir=/usr/lib64/pkgconfig \
|
|
&& make -j $(nproc) \
|
|
&& sudo make install
|
|
|
|
FROM solution-build-1
|
|
|
|
USER root
|
|
|
|
# Copy ffmpeg and ffprobe from build container
|
|
|
|
COPY --from=solution-build-2 /usr/local/bin/ /usr/local/bin/
|
|
|
|
RUN zypper clean --all
|
|
|
|
USER user
|
|
|
|
ENV LIBVA_DRIVER_NAME=iHD
|