1
0
intel-media-ffmpeg/Dockerfile.solution
James P. Ketrenos f83bce7178 Install curl and use it to download content (rhel 8.0 has curl)
Signed-off-by: James P. Ketrenos <james.p.ketrenos@intel.com>
2020-01-28 11:07:22 -08:00

83 lines
2.3 KiB
Docker

#
# 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
USER root
# Install git and build tools, clone ffmpeg, and get ready to build it
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get -q -y install \
git build-essential pkg-config
# Install all required Media common packages, broken out
# from the above command to highlight which packages are
# specific to media
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get -q -y install \
libva-dev$LIBVA_DEV_VERSION \
libmfx-dev$LIBMFX_DEV_VERSION \
libmfx1$LIBMFX1_VERSION \
vainfo$VAINFO_VERSION
ENV LIBVA_DRIVER_NAME=iHD
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
RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make -j $(nproc --all) \
&& sudo make install
FROM xe-user-stage
USER root
# Update and install the Mesa, OpenCL, and Media from repositories.intel.com
#
# NOTE: libva requires libpciaccess0, however it doesn't depend on it
# so explicitly install it.
#
# curl is used by assets/commands/test to obtain test content if it
# does not already exist
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get --no-install-recommends -q -y install \
intel-media-va-driver-non-free$INTEL_MEDIA_VA_DRIVER_NON_FREE_VERSION \
libva2$LIBVA2_VERSION \
libmfx1$LIBMFX1_VERSION \
vainfo$VAINFO_VERSION \
libpciaccess0 \
pciutils \
curl
# Copy ffmpeg and ffprobe from build container
COPY --from=solution-build /usr/local/bin/ /usr/local/bin/
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LIBVA_DRIVER_NAME=iHD
# In order for ffmpeg to access the video input, 'user' needs to have
# access to the hardware. Not sure how to do that across different
# OS releases, so setting user to 'root' for now.
USER root
WORKDIR /home/user