Some frames had minor combing and TFM decided to deinterlace generating aliasing artifacts. By raising CThresh you convinced it not deinterlace and let the combing through.
For example, in S3.E14-FuturamaTestClip2.m1v, after Interleave(TFM...TFM) at frame 142 you'll see:
There are combing artifacts in the first guy's mouth and the third guys eyes. That's because of the fading titles which can't be matched to any of the fields around it. Following that with TFM(field=0) gives:
TFM decided to deinterlace the frame but now you have aliasing artifacts. Using a higher CThresh value causes TFM to let that through with combing intact (as in the first image). Further processing might have blurred the combing artifacts together (vInverse) or dropped the frame completely (TDecimate, SRestore). Or maybe you just didn't notice it.
One way around that problem is to use another deinterlacer like Yadif(). Unfortunately, Yadif() will damage non-interlaced frames at times. But there is a way to only use it when TFM detects residual combing:
This way, TFM will use the Yadif deinterlaced clip rather than its own deinterlacer -- but only when it detects residual combing from the earlier Interleave(tfm, tfm).Code:Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(field=0, clip2=Yadif()) vInverse() SRestore(23.976)
+ Reply to Thread
Results 31 to 49 of 49
-
-
By the way, that fix won't work for places where the source already has aliasing from a crude bob deinterlace (like the ATM shot).
-
Thank you for the explanation
. My Trim test of the Globtrotters title sequence with the script from Post #30 had neither combing artifacts nor aliasing (that's actually the episode that led me to the CThresh=23 "fix" after an earlier batch of SelectRangeEvery(66,1000) encodes were riddled with aliasing), so vInverse and-or SRestore must've hooked me up. After running a dozen title sequence Trim tests I've learned that the fade in-out aliasing is more prevalent than I'd thought (although not to the extent where it's super annoying, just a wee bit annoying). So, I'll try jagabo's Yadif Trick©®, without the CThresh=23, and run some more tests.
Thanks for the reminder. Unfortunately there are quite a few spots where this is the case, but usually they're single frames or short bursts of non-contiguous frames so it's much less annoying than the aliasing. Damn lazy Futurama videographers...Last edited by LouieChuckyMerry; 3rd May 2016 at 03:32. Reason: Syntax!
-
After running the same dozen (3 from each of the 4 seasons) title sequence Trim tests with jagabo's Yadif Trick©®, the only difference I could find was with this short section in episode 13 of season 4. The lane lines on the track look a bit warped with "TFM(Field=0,Clip2=Yadif())" but not with "TFM(Field=0,CThresh=23)".
It seems to me that, overall, the line with Yadif should be better than "cheating" with CThresh=23 but, given that I thought aliasing was combing artifacts, any knowledgeable input would be much appreciated.
-
Any deinterlacer is going to be confused by those thin horizontal lines. You'll just have to special case shots like that. Just TFM(pp=0).TDecimate() works for that shot since there are no other irregularities.
-
Good point, thanks. I figure that any episode with a title sequence that proves sufficiently annoying can be run a second time with any such tweaks as necessary. On that note, my memory tells me that it's possible to use Trim not only to encode a single section of a source but also to encode sections within a source using different parameters that are then output together to form the whole source. Right
. What I mean is, do I remember correctly that there's a syntax using Trim that basically encodes contiguous sections of the source, determined by Trim, with different AviSynth arguments for each section, then spits them out the correct length as the source, the end result being the same as running multiple Trims with different filters then appending them in a muxer? Searching, searching...
P.S.--I ran a half dozen full episodes overnight with the "final" Yadif script and a quick perusal is very promising.
Edit: I checked the six full episode title sequences using the Yadif script and compared any bad frame(s) to the CThresh=23 title sequence encodes; on the whole they're frame-for-frame identical, with occasional places where a single aliased frame from one is a different single aliased frame in the other. They look really, really good, leagues better than encodes with earlier scripts. Thanks, jagabo.
So, unless something drastic occurs, as of now the, er, Final* Script is:
Code:### Deinterlace-Match Fields-Decimate ### LoadPlugin("SourcePath/TIVTC.dll") AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(Field=0,Clip2=Yadif()) vInverse() SRestore(23.976) ### Adjust Color ### SmoothTweak(Saturation=1.06) ### Crop ### Crop(8,0,-8,0) ### Gibbs Noise Block ### Edge=MT_Edge("prewitt",ThY1=20,ThY2=40).RemoveGrain(17) Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor") MT_Merge(Minblur(),Mask,Luma=True) ### Overall Temporal Denoise ### SMDegrain(TR=1,ThSAD=200,ContraSharp=True,RefineMotion=True,Plane=0,PreFilter=2,Chroma=False,Lsb=True,Lsb_Out=True) ### Resize ### LinearResize(640,480,Kernel="Bicubic",A1=-0.5,A2=0.25,Lsb_In=True,Lsb_Out=True) ### Darken-Thin Lines ### F=DitherPost(Mode=-1) S=F.FastLineDarkenMod(Strength=24,Prot=6).aWarpSharp2(Blur=4,Type=1,Depth=2,Chroma=2) D=MT_MakeDiff(S,F).Dither_Convert_8_To_16() Dither_Add16(Last,D,Dif=True,U=2,V=2) ### Deband ### GradFun3(Radius=16,ThR=0.55,SMode=2,StaticNoise=True,Lsb_In=True,Lsb=True) ### Preview Source OR Send 16-bit Output To x264 10-bit ### ## Trim() # SelectRangeEvery(1000,66) # DitherPost() Dither_Out()
Also, if encoding with x264 10-bit, add the following to the command line
Code:--demuxer raw --input-depth 16 --input-res 640x480 --fps 23.976 --sar 1:1
.
Last edited by LouieChuckyMerry; 18th Aug 2016 at 09:41. Reason: Information³
-
Yes, you can use trim to create sections and treat them separately.
Code:source = WhateverSource("filename.ext") v1=source.Trim(0,1000).FilterChain1() v2=source.Trim(1001,0).FilterChain2() v1++v2
Code:source = WhateverSource("filename.ext") v1=source.FilterChain1() v2=source.FilterChain2() ReplaceFramesSimple(v1, v2, mappings="[0 1000]")
-
Ahhh, yes, the first example is what I remember reading about once, way back when. For an example like the lane lines on the racetrack, using frame numbers from the actual full episode source, in the script
Code:Source=WhateverSource("S4.E13-OriginalSourceVideo.m2v") V1=Source.Trim(0,792).FilterChain1() V2=Source.Trim(793,930).FilterChain2() V3=Source.Trim(931,0).FilterChain1() V1++V2++V3
-
If you're having trouble figuring out how to do all the filter on one line, you can also do it like this:
Code:source = WhateverSource("filename.ext") source.Trim(0,792) filter1() filter2() v1=filter3() source.Trim(793,930) filter4() filter5() v2=filter6() source.Trim(931,0) filter1() filter2() v3=filter3() v1++v2++v3
-
Thanks, I think with the number of filters in this particular script the above method is much simpler for me to negotiate. The only thing (right now, ha ha) I don't understand are the Vx=FilterX() lines. The Source=WhateverSource("Filename.ext"), Source.Trim(X,Y), and FilterX() seemingly make sense, but I can't figure out why the Vx's equal filters. More searching is necessary...
P.S.--I ran some more full episodes last night and they look great. The only problems are the infrequent aliased frame(s) at the title fades and those evil occasional aliased and-or blended frame(s) from the lazy videographers. Thank you again! -
Most filters in AviSynth take in input stream and produce an output stream. When you don't specify a stream by name the name "last" is used. So a sequence like:
Code:source.Trim(0,792) filter1() filter2() v1=filter3()
Code:last = Trim(source,0,792) last = filter1(last) last = filter2(last) v1=filter3(last)
The next two sections work similarly producing v2 and v3. Finally, v1, v2, and v3 are appended.Last edited by jagabo; 6th May 2016 at 06:31.
-
OK OK, now I understand (I'm only a bit slow
). Thank you very much for the clear explanation, jagabo
. I'll now try to build a simple version, with single filters, then expand to the entire shebang. Ahhh, Happy Saturday
Edit:
This seemingly worked perfectly (I truncated the last Trim for testing purposes)
Code:LoadPlugin("SourcePath\DGDecodeNV.dll") Source=DGSource("D:\Temp\[0000]ReEncTemp\Futurama[S]{1999-}[480p+]\Futurama-S4[S][Commentary]{2002-03}[480p][JSLIII]\S4.E13-BendHer[S][Commentary][480p]\S4.E13-Original[]-.dgi") LoadPlugin("SourcePath\TIVTC.dll") Source.Trim(0,792) ### Deinterlace-Match Fields-Decimate ### AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(Field=0,Clip2=Yadif()) vInverse() SRestore(23.976) ### Adjust Color ### SmoothTweak(Saturation=1.06) ### Crop ### Crop(8,0,-8,0) ### Gibbs Noise Block ### Edge=MT_Edge("prewitt",ThY1=20,ThY2=40).RemoveGrain(17) Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor") MT_Merge(Minblur(),Mask,Luma=True) ### Overall Temporal Denoise ### SMDegrain(TR=1,ThSAD=200,ContraSharp=True,RefineMotion=True,Plane=0,PreFilter=2,Chroma=False,Lsb=True,Lsb_Out=True) ### Resize ### LinearResize(640,480,Kernel="Bicubic",A1=-0.5,A2=0.25,Lsb_In=True,Lsb_Out=True) ### Darken-Thin Lines ### F=DitherPost(Mode=-1) S=F.FastLineDarkenMod(Strength=24,Prot=6).aWarpSharp2(Blur=4,Type=1,Depth=2,Chroma=2) D=MT_MakeDiff(S,F).Dither_Convert_8_To_16() Dither_Add16(Last,D,Dif=True,U=2,V=2) ### Deband ### GradFun3(Radius=16,ThR=0.55,SMode=2,StaticNoise=True,Lsb_In=True,Lsb=True) ### Preview Source OR Send 16-bit Output To x264 10-bit ### ## Trim() # SelectRangeEvery(1000,66) # DitherPost() V1=Dither_Out() Source.Trim(793,930) ### Deinterlace-Match Fields-Decimate ### AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(PP=0) vInverse() SRestore(23.976) ### Adjust Color ### SmoothTweak(Saturation=1.06) ### Crop ### Crop(8,0,-8,0) ### Gibbs Noise Block ### Edge=MT_Edge("prewitt",ThY1=20,ThY2=40).RemoveGrain(17) Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor") MT_Merge(Minblur(),Mask,Luma=True) ### Overall Temporal Denoise ### SMDegrain(TR=1,ThSAD=200,ContraSharp=True,RefineMotion=True,Plane=0,PreFilter=2,Chroma=False,Lsb=True,Lsb_Out=True) ### Resize ### LinearResize(640,480,Kernel="Bicubic",A1=-0.5,A2=0.25,Lsb_In=True,Lsb_Out=True) ### Darken-Thin Lines ### F=DitherPost(Mode=-1) S=F.FastLineDarkenMod(Strength=24,Prot=6).aWarpSharp2(Blur=4,Type=1,Depth=2,Chroma=2) D=MT_MakeDiff(S,F).Dither_Convert_8_To_16() Dither_Add16(Last,D,Dif=True,U=2,V=2) ### Deband ### GradFun3(Radius=16,ThR=0.55,SMode=2,StaticNoise=True,Lsb_In=True,Lsb=True) ### Preview Source OR Send 16-bit Output To x264 10-bit ### ## Trim() # SelectRangeEvery(1000,66) # DitherPost() V2=Dither_Out() Source.Trim(931,1500) ### Deinterlace-Match Fields-Decimate ### AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(Field=0,Clip2=Yadif()) vInverse() SRestore(23.976) ### Adjust Color ### SmoothTweak(Saturation=1.06) ### Crop ### Crop(8,0,-8,0) ### Gibbs Noise Block ### Edge=MT_Edge("prewitt",ThY1=20,ThY2=40).RemoveGrain(17) Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor") MT_Merge(Minblur(),Mask,Luma=True) ### Overall Temporal Denoise ### SMDegrain(TR=1,ThSAD=200,ContraSharp=True,RefineMotion=True,Plane=0,PreFilter=2,Chroma=False,Lsb=True,Lsb_Out=True) ### Resize ### LinearResize(640,480,Kernel="Bicubic",A1=-0.5,A2=0.25,Lsb_In=True,Lsb_Out=True) ### Darken-Thin Lines ### F=DitherPost(Mode=-1) S=F.FastLineDarkenMod(Strength=24,Prot=6).aWarpSharp2(Blur=4,Type=1,Depth=2,Chroma=2) D=MT_MakeDiff(S,F).Dither_Convert_8_To_16() Dither_Add16(Last,D,Dif=True,U=2,V=2) ### Deband ### GradFun3(Radius=16,ThR=0.55,SMode=2,StaticNoise=True,Lsb_In=True,Lsb=True) ### Preview Source OR Send 16-bit Output To x264 10-bit ### ## Trim() # SelectRangeEvery(1000,66) # DitherPost() V3=Dither_Out() V1++V2++V3
This leaves me with a final (ha ha ha) question: Is there any way to make the above script more concise? It seems to me that I should be able to define the portion of the script that's the same for all the parts--everything from vInverse to GradFun3--into a single variable that I can then more easily call. I've been poking through the AviSynth Wiki (ouch) and searching, but I'm most likely using the wrong terms. More searching...Last edited by LouieChuckyMerry; 7th May 2016 at 02:38. Reason: Information!
-
Into a function:
Code:function CleanUp(clip c) { c.vInverse() SRestore(23.976) ### Adjust Color ### SmoothTweak(Saturation=1.06) ### Crop ### Crop(8,0,-8,0) ### Gibbs Noise Block ### Edge=MT_Edge("prewitt",ThY1=20,ThY2=40).RemoveGrain(17) Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor") MT_Merge(Minblur(),Mask,Luma=True) ### Overall Temporal Denoise ### SMDegrain(TR=1,ThSAD=200,ContraSharp=True,RefineMotion=True,Plane=0,PreFilter=2,Chroma=False,Lsb=True,Lsb_Out=True) ### Resize ### LinearResize(640,480,Kernel="Bicubic",A1=-0.5,A2=0.25,Lsb_In=True,Lsb_Out=True) ### Darken-Thin Lines ### F=DitherPost(Mode=-1) S=F.FastLineDarkenMod(Strength=24,Prot=6).aWarpSharp2(Blur=4,Type=1,Depth=2,Chroma=2) D=MT_MakeDiff(S,F).Dither_Convert_8_To_16() Dither_Add16(Last,D,Dif=True,U=2,V=2) ### Deband ### GradFun3(Radius=16,ThR=0.55,SMode=2,StaticNoise=True,Lsb_In=True,Lsb=True) ### Preview Source OR Send 16-bit Output To x264 10-bit ### ## Trim() # SelectRangeEvery(1000,66) # DitherPost() }
Code:Source.Trim(0,792) ### Deinterlace-Match Fields-Decimate ### AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(Field=0,Clip2=Yadif()) CleanUp()
-
That's so awesome, I feel like a little kid who just figured out how to tie his shoes
. I tried to create a function when I perused the AviSynth Wiki but I couldn't get it to work. Now that I've a working example I can reverse engineer it and actually learn something. Then I can apply that knowledge to my older, live action movies that suffer from varying degrees of noise, scene to scene, because (I think) of the different film stocks used depending on the lighting conditions. Thank you, jagabo
.
Of course, I've another question if you've time. I'm curious about these two test clips, S2.E2-FuturamaTestClip[Fixable] and S2.E5-FuturamaTestClip[Fixable]. It seems to me that the S2.E5 clip can't be fixed because it's during the title sequence, but what about the S2.E2 clip? I guess my question is, if you preview the clip (or any section of a source, for that matter) frame-by-frame, then how can you tell if the problem is with the script or the source? That is, what would one look for? Or is the question is too general to be answered? Thanks.
Edit: In case this is useful to someone someday, this is a reasonably functional template
Code:LoadPlugin("SourcePath/WhateverSource.dll") Source=WhateverSource("SourcePath") LoadPlugin("SourcePath\TIVTC.dll") ################################################# Function SharedScript(Clip C) { ### Deinterlace-Match Fields-Decimate ### C.vInverse() SRestore(23.976) ### Adjust Color ### SmoothTweak(Saturation=1.06) ### Crop ### Crop(8,0,-8,0) ### Gibbs Noise Block ### Edge=MT_Edge("prewitt",ThY1=20,ThY2=40).RemoveGrain(17) Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor") MT_Merge(Minblur(),Mask,Luma=True) ### Overall Temporal Denoise ### SMDegrain(TR=1,ThSAD=200,ContraSharp=True,RefineMotion=True,Plane=0,PreFilter=2,Chroma=False,Lsb=True,Lsb_Out=True) ### Resize ### LinearResize(640,480,Kernel="Bicubic",A1=-0.5,A2=0.25,Lsb_In=True,Lsb_Out=True) ### Darken-Thin Lines ### F=DitherPost(Mode=-1) S=F.FastLineDarkenMod(Strength=24,Prot=6).aWarpSharp2(Blur=4,Type=1,Depth=2,Chroma=2) D=MT_MakeDiff(S,F).Dither_Convert_8_To_16() Dither_Add16(Last,D,Dif=True,U=2,V=2) ### Deband ### GradFun3(Radius=16,ThR=0.55,SMode=2,StaticNoise=True,Lsb_In=True,Lsb=True) ### Preview Source OR Send 16-bit Output To x264 10-bit ### ## Trim() # SelectRangeEvery(1000,66) # DitherPost() Dither_Out } ################################################# Source.Trim(0,) ### Deinterlace-Match Fields-Decimate ### AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(Field=0,Clip2=Yadif()) V1=SharedScript() ################################################# Source.Trim(,) ### Deinterlace-Match Fields-Decimate ### AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(PP=0) V2=SharedScript() ################################################# Source.Trim(,0) ### Deinterlace-Match Fields-Decimate ### AssumeTFF() TFM(Chroma=False,PP=0) AssumeBFF() Interleave(TFM(Mode=1,PP=0,Field=1),TFM(Mode=1,PP=0,Field=0)) TFM(Field=0,Clip2=Yadif()) V3=SharedScript() ################################################# V1++V2++V3
EditEdit: Oops, forgot Dither_Out...Last edited by LouieChuckyMerry; 13th May 2016 at 21:20. Reason: I Can't Spel; I Forgot "Dither_Out"
-
To analyze a source you can view it unfiltered. In your clips you'll see frames with combing artifacts where there is motion and aliasing artifacts where there is no motion. That's an indication that the shot was bob deinterlaced and the same field repeated to slow the video, or fields dropped to speed it up. You can apply a simple bob and look for blended fields.
-
-
-
Similar Threads
-
Progressive source has interlacing lines in the video?
By killerteengohan in forum RestorationReplies: 9Last Post: 21st Mar 2015, 21:43 -
Dot Crawl Artifacts from Composite Source?
By Ish Kabibble in forum Capturing and VCRReplies: 9Last Post: 20th Mar 2015, 06:48 -
Progressive Segm.Frame video to real progressive videos in PREMIERE PRO CS5
By Stears555 in forum EditingReplies: 4Last Post: 3rd Mar 2013, 14:43 -
Determine original framerate of progressive source
By bobp127001 in forum Video ConversionReplies: 8Last Post: 2nd Mar 2013, 15:52 -
Removing jagged interlacing artifacts from a progressive file?
By tfolder in forum RestorationReplies: 13Last Post: 17th Mar 2011, 04:19