Skip to content

Commit

Permalink
feat: add some VapourSynth C++ plugins (#43)
Browse files Browse the repository at this point in the history
* doc: add VapourSynth C++ Plugin List in README.md
  • Loading branch information
Tohrusky authored Jan 25, 2025
1 parent f43de83 commit 1f19498
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 7 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,38 @@ the playground image has sshd installed, you can ssh into the container to dev
- user: root
- password: 123456

### VapourSynth C++ Plugin List

```bash
bestsource.so
libaddgrain.so
libakarin.so
libassrender.so
libbilateral.so
libbm3dcpu.so
libbm3dcuda.so
libbm3dcuda_rtc.so
libboxblur.so
libbwdif.so
libcas.so
libctmf.so
libdctfilter.so
libdfttest2_cpu.so
libdfttest2_cuda.so
libdfttest2_nvrtc.so
libeedi2.so
libeedi3m.so
libffms2.so
libfillborders.so
libfmtconv.so
libils.so
libmiscfilters.so
libmvtools.so
libretinex.so
libtcanny.so
libttempsmooth.so
```

### Build

build [image](./vs-pytorch.dockerfile) (default for FinalRip) and [playground image](./vs-playground.dockerfile)
Expand Down
76 changes: 73 additions & 3 deletions vs-pytorch-rocm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ WORKDIR /workspace
###

# --- prerequisites ---

RUN apt install -y \
autoconf \
llvm-15 \
nasm \
libboost-dev \
libxxhash-dev \
libfftw3-dev

# jansson
RUN git clone https://github.com/akheron/jansson --depth 1 && cd jansson && autoreconf -fi && CFLAGS=-fPIC ./configure && \
make -j$(nproc) && make install
Expand All @@ -78,12 +87,14 @@ RUN git clone https://github.com/libarchive/bzip2 --depth 1 && cd bzip2 && \

# --- VapourSynth plugins ---
# bestsource
RUN apt install libxxhash-dev -y
RUN git clone https://github.com/vapoursynth/bestsource.git --depth 1 --recurse-submodules --shallow-submodules --remote-submodules && cd bestsource && \
CFLAGS=-fPIC meson setup -Denable_plugin=true build && CFLAGS=-fPIC ninja -C build && ninja -C build install

# vs-miscfilters
RUN git clone https://github.com/vapoursynth/vs-miscfilters-obsolete --depth 1 && cd vs-miscfilters-obsolete && \
mkdir build && cd build && meson ../ && ninja && ninja install

# ffms2
RUN apt install autoconf -y
RUN git clone https://github.com/FFMS/ffms2 --depth 1 && cd ffms2 && \
./autogen.sh && CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS="-Wl,-Bsymbolic" ./configure --enable-shared && make -j$(nproc) && make install
RUN ln -s /usr/local/lib/libffms2.so /usr/local/lib/vapoursynth/libffms2.so
Expand All @@ -110,9 +121,55 @@ RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-CTMF --d
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-CAS --depth 1 && cd VapourSynth-CAS && \
mkdir build && cd build && meson ../ && ninja && ninja install

# AddGrain
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-AddGrain --depth 1 && cd VapourSynth-AddGrain && \
mkdir build && cd build && meson ../ && ninja && ninja install

# Bilateral
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-Bilateral --depth 1 && cd VapourSynth-Bilateral && \
./configure && make -j$(nproc) && make install

# Bwdif
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-Bwdif --depth 1 && cd VapourSynth-Bwdif && \
mkdir build && cd build && meson ../ && ninja && ninja install

# DCTFilter
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DCTFilter --depth 1 && cd VapourSynth-DCTFilter && \
mkdir build && cd build && meson ../ && ninja && ninja install

# TTempSmooth
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-TTempSmooth --depth 1 && cd VapourSynth-TTempSmooth && \
mkdir build && cd build && meson ../ && ninja && ninja install

# EEDI2
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-EEDI2 --depth 1 && cd VapourSynth-EEDI2 && \
mkdir build && cd build && meson ../ && ninja && ninja install

# EEDI3
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-EEDI3 --depth 1 && cd VapourSynth-EEDI3 && \
mkdir build && cd build && meson -D opencl=false ../ && ninja && ninja install

# AmusementClub's plugins
# assrender
RUN git clone https://github.com/AmusementClub/assrender --depth 1 && cd assrender && \
mkdir build && cd build && cmake .. && make -j$(nproc) && make install

# vs-boxblur
RUN git clone https://github.com/AmusementClub/vs-boxblur --depth 1 --recurse-submodules && cd vs-boxblur && \
cmake -S . -B build -G Ninja \
-D VS_INCLUDE_DIR="/usr/local/include/vapoursynth" \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS_RELEASE="-Wall -ffast-math -march=x86-64-v3" && \
cmake --build build --verbose && \
cmake --install build --prefix /usr/local

# AkarinVS's plugins
# libakarin, depends on llvm ver >= 10.0 && < 16
RUN git clone https://github.com/AkarinVS/vapoursynth-plugin --depth 1 && cd vapoursynth-plugin && \
mkdir build && cd build && meson ../ && ninja && ninja install

# dubhater's plugins
# mvtools
RUN apt install nasm libfftw3-dev -y
RUN git clone https://github.com/dubhater/vapoursynth-mvtools --depth 1 && cd vapoursynth-mvtools && \
mkdir build && cd build && meson ../ && ninja && ninja install
RUN ln -s /usr/local/lib/x86_64-linux-gnu/libmvtools.so /usr/local/lib/vapoursynth/libmvtools.so
Expand All @@ -128,6 +185,19 @@ RUN ln -s /usr/local/lib/x86_64-linux-gnu/libfillborders.so /usr/local/lib/vapou

# TODO: Support ROCm, temporarily use the CPU version

# AmusementClub's plugins
# dfttest2
RUN git clone https://github.com/AmusementClub/vs-dfttest2 --depth 1 --recurse-submodules && cd vs-dfttest2 && \
cmake -S . -B build -G Ninja -LA \
-D ENABLE_CPU=ON \
-D ENABLE_CUDA=OFF \
-D ENABLE_HIP=OFF \
-D VAPOURSYNTH_INCLUDE_DIRECTORY="/usr/local/include/vapoursynth" \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS="-Wall -ffast-math -march=x86-64-v3" && \
cmake --build build --verbose && \
cmake --install build --verbose --prefix /usr/local

# WolframRhodium's plugins
# BM3DCUDA
RUN git clone https://github.com/WolframRhodium/VapourSynth-BM3DCUDA --depth 1 && cd VapourSynth-BM3DCUDA && \
Expand Down
90 changes: 86 additions & 4 deletions vs-pytorch.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WORKDIR /cuda
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
apt update && \
apt install -y cuda-nvcc-12-4 cuda-cudart-dev-12-4 cuda-nvrtc-dev-12-4
apt install -y cuda-nvcc-12-4 cuda-cudart-dev-12-4 cuda-nvrtc-dev-12-4 libcufft-dev-12-4

# set up environment variables
ENV PATH=/usr/local/cuda/bin:${PATH}
Expand All @@ -31,6 +31,15 @@ WORKDIR /workspace
###

# --- prerequisites ---

RUN apt install -y \
autoconf \
llvm-15 \
nasm \
libboost-dev \
libxxhash-dev \
libfftw3-dev

# jansson
RUN git clone https://github.com/akheron/jansson --depth 1 && cd jansson && autoreconf -fi && CFLAGS=-fPIC ./configure && \
make -j$(nproc) && make install
Expand All @@ -41,12 +50,14 @@ RUN git clone https://github.com/libarchive/bzip2 --depth 1 && cd bzip2 && \

# --- VapourSynth plugins ---
# bestsource
RUN apt install libxxhash-dev -y
RUN git clone https://github.com/vapoursynth/bestsource.git --depth 1 --recurse-submodules --shallow-submodules --remote-submodules && cd bestsource && \
CFLAGS=-fPIC meson setup -Denable_plugin=true build && CFLAGS=-fPIC ninja -C build && ninja -C build install

# vs-miscfilters
RUN git clone https://github.com/vapoursynth/vs-miscfilters-obsolete --depth 1 && cd vs-miscfilters-obsolete && \
mkdir build && cd build && meson ../ && ninja && ninja install

# ffms2
RUN apt install autoconf -y
RUN git clone https://github.com/FFMS/ffms2 --depth 1 && cd ffms2 && \
./autogen.sh && CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS="-Wl,-Bsymbolic" ./configure --enable-shared && make -j$(nproc) && make install
RUN ln -s /usr/local/lib/libffms2.so /usr/local/lib/vapoursynth/libffms2.so
Expand All @@ -73,9 +84,55 @@ RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-CTMF --d
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-CAS --depth 1 && cd VapourSynth-CAS && \
mkdir build && cd build && meson ../ && ninja && ninja install

# AddGrain
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-AddGrain --depth 1 && cd VapourSynth-AddGrain && \
mkdir build && cd build && meson ../ && ninja && ninja install

# Bilateral
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-Bilateral --depth 1 && cd VapourSynth-Bilateral && \
./configure && make -j$(nproc) && make install

# Bwdif
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-Bwdif --depth 1 && cd VapourSynth-Bwdif && \
mkdir build && cd build && meson ../ && ninja && ninja install

# DCTFilter
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DCTFilter --depth 1 && cd VapourSynth-DCTFilter && \
mkdir build && cd build && meson ../ && ninja && ninja install

# TTempSmooth
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-TTempSmooth --depth 1 && cd VapourSynth-TTempSmooth && \
mkdir build && cd build && meson ../ && ninja && ninja install

# EEDI2
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-EEDI2 --depth 1 && cd VapourSynth-EEDI2 && \
mkdir build && cd build && meson ../ && ninja && ninja install

# EEDI3
RUN git clone https://github.com/HomeOfVapourSynthEvolution/VapourSynth-EEDI3 --depth 1 && cd VapourSynth-EEDI3 && \
mkdir build && cd build && meson -D opencl=false ../ && ninja && ninja install

# AmusementClub's plugins
# assrender
RUN git clone https://github.com/AmusementClub/assrender --depth 1 && cd assrender && \
mkdir build && cd build && cmake .. && make -j$(nproc) && make install

# vs-boxblur
RUN git clone https://github.com/AmusementClub/vs-boxblur --depth 1 --recurse-submodules && cd vs-boxblur && \
cmake -S . -B build -G Ninja \
-D VS_INCLUDE_DIR="/usr/local/include/vapoursynth" \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS_RELEASE="-Wall -ffast-math -march=x86-64-v3" && \
cmake --build build --verbose && \
cmake --install build --prefix /usr/local

# AkarinVS's plugins
# libakarin, depends on llvm ver >= 10.0 && < 16
RUN git clone https://github.com/AkarinVS/vapoursynth-plugin --depth 1 && cd vapoursynth-plugin && \
mkdir build && cd build && meson ../ && ninja && ninja install

# dubhater's plugins
# mvtools
RUN apt install nasm libfftw3-dev -y
RUN git clone https://github.com/dubhater/vapoursynth-mvtools --depth 1 && cd vapoursynth-mvtools && \
mkdir build && cd build && meson ../ && ninja && ninja install
RUN ln -s /usr/local/lib/x86_64-linux-gnu/libmvtools.so /usr/local/lib/vapoursynth/libmvtools.so
Expand All @@ -89,6 +146,19 @@ RUN ln -s /usr/local/lib/x86_64-linux-gnu/libfillborders.so /usr/local/lib/vapou
# Install VapourSynth CUDA plugins
###

# AmusementClub's plugins
# dfttest2
RUN git clone https://github.com/AmusementClub/vs-dfttest2 --depth 1 --recurse-submodules && cd vs-dfttest2 && \
cmake -S . -B build -G Ninja -LA \
-D USE_NVRTC_STATIC=ON \
-D VAPOURSYNTH_INCLUDE_DIRECTORY="/usr/local/include/vapoursynth" \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS="-Wall -ffast-math -march=x86-64-v3" \
-D CMAKE_CUDA_FLAGS="--threads 0 --use_fast_math --resource-usage -Wno-deprecated-gpu-targets" \
-D CMAKE_CUDA_ARCHITECTURES="50;52-real;60;61-real;70;75-real;80;86-real;89-real;90-real" && \
cmake --build build --verbose && \
cmake --install build --verbose --prefix /usr/local

# WolframRhodium's plugins
# BM3DCUDA
RUN git clone https://github.com/WolframRhodium/VapourSynth-BM3DCUDA --depth 1 && cd VapourSynth-BM3DCUDA && \
Expand All @@ -105,6 +175,18 @@ RUN ln -s /usr/local/lib/libbm3dcuda.so /usr/local/lib/vapoursynth/libbm3dcuda.s
ln -s /usr/local/lib/libbm3dcuda_rtc.so /usr/local/lib/vapoursynth/libbm3dcuda_rtc.so && \
ln -s /usr/local/lib/libbm3dcpu.so /usr/local/lib/vapoursynth/libbm3dcpu.so

# ILS
RUN git clone https://github.com/WolframRhodium/VapourSynth-ILS --depth 1 && cd VapourSynth-ILS && \
cmake -S . -B build -G Ninja \
-D VAPOURSYNTH_INCLUDE_DIRECTORY="/usr/local/include/vapoursynth" \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS="-Wall -ffast-math -march=x86-64-v3" \
-D CMAKE_CUDA_FLAGS="--threads 0 --use_fast_math --resource-usage -Wno-deprecated-gpu-targets" \
-D CMAKE_CUDA_ARCHITECTURES="50;52-real;60;61-real;70;75-real;80;86-real;89-real;90-real" && \
cmake --build build --verbose
RUN cp VapourSynth-ILS/build/libils.so /usr/local/lib && \
ln -s /usr/local/lib/libils.so /usr/local/lib/vapoursynth/libils.so

###
# Install VapourSynth Python plugins
###
Expand Down

0 comments on commit 1f19498

Please sign in to comment.