1
0
James Ketrenos 92b62d4636 Added more info on launching the container
Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
2019-09-16 17:13:45 -07:00
2019-09-16 16:59:25 -07:00
2019-09-16 16:59:25 -07:00
2019-09-16 16:59:25 -07:00
2019-09-16 16:59:25 -07:00
2019-09-16 16:59:25 -07:00

Intel Media FFMPEG Transcode Container

This project hosts a container demonstrating the use of ffmpeg using GPU offload for transcode operations.

Using

Build the container:

docker build . -t intel-media-ffmpeg

Run the container:

docker run \
  --rm \
  --device=/dev/dri:/dev/dri \
  -it \
  intel-media-ffmpeg

Developing

The Dockerfile itself is constructed from re-usable snippets, located in the templates/ directory, and can be regenerated by running:

scripts/build-dockerfile

The above script uses environment substitution to stamp version information within the created Dockerfile. The files used are SOLUTION, and MANIFEST.

After building the template components, the file Dockerfile.solution is then added to the Dockerfile with environment substitution.

SOLUTION

Solution specific definitions:

CONTAINER_IMAGE is used as the container tag name
OS_DISTRO       is used as the base OS distribution. Possible values: ubuntu
OS_VERSION      is used as the OS version. Possible values: disco, eoan

MANIFEST

The version of MANIFEST was hard coded by reading the set of Agama packages on my local disk, sorting, and name-mangling them to be VERSION declarations.

For example:

libgl1-mesa-glx_19.0.1-agama-109_amd64.deb

is changed to:

LIBGL1_MESA_GLX_VERSION=19.0.1-agama-109

This allows the Dockerfile templates to then version pin Agama packages:

  RUN apt-get install -y libgl1-mesa-glx=$LIBGL1_MESA_GLX_VERSION

The scripts/build-dockerfile loads MANIFEST, which defines LIBGL1_MESA_GLX_VERSION. That is then subsituted for the version in the above Dockerfile snippet when being placed into the main Dockerfile.

The generic script I ran to generate these names is below, although it doesn't quite work and a few entries were modified by hand. This should be replaced by a tool that is actually querying the .deb packages and building the manifest.

echo "AGAMA_VERSION=109"
find /var/www/packages/ -path '*public*' -name '*deb' -printf '%f\n' |
  sort |
  uniq |
  sed -E \
    -e s,_,=,g \
    -e 's,=all\.deb|\.x86_64\.deb|=amd64\.deb,_VERSION,g' \
    -e s,-\([^0-9]\),_\\1,g \
    -e 's,^([^=]*),\U\1,'

Tagging

If the build succeeds, we want to be able to tag the git project as well as corresponding Docker images with the appropriate Agama tag:

. MANIFEST ; git tag -f agama-${AGAMA_VERSION}
Description
Intel graphics driver hardware accelerated FFMPEG
Readme 447 KiB