494 lines
13 KiB
Docker
494 lines
13 KiB
Docker
|
|
# H.264 codecs/tools
|
|
ARG X264_REPO=https://code.videolan.org/videolan/x264.git
|
|
|
|
# H.265 / HEVC codecs/tools
|
|
ARG X265_TAG=3.5
|
|
ARG X265_REPO=https://bitbucket.org/multicoreware/x265_git.git
|
|
|
|
ARG KVAZAAR_TAG=v2.2.0
|
|
ARG KVAZAAR_REPO=https://github.com/ultravideo/kvazaar.git
|
|
|
|
# H.266 / VVC codecs/tools
|
|
ARG UVG266_TAG=v0.4.1
|
|
ARG UVG266_REPO=https://github.com/ultravideo/uvg266.git
|
|
|
|
ARG VVENC_TAG=v1.9.0
|
|
ARG VVENC_REPO=https://github.com/fraunhoferhhi/vvenc.git
|
|
|
|
ARG VTM_TAG=VTM-21.2
|
|
ARG VTM_REPO=https://vcgit.hhi.fraunhofer.de/jvet/VVCSoftware_VTM.git
|
|
|
|
# AV1 codecs/tools
|
|
ARG AOM_TAG=v3.7.0-rc2
|
|
ARG AOM_REPO=https://aomedia.googlesource.com/aom.git
|
|
|
|
ARG SVT_TAG=v1.6.0
|
|
ARG SVT_REPO=https://gitlab.com/AOMediaCodec/SVT-AV1.git
|
|
|
|
ARG RAV1E_TAG=p20230815
|
|
ARG RAV1E_REPO=https://github.com/xiph/rav1e.git
|
|
|
|
ARG AV1AN_TAG=0.4.1
|
|
ARG AV1AN_REPO=https://github.com/master-of-zen/Av1an.git
|
|
|
|
# MPEG-5 EVC codecs/tools
|
|
ARG XEVE_TAG=v0.4.3-3890dae6
|
|
ARG XEVE_REPO=https://github.com/mpeg5/xeve.git
|
|
|
|
ARG REVC_TAG=master
|
|
ARG REVC_REPO=https://github.com/revcx/revc.git
|
|
|
|
|
|
# VapourSynth versions and tools
|
|
ARG VS3_TAG=R55-API3
|
|
ARG VS4_TAG=R62
|
|
|
|
ARG WOBBLY_TAG=730e15f806817ecd0d5c7bf07d14949a2ba1881c
|
|
ARG WOBBLY_REPO="https://github.com/dubhater/Wobbly.git"
|
|
|
|
# AAC codecs/tools
|
|
ARG FDKAAC_TAG=master
|
|
ARG FDKAAC_REPO=https://github.com/mstorsjo/fdk-aac.git
|
|
|
|
# Multimedia tools
|
|
ARG VMAF_TAG=v2.3.1
|
|
ARG VMAF_REPO=https://github.com/Netflix/vmaf.git
|
|
|
|
ARG MKVTOOLNIX_TAG=release-78.0
|
|
ARG MKVTOOLNIX_REPO=https://gitlab.com/mbunkus/mkvtoolnix.git
|
|
|
|
ARG MEDIAINFO_TAG=v23.07
|
|
ARG MEDIAINFOLIB_TAG=v23.07
|
|
|
|
ARG SUSHI_TAG=747c9790909543a0cd957f3f52a282afa5bcd2ff
|
|
ARG SUSHI_REPO=https://github.com/FichteFoll/Sushi.git
|
|
|
|
# Dependencies
|
|
ARG BROTLI_TAG=v1.0.9
|
|
ARG BROTLI_REPO=https://github.com/google/brotli.git
|
|
|
|
ARG JXL_TAG=v0.8.2
|
|
ARG JXL_REPO=https://github.com/libjxl/libjxl.git
|
|
|
|
ARG MAGICK_TAG=7.1.1-15
|
|
ARG ZIMG_TAG=release-3.0.5
|
|
|
|
ARG QT5_TAG=v5.15.10-lts-lgpl
|
|
# https://code.qt.io/qt/qt5.git
|
|
ARG QT5_REPO=https://github.com/qt/qt5.git
|
|
|
|
ARG ZENLIB_TAG=v0.4.41
|
|
|
|
FROM debian:bookworm AS dep-base
|
|
|
|
ENV PYTHON_VERSION=3.11
|
|
ENV CYTHON_VERSION=0.29.36
|
|
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt update && \
|
|
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
|
|
libpython${PYTHON_VERSION} python3-pip python3-numpy python3-opencv python3-tk git nscd curl xz-utils ca-certificates gpg gnupg \
|
|
libavcodec59 libavformat59 libswscale6 libswresample4 libavutil57 libavfilter8 libavdevice59 libass9 \
|
|
libnuma1 libatomic1 libfftw3-single3 libfftw3-double3 && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
pip3 install Cython==${CYTHON_VERSION}
|
|
|
|
FROM dep-base AS build-base
|
|
|
|
COPY docker/clang.list /etc/apt/sources.list.d/clang.list
|
|
|
|
RUN echo "deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian bookworm main" > /etc/apt/sources.list.d/src.list && \
|
|
echo "deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://security.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list.d/src.list && \
|
|
echo "deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list.d/src.list
|
|
|
|
RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
|
|
DEBIAN_FRONTEND=noninteractive apt update && \
|
|
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
|
|
python${PYTHON_VERSION}-dev \
|
|
python3-setuptools python3-wheel \
|
|
autoconf automake libtool pkg-config meson ninja-build make rake cmake yasm nasm gcc g++ clang llvm lld ccache jq \
|
|
libflac-dev libogg-dev libvorbis-dev libboost-all-dev zlib1g-dev libdvdread-dev libgmp-dev xsltproc docbook-xsl doxygen \
|
|
libxcb-xinerama0-dev \
|
|
libnuma-dev libavcodec-dev libavformat-dev libswscale-dev libswresample-dev libavutil-dev libavfilter-dev libavdevice-dev libass-dev libfftw3-single3 libfftw3-double3 libfftw3-dev && \
|
|
rm /usr/lib/python${PYTHON_VERSION}/EXTERNALLY-MANAGED && \
|
|
update-alternatives --install /usr/bin/cc cc $(readlink -f /usr/bin/clang) 100 && \
|
|
update-alternatives --install /usr/bin/c++ c++ $(readlink -f /usr/bin/clang++) 100 && \
|
|
update-alternatives --install /usr/bin/link link $(readlink -f /usr/bin/ld.lld) 100
|
|
|
|
ENV CC=clang
|
|
ENV CXX=clang++
|
|
ENV LD=ld.lld
|
|
ENV CFLAGS "-Ofast -march=native -flto"
|
|
ENV CPPFLAGS "$CFLAGS"
|
|
ENV CXXFLAGS "-Ofast -march=native -flto"
|
|
ENV LDFLAGS "-flto -fuse-ld=lld"
|
|
ENV PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig"
|
|
|
|
COPY docker/git-shallow-clone.sh /usr/bin/git-shallow-clone
|
|
|
|
|
|
FROM build-base AS build-x265
|
|
|
|
ARG X265_TAG
|
|
ARG X265_REPO
|
|
|
|
COPY docker/build/x265/multilib.sh /multilib.sh
|
|
COPY docker/build/x265/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
|
|
FROM build-base AS build-lsmash
|
|
|
|
COPY docker/build/l-smash/build.sh /build-l-smash.sh
|
|
|
|
RUN /build-l-smash.sh
|
|
|
|
FROM build-lsmash AS build-x264
|
|
|
|
ARG X264_REPO
|
|
|
|
COPY docker/build/x264/build.sh /build.sh
|
|
|
|
RUN /build.sh stable
|
|
|
|
FROM build-lsmash AS build-x264-dev
|
|
|
|
ARG X264_REPO
|
|
|
|
COPY docker/build/x264/build.sh /build.sh
|
|
|
|
RUN /build.sh master
|
|
|
|
FROM build-base AS build-uvg266
|
|
|
|
ARG UVG266_DEFS=""
|
|
ARG UVG266_TAG
|
|
ARG UVG266_REPO
|
|
|
|
COPY docker/build/uvg266/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-kvazaar
|
|
|
|
ARG KVAZAAR_TAG
|
|
ARG KVAZAAR_REPO
|
|
|
|
COPY docker/build/kvazaar/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-uvg266-10bit
|
|
|
|
ARG UVG266_DEFS="-DUVG_BIT_DEPTH=10"
|
|
ARG UVG266_TAG
|
|
ARG UVG266_REPO
|
|
|
|
COPY docker/build/uvg266/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-vvenc
|
|
|
|
ARG VVENC_TAG
|
|
ARG VVENC_REPO
|
|
|
|
COPY docker/build/vvenc/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-vtm
|
|
|
|
ARG VTM_TAG
|
|
ARG VTM_REPO
|
|
|
|
COPY docker/build/vtm/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-aom
|
|
|
|
ARG AOM_TAG
|
|
ARG AOM_REPO
|
|
|
|
ARG VMAF_TAG
|
|
ARG VMAF_REPO
|
|
|
|
ARG BROTLI_TAG
|
|
ARG BROTLI_REPO
|
|
|
|
ARG JXL_TAG
|
|
ARG JXL_REPO
|
|
|
|
COPY docker/build/vmaf/build.sh /build-vmaf.sh
|
|
#COPY docker/build/jxl/build.sh /build-jxl.sh
|
|
#COPY docker/build/brotli/build.sh /build-brotli.sh
|
|
COPY docker/build/aom/build.sh /build.sh
|
|
|
|
RUN /build-vmaf.sh
|
|
#RUN /build-brotli.sh
|
|
#RUN /build-jxl.sh
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-svt-av1
|
|
|
|
ARG SVT_TAG
|
|
ARG SVT_REPO
|
|
|
|
COPY docker/build/svt-av1/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM rust:1.71-bookworm AS build-rav1e
|
|
|
|
ARG RAV1E_TAG
|
|
ARG RAV1E_REPO
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt update && \
|
|
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
|
|
nasm jq
|
|
|
|
COPY docker/git-shallow-clone.sh /usr/bin/git-shallow-clone
|
|
COPY docker/build/rav1e/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-fdk-aac
|
|
|
|
ARG FDKAAC_TAG
|
|
ARG FDKAAC_REPO
|
|
|
|
COPY docker/build/fdk-aac/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-lsmash AS build-vapoursynth-deps
|
|
|
|
ARG MAGICK_TAG
|
|
ARG ZIMG_TAG
|
|
|
|
COPY docker/build/magick/build.sh /build-magick.sh
|
|
COPY docker/build/zimg/build.sh /build-zimg.sh
|
|
|
|
RUN /build-zimg.sh && \
|
|
/build-magick.sh
|
|
|
|
FROM build-vapoursynth-deps AS build-vapoursynth3
|
|
|
|
ARG VS3_TAG
|
|
ENV VS_TAG=${VS3_TAG}
|
|
|
|
COPY docker/build/vapoursynth/build.sh /build-vapoursynth.sh
|
|
|
|
RUN /build-vapoursynth.sh
|
|
|
|
ENV PYTHONPATH "/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/lib/vapoursynth:$PYTHONPATH"
|
|
|
|
COPY docker/build/vapoursynth3-plugins/build.sh /build-vapoursynth-plugins.sh
|
|
|
|
RUN /build-vapoursynth-plugins.sh
|
|
|
|
FROM build-vapoursynth-deps AS build-vapoursynth4
|
|
|
|
ARG VS4_TAG
|
|
ENV VS_TAG=${VS4_TAG}
|
|
|
|
COPY docker/build/vapoursynth/build.sh /build-vapoursynth.sh
|
|
|
|
RUN /build-vapoursynth.sh
|
|
|
|
ENV PYTHONPATH "/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/lib/vapoursynth:$PYTHONPATH"
|
|
|
|
ARG VMAF_TAG
|
|
ARG VMAF_REPO
|
|
COPY docker/build/vmaf/build.sh /build-vmaf.sh
|
|
|
|
RUN /build-vmaf.sh
|
|
|
|
FROM build-vapoursynth4 AS build-vapoursynth4-plugins
|
|
|
|
COPY docker/build/vapoursynth4-plugins/build.sh /build-vapoursynth-plugins.sh
|
|
|
|
RUN /build-vapoursynth-plugins.sh
|
|
|
|
#FROM build-vapoursynth4 AS build-wobbly
|
|
|
|
#ARG WOBBLY_TAG
|
|
#ARG WOBBLY_REPO
|
|
|
|
#ARG QT5_REPO
|
|
#ARG QT5_TAG
|
|
|
|
#COPY docker/build/qt5/build.sh /build-qt5.sh
|
|
#RUN /build-qt5.sh
|
|
|
|
#COPY docker/build/wobbly/build.sh /build.sh
|
|
#RUN /build.sh
|
|
|
|
FROM build-base AS build-mkvtoolnix
|
|
|
|
ARG MKVTOOLNIX_TAG
|
|
ARG MKVTOOLNIX_REPO
|
|
|
|
ARG QT5_REPO
|
|
ARG QT5_TAG
|
|
|
|
COPY docker/build/qt5/build.sh /build-qt5.sh
|
|
RUN /build-qt5.sh "-no-widgets -no-shared -static"
|
|
|
|
COPY docker/build/mkvtoolnix/build.sh /build.sh
|
|
RUN /build.sh
|
|
|
|
|
|
|
|
FROM build-vapoursynth3 AS build-av1an-vapoursynth3
|
|
|
|
ARG VMAF_TAG
|
|
ARG VMAF_REPO
|
|
|
|
ARG AV1AN_TAG
|
|
ARG AV1AN_REPO
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
|
|
COPY docker/build/vmaf/build.sh /build-vmaf.sh
|
|
COPY docker/build/av1an/build.sh /build-av1an.sh
|
|
|
|
RUN /build-vmaf.sh
|
|
RUN /build-av1an.sh
|
|
|
|
FROM build-vapoursynth4 AS build-av1an-vapoursynth4
|
|
|
|
ARG AV1AN_TAG
|
|
ARG AV1AN_REPO
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
|
|
COPY docker/build/av1an/build.sh /build-av1an.sh
|
|
|
|
RUN /build-av1an.sh
|
|
|
|
FROM build-base AS build-xeve
|
|
|
|
ARG XEVE_TAG
|
|
ARG XEVE_REPO
|
|
|
|
COPY docker/build/xeve/build.sh /build.sh
|
|
|
|
RUN /build.sh BASE
|
|
|
|
FROM build-base AS build-xeve-main
|
|
|
|
ARG XEVE_TAG
|
|
ARG XEVE_REPO
|
|
|
|
COPY docker/build/xeve/build.sh /build.sh
|
|
|
|
RUN /build.sh MAIN
|
|
|
|
FROM rust:1.71-bookworm AS build-revc
|
|
|
|
ARG REVC_TAG
|
|
ARG REVC_REPO
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt update && \
|
|
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
|
|
nasm jq
|
|
|
|
COPY docker/git-shallow-clone.sh /usr/bin/git-shallow-clone
|
|
COPY docker/build/revc/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM build-base AS build-mediainfo
|
|
|
|
ARG ZENLIB_TAG
|
|
ARG MEDIAINFO_TAG
|
|
ARG MEDIAINFOLIB_TAG
|
|
|
|
COPY docker/build/mediainfo/build.sh /build.sh
|
|
|
|
RUN /build.sh
|
|
|
|
FROM dep-base AS final
|
|
|
|
RUN pip3 install "git+${SUSHI_REPO}@${SUSHI_TAG}"
|
|
|
|
RUN curl "https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-$(dpkg --print-architecture)-static.tar.xz" > /tmp/ffmpeg.tar.xz && \
|
|
cd /tmp && tar -xJf /tmp/ffmpeg.tar.xz && cd ffmpeg-* && \
|
|
cp -r model /usr/local/share/ && \
|
|
cp ./ffprobe /usr/bin/ffprobe-git && \
|
|
cp ./ffmpeg /usr/bin/ffmpeg-git && \
|
|
cp ./qt-faststart /usr/bin/qt-faststart-git && \
|
|
cd / && rm -r /tmp/ffmpeg*
|
|
|
|
RUN curl "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-$(dpkg --print-architecture)-static.tar.xz" > /tmp/ffmpeg.tar.xz && \
|
|
cd /tmp && tar -xJf /tmp/ffmpeg.tar.xz && cd ffmpeg-* && \
|
|
cp -r model /usr/local/share/ && \
|
|
cp ./ffprobe /usr/bin/ && \
|
|
cp ./ffmpeg /usr/bin/ && \
|
|
cp ./qt-faststart /usr/bin/ && \
|
|
cd / && rm -r /tmp/ffmpeg*
|
|
|
|
|
|
ENV PYTHONPATH "/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/lib/vapoursynth:$PYTHONPATH"
|
|
|
|
|
|
COPY --from=build-x264 /usr/bin/x264 /usr/bin/x264
|
|
COPY --from=build-x264-dev /usr/bin/x264 /usr/bin/x264-dev
|
|
|
|
COPY --from=build-x265 /usr/bin/x265 /usr/bin/x265
|
|
COPY --from=build-kvazaar /usr/bin/kvazaar /usr/bin/kvazaar
|
|
|
|
COPY --from=build-aom /usr/bin/aom* /usr/bin/
|
|
COPY --from=build-svt-av1 /usr/bin/SvtAv1* /usr/bin/
|
|
COPY --from=build-rav1e /usr/bin/rav1e /usr/bin/rav1e
|
|
|
|
COPY --from=build-uvg266 /usr/bin/uvg266 /usr/bin/uvg266
|
|
COPY --from=build-uvg266-10bit /usr/bin/uvg266 /usr/bin/uvg266-10bit
|
|
COPY --from=build-vvenc /usr/bin/vvenc* /usr/bin/
|
|
COPY --from=build-vtm /usr/bin/VTM* /usr/bin/
|
|
|
|
COPY --from=build-xeve /usr/bin/xeveb_app /usr/bin/xeveb
|
|
COPY --from=build-xeve-main /usr/bin/xeve_app /usr/bin/xeve
|
|
COPY --from=build-revc /usr/bin/revc* /usr/bin/
|
|
|
|
COPY --from=build-fdk-aac /usr/bin/aac-enc /usr/bin/aac-enc
|
|
|
|
COPY --from=build-vapoursynth-deps /usr/lib/libzimg* /usr/lib/
|
|
COPY --from=build-vapoursynth-deps /usr/bin/magick /usr/bin/magick
|
|
COPY --from=build-vapoursynth-deps /usr/etc/ImageMagick-7 /usr/etc/ImageMagick-7
|
|
|
|
COPY --from=build-mkvtoolnix /usr/bin/mkv* /usr/bin/
|
|
COPY --from=build-mediainfo /usr/bin/mediainfo /usr/bin/mediainfo
|
|
|
|
FROM final AS encoder-vapoursynth3
|
|
|
|
COPY --from=build-av1an-vapoursynth3 /usr/bin/av1an /usr/bin/av1an
|
|
COPY --from=build-av1an-vapoursynth3 /usr/bin/vmaf /usr/bin/vmaf
|
|
|
|
COPY --from=build-vapoursynth3 /usr/bin/vspipe /usr/bin/vspipe
|
|
COPY --from=build-vapoursynth3 /usr/lib/python${PYTHON_VERSION}/site-packages/vapoursynth.* /usr/lib/python${PYTHON_VERSION}/site-packages/
|
|
COPY --from=build-vapoursynth3 /usr/lib/libvapoursynth* /usr/lib/
|
|
COPY --from=build-vapoursynth3 /usr/lib/vapoursynth /usr/lib/vapoursynth
|
|
COPY --from=build-vapoursynth3 /usr/lib/libvs* /usr/lib/
|
|
COPY --from=build-vapoursynth3 /usr/lib/libffms* /usr/lib/
|
|
|
|
FROM final AS encoder-vapoursynth4
|
|
|
|
COPY --from=build-av1an-vapoursynth4 /usr/bin/av1an /usr/bin/av1an
|
|
COPY --from=build-av1an-vapoursynth4 /usr/bin/vmaf /usr/bin/vmaf
|
|
|
|
#COPY --from=build-wobbly /usr/bin/wobbly /usr/bin/wobbly
|
|
#COPY --from=build-wobbly /usr/bin/wibbly /usr/bin/wibbly
|
|
|
|
COPY --from=build-vapoursynth4-plugins /usr/bin/vspipe /usr/bin/vspipe
|
|
COPY --from=build-vapoursynth4-plugins /usr/lib/python${PYTHON_VERSION}/site-packages/vapoursynth.* /usr/lib/python${PYTHON_VERSION}/site-packages/
|
|
COPY --from=build-vapoursynth4-plugins /usr/lib/libvapoursynth* /usr/lib/
|
|
COPY --from=build-vapoursynth4-plugins /usr/lib/vapoursynth /usr/lib/vapoursynth
|
|
COPY --from=build-vapoursynth4-plugins /usr/lib/libvs* /usr/lib/
|
|
COPY --from=build-vapoursynth4-plugins /usr/lib/libffms* /usr/lib/
|
|
|
|
FROM encoder-vapoursynth3 |