+ Reply to Thread
Results 31 to 48 of 48
-
- Telecide() or TFM() matches the fields of telecined or phase-shifted video
- Decimate() or TDecimate() removes duplicates (which may result from the fieldmatching)
- bob().sRestore() removes ghosts from blended fields (typically originating from framerate conversions)
All of these filters have settings to optimize their effectiveness, depending on the source
https://www.rationalqm.us/decomb/decombnew.html
http://avisynth.nl/index.php/Internal_filters
http://avisynth.nl/index.php/External_filters
http://avisynth.nl/index.php/TIVTC
http://avisynth.nl/index.php/SrestoreLast edited by Sharc; 17th Mar 2026 at 17:02.
-
-
I have been meaning to try applying what I suggested earlier in this thread. I did briefly try my various automatic scripts for detecting and correcting field shifts (which is one aspect of the problem) as well as detecting and then dealing with duplicates. The section between frames 563 and 575 is the easy place to figure out the automatic fix. If I get time, I may try to do it, even if the OP has moved on.
-
This simple script seems to detect and correct the field reversal. It uses the old MugFunky "FillDrops" function to take care of the duplicate which happens at each point where the fields reverse.
This is the result:
Automatically Detect and Correct Field Reversal
Code:#Detect and correct field reversal #John Meyer March 21, 2026 Loadplugin("E:\Documents\My Videos\AVISynth\AVISynth Plugins\plugins\MVTools\mvtools2.dll") #Modify this to point to the video file you use. src = AVISource("E:\fs.avi").ConvertToYV12() # Start by assuming TFF clip = src.AssumeTFF() # Use TFM in debug mode to detect combing tfm = clip.TFM(mode=2, debug=true) # Conditional: if combing detected, flip field order # Change test from 5.0 to something else, if needed ScriptClip(tfm, """ c = YDifferenceToNext() c > 5.0 ? last.AssumeBFF() : last """) filldrops () #----------------- #Begin functions #Function which detects duplicate frames and fills one of those frames with #a motion estimated frame. This function (unlike my modified one below) is #hard-wired with a detection threshhold of 1.1. I was too lazy to correct this function filldrops (clip c) { super=MSuper(c,pel=2) vfe=manalyse(super,truemotion=true,isb=false,delta=1) vbe=manalyse(super,truemotion=true,isb=true,delta=1) filldrops = mflowinter(c,super,vbe,vfe,time=50) fixed = ConditionalFilter(c, filldrops, c, "YDifferenceFromPrevious()", "lessthan", "1.1") return fixed } #Same as FillDrops, but for interlaced video function filldropsI (clip c, float "thresh") { thresh = Default(thresh, 0.1) even = c.SeparateFields().SelectEven() super_even=MSuper(even,pel=2) vfe=manalyse(super_even,truemotion=true,isb=false,delta=1) vbe=manalyse(super_even,truemotion=true,isb=true,delta=1) filldrops_e = mflowinter(even,super_even,vbe,vfe,time=50) odd = c.SeparateFields().SelectOdd() super_odd=MSuper(odd,pel=2) vfo=manalyse(super_odd,truemotion=true,isb=false,delta=1) vbo=manalyse(super_odd,truemotion=true,isb=true,delta=1) filldrops_o = mflowinter(odd,super_odd,vbo,vfo,time=50) evenfixed = ConditionalFilter(even, filldrops_e, even, "YDifferenceFromPrevious()", "lessthan", String(thresh)) oddfixed = ConditionalFilter(odd, filldrops_o, odd, "YDifferenceFromPrevious()", "lessthan", String(thresh)) Interleave(evenfixed,oddfixed) Weave() }Last edited by johnmeyer; 22nd Mar 2026 at 09:46.
-
Hi yeah I tried everything so far, almost gave up.@Johnmeyer I've tried your script above, it seems to work on that segment (between frames 563 and 575) you mentioned but there's many other scenes that it doesnt fix automatically. I noticed on other scenes if I change :AssumeTFF() to AssumeBFF() it fixes some but for others I have to change back to AssumeTFF(). Dont know what else to do.
-
Here is a short clip:https://www.swisstransfer.com/d/f5c80775-3e2c-424d-a1a5-23b43d57996d
If i use your script you'll see some parts are not fixed until I change line 10 from AssumeTFF() to AssumeBFF()
Here is the script, maybe I'm doing something wrong in script:
Code:#Detect and correct field reversal #John Meyer March 21, 2026 #Modify this to point to the video file you use. src = LWLibavVideoSource("G:\future projects\Dance of the Drunken Mantis proejct\NEW SAMPLE\VTS_01_1.VOB").ConvertToYV12() # Start by assuming TFF clip = src.AssumeTFF() # Use TFM in debug mode to detect combing tfm = clip.TFM(mode=2, debug=true) # Conditional: if combing detected, flip field order # Change test from 5.0 to something else, if needed ScriptClip(tfm, """ c = YDifferenceToNext() c > 5.0 ? last.AssumeBFF() : last """) filldrops () #----------------- #Begin functions #Function which detects duplicate frames and fills one of those frames with #a motion estimated frame. This function (unlike my modified one below) is #hard-wired with a detection threshhold of 1.1. I was too lazy to correct this function filldrops (clip c) { super=MSuper(c,pel=2) vfe=manalyse(super,truemotion=true,isb=false,delta=1) vbe=manalyse(super,truemotion=true,isb=true,delta=1) filldrops = mflowinter(c,super,vbe,vfe,time=50) fixed = ConditionalFilter(c, filldrops, c, "YDifferenceFromPrevious()", "lessthan", "1.1") return fixed } Crop(10, 4, -8, -0, align=true) Spline36Resize(704, 284) -
-
Or try, (similar to above):
The script removes most ghost, returning 25fps, preserving the original number of frames (624) with some duplicates. Then duplicates and near duplicates get substituted by motion interpolated frames (labelled "interpolated" for demo). As the number of frames is preseved the audio should stay synched.
Code:LWLibavVideoSource("VTS_01_1.VOB") #ghosts removal QTGMC(preset="fast").SRestore(frate=25) # followed by replacement of remaining dupes (or near dupes) by motion interpolated frames # script based on a proposal by jagabo thresh=2.2 #sensitivity for dupes recognition; adjust as needed alt = DoubleFPS_RIFE().SelectOdd() # double frame rate, keep only the newly interpolated frames alt=alt.subtitle("interpolated",size=24) #for debugging only, disable for real use case test = mt_lutxy(last, last.Loop(2,0,0),"x y - abs", chroma="-128") # abs diff between frames, for duplicate detection ConditionalFilter(test, alt, last, "AverageLuma", "lessthan", "thresh") # replace nearly identical frames with the motion interpolated frames AssumeFPS(24.0, synch_audio=true) #slowdown if really needed function DoubleFPS_RIFE(clip source) { source.z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f") Rife(model=12, sc=true, sc_threshold=0.10) z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l") }Last edited by Sharc; 24th Mar 2026 at 07:38. Reason: aspect ratio 16:9 added
-
just for fun I used QTGMC(preset="fast") + sRestore(frate=25) + SeedVR2,...
users currently on my ignore list: deadrats, Stears555, marcorocchini -
My script worked fine on the two sections that others had identified and which I also easily found. I did not, however, walk through the entire clip frame-by-frame. As others have suggested, you may need to "tune" the script by adjusting the threshold ("c > 5.0").
-
Thanks Sharc that works alot better overall. Yeah johnmeyer I tried adjusting threshold coudnt get it to improve other section of movie. I like the upscale Selur, what parameters, settings you used on SeedVR2, I would like to replicate the same results please. I have downloaded ComfyUI and SeedVR2.
-
Here is an export of the settings: https://pastebin.com/dpkPcqsu
should be near the defaults, aside from using ffv1 as output.
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
Much fun, but be aware diffusion based upscalers like SeedVR2 or Topaz Starlight are really slow.
users currently on my ignore list: deadrats, Stears555, marcorocchini
Similar Threads
-
Handling Aspect Ratio when going from DVD sources to NLE?
By GMaq in forum EditingReplies: 16Last Post: 3rd Jan 2025, 14:34 -
How to fix DVD aspect ratio please?
By BrownMan in forum Newbie / General discussionsReplies: 12Last Post: 24th Aug 2024, 12:45 -
Fixing interlacing(?) in Youtube video
By corecore in forum Newbie / General discussionsReplies: 0Last Post: 6th Jul 2024, 21:32 -
Converting DVD: Aspect Ratio Error
By SomeoneNeutral in forum Newbie / General discussionsReplies: 3Last Post: 12th Feb 2023, 23:13 -
Aspect ratio and video picture size issue DVD
By njemje in forum Newbie / General discussionsReplies: 37Last Post: 9th Jan 2023, 03:13





Quote