Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable vaapi, to support hardware acceleration #106

Merged
merged 12 commits into from
Jun 18, 2018
Merged

Enable vaapi, to support hardware acceleration #106

merged 12 commits into from
Jun 18, 2018

Conversation

qmfrederik
Copy link
Contributor

This PR adds the --enable-vaapi flag, and builds FFmpeg with support for (Intel) hardware acceleration.
The Ubuntu, CentOS and Alpine images have also been updated to include the build-time vaapi dependencies.

@@ -61,5 +62,10 @@ ENV LD_LIBRARY_PATH=/usr/local/lib

COPY --from=build /usr/local /usr/local/

RUN \
apt-get update -y && \
apt-get install -y libva-drm1 libva1 && \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime dependency ?

Just for ubuntu ? That would explain the failure on https://travis-ci.org/jrottenberg/ffmpeg/builds/389354692 though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be move into the base container to avoid an extra layer

@jrottenberg
Copy link
Owner

Thanks a lot for your contribution it was on my todo list for a while and was requested like on #27

@qmfrederik
Copy link
Contributor Author

@jrottenberg I've fixed the CentOS and Alpine builds by installing libva in the target container. Travis shows a couple of errors; that seems to be because of file download issues.

@jrottenberg
Copy link
Owner

jrottenberg commented Jun 8, 2018

It looks great, thank you.

One more commit andI'll merge : remove templates/.Dockerfile-env.swp
https://github.com/jrottenberg/ffmpeg/pull/106/files#diff-c479c96df0fcf8f4474e645d4d473888

@jrottenberg
Copy link
Owner

oh !

The following NEW packages will be installed:
  i965-va-driver libbsd0 libdrm-amdgpu1 libdrm-common libdrm-intel1
  libdrm-nouveau2 libdrm-radeon1 libdrm2 libedit2 libelf1 libffi6 libllvm5.0
  libpciaccess0 libsensors4 libva-drm1 libva1 libx11-xcb1 libxau6
  libxcb-dri2-0 libxcb-dri3-0 libxcb-present0 libxcb-sync1 libxcb-xfixes0
  libxcb1 libxdmcp6 libxshmfence1 mesa-va-drivers va-driver-all
0 upgraded, 28 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.9 MB of archives.
After this operation, 74.5 MB of additional disk space will be used.

I wonder if we should make a variant for that build ...

@qmfrederik
Copy link
Contributor Author

qmfrederik commented Jun 14, 2018

@jrottenberg Using --no-install-recommends seems to fix this:

The following additional packages will be installed:
  libdrm-common libdrm2
Recommended packages:
  va-driver-all | va-driver
The following NEW packages will be installed:
  libdrm-common libdrm2 libva-drm1 libva1
0 upgraded, 4 newly installed, 0 to remove and 3 not upgraded.
Need to get 89.0 kB of archives.
After this operation, 356 kB of additional disk space will be used.

The recommended part contains the i695-va-driver, which needs to run on the host, not inside the Docker container, so I think this is a safe change to make.

@jrottenberg
Copy link
Owner

ok I really want to merge it , but it touches too many images, would you be ok to create a new variant based on ubuntu named :

  • jrottenberg/ffmpeg:3.3-vaapi
  • jrottenberg/ffmpeg:4.0-vaapi
    etc

@qmfrederik
Copy link
Contributor Author

Yes, sure, I'm using the Ubuntu variant anyway.

@jrottenberg jrottenberg changed the base branch from master to vaapi June 17, 2018 18:16
@jrottenberg jrottenberg merged commit 87e1182 into jrottenberg:vaapi Jun 18, 2018
@jrottenberg jrottenberg mentioned this pull request Jun 18, 2018
jrottenberg pushed a commit that referenced this pull request Jun 21, 2018
* Enable vaapi

* Add libva

* Don't install recommended packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants