Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#201 | Link | |
Registered User
Join Date: Apr 2019
Posts: 183
|
Quote:
What I meant was something like this. If EOS=True Then nextframe=SOS (not relying on maths but a fact that SOS must be after EOS. Accept for start of video of course.) Else end of video. |
|
![]() |
![]() |
![]() |
#202 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
But if its wrong, then they're both then wrong.
And if SOS detected and not EOS, then how does it go back and make EOS true on previous frame [its already gone past it]. There is no easy solution testing only 3 frame, prev,curr,next, and testing 2 prev, curr, 2 next aint without its own problems either.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 17th October 2021 at 00:00. |
![]() |
![]() |
![]() |
#203 | Link | |
Registered User
Join Date: Apr 2019
Posts: 183
|
Quote:
If SOS is detected but not previous frame as EOS then there is no SOS. For scene change to be true there must be EOS and SOS. It can't be either or none. |
|
![]() |
![]() |
![]() |
#204 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
Quote:
If you dont like'em, there are others to choose from:- http://avisynth.nl/index.php/SCDetec...ange_Detection
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
![]() |
![]() |
![]() |
#205 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
You could add the VapourSynth code version to the first post. I'll remove it from my code but don't want this to get lost.
In VapourSynth, it currently only works with the 32-bit library. The dubhater library has a bug. Code:
# SpotLess denoising method (m1=4) EXPERIMENTAL def SpotLess(c: vs.VideoNode, radt: int = 1, thsad: int = 10000, thsad2: Optional[int] = None, pel: int = 2, chroma: bool = True, blksize: int = 8, overlap: Optional[int] = None, truemotion: bool = True, pglobal: bool = True, blur: float = 0.0, ref: Optional[vs.VideoNode] = None) -> vs.VideoNode: if radt < 1 or radt > 3: raise ValueError("Spotless: radt must be between 1 and 3") if not pel in [1, 2, 4]: raise ValueError("Spotless: pel must be 1, 2 or 4") thsad2 = thsad2 or thsad icalc = c.format.bits_per_sample < 32 S = core.mv.Super if icalc else core.mvsf.Super A = core.mv.Analyse if icalc else core.mvsf.Analyse C = core.mv.Compensate if icalc else core.mvsf.Compensate pad = max(blksize, 8) sup = ref or (c.std.Convolution(matrix=[1, 2, 1, 2, 4, 2, 1, 2, 1]) if blur > 0.0 else c) sup = S(sup, hpad=pad, vpad=pad, pel=pel, sharp=2) sup_rend = S(c, hpad=pad, vpad=pad, pel=pel, sharp=2, levels=1) if ref or blur > 0.0 else sup th1 = thsad th2 = (thsad + thsad2)/2 if radt==3 else thsad2 th3 = thsad2 bv1 = A(sup, isb=True, delta=1, blksize=blksize, overlap=overlap, chroma=chroma, truemotion=truemotion, pglobal=pglobal) fv1 = A(sup, isb=False, delta=1, blksize=blksize, overlap=overlap, chroma=chroma, truemotion=truemotion, pglobal=pglobal) if radt >= 2: bv2 = A(sup, isb=True, delta=2, blksize=blksize, overlap=overlap, chroma=chroma, truemotion=truemotion, pglobal=pglobal) fv2 = A(sup, isb=False, delta=2, blksize=blksize, overlap=overlap, chroma=chroma, truemotion=truemotion, pglobal=pglobal) if radt >= 3: bv3 = A(sup, isb=True, delta=3, blksize=blksize, overlap=overlap, chroma=chroma, truemotion=truemotion, pglobal=pglobal) fv3 = A(sup, isb=False, delta=3, blksize=blksize, overlap=overlap, chroma=chroma, truemotion=truemotion, pglobal=pglobal) bc1 = C(c, sup_rend, bv1, thsad=th1) fc1 = C(c, sup_rend, fv1, thsad=th1) if radt >= 2: bc2 = C(c, sup_rend, bv2, thsad=th2) fc2 = C(c, sup_rend, fv2, thsad=th2) if radt >= 3: bc3 = C(c, sup_rend, bv3, thsad=th3) fc3 = C(c, sup_rend, fv3, thsad=th3) ic = core.std.Interleave([bc1, c, fc1]) if radt == 1 else \ core.std.Interleave([bc2, bc1, c, fc1, fc2]) if radt == 2 else \ core.std.Interleave([bc3, bc2, bc1, c, fc1, fc2, fc3]) output = core.tmedian.TemporalMedian(ic, radius=radt) return output.std.SelectEvery(radt*2+1, radt) # Return middle frame |
![]() |
![]() |
![]() |
#206 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
How bout I put link to it in 1st post.
I dont speak python/vapoursynth, so it means little to me and I dont really want to be tip-toe-ing around it, wondering why its there. EDIT: Put link in first post.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 17th October 2021 at 17:32. |
![]() |
![]() |
![]() |
#208 | Link |
Registered User
Join Date: Apr 2019
Posts: 183
|
Hey Stainless, s 3 ep17 war without end f 8013 to 8215 is weird. Had to do that from vob again using assume bff to get it right. Any idea why this happen in the first place? Had this in an earlier ep in s3, can't remember which now.
|
![]() |
![]() |
![]() |
#209 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
Is that the sequence starting with subs "Special guest star Michael O'hare".
Seems progressive in my VOB, no jumping with AssumeTFF or AssumeBFF. [EDIT: Assume??? then SeparateFields]
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
![]() |
![]() |
![]() |
#212 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
S05E18, Disk 5, ep Clip2, - "The Fall of Centauri Prime".
is 42:21 ![]() EDIT: Quote:
38:42 is a time, not file size and teaser is part of the clip. OK, cutting out all of "teaser", and starting at first frame of B5 intro/credits with first frame showing very small but distinct "2258", [frame before is black] leaves 58024 frames, 38:40.96 duration. [but it depends upon where you cut the black sequence - I cut on very first visible "2258" so you should get exactly the same if cut at that point] EDIT: My season 5 is not boxed version as my other seasons, is single DVD case with multiple flip disk holders (6).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 1st December 2021 at 01:20. |
|
![]() |
![]() |
![]() |
#213 | Link |
Registered User
Join Date: Apr 2019
Posts: 183
|
Well it seems my dvd got a defect. Tried other software and can't read it. Tried vdub and as soon as i move to the first frame it crashes.
If you have time could you upload the missing vob clip up to the first keyframe of intro for me. Cheers. Last edited by coolgit; 1st December 2021 at 11:25. |
![]() |
![]() |
![]() |
#214 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
Check PM.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
![]() |
![]() |
![]() |
#215 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
Any of you mask wizards out there improve on this ?
Code:
AviSourcE(".\somefile.avi") ConvertToYV24 #ConvertBits(16) Src=Last Filtered=SpotLess(RadT=2) YTH8 = 12 CTH8 = 12 CAMP = True SHOW = True SpotTest(Src,Filtered,YTH8,CTH8,CAMP,SHOW) Return Last.ConvertToRGB32 /* SpotTest(), Purpose: Spotless produces frame global changes [most pixels are changed], here we want to try alter only real spots where there is significant change in spotless Y [by YTh8] and also that are near grey in source [by CTh8], these targeted pixels are then overlayed from Spotless result onto original src. Src, Pre-Spotless source Filtered, Spotless result YTh8, threshold for Y in 8 bit range. CTh8, threshold for Chroma in 8 bit range. CAMP, If True amplify chroma MaskC when Show Show, Show Masks. Mask is the final mask made from MaskY and MaskC. */ Function SpotTest(clip Src,clip Filtered,int "YTh8",int "Cth8",Bool "AmpC",Bool "Show") { # 8 -> 16 bit YUV444 only YTh8 = Default(YTh8,12) CTh8 = Default(CTh8,12) AmpC = Default(AmpC,True) Show = Default(Show,False) try {bpc = Src.BitsPerComponent} catch(msg) {bpc=8} try {Y444=Src.IsYV24||Src.Is444} catch(msg) {Y444=false} Assert(Y444,"SpotTest: Must be YV24/YUV444") YTh = BitLShift(YTh8,bpc-8) CTh = BitLShift(YTh8,bpc-8) MaskY = Mt_Lutxy(Src.ExtractY,Filtered.ExtractY,"x y - abs " + String(YTh) + " > range_max 0 ?") # "(abs(x-y) > YTh) ? range_max : 0" MU = Mt_Lut(Src.ExtractU,"x range_half - abs") # "abs(x - range_half)" MV = Mt_Lut(Src.ExtractV,"x range_half - abs") # "abs(x - range_half)" MaskC = Mt_Lutxy(MU,MV,"x x * y y * + 0.5 ^") # "((x^2)+(y^2)) ^ 0.5" # 2D chroma (by Pythagoras) Mask = Mt_Lutxy(MaskC,MaskY,"x " + string(CTh) + " < y 0 ?") # "(x < CTh) ? y : 0 Mask = Mask.mt_Expand.Blur(1.0) MaskC = (!AmpC) ? MaskC : MaskC.mt_lut("x 8 *") # 2D chroma Amp'ed for view if AmpC Overlay(Src,Filtered,Mask=Mask,Opacity=1.0) CGREY = Mask.Mt_lut("range_half") TOP=StackHorizontal(Src.Subtitle("Src"),Filtered.Subtitle("Filt"),YtoUV(CGrey,CGrey,MaskY).Subtitle("MaskY")) BOT=StackHorizontal(Last.Subtitle("Result"),YtoUV(CGrey,CGrey,Mask).Subtitle("Mask"),YtoUV(CGrey,CGrey,MaskC).Subtitle((AmpC)?"MaskC Amp'ed":"MaskC")) STK = StackVertical(TOP,BOT) (Show) ? STK : Last }
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 18th December 2021 at 22:02. |
![]() |
![]() |
![]() |
#216 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,180
|
It might be obvious but maybe looking into current algorithms (Wiki) can provide some insight. I plan to give it a stab in a few weeks.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
![]() |
![]() |
![]() |
#217 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
Thanks doggie, looks like Gobble-De-Gook to me though.
Above script does pretty well with VOB where looks like original film stock had emulsion chipped off (or something), white-ish dots every now and then. [will undergo further processing and did not want to overdo it with spotless - RADT=2 was just to make it more difficult test (with repaired disappearing arm ), RADT=1 is quite sufficient for my clip] Just tried with dirty home movie where various color dirt, not so good. Anyways, I think it does pretty much exactly as I want for current clip, and really quite simple. EDIT: Here, two frames from very jerky InGoldie clip that you might remember [boy in purple throws ball in the air, Spotless removes it but we use original source pixels not spotless result]. [no white spots for demo here] ![]() ![]()
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 18th December 2021 at 23:44. |
![]() |
![]() |
![]() |
#219 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,571
|
Quote:
MaskY is white where change in pixel Y [for src->spotless] is > YTh, MaskC is amount Chroma in SOURCE pixels [*8 Amplified in images for view only], will only overlay with Spotless pixels where MaskC is < CTh and MaskY = white. Code:
Mask = Mt_Lutxy(MaskC,MaskY,"x " + string(CTh) + " < y 0 ?") # "(x < CTh) ? y : 0 # x is MaskC pixel and y = corresponding MaskY pixel (we are selecting what we want rather than restoring what we dont want) There are not usually that many white dots on final mask, probably down to all them there daisies.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 19th December 2021 at 02:39. |
|
![]() |
![]() |
![]() |
Tags |
denoise, despot, prefilter |
Thread Tools | Search this Thread |
Display Modes | |
|
|