This repository has been archived on 2021-01-24. You can view files and clone it, but cannot push or open issues or pull requests.
vapoursynth/Dockerfile
2020-10-23 18:13:22 +02:00

181 lines
6.6 KiB
Docker

FROM alpine as fonts
RUN wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Iosevka.zip \
&& mkdir iosevka \
&& unzip -d iosevka Iosevka.zip \
&& rm Iosevka.zip iosevka/Iosevka\ Term\ * \
&& chown -R 1000:1000 iosevka
FROM debian:testing
RUN echo 'deb http://ftp-stud.hs-esslingen.de/pub/Mirrors/debian-multimedia/ testing main' > /etc/apt/sources.list.d/deb-multimedia.list \
&& apt-get update -oAcquire::AllowInsecureRepositories=true \
&& apt-get -y --allow-unauthenticated install deb-multimedia-keyring \
&& apt-get update
# Base build dependencies
RUN apt-get -y install \
build-essential \
wget
# Vapoursynth plugin build dependencies
RUN apt-get -y install \
autoconf \
cargo \
git \
libfftw3-dev \
libtool \
meson \
vapoursynth-dev
RUN cd /tmp \
&& git clone --depth=1 --recursive https://git.kageru.moe/kageru/adaptivegrain \
&& cd adaptivegrain \
&& cargo build --release \
&& cp target/release/libadaptivegrain_rs.so /usr/lib/x86_64-linux-gnu/vapoursynth/ \
&& cd .. \
&& rm -rf adaptivegrain \
&& rm -rf ~/.cargo
# required by hvf.Deblock_QED (required by fvf.AutoDeblock)
RUN cd /tmp \
&& git clone --depth=1 https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DCTFilter \
&& cd VapourSynth-DCTFilter \
&& ./autogen.sh \
&& ./configure --libdir=/usr/lib/x86_64-linux-gnu/vapoursynth \
&& make install \
&& cd .. \
&& rm -rf VapourSynth-DCTFilter
RUN cd /tmp \
&& git clone --depth=1 https://github.com/MonoS/VS-ContinuityFixer \
&& cd VS-ContinuityFixer \
&& sed -i \
-e 's/VapourSynth\.h/vapoursynth\/VapourSynth.h/' \
-e 's/VSHelper\.h/vapoursynth\/VSHelper.h/' \
continuity.cpp \
&& g++ -shared -fPIC -O2 -msse2 -mfpmath=sse continuity.cpp -o continuity.so \
&& cp continuity.so /usr/lib/x86_64-linux-gnu/vapoursynth/ \
&& cd .. \
&& rm -rf VS-ContinuityFixer
# TODO: Remove when newer version is in deb-multimedia
RUN cd /tmp \
&& git clone --depth=1 https://github.com/Irrational-Encoding-Wizardry/vapoursynth-descale \
&& cd vapoursynth-descale \
&& meson build \
&& ninja -C build \
&& cp build/libdescale.so /usr/lib/x86_64-linux-gnu/vapoursynth/ \
&& cd .. \
&& rm -rf vapoursynth-descale
# TODO: Remove when working version is in deb-multimedia (current one crashes
# with symbol lookup error:
# /usr/lib/x86_64-linux-gnu/vapoursynth/libdfttest.so: undefined symbol:
# fftwf_make_planner_thread_safe
COPY dfttest-dummy /tmp/
RUN cd /tmp/ \
&& apt-get -y install equivs \
&& equivs-build dfttest-dummy \
&& dpkg -i vapoursynth-dfttest_7-dmo2_all.deb \
&& apt-get purge -y equivs \
&& apt-get autoremove --purge -y \
&& rm dfttest-dummy vapoursynth-dfttest_7-dmo2_all.deb
RUN cd /tmp \
&& git clone --depth=1 https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DFTTest \
&& cd VapourSynth-DFTTest \
&& meson build --prefix /usr/local \
&& ninja -C build \
&& ninja -C build install \
&& cd .. \
&& rm -rf VapourSynth-DFTTest
# TODO: Remove once debian has compatible libplacebo version
RUN echo "deb-src" http://deb.debian.org/debian testing main >> /etc/apt/sources.list.d/src.list \
&& apt-get update \
&& apt-get -y build-dep libplacebo \
&& cd /tmp/ \
&& git clone --depth=1 https://code.videolan.org/videolan/libplacebo.git \
&& cd libplacebo \
&& meson build \
&& ninja -C build \
&& ninja -C build install \
&& cd .. \
&& rm -rf libplacebo \
&& rm /etc/apt/sources.list.d/src.list
RUN cd /tmp \
&& git clone --depth=1 --recursive https://github.com/Lypheo/vs-placebo \
&& cd vs-placebo \
&& meson build \
&& cd build \
&& ninja \
&& cp libvs_placebo.so /usr/lib/x86_64-linux-gnu/vapoursynth/ \
&& cd /tmp/ \
&& rm -rf vs-placebo
# Runtime dependencies
RUN apt-get -y install \
beignet-opencl-icd \
clinfo \
ffmpeg \
mkvtoolnix \
pocl-opencl-icd \
python3-opencv \
python3-pip \
qtwayland5 \
vapoursynth-* \
x264 \
x265
# ROCm (AMD Radeon OpenCL)
# The gdb packages is necessary for opencl to work (why?)
COPY rocm.gpg /etc/apt/trusted.gpg.d/
RUN echo 'deb http://repo.radeon.com/rocm/apt/debian/ xenial main' > /etc/apt/sources.list.d/rocm.list \
&& apt-get update \
&& apt-get -y install rocm-opencl rocm-gdb \
&& rm /etc/OpenCL/vendors/amdocl64* \
&& echo /opt/rocm-*/opencl/lib/libamdocl64.so > /etc/OpenCL/vendors/amdocl64.icd
# models are at wrong location (whyever the package installs it there)
RUN cp -r /usr/share/vapoursynth-waifu2x-models/ /usr/lib/x86_64-linux-gnu/vapoursynth/models/
RUN pip3 --no-cache-dir install \
tqdm \
yuuno 'pygments>=2.4.1' \
&& yuuno jupyter install
ENV PYTHONPATH=/data/functions/:/usr/local/lib/vapoursynth-scripts/
ARG CACHEBUST_SCRIPTS=1
RUN mkdir /usr/local/lib/vapoursynth-scripts/ \
&& wget -nv -P /usr/local/lib/vapoursynth-scripts/ \
https://gist.github.com/4re/342624c9e1a144a696c6/raw/08df48752c70c66df4127f2791bbedbc1958da77/nnedi3_rpow2.py \
https://gist.github.com/YamashitaRen/020c497524e794779d9c/raw/2a20385e50804f8b24f2a2479e2c0f3c335d4853/edi_rpow2.py \
https://github.com/HomeOfVapourSynthEvolution/havsfunc/raw/master/havsfunc.py \
https://github.com/HomeOfVapourSynthEvolution/mvsfunc/raw/master/mvsfunc.py \
https://github.com/HomeOfVapourSynthEvolution/vsTAAmbk/raw/master/vsTAAmbk.py \
https://github.com/IFeelBloated/Oyster/raw/master/Oyster.py \
https://github.com/IFeelBloated/vapoursynth-mvtools-sf/raw/5dfa8756092daa7dcc635eef799c6964bd40c259/src/mvmulti.py \
https://github.com/Irrational-Encoding-Wizardry/fvsfunc/raw/master/fvsfunc.py \
https://github.com/Irrational-Encoding-Wizardry/kagefunc/raw/master/kagefunc.py \
https://github.com/WolframRhodium/muvsfunc/raw/master/Collections/muvsfunc_numpy.py \
https://github.com/WolframRhodium/muvsfunc/raw/master/muvsfunc.py \
https://github.com/dubhater/vapoursynth-adjust/raw/master/adjust.py \
https://github.com/theChaosCoder/lostfunc/raw/master/lostfunc.py \
&& chmod 755 /usr/local/lib/vapoursynth-scripts/*
# kinda dumb (vapoursynth gets built), but I do not know how to do this better
RUN pip3 install -t /usr/local/lib/vapoursynth-scripts/ --no-cache-dir \
getnative \
vsutil \
&& pip3 uninstall -y vapoursynth
RUN adduser --disabled-password --gecos '' vapoursynth
USER vapoursynth
COPY --from=fonts /iosevka /home/vapoursynth/.fonts