Skip to content

Commit 8b95893

Browse files
committed
update vaapi
1 parent d307fb3 commit 8b95893

File tree

4 files changed

+9
-116
lines changed

4 files changed

+9
-116
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:20.04 AS build
22

33
RUN apt-get update \
4-
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates python3 i965-va-driver \
4+
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates libdrm-dev \
55
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
66
&& update-ca-certificates
77

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ because I don't have the resources and the time to maintain other systems.
4848
* Encoders
4949
* H264 `nvenc_h264`
5050
* H265 `nvenc_hevc`
51-
* `amf`: [Advanced Media Framework SDK](https://gpuopen.com/advanced-media-framework/). Optimal access to AMD GPUs for multimedia processing. Supported codecs in amf:
52-
* Encoders
53-
* H264 `h264_amf`
54-
* H265 `hevc_amf`
5551
* `vaapi`: [Video Acceleration API](https://trac.ffmpeg.org/wiki/Hardware/VAAPI). Installation is triggered only if libva driver installation is detected, follow [these](#Vaapi-installation) instructions for installation. Supported codecs in vaapi:
5652
* Encoders
5753
* H264 `h264_vaapi`
@@ -194,10 +190,10 @@ You will need the libva driver, so please install it below.
194190

195191
```bash
196192
# Debian and Ubuntu
197-
$ sudo apt install vainfo
193+
$ sudo apt install libva-dev vainfo
198194

199195
# Fedora and CentOS
200-
$ sudo dnf install libva libva-intel-driver libva-utils
196+
$ sudo dnf install libva-devel libva-intel-driver libva-utils
201197
```
202198

203199
## Usage

build-ffmpeg

Lines changed: 4 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,9 @@ command_exists () {
132132
}
133133

134134
library_exists () {
135-
if ! command_exists "ldconfig"; then
136-
return 1
137-
fi
138-
139-
if ! [ -n "$(ldconfig -p | grep "$1")" ]; then
135+
local result=0
136+
local output=$(pkg-config --exists --print-errors "$1" 2>&1 > /dev/null) || result=$?
137+
if [ ! "$result" = "0" ]; then
140138
return 1
141139
fi
142140

@@ -238,62 +236,11 @@ if ! command_exists "curl"; then
238236
exit 1
239237
fi
240238

241-
if [[ "$OSTYPE" == "linux-gnu" ]]; then
242-
if ! command_exists "python3" ; then
243-
echo "python3 not installed.";
244-
exit 1
245-
fi
246-
fi
247239

248240
##
249241
## build tools
250242
##
251243

252-
if build "m4"; then
253-
download "https://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.xz"
254-
# https://lists.gnu.org/archive/html/bug-m4/2018-08/msg00000.html
255-
# No new version of M4 has been released, so a patch has been applied.
256-
execute curl -sLJO https://github.com/easybuilders/easybuild-easyconfigs/raw/master/easybuild/easyconfigs/m/M4/M4-1.4.18_glibc_2.28.patch
257-
execute patch -p1 -d . < M4-1.4.18_glibc_2.28.patch
258-
execute ./configure --prefix="${WORKSPACE}"
259-
execute make -j $MJOBS
260-
execute make install
261-
build_done "m4"
262-
fi
263-
264-
if build "autoconf"; then
265-
download "https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz"
266-
execute ./configure --prefix="${WORKSPACE}"
267-
execute make -j $MJOBS
268-
execute make install
269-
build_done "autoconf"
270-
fi
271-
272-
if build "automake"; then
273-
download "https://ftp.gnu.org/gnu/automake/automake-1.16.tar.xz"
274-
execute ./configure --prefix="${WORKSPACE}"
275-
execute make -j $MJOBS
276-
execute make install
277-
build_done "automake"
278-
fi
279-
280-
if build "libtool"; then
281-
download "https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz"
282-
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
283-
execute make -j $MJOBS
284-
execute make install
285-
build_done "libtool"
286-
fi
287-
288-
if build "util-macros"; then
289-
download "https://gitlab.freedesktop.org/xorg/util/macros/-/archive/util-macros-1.19.2/macros-util-macros-1.19.2.tar.bz2" "util-macros-1.19.2.tar.bz2"
290-
execute autoreconf --force --verbose --install
291-
execute ./configure --prefix="${WORKSPACE}"
292-
execute make -j $MJOBS
293-
execute make install
294-
build_done "util-macros"
295-
fi
296-
297244
if build "yasm"; then
298245
download "https://github.com/yasm/yasm/releases/download/v1.3.0/yasm-1.3.0.tar.gz"
299246
execute ./configure --prefix="${WORKSPACE}"
@@ -311,7 +258,7 @@ if build "nasm"; then
311258
fi
312259

313260
if build "pkg-config"; then
314-
download "https://gitlab.freedesktop.org/pkg-config/pkg-config/-/archive/pkg-config-0.29.2/pkg-config-pkg-config-0.29.2.tar.bz2" "pkg-config-0.29.2.tar.bz2"
261+
download "https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz"
315262
execute autoreconf --force --verbose --install
316263
execute ./configure --silent --prefix="${WORKSPACE}" --with-pc-path="${WORKSPACE}"/lib/pkgconfig --with-internal-glib
317264
execute make -j $MJOBS
@@ -345,23 +292,6 @@ if build "cmake"; then
345292
build_done "cmake"
346293
fi
347294

348-
# Required for building vaapi tools so linux only
349-
if [[ "$OSTYPE" == "linux-gnu" ]]; then
350-
if build "meson"; then
351-
download "https://github.com/mesonbuild/meson/releases/download/0.55.3/meson-0.55.3.tar.gz"
352-
execute ln -s $(pwd)/meson.py ${WORKSPACE}/bin/meson
353-
build_done "meson"
354-
fi
355-
356-
if build "ninja"; then
357-
download "https://github.com/ninja-build/ninja/archive/v1.10.1.tar.gz" "ninja-1.10.1.tar.gz"
358-
execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" .
359-
execute make -j $MJOBS
360-
execute make install
361-
build_done "ninja"
362-
fi
363-
fi
364-
365295

366296
##
367297
## video library
@@ -580,43 +510,9 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
580510
CONFIGURE_OPTIONS+=("--nvccflags=-gencode arch=compute_52,code=sm_52")
581511
fi
582512

583-
if build "amf"; then
584-
download "https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/1.4.16.1.tar.gz" "amf-1.4.16.1.tar.gz"
585-
execute mkdir -p "${WORKSPACE}"/include/AMF
586-
execute cp -r amf/public/include/* "${WORKSPACE}"/include/AMF/
587-
build_done "amf"
588-
fi
589-
CONFIGURE_OPTIONS+=("--enable-amf")
590-
591513
# Vaapi doesn't work well with static links ffmpeg.
592514
if [ -z "$LDEXEFLAGS" ]; then
593515
if library_exists "libva" ; then
594-
if build "libpciaccess"; then
595-
download "https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/archive/libpciaccess-0.16/libpciaccess-libpciaccess-0.16.tar.bz2" "libpciaccess-0.16.tar.bz2"
596-
execute autoreconf --force --verbose --install
597-
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static CFLAGS=-fPIC
598-
execute make -j $MJOBS
599-
execute make install
600-
build_done "libpciaccess"
601-
fi
602-
603-
# https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/28
604-
# Since libdrm should not be statically linked, neither should libva or intel-vaapi-driver, on which it depends, be statically linked.
605-
# They should be installed as drivers in your host OS.
606-
if build "libdrm"; then
607-
download "https://gitlab.freedesktop.org/mesa/drm/-/archive/libdrm-2.4.102/drm-libdrm-2.4.102.tar.bz2" "libdrm-2.4.102.tar.bz2"
608-
execute meson --prefix="${WORKSPACE}" --libdir="${WORKSPACE}"/lib builddir/
609-
execute ninja -C builddir/ install
610-
build_done "libdrm"
611-
fi
612-
613-
if build "libva"; then
614-
download "https://github.com/intel/libva/releases/download/2.9.0/libva-2.9.0.tar.bz2"
615-
execute ./configure --prefix="${WORKSPACE}" --disable-static --enable-shared
616-
execute make -j $MJOBS
617-
execute make install
618-
build_done "libva"
619-
fi
620516
CONFIGURE_OPTIONS+=("--enable-vaapi")
621517
fi
622518
fi

cuda-ubuntu.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ ARG VER=20.04
22

33
FROM nvidia/cuda:11.1-devel-ubuntu${VER} AS build
44

5+
ENV DEBIAN_FRONTEND noninteractive
56
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
67

78
RUN apt-get update \
8-
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates python3 libva-drm2 \
9+
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates libdrm-dev \
910
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
1011
&& update-ca-certificates
1112

0 commit comments

Comments
 (0)