From 6b7693bf8bf7eeacb3f9f9f304fc7da7eafab574 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:41:03 -0500 Subject: [PATCH 1/2] Add vulkan and shaderc to x86_64 --- Dockerfile | 36 +++++++++++++++++++++++++++++++++++- README.md | 1 + readme-vars.yml | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c606e19..69dde3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,10 +37,12 @@ ENV \ OPENCOREAMR=0.1.6 \ OPENJPEG=2.5.0 \ OPUS=1.3.1 \ + SHADERC=v2023.7 \ SVTAV1=1.7.0 \ THEORA=1.1.1 \ VORBIS=1.3.7 \ VPX=1.13.1 \ + VULKANHEADERS=vulkan-sdk-1.3.268.0 \ WEBP=1.3.2 \ X265=3.5 \ XVID=1.3.7 @@ -454,6 +456,24 @@ RUN \ --enable-shared && \ make && \ make install +RUN \ + echo "**** grabbing shaderc ****" && \ + mkdir -p /tmp/shaderc && \ + git clone \ + --branch ${SHADERC} \ + --depth 1 https://github.com/google/shaderc.git \ + /tmp/shaderc +RUN \ + echo "**** compiling shaderc ****" && \ + cd /tmp/shaderc && \ + ./utils/git-sync-deps && \ + mkdir -p build && \ + cd build && \ + cmake -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + .. && \ + ninja install RUN \ echo "**** grabbing SVT-AV1 ****" && \ mkdir -p /tmp/svt-av1 && \ @@ -540,6 +560,18 @@ RUN \ --enable-vp9-highbitdepth && \ make && \ make install +RUN \ + echo "**** grabbing vulkan headers ****" && \ + mkdir -p /tmp/vulkan-headers && \ + git clone \ + --branch ${VULKANHEADERS} \ + --depth 1 https://github.com/KhronosGroup/Vulkan-Headers.git \ + /tmp/vulkan-headers +RUN \ + echo "**** compiling vulkan headers ****" && \ + cd /tmp/vulkan-headers && \ + cmake -S . -B build/ && \ + cmake --install build --prefix /usr/local RUN \ echo "**** grabbing webp ****" && \ mkdir -p /tmp/webp && \ @@ -626,6 +658,7 @@ RUN \ --enable-libopencore-amrwb \ --enable-libopenjpeg \ --enable-libopus \ + --enable-libshaderc \ --enable-libsvtav1 \ --enable-libtheora \ --enable-libv4l2 \ @@ -647,7 +680,8 @@ RUN \ --enable-stripping \ --enable-vaapi \ --enable-vdpau \ - --enable-version3 && \ + --enable-version3 \ + --enable-vulkan && \ make RUN \ diff --git a/README.md b/README.md index f8bf410..408dcc2 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **20.11.23:** - Add vulkan and shaderc support to x86_64. * **13.11.23:** - Bump FFmpeg to 6.1. * **02.11.23:** - Remove `--enable-small` from ffmpeg build options to add back some features. * **05.10.23:** - Add support for SVT-AV1. Update various libraries. diff --git a/readme-vars.yml b/readme-vars.yml index ad9196c..7fd3dc1 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -155,6 +155,7 @@ full_custom_readme: | ## Versions + * **20.11.23:** - Add vulkan and shaderc support to x86_64. * **13.11.23:** - Bump FFmpeg to 6.1. * **02.11.23:** - Remove `--enable-small` from ffmpeg build options to add back some features. * **05.10.23:** - Add support for SVT-AV1. Update various libraries. From cd263a29b8069bc4f827bd843fae87dc04749471 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:44:51 -0500 Subject: [PATCH 2/2] enable vulkan via en var, bump libs --- Dockerfile | 20 ++++++++++---------- Dockerfile.aarch64 | 10 +++++----- README.md | 8 +++++++- readme-vars.yml | 8 +++++++- root/ffmpegwrapper.sh | 8 ++++++++ 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 69dde3a..dc53e48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,36 +13,36 @@ ENV \ # versions ENV \ - AOM=v3.7.0 \ + AOM=v3.7.1 \ FDKAAC=2.0.2 \ FFMPEG_HARD=6.1 \ FONTCONFIG=2.14.2 \ FREETYPE=2.13.2 \ FRIBIDI=1.0.13 \ - GMMLIB=22.3.7 \ - IHD=23.2.4 \ + GMMLIB=22.3.12 \ + IHD=23.3.5 \ KVAZAAR=2.2.0 \ LAME=3.100 \ LIBASS=0.17.1 \ - LIBDRM=2.4.116 \ + LIBDRM=2.4.118 \ LIBMFX=22.5.4 \ - LIBVA=2.19.0 \ + LIBVA=2.20.0 \ LIBVDPAU=1.5 \ LIBVIDSTAB=1.1.1 \ LIBVMAF=2.3.1 \ LIBVPL=2023.3.1 \ NVCODEC=n12.1.14.0 \ OGG=1.3.5 \ - ONEVPL=23.2.4 \ + ONEVPL=23.3.4 \ OPENCOREAMR=0.1.6 \ OPENJPEG=2.5.0 \ - OPUS=1.3.1 \ + OPUS=1.4 \ SHADERC=v2023.7 \ SVTAV1=1.7.0 \ THEORA=1.1.1 \ VORBIS=1.3.7 \ VPX=1.13.1 \ - VULKANHEADERS=vulkan-sdk-1.3.268.0 \ + VULKANSDK=vulkan-sdk-1.3.268.0 \ WEBP=1.3.2 \ X265=3.5 \ XVID=1.3.7 @@ -445,7 +445,7 @@ RUN \ echo "**** grabbing opus ****" && \ mkdir -p /tmp/opus && \ curl -Lf \ - https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz | \ + https://downloads.xiph.org/releases/opus/opus-${OPUS}.tar.gz | \ tar -zx --strip-components=1 -C /tmp/opus RUN \ echo "**** compiling opus ****" && \ @@ -564,7 +564,7 @@ RUN \ echo "**** grabbing vulkan headers ****" && \ mkdir -p /tmp/vulkan-headers && \ git clone \ - --branch ${VULKANHEADERS} \ + --branch ${VULKANSDK} \ --depth 1 https://github.com/KhronosGroup/Vulkan-Headers.git \ /tmp/vulkan-headers RUN \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index e9c9708..3855608 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -13,7 +13,7 @@ ENV \ # versions ENV \ - AOM=v3.7.0 \ + AOM=v3.7.1 \ FDKAAC=2.0.2 \ FFMPEG_HARD=6.1 \ FREETYPE=2.13.2 \ @@ -21,15 +21,15 @@ ENV \ KVAZAAR=2.2.0 \ LAME=3.100 \ LIBASS=0.17.1 \ - LIBDRM=2.4.116 \ - LIBVA=2.19.0 \ + LIBDRM=2.4.118 \ + LIBVA=2.20.0 \ LIBVDPAU=1.5 \ LIBVIDSTAB=1.1.1 \ NVCODEC=n12.1.14.0 \ OGG=1.3.5 \ OPENCOREAMR=0.1.6 \ OPENJPEG=2.5.0 \ - OPUS=1.3.1 \ + OPUS=1.4 \ SVTAV1=1.7.0 \ THEORA=1.1.1 \ VORBIS=1.3.7 \ @@ -249,7 +249,7 @@ RUN \ echo "**** grabbing opus ****" && \ mkdir -p /tmp/opus && \ curl -Lf \ - https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz | \ + https://downloads.xiph.org/releases/opus/opus-${OPUS}.tar.gz | \ tar -zx --strip-components=1 -C /tmp/opus RUN \ echo "**** compiling opus ****" && \ diff --git a/README.md b/README.md index 408dcc2..4867e77 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,12 @@ docker run --rm -it \ /config/output.mkv ``` +### Vulkan support + +Preliminary Vulkan support has been added to x86_64, which can be enabled by setting the environment variable `VULKAN_SUPPORT=true`. When enabled, the container will download and install the Vulkan loader and dependencies from the Ubuntu repo prior to running FFmpeg on container start. + +Some Vulkan extensions may not yet be available due to installing an older version of MESA and Vulkan loader from the Ubuntu repository. + ## Building locally If you want to make local modifications to these images for development purposes or just to customize the logic: @@ -151,7 +157,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **20.11.23:** - Add vulkan and shaderc support to x86_64. +* **22.11.23:** - Add shaderc and (preliminary) Vulkan support (via env var `ENABLE_VULKAN=true`) to x86_64. Bump Intel drivers and other libs. * **13.11.23:** - Bump FFmpeg to 6.1. * **02.11.23:** - Remove `--enable-small` from ffmpeg build options to add back some features. * **05.10.23:** - Add support for SVT-AV1. Update various libraries. diff --git a/readme-vars.yml b/readme-vars.yml index 7fd3dc1..e07fe35 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -134,6 +134,12 @@ full_custom_readme: | /config/output.mkv ``` + ### Vulkan support + + Preliminary Vulkan support has been added to x86_64, which can be enabled by setting the environment variable `ENABLE_VULKAN=true`. When enabled, the container will download and install the Vulkan loader and dependencies from the Ubuntu repo prior to running FFmpeg on container start. + + Some Vulkan extensions may not yet be available due to installing an older version of MESA and Vulkan loader from the Ubuntu repository. + ## Building locally If you want to make local modifications to these images for development purposes or just to customize the logic: @@ -155,7 +161,7 @@ full_custom_readme: | ## Versions - * **20.11.23:** - Add vulkan and shaderc support to x86_64. + * **22.11.23:** - Add shaderc and (preliminary) Vulkan support (via env var `ENABLE_VULKAN=true`) to x86_64. Bump Intel drivers and other libs. * **13.11.23:** - Bump FFmpeg to 6.1. * **02.11.23:** - Remove `--enable-small` from ffmpeg build options to add back some features. * **05.10.23:** - Add support for SVT-AV1. Update various libraries. diff --git a/root/ffmpegwrapper.sh b/root/ffmpegwrapper.sh index bb1a19c..1e07e91 100755 --- a/root/ffmpegwrapper.sh +++ b/root/ffmpegwrapper.sh @@ -70,4 +70,12 @@ do fi done +## vulkan support ## +if [[ "${ENABLE_VULKAN}" = "true" ]]; then + echo "**** Installing Vulkan dependencies ****" + apt-get update + apt-get install -y libvulkan1 + echo "**** Vulkan dependencies installed ****" +fi + run_ffmpeg