So usually I'd use TFM() or even QTGMC(FPSDivisor=2), and that'd take care of it, but neither yield satisfactory results.
Raw:
[Attachment 61847 - Click to enlarge]
TFM: (note the duplicate frame afterwards which still has issues)
[Attachment 61849 - Click to enlarge]
[Attachment 61850 - Click to enlarge]
QTGMC (again a duplicate with issues):
[Attachment 61851 - Click to enlarge]
[Attachment 61852 - Click to enlarge]
There are also a few very aliased frames as well. Almost the entire scene is just one big mess.
[Attachment 61848 - Click to enlarge]
Looking to avoid duplicate frames and maintain the 25FPS if at all possible.
Many thanks in advance!
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 17 of 17
Thread
-
-
This worked pretty well:
Code:QTGMC() TDecimate(mode=2, rate=25)
Last edited by jagabo; 16th Nov 2021 at 23:14.
-
Thanks jagabo! I hadn't considered that combination. As for the clip length, sorry will keep that in mind next time.
-
There are only two frames in this clip that have combing, and they're caused by "dropped fields" that I suppose happened when the video was ingested for the DVD transfer. If you step through with SeparateFields, the pattern goes from 2-2 to 2-3-1-2-3-1. These repeated top fields that replace the original top fields are duplicates of the previous bottom field, just shifted down by one line.
Then before that is the aliased frame, where a single field was essentially duplicated with no shifting.
IMO you should just manually replace frames 9, 12, and 15 with QTGMC-filtered versions rather than running QTGMC over the whole thing.My YouTube channel with little clips: vhs-decode, comparing TBC, etc. -
I was lazy at the time and just gave the first thing I tried. Manually replacing frames will be very tedious if there are many occurrences of such irregular pulldown patterns. I worked out an automated method that works for this clip:
Code:########################################################################## # # Abs(v1-v2), Y channel only # ########################################################################## function AbsSubtractY(clip v1, clip v2) { Subtract(v1, v2).ColorYUV(off_y=2) Overlay(last.ColorYUV(off_y=-128), last.Invert().ColorYUV(off_y=-127), mode="add") GreyScale() } ########################################################################## Mpeg2Source("REBOOT.Title9.chapter05.demuxed.d2v", CPU2="ooooxx", Info=3) q = QTGMC().SelectOdd() sep = SeparateFields() eodiff = AbsSubtractY(sep.SelectEven(), sep.SelectOdd()) # difference between even and odd files of each frame ConditionalFilter(last, q.Subtitle("combed"), last, "IsCombedTIVTC(cthresh=9)") # substitute q if frame is combed ConditionalFilter(eodiff, q.Subtitle("eodiff", y=20), last, "AverageLuma()", "lessthan", "1.2") # substitute q if fields are the same
One may need to adjust the AverageLuma() threshold if you get too many false positives or false negatives. You may need to change the threshold in IsCombedIVTC(cthres=9) to compensate for false positives/negatives too. QTGMC().SelectOdd() may need to be changed QTGMC().SelectEven() to prevent duplicates frames in some cases. Deciding on how to determine which is a project for another day (and a clip that needs it). And remove the Subtitle() calls for the final production. -
################################################## ########################
#
# Abs(v1-v2), Y channel only
#
################################################## ########################
function AbsSubtractY(clip v1, clip v2)
{
Subtract(v1, v2).ColorYUV(off_y=2)
Overlay(last.ColorYUV(off_y=-128), last.Invert().ColorYUV(off_y=-127), mode="add")
GreyScale()
}
################################################## ########################
src=Mpeg2Source("F:\BABYLON5\Season 4\4x03 - The Summoning.d2v").ConvertToYV12(interlaced=true).kil laudio()
q=QTGMC(src).SelectOdd()
sep=SeparateFields(src)
eodiff=AbsSubtractY(sep.SelectEven(), sep.SelectOdd()) # difference between even and odd files of each frame
cc=ConditionalFilter(last, q, last, "IsCombedTIVTC(cthresh=9)") # substitute q if frame is combed
cs=ConditionalFilter(eodiff, q, last, "AverageLuma()", "lessthan", "1.2") # substitute q if fields are the same
S1=StackHorizontal(\
subtitle(src, "Source", size=24, align=4),\
subtitle(q, "qtgmc", size=24, align=4)\
)
S2=StackHorizontal(\
subtitle(cc, "combed fields", size=24, align=4),\
subtitle(cs, "same fields", size=24, align=4)\
)
output=StackVertical(S1,S2)
Return output
Any solution?
How exactly are you identifying differences in each frames?
I was thinking of using IsCombedTIVTC(mi=?) in both conditionalfilter.
I had some dvd extras that i wanted to incorporate in the main video. The extras interlaced vid was diabolical and used TFM to identify the correct fields. Sometimes is was same frame aka clean frames or matching previous field or next field or using one field then interpolate. The MI value were very reliable in detecting combed frames. Perhaps i am wrong but i suspect more reliable in using colours. -
I couldn't duplicate the error. I cut/pasted the script from your post, just changing the source filename. It ran with no problems.
I'm not sure what you mean. Combing is detected with IsCombedIVTC. Duplicate fields within a frame are detected by subtracting one field from the other.
That won't work for a frame where the two fields are identical (the second conditional filter). There's no combing in those frames.
Use whatever works best for you. -
Did you use vdub2?
Ok what dll files do i need for avisynth plugins folders as perhaps i am missing some files. Most are internal except for qtgmc and tivtc which i already have.
I'm not sure what you mean. Combing is detected with IsCombedIVTC. Duplicate fields within a frame are detected by subtracting one field from the other.[/QUOTE]
I referring to your function. -
Yes, I used AviSynth+ and VirtualDub2 to preview the script, x264 CLI to encode -- all 64 bit. But I just tried 32 bit versions and they ran fine too. Try changing the "cc=ConditionalFilter(...)" line to just "cc=last". That will eliminate IsCombedTIVTC from the equation. The script won't perform its intended function but it may help you narrow down the possibilities.
AbsSubtractY() uses AviSynth's built in subtract filter to subtract one image from the other (in this case the top and bottom fields) and return the absolute value of the differences (just the Y channel). Essentially abs(a-b) on a pixel by pixel basis. The result is a greyscale image where identical pixels are black, non-identical pixels are not black, the bigger the difference the brighter the pixel. For example, if the pixel at X,Y in the first image a has a Y value of 100 and the pixel at the same location has a 90, the difference is 10. If the first image is 90 and the second image is 100 the difference also 10. You can always look at the resulting image to see what it looks like. eg "return(eodiff)" any time after it's calculated. You may want to brighten it because most of it will be very dark, "return(eodiff.ColorYUV(gain_y=1000))" -
cc=last - tried that and the error moved to the next line 25 cs=blah blah.
I'm going to restart my pc later and see if that will fix it. -
Oh wait! I see what's wrong with your script. I accidentally fixed it when I substituted my source line for yours. Change your source line:
Code:src=Mpeg2Source("F:\BABYLON5\Season 4\4x03 - The Summoning.d2v").ConvertToYV12(interlaced=true).kil laudio()
Code:src=Mpeg2Source("F:\BABYLON5\Season 4\4x03 - The Summoning.d2v").ConvertToYV12(interlaced=true).kil laudio() last=src
-
-
Most AviSynth filters take an input clip and produce an output clip. If you don't specify a clip by name AviSynth assumes the name "last".
In my script the first conditional filter takes the original video and replaces all the interlaced frames with a QTGMC frame. Then the output of that filter has the frames with duplicate fields replaced with a QTGMC frame. The end result is single clip where all the interlaced frames and all the dup-field frames have been replaced by a QTGMC frame.
Your script produces two clips, cc with only the interlaced frames replaced, and cs with only the dup-field frames replaced. It never produces a clip with both types of frames replaced. -
Does this work the same as yours?
################################################## ########################
#
# Abs(v1-v2), Y channel only
#
################################################## ########################
function AbsSubtractY(clip v1, clip v2)
{
Subtract(v1, v2).ColorYUV(off_y=2)
Overlay(last.ColorYUV(off_y=-128), last.Invert().ColorYUV(off_y=-127), mode="add")
GreyScale()
}
################################################## ########################
src=Mpeg2Source("F:\BABYLON5\Season 4\4x03 - The Summoning.d2v").ConvertToYV12(interlaced=true).kil laudio()
q=QTGMC(src).SelectOdd()
sep=SeparateFields(src)
eodiff=AbsSubtractY(sep.SelectEven(), sep.SelectOdd()) # difference between even and odd files of each frame
cc=ConditionalFilter(src, q, src, "IsCombedTIVTC(cthresh=9)", show=true) # substitute q if frame is combed
cs=ConditionalFilter(eodiff, q, cc, "AverageLuma()", "lessthan", "1.2", show=true) # substitute q if fields are the same
S1=StackHorizontal(\
subtitle(src, "Source", size=24, align=4),\
subtitle(q, "qtgmc", size=24, align=4)\
)
S2=StackHorizontal(\
subtitle(cc, "combed fields", size=24, align=4),\
subtitle(cs, "same fields", size=24, align=4)\
)
output=StackVertical(S1,S2)
Return output
#return(eodiff.ColorYUV(gain_y=1000))
#Return q -
That should give the same result. Regarding the show=true problem, use only one of them at a time.
-
It's an easy fix for that series. I worked on that show before. No matter what deinterlacer or decomb filter I used, those would not go away. A solution was suggested to me, and it worked perfectly.
Just use this.
santiag(strv=0, nns=4, nsize=5)Last edited by killerteengohan; 30th Dec 2021 at 04:28.
Similar Threads
-
PAL DVD - Progressive video but telecined frames during shaking sequences
By GlitchBob in forum Newbie / General discussionsReplies: 4Last Post: 22nd Mar 2021, 18:06 -
Fix Telecined Fades
By ZetaStax in forum Video ConversionReplies: 3Last Post: 10th Jul 2019, 11:03 -
AVI files severely corrupted.
By rdg2000 in forum Newbie / General discussionsReplies: 1Last Post: 6th Mar 2019, 13:19 -
Avisynth fix Chroma artifacts in PAL DVD CGI cartoon
By Wizard81 in forum RestorationReplies: 1Last Post: 11th Oct 2018, 10:47 -
Fix duplicate frames on old digicam video
By Homestar in forum RestorationReplies: 13Last Post: 25th Dec 2017, 00:15