View Full Version : VIVTC Usage Issues
ShogoXT
1st February 2017, 06:13
Hello I have been using vapoursynth through staxrip to fix up and upscale some of the issues on my anime DVDs. I fixed most of the issues and picked out most of the filters to my liking, but I still have problems with VIVTC and residual combing or duplicate frames.
Source (https://mega.nz/#!WExinLKR!zW6EkiEdDQkZWbF3guIoc6s2kJR9PBD1wydx8E9Gjvk)
My Attempt (https://mega.nz/#!7cJBGZII!FccxqO9JUvCzCZzit6gvbbq2hWNZZsrfduPaWWNO6Zk)
My current settings for VIVTC so far, im relying a lot on vinverse to clean up combing afterward, but I must being doing something wrong.
clip = core.vivtc.VFM(clip, 1, mode = 0, cthresh = 8, scthresh = 10)
clip = core.vivtc.VDecimate(clip, scthresh = 14)
If I use anything higher than mode=0, I get really bad duplicate frames. Mode=0 though leaves behind a lot of combing, especially in scene changes, which is why I attempted to change scthresh.
I dont remember it being as bad on TIVTC, which I assume because of blending. I tried to load the AVS plugin, but always get plugin failed to load:
core.avs.LoadPlugin(path='C:/Users/Blah/Documents/Staxrip/Apps/Plugins/avs/tivtc64/TIVTC.dll')
clip = core.avs.TFM(clip)
clip = core.avs.TDecimate(clip, mode = 1, hybrid = 1)
Also ive tried several versions of TIVTC, the 64 bit one was the only one to come with a different error about avisynth 2.5 plugins not usable in 64bit. The other 2 just failed to load.
Learning all this has been fun though, so thank you all for all the hard work.
Myrsloik
1st February 2017, 11:02
VFM doesn't post process on its own. You need to script that manually. Compare with TFM without postprocessing.
Did you try changing cthresh/mi? That's what would trigger the matching issues in mode=1. If I'm not mistaken...
Myrsloik
1st February 2017, 19:24
I checked it and
clip = core.vivtc.VFM(clip, 1, mode = 1, cthresh = 8, scthresh = 10)
clip = core.vivtc.VDecimate(clip, scthresh = 14)
looks good to me. But you have to use d2vsource to get proper seeking or you'll get lots of weird things happening. Since you provided an mkv I assume you didn't do this. FFMS2 won't seek properly in your sample, ever, which probably creates most of your issues.
You can also script your own postprocessing like this:
import vapoursynth as vs
import functools
core = vs.get_core()
input_clip = core.std.BlankClip(format=vs.YUV420P8, length=1000, color=[255, 128, 128])
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 = core.eedi3.eedi3(matched_clip, field=1)
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)
decimated_clip.set_output()
This example will be added to the documentation as well. Substitute eedi3 with whatever you like.
ShogoXT
2nd February 2017, 08:14
Thanks so much!
I have to admit I never fully understood the function of the source filters and had been using ffms2 this whole time as it was default. I guess il have to do more reading on it. It was something I left to ripbot and staxrip based on my source.
That source came from MakeMKV from the DVDs and then split up the main file with MKVToolnixGUI. The problem part is like 40 seconds in when the frame turns around. I always try to use default settings first before trying to use custom settings.
I am interested in d2vsource though. I have AnyDVD as well, so I guess I should find a better way to split up the vobs and make them into d2v I suppose.
I will definitely save the script.
ShogoXT
3rd February 2017, 12:45
Looks like D2vsource is going to require a lot more work to properly use with Staxrip, so it might not be worth it.
Trying your script I got this message:
Error: Failed to retrieve frame 0 with error: 'vapoursynth.VideoProps' object is not subscriptable
I must of did something wrong. Trying to google it shows its python error of something not able to be retrieved, but im not sure how to fix it.
Thanks again, sorry for my noobness.
Myrsloik
3rd February 2017, 12:46
Looks like D2vsource is going to require a lot more work to properly use with Staxrip, so it might not be worth it.
Trying your script I got this message:
Error: Failed to retrieve frame 0 with error: 'vapoursynth.VideoProps' object is not subscriptable
I must of did something wrong.
Thanks again, sorry for my noobness.
Script?
ShogoXT
4th February 2017, 00:38
My script that ive been using so far through the Staxrip script preview, there are some loadplugins not shown as well:
import vapoursynth as vs
core = vs.get_core()
import importlib.machinery
clip = core.ffms2.Source(r"G:\Public\Videos\Encodes\One Piece\Source\S2P5D1\Split1-005.mkv", cachefile = r"G:\Public\Videos\Encodes\One Piece\Source\S2P5D1\Split1-005_temp\Split1-005.ffindex")
clip = core.std.CropRel(clip, 8, 8, 0, 0)
clip = core.vivtc.VFM(clip, 1, mode = 0, cthresh = 8, scthresh = 10)
clip = core.vivtc.VDecimate(clip, scthresh = 14)
clip = core.vinverse.Vinverse(clip)
clip = core.flux.SmoothST(clip, temporal_threshold = 7, spatial_threshold = 7, planes = [0, 1, 2])
clip = core.rgvs.RemoveGrain(clip, 1)
clip = core.rgvs.RemoveGrain(clip, 1)
import edi_rpow2 as edi
clip = edi.nnedi3_rpow2(clip,rfactor = 2)
clip = core.resize.Spline36(clip, 1440, 1080)
clip = core.warp.AWarpSharp2(clip, depth = 20)
clip = havsfunc.LSFmod(clip, strength = 75)
import havsfunc as haf
clip = haf.Toon(clip, str = 0.5)
clip = core.f3kdb.Deband(clip)
clip.set_output()
That works well enough so far at like 7-8 fps 2 pass.
There are probably a few redundancies in the imports because of the difference where Staxrip stores plugins and scripts vs me figuring out how to add my own. My attempt at putting your script in is below. It had errors about the indents before, but I think I fixed that. Its just the Videoprops error now:
clip = core.ffms2.Source(r"G:\Public\Videos\Encodes\One Piece\Source\TestSourceOP1.mkv", cachefile = r"G:\Public\Videos\Encodes\One Piece\Source\TestSourceOP1_temp\TestSourceOP1.ffindex")
clip = core.std.CropRel(clip, 8, 8, 0, 0)
import functools
input_clip = core.std.BlankClip(format=vs.YUV420P8, length=1000, color=[255, 128, 128])
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 = core.eedi3.eedi3(matched_clip, field=1)
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)
decimated_clip.set_output()
clip = core.vinverse.Vinverse(clip)
clip = core.flux.SmoothST(clip, temporal_threshold = 7, spatial_threshold = 7, planes = [0, 1, 2])
clip = core.rgvs.RemoveGrain(clip, 1)
clip = core.rgvs.RemoveGrain(clip, 1)
import edi_rpow2 as edi
clip = edi.nnedi3_rpow2(clip,rfactor = 2)
clip = core.resize.Spline36(clip, 1440, 1080)
clip = core.warp.AWarpSharp2(clip, depth = 20)
clip = havsfunc.LSFmod(clip, strength = 75)
import havsfunc as haf
clip = haf.Toon(clip, str = 0.5)
clip = core.f3kdb.Deband(clip)
Otherwise its all the same. I will say I haven't updated Vapoursynth in a couple months or python as I was worried about having to move the plugins and scripts back around.
jackoneill
6th February 2017, 21:52
f.props['_Combed']
Doesn't that require VapourSynth R36?
Try
f.props._Combed
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.