Skip to content

Instantly share code, notes, and snippets.

@Krisseck
Last active December 6, 2024 11:28
Show Gist options
  • Save Krisseck/43b01a8235c7b4ab694e959002bc5e69 to your computer and use it in GitHub Desktop.
Save Krisseck/43b01a8235c7b4ab694e959002bc5e69 to your computer and use it in GitHub Desktop.
QTGMC Vapoursynth Docker config

Dockerfile configuration to run QTGMC with Vapoursynth. Built on Archlinux. Includes optimized and slightly opinionated settings.

To use:

  • Copy Dockerfile to local directory
  • Build with docker build -t qtgmc:latest ./
  • Run like you would normally run vspipe, for example:
docker run -it -v /local/dir:/app qtgmc:latest /bin/bash -c 'VS_NUM_THREADS=8 VS_SOURCE=/app/input.mkv QTGMC_SHARPNESS=1 vspipe -c y4m /root/qtgmc.vpy - | ffmpeg -i - -c:v libx264 /app/output.mkv'
FROM archlinux:latest
RUN echo '[multilib]' >> /etc/pacman.conf && echo 'Include = /etc/pacman.d/mirrorlist' >> /etc/pacman.conf && pacman --noconfirm -Syyu && pacman --noconfirm -S base-devel git ffms2 && useradd -m -r -s /bin/bash aur && passwd -d aur && echo 'aur ALL=(ALL) ALL' > /etc/sudoers.d/aur && chown -R aur:aur /home/aur && mkdir /build && chown -R aur:aur /build && cd /build && sudo -u aur git clone --depth 1 https://aur.archlinux.org/yay.git && cd yay && chmod 777 -R /root && sudo -E -u aur makepkg --noconfirm -si && sudo -E -u aur yay --afterclean --removemake --save && pacman -Qtdq | xargs -r pacman --noconfirm -Rcns && rm -rf /home/aur/.cache && rm -rf /build && rm -rf /root/.cache
RUN sudo -u aur yay -S vapoursynth-plugin-bestsource-git qtgmc --noconfirm
RUN curl https://gist.githubusercontent.com/Krisseck/43b01a8235c7b4ab694e959002bc5e69/raw/ce0468e4bbccec37ed6e77b4bc262eeb1176fffc/qtgmc.vpy -o /root/qtgmc.vpy && chmod a+rx /root/qtgmc.vpy
CMD ["/bin/bash"]
#!/usr/bin/env python3
# Based on https://aur.archlinux.org/cgit/aur.git/tree/qtgmc.vpy?h=qtgmc
import os
import sys
from vapoursynth import core
import havsfunc
# VapourSynth Settings
core.num_threads = int(os.getenv("VS_NUM_THREADS", "4"))
video = core.ffms2.Source(os.getenv("VS_SOURCE"))
video = havsfunc.QTGMC(Input=video,
Preset=os.getenv("QTGMC_PRESET", "very slow"),
Sharpness=float(os.getenv("QTGMC_SHARPNESS", "0")),
SourceMatch=3,
TR2=2,
Lossless=2,
MatchEnhance=0.75,
NoiseProcess=1,
NoiseRestore=0.7,
Sigma=1.5)
video.set_output()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment