Skip to content

Instantly share code, notes, and snippets.

@rlaphoenix
Last active January 28, 2024 01:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlaphoenix/0957656a97559c397ec12544743f2898 to your computer and use it in GitHub Desktop.
Save rlaphoenix/0957656a97559c397ec12544743f2898 to your computer and use it in GitHub Desktop.
Mickey's Christmas Carol 1080p 4:3 OAR Restoration
import vapoursynth as vs
from vapoursynth import core
import functools
from mpgg import MPGG
from vsgan import ESRGAN
from havsfunc import QTGMC
from muvsfunc import mdering
clip = MPGG(r"C:\Users\Justin\Videos\Mickeys.Christmas.Carol.PAL.mkv", verbose=False).\
recover(verbose=False).\
ceil().\
deinterlace(kernel=functools.partial(QTGMC, FPSDivisor=2, Preset="Very Slow"), verbose=False).\
clip
clip = core.std.AssumeFPS(clip, fpsnum=24000, fpsden=1001)[24:]
clip = mdering(clip, 32)
clip = core.resize.Spline16(clip, format=vs.RGBS, src_left=2, src_width=720 - 4, matrix_in_s="470bg")
clip = ESRGAN(clip, device="cuda:0").\
load("2X_DigitalFilmV5_Lite.pth").\
apply().\
clip
clip = core.resize.Spline16(clip, 1440, 1080, format=vs.YUV420P8, matrix_s="709")
clip = core.grain.Add(clip, var=15, uvar=0, hcorr=0.01, vcorr=0.24) # psychovisual
clip.set_output()
@rlaphoenix
Copy link
Author

rlaphoenix commented Dec 17, 2021

Updates to the script may be made to keep it relevant and up-to-date with dependency changes. The script overall will always be kept to do the same as when originally finalized.

1-minute preview: https://vimeo.com/657905289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment