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. |
![]() |
#81 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
I think I cocked up the initial post, and removed a ",8" after the matrix string, maybe you took a copy before I fixed it.
Anyways, here a comparison, top is result - Original [should be mid grey-ish], bottom is same but differences amplified GREATLY, maximum amp'ed. You can see that the light lines have been modified, and are darker, meaning darker than original, as intended. It does produce global frame changes, as does most denoise type processing. Code:
Avisource("SH_2_secs.avi.avi") # Did not have codec for FOURCC, redid in ffmpeg to UT_Video so AVI.AVI ConvertToYV24 O=Last GeneralConvolution(0, " 1 0 1 2 4 2 1 0 1 ") D1=ClipDelta(Last,O,false) D2=ClipDelta(Last,O,true) StackVertical(D1,D2) # Top Subtract, bottom amplified Return last # Return Clip Difference of input clips (amp==true = Amplified, show==true = show background) Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") { amp=Default(amp,false) show=Default(show,false) c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale() c1=clip1.subtract(clip2) c1=(amp)?c1.levels(127,1.0,129,0,255):c1 return (show)?c1.Merge(c2):c1 } ![]() Pretty much all avisynth scripts, can of course by loaded into Megui main screen top input Avisynth Script editbox. [or just view in eg VDub2]
__________________
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; 27th July 2021 at 12:49. |
![]() |
![]() |
![]() |
#82 | Link |
Registered User
Join Date: Apr 2019
Posts: 194
|
StainMoreH
![]() ![]() Will try your new script later. Just played with photoshop (36 action commands) a bit more and boooooom, i manage to remove the white line in 98% of all the frames. Just a small 1 pixel thin, about 10 pixel high, line in some obscure location. At normal zoom i can not see anything. I would have to zoom to 200% or more before noticing faint band, small bits of line and i know where to look. A random person wouldn't. Will convert the frames to mp4 and see how that pans out. |
![]() |
![]() |
![]() |
#84 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
That is just the difference between src and dest. Use the original (fixed) script.
EDIT: Fixed original Code:
Avisource("SH_2_secs.avi.avi") # Did not have codec for FOURCC, redid in ffmpeg to UT_Video so AVI.AVI ConvertToYV24 O=Last # Intention: Single pixel width, vertical line/scratch reduction. GeneralConvolution(0, " 1 0 1 2 4 2 1 0 1 ") StackVertical(O,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; 27th July 2021 at 12:52. |
![]() |
![]() |
![]() |
#85 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
Coolgit,
maybe of use [I've used my GeneralConvolution thingy as fixed clip, but could use some other de-streak'ed clip]. Code:
/* Requires Avs+, FrameSel[v2.21 just posted new version], ClipClop, RT_Stats Frames file specifies frames/ranges to fix. */ Avisource("SH_2_secs.avi.avi") STACK = false # True, result is STACKED, else Not SHOW = True # True, Show ClipClop metrics, else Not Frames = ".\Frames.txt" # Frames/Ranges to fix, file, either single frame number or range eg 100,110 or 100 110. ### Frames = Frames.RT_GetFullPathName ### ConvertToYV24 O=Last # We're gonna use GeneralConvolution de-streaker whotsit, is applied to ENTIRE clip. De_Streak = GeneralConvolution(0, " 1 0 1 2 4 2 1 0 1 ") FixFrames(O,De_Streak,Frames,Show=SHOW) # Replace frames/ranges in frames file with De_Streaked frames ### STK = StackHorizontal(O,Last) # Lft=Original, Rgt=Fixed #STK = StackVertical(O,Last) # Top=Original, Bot=Fixed ## If Preferred (STACK) ? STK : Last ConvertToYV12 Return last Function FixFrames(clip c,clip repc,string Frames,Bool "Show") { Show = Default(Show,False) Assert(Frames!="","FixFrames: Frames cannot be ''") Frames = Frames.RT_GetFullPathName Assert(Frames.Exist,"FixFrames: Frames file Does Not Exist") # Temp filename for Frames file re-written as ClipClop Command file [with clip index of 1 for replacement clip]. ClipClopCmd=(".\~ClipClipCmd_" + RT_LocalTimeString(file=True) + ".Txt").RT_GetFullPathName # Convert To ClipClop Cmd file, REQUIRES FrameSel v2.21 for PruneIx arg and ClipClop clip_index=1 conversion. FrameSel_CmdReWrite(c,ClipClopCmd,cmd=Frames,Ordered=true,range=true,Prune=True,PruneIx=1) ClipClop(c,repc,Cmd=ClipClopCmd,show=SHOW) RT_FileDelete(ClipClopCmd) # Done with it. return Last } EDIT: Contents of Frames file [Frames.txt] to fix frame 5, and range 10 to 20, and range 30 to 40 Code:
5 10,20 30,40
__________________
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; 27th July 2021 at 22:27. |
![]() |
![]() |
![]() |
#86 | Link |
Registered User
Join Date: Apr 2019
Posts: 194
|
Stainless or anybody
Need help getting the output right. Currently both left and right viewers show the spotless output. I want the left to stick with the original and the right to show the output so i can compare. Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins+\mvtools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth\plugins+\MedianBlur2.dll") source=FFVideoSource("E:\currser\BABYLON5\new\Soul Hunter.avi").convertTOYV12(interlaced=false).killaudio() Function SpotLess(clip c,int "RadT",int "ThSAD",int "ThSAD2",int "pel",bool "chroma", int "BlkSz",Int "Olap",bool "tm",Bool "glob", \ Float "bBlur", clip "dc" ) { myName = "SpotLess: " RadT = Default(RadT,1) # Temporal radius. (MCompensate arg) ThSAD = Default(ThSAD,10000) # SAD threshold at radius 1 (Default Nearly OFF). ThSAD2 = Default(ThSAD2,ThSAD) # SAD threshold at radius RadT. Pel = Default(pel,2) # Default 2. 1, 2, or 4. Maybe set 1 for HD+. (1=precision to pixel, 2=precision to half pixel, 4=quarter pixel) Chroma = Default(chroma,True) # MAnalyse chroma arg. If set to true, use chroma in block matching. BlkSz = Default(BlkSz,8) # Default 8. MAnalyse BlkSize. Bigger blksz quicker and perhaps better, esp for HD clips. Maybe also better where BIG noise. OLap = Default(OLap, BlkSz/2) # Default half of BlkSz. Tm = Default(tm,True) # TrueMotion, Some folk swear MAnalyse(truemotion=false) is better. Glob = Default(glob,True) # Default True, Allow set MAnalyse(global) independently of TrueMotion. bBlur = Default(bblur,0.0) # Default 0.6. Suggest about 0.6 for better motion analysis, but a bit slower. HasDC = dc.Defined # bblur ignored if HasDC, ie user already provided prefiltered clip. Assert(1 <= RadT,myName + " 1 <= RadT") Assert(0.0 <= bblur <= 1.58, myName + "0.0 <= bblur <= 1.58") Assert(pel==1 || pel==2 || pel==4, myName + "pel==1 || pel==2 || pel==4") pad = max(BlkSz,8) sup = (HasDC ? dc : bBlur>0.0 ? c.blur(bBlur) : c ).MSuper(hpad=pad,vpad=pad,pel=pel, sharp=2) # Only 1 Level required where not MAnalyse-ing. sup_rend = (HasDC||bBlur>0.0) ? c.MSuper(hpad=pad,vpad=pad,pel=pel, sharp=2,Levels=1) : sup MultiVec = sup.MAnalyse(multi=true, delta=RadT,blksize=BlkSz,overlap=OLap,chroma=Chroma,truemotion=Tm,global=Glob) c.MCompensate(sup_rend, MultiVec, tr=RadT, thSad=ThSAD, thSad2=ThSAD2) MedianBlurTemporal(radiusY=0,radiusU=0,radiusV=0,temporalradius=RadT) # Temporal median blur only [not spatial] SelectEvery(RadT*2+1,RadT) # Return middle frame } output=SpotLess(source) return(output) So far impressed with this one. cheers Last edited by coolgit; 28th July 2021 at 17:59. |
![]() |
![]() |
![]() |
#87 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
this what you're after
Code:
# ... output=SpotLess(source) StackHorizontal(source,output) # stack side by side, source left, output right #StackVertical(source,output) # stack vertical, source top, output bot return last EDIT: Quote:
Those panes are VD2 input and output, which are probably both the same, [assuming no editing in vd2]. What you want is input and output in avisynth, as stacked above. [I mostly have VD2 output pane @ tiny size]. EDIT: Also, maybe try with Code:
output=SpotLess(source,tm=false,bblur=0.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; 28th July 2021 at 19:32. |
|
![]() |
![]() |
![]() |
#88 | Link | |||
Registered User
Join Date: Apr 2019
Posts: 194
|
Quote:
Quote:
Quote:
Got it to work however output=SpotLess(source) is better. A defect 100% cleared up and the above only 70% cleared up. Culprit tm=false... when true is did better, say 95%. I was just testing your script. It worked a lot of better when there are motion (fast and/or close to camera) as dirt cleaner took chunks of pixel and left artefacts behind. However, 1st and last frame before scene changes are not processed. Does your script needs to look behind and ahead 1 frame for analysis to detect spot? How i denoise a bit more? Last edited by coolgit; 28th July 2021 at 21:28. |
|||
![]() |
![]() |
![]() |
#89 | Link | |||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
Quote:
Spotless is intended to fix temporal anomalies, mainly Spots [hence the name]. A spot exists [usually] on a single frame, and it is that that enables detection, your stripey streaky things are spatial, in the same spacial location, temporally kinda constant, so the spotless doofah dont work too well. Did you try the script I recently gave, using ClipClop, can just use frames file containing "0,0" meaning all frames if you want to see all frames. It will not be perfect but gottat be bettr than Spotless. [calms your streaks to maybe 50% as visible]. Quote:
Quote:
Give me a little while, I want to try something, only I'm a bit busy so might take some time.
__________________
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; 28th July 2021 at 23:23. |
|||
![]() |
![]() |
![]() |
#90 | Link | |
Registered User
Join Date: Apr 2019
Posts: 194
|
Quote:
|
|
![]() |
![]() |
![]() |
#93 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
Quote:
Maybe you got x64 plug in x86 plugins, or something.
__________________
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 ??? |
|
![]() |
![]() |
![]() |
#95 | Link |
Registered User
Join Date: Apr 2019
Posts: 194
|
Stainless
Spotless worked great. Tried many ways and watched them on my TV. Small improvements here and there. Lines can't been seen on the TV, monitor yes but that's because it's in my face. On the TV the noticeable part is when the camera is still and there is a close up scene. The 3 lines shows up when there is dark background on the bottom 1/3. So i decided to have cuppa break. Then a brainwave. Photoshop clone. Previously didn't work because one can not clone precisely frame by frame thus it created more flickering. My brainwave is do the cloning quickly for the noticeable parts, approx 75 frames, then apply spotless. The cloning differences between frames was removed and flickering non-existent. Now it looked great. Miles better than the original. Pleased with my hard work I proceed to save it. Didn't work. I got a vid file with both org and new from the output in vdub. How do i save the result of the work after spotless? |
![]() |
![]() |
![]() |
#96 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
Code:
STACK = false # True, result is STACKED, else Not SHOW = True # True, Show ClipClop metrics, else Not SHOW was for if you were using ClipClop. [where you would switch that off too]. Good Job ![]()
__________________
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 ??? |
![]() |
![]() |
![]() |
#98 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,655
|
OK, then just comment out StackHorizontal/StackVertical lines [precede line with '#'],
or delete them. You really ortta be gettin to learn a bit of avisynth script yourself, people are not gonna be wantin' to spoon feed you forever. ![]()
__________________
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 ??? |
![]() |
![]() |
![]() |
#99 | Link |
Registered User
Join Date: Apr 2019
Posts: 194
|
It is your script. It is not my fault if avisynth is complicated with crap 'manual'.
Showing a new output and saving it, is the most basic task that all software does in 5 seconds. 24 hours later and i still can't do the basic. I can only learn as i go along bit by bit. This is the latest and obviously "the script's return value was not a video clip" pops up. Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins+\mvtools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth\plugins+\MedianBlur2.dll") source=FFVideoSource("E:\currser\BABYLON5\new\Soul Hunter.avi").convertTOYV12(interlaced=false).killaudio() Function SpotLess(clip c,int "RadT",int "ThSAD",int "ThSAD2",int "pel",bool "chroma", int "BlkSz",Int "Olap",bool "tm",Bool "glob", \ Float "bBlur", clip "dc" ) { myName = "SpotLess: " RadT = Default(RadT,1) # Temporal radius. (MCompensate arg) ThSAD = Default(ThSAD,10000) # SAD threshold at radius 1 (Default Nearly OFF). ThSAD2 = Default(ThSAD2,ThSAD) # SAD threshold at radius RadT. Pel = Default(pel,2) # Default 2. 1, 2, or 4. Maybe set 1 for HD+. (1=precision to pixel, 2=precision to half pixel, 4=quarter pixel) Chroma = Default(chroma,True) # MAnalyse chroma arg. If set to true, use chroma in block matching. BlkSz = Default(BlkSz,8) # Default 8. MAnalyse BlkSize. Bigger blksz quicker and perhaps better, esp for HD clips. Maybe also better where BIG noise. OLap = Default(OLap, BlkSz/2) # Default half of BlkSz. Tm = Default(tm,True) # TrueMotion, Some folk swear MAnalyse(truemotion=false) is better. Glob = Default(glob,True) # Default True, Allow set MAnalyse(global) independently of TrueMotion. bBlur = Default(bblur,0.3) # Default 0.6. Suggest about 0.6 for better motion analysis, but a bit slower. HasDC = dc.Defined # bblur ignored if HasDC, ie user already provided prefiltered clip. Assert(1 <= RadT,myName + " 1 <= RadT") Assert(0.0 <= bblur <= 1.58, myName + "0.0 <= bblur <= 1.58") Assert(pel==1 || pel==2 || pel==4, myName + "pel==1 || pel==2 || pel==4") pad = max(BlkSz,8) sup = (HasDC ? dc : bBlur>0.0 ? c.blur(bBlur) : c ).MSuper(hpad=pad,vpad=pad,pel=pel,sharp=2) # Only 1 Level required where not MAnalyse-ing. sup_rend = (HasDC||bBlur>0.0) ? c.MSuper(hpad=pad,vpad=pad,pel=pel,sharp=2,Levels=1) : sup MultiVec = sup.MAnalyse(multi=true, delta=RadT,blksize=BlkSz,overlap=OLap,chroma=Chroma,truemotion=Tm,global=Glob) c.MCompensate(sup_rend, MultiVec, tr=RadT, thSad=ThSAD, thSad2=ThSAD2) MedianBlurTemporal(radiusY=0,radiusU=0,radiusV=0,temporalradius=RadT) # Temporal median blur only [not spatial] SelectEvery(RadT*2+1,RadT) # Return middle frame } #output=SpotLess(source,tm=true,bblur=0.6) #output=SpotLess(source) #StackHorizontal(source,output) # stack side by side, source left, output right #StackVertical(source,output) # stack vertical, source top, output bot #return source return last #return spotless(source) |
![]() |
![]() |
![]() |
Tags |
denoise, despot, prefilter |
Thread Tools | Search this Thread |
Display Modes | |
|
|