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

Add vulkan and shaderc to x86_64 #48

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 43 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +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 \
VULKANSDK=vulkan-sdk-1.3.268.0 \
WEBP=1.3.2 \
X265=3.5 \
XVID=1.3.7
Expand Down Expand Up @@ -443,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 ****" && \
Expand All @@ -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 && \
Expand Down Expand Up @@ -540,6 +560,18 @@ RUN \
--enable-vp9-highbitdepth && \
make && \
make install
RUN \
echo "**** grabbing vulkan headers ****" && \
mkdir -p /tmp/vulkan-headers && \
git clone \
--branch ${VULKANSDK} \
--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 && \
Expand Down Expand Up @@ -626,6 +658,7 @@ RUN \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libshaderc \
--enable-libsvtav1 \
--enable-libtheora \
--enable-libv4l2 \
Expand All @@ -647,7 +680,8 @@ RUN \
--enable-stripping \
--enable-vaapi \
--enable-vdpau \
--enable-version3 && \
--enable-version3 \
--enable-vulkan && \
make

RUN \
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ ENV \

# versions
ENV \
AOM=v3.7.0 \
AOM=v3.7.1 \
FDKAAC=2.0.2 \
FFMPEG_HARD=6.1 \
FREETYPE=2.13.2 \
FRIBIDI=1.0.13 \
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 \
Expand Down Expand Up @@ -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 ****" && \
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -151,6 +157,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **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.
Expand Down
7 changes: 7 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -155,6 +161,7 @@ full_custom_readme: |

## Versions

* **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.
Expand Down
8 changes: 8 additions & 0 deletions root/ffmpegwrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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