Skip to content
Draft
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
98 changes: 61 additions & 37 deletions porting/ffmpeg/Dockerfile → apps/ffmpeg/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# build stage
FROM ghcr.io/trueforge-org/python:3.13.12 AS buildstage
FROM ghcr.io/trueforge-org/python:3.14.4 AS buildstage

ARG TARGETARCH
ARG VERSION
USER root

# Set GNU architecture (x86_64/aarch64) from Docker TARGETARCH (amd64/arm64)
RUN if [ "$TARGETARCH" = "amd64" ]; then \
echo "x86_64" > /tmp/gnu_arch; \
elif [ "$TARGETARCH" = "arm64" ]; then \
echo "aarch64" > /tmp/gnu_arch; \
else \
echo "$TARGETARCH" > /tmp/gnu_arch; \
fi
ENV GNU_ARCH_FILE=/tmp/gnu_arch

# common env
ENV \
DEBIAN_FRONTEND="noninteractive" \
Expand All @@ -16,7 +26,7 @@ ENV \
ENV \
AOM=v3.12.1 \
FDKAAC=2.0.3 \
FFMPEG_HARD=8.0 \
FFMPEG=8.0 \
FONTCONFIG=2.16.0 \
FREETYPE=2.13.3 \
FRIBIDI=1.0.16 \
Expand Down Expand Up @@ -89,7 +99,6 @@ RUN \
libclc-18-dev \
libelf-dev \
libexpat1-dev \
libgcc-10-dev \
libglib2.0-dev \
libgomp1 \
libllvmspirvlib-18-dev \
Expand Down Expand Up @@ -141,7 +150,7 @@ RUN \
pip \
setuptools \
wheel && \
/app/venv/bin/pip install --no-cache-dir cmake==3.31.6 mako meson ninja packaging ply pyyaml
/app/venv/bin/pip install --no-cache-dir cmake==3.31.6 mako meson ninja packaging ply pycparser pyyaml

# compile 3rd party libs
RUN \
Expand Down Expand Up @@ -248,7 +257,8 @@ RUN \
cd /tmp/harfbuzz && \
meson build && \
ninja -C build install && \
strip -d /usr/local/lib/$TARGETARCH-linux-gnu/libharfbuzz*.so
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
strip -d /usr/local/lib/${GNU_ARCH}-linux-gnu/libharfbuzz*.so
RUN \
echo "**** grabbing kvazaar ****" && \
mkdir -p /tmp/kvazaar && \
Expand All @@ -274,12 +284,9 @@ RUN \
RUN \
echo "**** compiling lame ****" && \
cd /tmp/lame && \
cp \
/usr/share/automake-1.16/config.guess \
config.guess && \
cp \
/usr/share/automake-1.16/config.sub \
config.sub && \
AUTOMAKE_DIR=$(find /usr/share -maxdepth 1 -name 'automake-*' -type d | head -1) && \
cp ${AUTOMAKE_DIR}/config.guess config.guess && \
cp ${AUTOMAKE_DIR}/config.sub config.sub && \
./configure \
--disable-frontend \
--disable-static \
Expand Down Expand Up @@ -329,14 +336,15 @@ RUN \
--buildtype=release \
build && \
ninja -C build install && \
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
strip -d \
/usr/local/lib/$TARGETARCH-linux-gnu/libEGL.so \
/usr/local/lib/$TARGETARCH-linux-gnu/libGLdispatch.so \
/usr/local/lib/$TARGETARCH-linux-gnu/libGLESv1_CM.so \
/usr/local/lib/$TARGETARCH-linux-gnu/libGLESv2.so \
/usr/local/lib/$TARGETARCH-linux-gnu/libGL.so \
/usr/local/lib/$TARGETARCH-linux-gnu/libGLX.so \
/usr/local/lib/$TARGETARCH-linux-gnu/libOpenGL.so
/usr/local/lib/${GNU_ARCH}-linux-gnu/libEGL.so \
/usr/local/lib/${GNU_ARCH}-linux-gnu/libGLdispatch.so \
/usr/local/lib/${GNU_ARCH}-linux-gnu/libGLESv1_CM.so \
/usr/local/lib/${GNU_ARCH}-linux-gnu/libGLESv2.so \
/usr/local/lib/${GNU_ARCH}-linux-gnu/libGL.so \
/usr/local/lib/${GNU_ARCH}-linux-gnu/libGLX.so \
/usr/local/lib/${GNU_ARCH}-linux-gnu/libOpenGL.so
RUN \
echo "**** grabbing libdrm ****" && \
mkdir -p /tmp/libdrm && \
Expand All @@ -346,13 +354,14 @@ RUN \
RUN \
echo "**** compiling libdrm ****" && \
cd /tmp/libdrm && \
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
meson setup \
--prefix=/usr --libdir=/usr/local/lib/$TARGETARCH-linux-gnu \
--prefix=/usr --libdir=/usr/local/lib/${GNU_ARCH}-linux-gnu \
-Dvalgrind=disabled \
. build && \
ninja -C build && \
ninja -C build install && \
strip -d /usr/local/lib/$TARGETARCH-linux-gnu/libdrm*.so
strip -d /usr/local/lib/${GNU_ARCH}-linux-gnu/libdrm*.so
RUN \
echo "**** grabbing liblc3 ****" && \
mkdir -p /tmp/liblc3 && \
Expand Down Expand Up @@ -434,6 +443,8 @@ RUN \
-Dprefix="/usr/local" \
-Dbuildtype=release \
-Dvideo-codecs=all \
-Dc_args="-DC11_THREADS_H_HEADER_AVAILABLE=1" \
-Dgallium-drivers=v3d,vc4,freedreno,etnaviv,svga,tegra,virgl,lima,panfrost,llvmpipe,softpipe,iris,zink \
builddir/ && \
meson compile -C builddir/ && \
meson install -C builddir/
Expand Down Expand Up @@ -463,12 +474,13 @@ RUN \
echo "**** compiling IHD ****" && \
mkdir -p /tmp/ihd/build && \
cd /tmp/ihd/build && \
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
cmake \
-DLIBVA_DRIVERS_PATH=/usr/local/lib/$TARGETARCH-linux-gnu/dri/ \
-DLIBVA_DRIVERS_PATH=/usr/local/lib/${GNU_ARCH}-linux-gnu/dri/ \
.. && \
make && \
make install && \
strip -d /usr/local/lib/$TARGETARCH-linux-gnu/dri/iHD_drv_video.so
strip -d /usr/local/lib/${GNU_ARCH}-linux-gnu/dri/iHD_drv_video.so
RUN \
echo "**** grabbing libvpl ****" && \
mkdir -p /tmp/libvpl && \
Expand Down Expand Up @@ -613,7 +625,8 @@ RUN \
echo "**** compiling rav1e ****" && \
cd /tmp/rav1e && \
cargo cinstall --release && \
strip -d /usr/local/lib/$TARGETARCH-linux-gnu/librav1e.so
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
strip -d /usr/local/lib/${GNU_ARCH}-linux-gnu/librav1e.so
RUN \
echo "**** grabbing libdovi ****" && \
mkdir -p /tmp/libdovi && \
Expand All @@ -625,7 +638,8 @@ RUN \
echo "**** compiling libdovi ****" && \
cd /tmp/libdovi/dolby_vision && \
cargo cinstall --release && \
strip -d /usr/local/lib/$TARGETARCH-linux-gnu/libdovi.so
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
strip -d /usr/local/lib/${GNU_ARCH}-linux-gnu/libdovi.so
RUN \
echo "**** grabbing libplacebo ****" && \
mkdir -p /tmp/libplacebo && \
Expand Down Expand Up @@ -774,9 +788,10 @@ RUN \
cd /tmp/vulkan-loader && \
mkdir -p build && \
cd build && \
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
cmake \
-D CMAKE_BUILD_TYPE=Release \
-D VULKAN_HEADERS_INSTALL_DIR=/usr/local/lib/$TARGETARCH-linux-gnu \
-D VULKAN_HEADERS_INSTALL_DIR=/usr/local/lib/${GNU_ARCH}-linux-gnu \
-D CMAKE_INSTALL_PREFIX=/usr/local \
.. && \
make && \
Expand Down Expand Up @@ -953,13 +968,14 @@ RUN \
echo "**** arrange files ****" && \
/usr/local/lib/rustlib/uninstall.sh && \
ldconfig && \
GNU_ARCH=$(cat $GNU_ARCH_FILE) && \
mkdir -p \
/buildout/usr/local/bin \
/buildout/usr/local/etc/fonts \
/buildout/usr/local/lib/libmfx-gen \
/buildout/usr/local/lib/mfx \
/buildout/usr/local/lib/$TARGETARCH-linux-gnu/dri \
/buildout/usr/local/lib/$TARGETARCH-linux-gnu/vdpau \
/buildout/usr/local/lib/${GNU_ARCH}-linux-gnu/dri \
/buildout/usr/local/lib/${GNU_ARCH}-linux-gnu/vdpau \
/buildout/usr/local/share/vulkan \
/buildout/usr/share/fonts \
/buildout/usr/share/libdrm \
Expand All @@ -983,17 +999,19 @@ RUN \
/usr/local/lib/mfx/*.so \
/buildout/usr/local/lib/mfx/ && \
cp -a \
/usr/local/lib/$TARGETARCH-linux-gnu/lib*so* \
/buildout/usr/local/lib/$TARGETARCH-linux-gnu/ && \
/usr/local/lib/${GNU_ARCH}-linux-gnu/lib*so* \
/buildout/usr/local/lib/${GNU_ARCH}-linux-gnu/ && \
cp -a \
/usr/local/lib/$TARGETARCH-linux-gnu/dri/*.so \
/buildout/usr/local/lib/$TARGETARCH-linux-gnu/dri/ && \
/usr/local/lib/${GNU_ARCH}-linux-gnu/dri/*.so \
/buildout/usr/local/lib/${GNU_ARCH}-linux-gnu/dri/ && \
cp -a \
/usr/local/lib/$TARGETARCH-linux-gnu/vdpau/*.so \
/buildout/usr/local/lib/$TARGETARCH-linux-gnu/vdpau/ && \
cp -a \
/usr/lib/$TARGETARCH-linux-gnu/dri/i965* \
/buildout/usr/local/lib/$TARGETARCH-linux-gnu/dri/ && \
/usr/local/lib/${GNU_ARCH}-linux-gnu/vdpau/*.so \
/buildout/usr/local/lib/${GNU_ARCH}-linux-gnu/vdpau/ && \
if [ "$TARGETARCH" = "amd64" ]; then \
cp -a \
/usr/lib/${GNU_ARCH}-linux-gnu/dri/i965* \
/buildout/usr/local/lib/${GNU_ARCH}-linux-gnu/dri/; \
fi && \
cp -a \
/usr/share/libdrm/amdgpu.ids \
/buildout/usr/share/libdrm/ && \
Expand All @@ -1008,7 +1026,7 @@ RUN \
/buildout/etc/OpenCL/vendors/nvidia.icd

# runtime stage
FROM ghcr.io/trueforge-org/ubuntu:24.04
FROM ghcr.io/trueforge-org/ubuntu:26.04

# Add files from binstage
COPY --from=buildstage /buildout/ /
Expand All @@ -1018,6 +1036,12 @@ ARG VERSION
ARG TARGETARCH
USER root

# Create symlink from Docker TARGETARCH to GNU triplet for compatibility
RUN if [ "$TARGETARCH" = "amd64" ]; then \
ln -sf x86_64-linux-gnu /usr/local/lib/amd64-linux-gnu; \
elif [ "$TARGETARCH" = "arm64" ]; then \
ln -sf aarch64-linux-gnu /usr/local/lib/arm64-linux-gnu; \
fi

# hardware env
ENV \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading