Skip to content

Commit

Permalink
Upgrade ubuntu-vaapi image to 24.04 (noble)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Sep 25, 2024
1 parent fcec5d9 commit 478704f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 175 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/build_base_ubuntu-vaapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,9 @@ jobs:
file: ./Dockerfile.ubuntu.vaapi
build-args: |
BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }}
DEPLOY_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }}
BUILD_DATE=${{ env.CURRENT_DATE }}
BUILD_COMMIT=${{ env.CURRENT_COMMIT }}
DEPLOY_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }}
FREETYPE_VERSION=${{ env.FREETYPE_VERSION }}
XML2_VERSION=${{ env.XML2_VERSION }}
SRT_VERSION=${{ env.SRT_VERSION }}
X264_VERSION=${{ env.X264_VERSION }}
X265_VERSION=${{ env.X265_VERSION }}
VPX_VERSION=${{ env.VPX_VERSION }}
LAME_VERSION=${{ env.LAME_VERSION }}
OPUS_VERSION=${{ env.OPUS_VERSION }}
OGG_VERSION=${{ env.OGG_VERSION }}
VORBIS_VERSION=${{ env.VORBIS_VERSION }}
DAV1D_VERSION=${{ env.DAV1D_VERSION }}
RAV1E_VERSION=${{ env.RAV1E_VERSION }}
FFMPEG_VERSION=${{ env.FFMPEG_VERSION }}
platforms: linux/amd64
push: true
Expand Down
3 changes: 2 additions & 1 deletion Build.ubuntu.vaapi.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# FFMPEG VAAPI PACKAGES
# FFMPEG VAAPI PACKAGES
OS_VERSION=24.04
190 changes: 29 additions & 161 deletions Dockerfile.ubuntu.vaapi
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,7 @@ FROM $BUILD_IMAGE AS builder

ARG BUILD_DATE=1970-01-01T00:00:00Z
ARG BUILD_COMMIT=unknown

ARG FREETYPE_VERSION=2.10.4
ARG XML2_VERSION=2.9.14
ARG SRT_VERSION=1.4.2
ARG X264_VERSION=stable
ARG X265_VERSION=3.4
ARG VPX_VERSION=1.11.0
ARG LAME_VERSION=3.100
ARG OPUS_VERSION=1.3.1
ARG OGG_VERSION=1.3.5
ARG VORBIS_VERSION=1.3.7
ARG RAV1E_VERSION=0.7.1
ARG DAV1D_VERSION=1.4.1
ARG FFMPEG_VERSION=4.4.2
ARG FFMPEG_VERSION=none

ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
ENV SRC=/usr/local
Expand All @@ -37,159 +24,31 @@ RUN apt-get update -y && \
build-essential \
libtool \
autoconf \
libx265-dev \
libv4l-dev \
libva-drm2 \
libva2 \
libva-dev \
i965-va-driver-shaders \
intel-media-va-driver-non-free \
libasound2-dev \
meson \
libx264-dev \
libx265-dev \
librav1e-dev \
libaom-dev \
libdav1d-dev \
libvpx-dev \
libmp3lame-dev \
libopus-dev \
libvorbis-dev \
libogg-dev \
libfreetype-dev \
libsrt-openssl-dev \
libxml2-dev \
libfdk-aac-dev \
libharfbuzz-dev \
libxml2-dev \
zlib1g-dev

# install rust
RUN curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y

# install librav1e
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://github.com/xiph/rav1e/archive/refs/tags/v${RAV1E_VERSION}.tar.gz && \
tar xfvz v${RAV1E_VERSION}.tar.gz && \
rm v${RAV1E_VERSION}.tar.gz && \
cd rav1e-${RAV1E_VERSION} && \
/root/.cargo/bin/cargo install cargo-c && \
/root/.cargo/bin/cargo cinstall --release

# install libxml2
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${XML2_VERSION}/libxml2-v${XML2_VERSION}.tar.gz && \
tar xfvz libxml2-v${XML2_VERSION}.tar.gz && \
rm libxml2-v${XML2_VERSION}.tar.gz && \
cd libxml2-v${XML2_VERSION} && \
./autogen.sh --prefix="${SRC}" \
--with-ftp=no \
--with-http=no \
--with-python=no && \
make -j$(nproc) && \
make install

# install libdav1d
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://code.videolan.org/videolan/dav1d/-/archive/${DAV1D_VERSION}/dav1d-${DAV1D_VERSION}.tar.gz && \
tar xfvz dav1d-${DAV1D_VERSION}.tar.gz && \
rm dav1d-${DAV1D_VERSION}.tar.gz && \
cd dav1d-${DAV1D_VERSION} && \
mkdir build && cd build && \
meson setup .. && \
ninja && ninja install

# install x264
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://code.videolan.org/videolan/x264/-/archive/stable/x264-${X264_VERSION}.tar.gz && \
tar xfvz x264-${X264_VERSION}.tar.gz && \
rm x264-${X264_VERSION}.tar.gz && \
cd x264-${X264_VERSION}* && \
./configure \
--SRC="${SRC}" \
--bindir="${SRC}/bin" \
--enable-shared && \
make -j$(nproc) && \
make install

# install opus
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz && \
tar xfvz opus-${OPUS_VERSION}.tar.gz && \
rm opus-${OPUS_VERSION}.tar.gz && \
cd opus-${OPUS_VERSION} && \
autoreconf -fiv && \
./configure --prefix="${SRC}" \
--enable-shared && \
make -j$(nproc) && \
make install

# install ogg
RUN mkdir -p /dist && cd /dist && \
curl -OLk http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \
tar xfvz libogg-${OGG_VERSION}.tar.gz && \
rm libogg-${OGG_VERSION}.tar.gz && \
cd libogg-${OGG_VERSION} && \
./configure --prefix="${SRC}" \
--enable-shared && \
make -j$(nproc) && \
make install

# install vorbis
RUN mkdir -p /dist && cd /dist && \
curl -OLk http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \
tar xfvz libvorbis-${VORBIS_VERSION}.tar.gz && \
rm libvorbis-${VORBIS_VERSION}.tar.gz && \
cd libvorbis-${VORBIS_VERSION} && \
./configure --prefix="${SRC}" --with-ogg="${SRC}" \
--enable-shared && \
make -j$(nproc) && \
make install

# install libmp3lame
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz && \
tar -xvz -f lame-${LAME_VERSION}.tar.gz && \
rm lame-${LAME_VERSION}.tar.gz && \
cd lame-${LAME_VERSION} && \
./configure \
--prefix="${SRC}" \
--bindir="${SRC}/bin" \
--disable-static \
--enable-nasm && \
make -j$(nproc) && \
make install

# install vpx
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://github.com/webmproject/libvpx/archive/refs/tags/v${VPX_VERSION}.tar.gz && \
tar xfvz v${VPX_VERSION}.tar.gz && \
rm v${VPX_VERSION}.tar.gz && \
cd libvpx-${VPX_VERSION} && \
./configure --prefix="${SRC}" \
--enable-vp8 \
--enable-vp9 \
--enable-vp9-highbitdepth \
--enable-pic \
--enable-shared \
--disable-debug \
--disable-examples \
--disable-docs \
--disable-install-bins && \
make -j$(nproc) && \
make install

# install freetype
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
tar xfvz freetype-${FREETYPE_VERSION}.tar.gz && \
rm freetype-${FREETYPE_VERSION}.tar.gz && \
cd freetype-${FREETYPE_VERSION} && \
./configure --prefix="${SRC}" \
--disable-static \
--enable-shared && \
make -j$(nproc) && \
make install

# install srt
RUN mkdir -p /dist && cd /dist && \
curl -OLk https://github.com/Haivision/srt/archive/refs/tags/v${SRT_VERSION}.tar.gz && \
tar xfvz v${SRT_VERSION}.tar.gz && \
rm v${SRT_VERSION}.tar.gz && \
cd srt-${SRT_VERSION} && \
cmake \
-G "Unix Makefiles" \
-DCMAKE_INSTALL_BINDIR="$SRC/bin" \
-DCMAKE_INSTALL_INCLUDEDIR="$SRC/include" \
-DCMAKE_INSTALL_LIBDIR="$SRC/lib" \
-DCMAKE_INSTALL_SRC="$SRC" && \
make -j$(nproc) && \
make install

# install and patch ffmpeg
RUN mkdir -p /dist && cd /dist && \
curl -OLk http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
Expand Down Expand Up @@ -222,8 +81,10 @@ RUN cd /dist/ffmpeg-${FFMPEG_VERSION} && \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libfdk-aac \
--enable-libdav1d \
--enable-librav1e \
--enable-libaom \
--disable-ffplay \
--disable-ffprobe \
--disable-debug \
Expand All @@ -232,15 +93,22 @@ RUN cd /dist/ffmpeg-${FFMPEG_VERSION} && \
make install && \
hash -r

RUN mkdir -p /ffmpeglibs && \
ldd /usr/local/bin/ffmpeg | grep -o -e '/lib/[a-z0-9_]*-linux-gnu/[^ ]*' | xargs -I % cp -v % /ffmpeglibs

FROM $DEPLOY_IMAGE

COPY --from=builder /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
COPY --from=builder /usr/local/lib /usr/local/lib
COPY --from=builder /ffmpeglibs /ffmpeglibs

ENV DEBIAN_FRONTEND=noninteractive

RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf && \
RUN echo "/ffmpeglibs" > /etc/ld.so.conf.d/ffmpeg.conf && \
ldconfig && \
apt-get update && \
apt-get install -y \
ca-certificates \
tzdata \
v4l-utils \
fbset \
x265 \
Expand All @@ -255,4 +123,4 @@ RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/ffmpeg.conf && \

WORKDIR /tmp
ENTRYPOINT ["/usr/local/bin/ffmpeg"]
CMD ["-version"]
CMD ["-version"]

0 comments on commit 478704f

Please sign in to comment.