Skip to content

Instantly share code, notes, and snippets.

@riverscn
Created June 26, 2021 09:41
Show Gist options
  • Save riverscn/a45e0541b44a66f405678cfecf0053bf to your computer and use it in GitHub Desktop.
Save riverscn/a45e0541b44a66f405678cfecf0053bf to your computer and use it in GitHub Desktop.
VapourSynth IVTC script ... may be the best
import havsfunc as haf
import functools
input_clip = src
def postprocess(n, f, clip, deinterlaced):
if f.props['_Combed'] > 0:
return deinterlaced
else:
return clip
matched_clip = core.vivtc.VFM(input_clip, 1)
deinterlaced_clip = haf.QTGMC(matched_clip, TFF=True, FPSDivisor=2)
postprocessed_clip = core.std.FrameEval(matched_clip, functools.partial(postprocess, clip=matched_clip, deinterlaced=deinterlaced_clip), prop_src=matched_clip)
decimated_clip = core.vivtc.VDecimate(postprocessed_clip)
src = decimated_clip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment