Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import vapoursynth as vs
- import sys, os
- sys.path.append(os.getenv('APPDATA') + r"\VapourSynth\scripts")
- import audiocutter
- import havsfunc as has
- import resamplehq as rhq
- def blank_strip(c, clip, height, offset):
- t = c.std.CropRel(clip, 0, 0, 0, height+offset)
- t = c.std.AddBorders(t, 0, 0, 0, height)
- b = c.std.CropRel(clip, 0, 0, clip.height-offset, 0)
- return c.std.StackVertical([t,b])
- core = vs.get_core()
- ts_file = "Uchuu_Sentai_Kyuuranger_039.d2v"
- ts_in = core.d2v.Source(ts_file)
- ac = audiocutter.AudioCutter()
- #Pre-Cold: ~450
- #SuperSentaiSeries: 60
- #OP: 2216
- #O-Christmas: ~300
- #ED: 1976
- #TAMA Gap: ~120
- #PV: 750
- # (926, 14110), (15911, 24240), (26939, 33709), (35959, 50079)
- # ts_in = core.text.FrameNum(ts_in, 5)
- # dec = ts_in
- vid = ac.split(ts_in, [(1367,6192, 'Cold Open'), (6193,8408, 'Opening'), (8711,14103, 'Part A'), (15905,24232, 'Part B'), (26932,33703, 'Part C'), (35953,47219, 'Part D'), (47220,49197, 'Ending'), (49318,50067, 'Preview')])#, doublecheck=True)
- # dec = vid
- fm = core.vivtc.VFM(vid, order=1, mode=2)
- deint = core.tdm.TDeintMod(fm, order=1, edeint=core.znedi3.nnedi3(clip=fm, field=1))
- pp = core.std.FrameEval(fm, lambda n, f: deint if f.props._Combed else fm, fm)
- pp2 = blank_strip(core, pp, 184, 46)
- dec = core.vivtc.VDecimate(pp2, clip2=pp)
- ac.ready_qp_and_chapters(dec)
- # dec = core.resize.Bicubic(dec, height=810, format=vs.YUV420P16, filter_param_a=-.5,filter_param_b=.25)
- dec = rhq.resample_hq(dec, height=810, kernel='cubic', filter_param_a=-.5, filter_param_b=.25)
- dec = core.std.Crop(dec, 2,2,0,0)
- dec = has.SMDegrain(dec, contrasharp=True, prefilter=4, Str=1.1, thSAD=250)
- dec = core.resize.Bicubic(dec, format=vs.YUV420P10, dither_type="ordered")
- # dec = core.resize.Bicubic(dec, format=vs.RGB48, matrix_in_s="709")
- dec.set_output()
- if __name__ == "__main__":
- prefix = os.path.splitext(__file__)[0]
- ac.cut_audio(prefix + '_aud_ac.mka', video_source=ts_file)
- ac.write_qpfile(prefix + "-vsac.qpfile")
- ac.write_chapters(prefix + "-vsac-ch.txt")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement