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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th May 2020, 11:21   #21  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by ChaosKing View Post
"subpixel=3" condition is
Code:
pelclip      = pel>1 && subpixel == 3
so pel needs to be > 1 to use nnedi
You are right.

I'd like, anyway, to try and use it with standard pel.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 7th May 2020, 11:27   #22  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
NNEDI3 is probably used for upscaling the pelclip. If pel=1 --> no upscale. I see no reason to not use pel=2 for HD.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 7th May 2020, 11:39   #23  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Based on his screenshot, real.finder's example seems to be the winner so far. I'll have to try Spresso.STpresso myself. I was completely oblivious to them.
hello_hello is offline   Reply With Quote
Old 7th May 2020, 12:04   #24  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by real.finder View Post
Code:
Spresso(10,30).STpresso(10,30,4,22,8,49,1,mc=true) #last updates
SMDegrain (tr=6, thSAD=1000, refinemotion=false, mode=0, contrasharp=false, PreFilter=2, truemotion=true, plane=4, chroma=true)
video output

Really hard to say which is better, if mine or yours. The discriminating factor could be fps: mine is 6.10, yours is 4.09.

P.S: I have always questioned myself about real meaning of truemotion. I read explanation multiple times and it's really a dice roll to find when it's good and when it's bad for a movie. Your idea?

P.P.S: Why to you chain the spatiotemporal version of Spresso with the spatial one? Isn't STpresso already including the spatial part? And why have two version of the same script exist? Isn't STpresso a superset of Spresso?
__________________
@turment on Telegram

Last edited by tormento; 7th May 2020 at 13:15.
tormento is offline   Reply With Quote
Old 7th May 2020, 12:21   #25  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by tormento View Post
My last attempt:
PHP Code:
SMDegrain (tr=9thSAD=1000refinemotion=falsen16=truemode=0contrasharp=falsePreFilter=4truemotion=trueplane=4chroma=true
What is PreFilter=4? Isn't the selection range -1 …… 3?
Which version of SMDegrain are you using? Thanks.
Sharc is offline   Reply With Quote
Old 7th May 2020, 12:34   #26  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by Sharc View Post
What is PreFilter=4?
Use KNLMeansCL, lot faster.
Quote:
Originally Posted by Sharc View Post
Which version of SMDegrain are you using? Thanks.
SMDegrain-3.1.2·106.avsi
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 7th May 2020, 12:36   #27  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
I did some tries using either clang plugins or msvc plugins (where available) on latest Spresso script from real.finder.

They funny thing is they ended with the same 4.24 fps result. And not on the short clip I sent here, a much longer one I use to better test (if you need I can upload).

Seems the bottleneck is MVTools or something else but not the compiler version.

P.S: Final bitrate of clang is 4450.15 kB/s, of msvc is 4450.16 kB/s. LOL
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 7th May 2020, 16:12   #28  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by tormento View Post
P.S: I have always questioned myself about real meaning of truemotion. I read explanation multiple times and it's really a dice roll to find when it's good and when it's bad for a movie. Your idea?
https://forum.videohelp.com/threads/...e6#post2458832

and like other settings, it depend on the source you deal with

Quote:
Originally Posted by tormento View Post
P.P.S: Why to you chain the spatiotemporal version of Spresso with the spatial one? Isn't STpresso already including the spatial part? And why have two version of the same script exist? Isn't STpresso a superset of Spresso?
I see Didée use it like this https://forum.doom9.org/showpost.php...71&postcount=2
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 8th May 2020, 10:42   #29  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Quote:
Originally Posted by tormento View Post
My last attempt:
PHP Code:
SMDegrain (tr=9thSAD=1000refinemotion=falsen16=truemode=0contrasharp=falsePreFilter=4truemotion=trueplane=4chroma=true
Really liking the result from that smdegrain call. I tried it myself with some tweaks and it looks like it recovers further details. With such kind of source I would add some digital noise on top to mask the remaining static grain.

Attempt: mediafire

Never thought thsad=1000 was a thing, it gave me some ideas to improve smdegrain.
Dogway is offline   Reply With Quote
Old 8th May 2020, 10:45   #30  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by Dogway View Post
Really liking the result from that smdegrain call.
Welcome back!
Quote:
Originally Posted by Dogway View Post
I tried it myself with some tweaks and it looks like it recovers further details.
Would you share the script?
Quote:
Originally Posted by Dogway View Post
Never thought thsad=1000 was a thing, it gave me some ideas to improve smdegrain.
As you probably noticed, real.finder is now maintaining your script. A collaboration would be terrific!
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 8th May 2020, 11:07   #31  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Thanks, from time to time I come over to update things, I'm grateful he is maintaining it I lost track of all updates so still need to catch up!

The script is a proof of concept, I did it in some passes, the last one a smear recovery which I found was interesting, I searched around and cretindesalpes had an implementation, so I tweaked it. It's some hard coded values but I would like to integrate it in a safe manner.


Code:
ffvideosource("BD 21 grammi.mkv").crop(0,20,0,-20).Dither_convert_8_to_16()
src=last


Dfttest(sstring="0.0:4.0 0.2:9.0 1.0:15.0",tbsize=1,u=true,v=true,lsb=true,quiet=true)
ditherpost(mode=6)

smdegrain(src.fluxsmoothT(3), tr=9, thSAD=1000, mfilter=last, n16=true, mode=0, contrasharp=false, prefilter=4, truemotion=true, plane=4, chroma=true)  

smdegrain(tr=3, thSAD=250, refinemotion=true, n16=true, mode=0, contrasharp=true, prefilter=2, plane=4, chroma=true)


fslg_fix_dc(last,src, 1.0)
DitherPost(stacked=true,prot=false,mode=6)


Function fslg_fix_dc (clip flt16, clip src16, float "thr")
{
	thr = Default (thr, 1.0)

	lp_f = flt16.fslg_fix_dc_lowpass ()
	lp_s = src16.KNLMeansCL(D=2, A=2, h=7.0,device_type="GPU",stacked=true).fslg_fix_dc_lowpass ()

	hp_f = Dither_sub16 (flt16, lp_f, dif=true)
	(thr < 0.1) ? lp_s : lp_f.Dither_limit_dif16 (lp_s, thr=thr, elast=2.0)
    
    msk=SafeMotionMask(DitherPost(stacked=true,prot=false,mode=6),gam=0.6,mv=3,em=false,lm=1, motion=100,darkb=55)
    Dither_merge16_8(flt16,Dither_add16 (hp_f, dif=true),msk,luma=true)
}

Function fslg_fix_dc_lowpass (clip src16)
{
	src16

	w = Width ()
	h = Height () / 2
	r = 8.5
	Dither_resize16 (w, h, kernel="bicubic", a1=1, a2=0, fv=-1.0/r)
	Dither_resize16 (w, h, kernel="bicubic", a1=1, a2=0, fh=-1.0/r)
}
Dogway is offline   Reply With Quote
Old 8th May 2020, 11:39   #32  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by Dogway View Post
The script is a proof of concept, I did it in some passes, the last one a smear recovery which I found was interesting
Do you mind to upload the finished product?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 8th May 2020, 11:44   #33  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Do you mean the script? it's the above one. I have to integrate it and try to make it faster by reusing code. I will add some other ideas I have, basically protection against high thSAD.
Dogway is offline   Reply With Quote
Old 8th May 2020, 11:53   #34  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by Dogway View Post
Do you mean the script?
I meant the video.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 8th May 2020, 12:38   #35  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
I linked it above to mediafire, good morning haha
Dogway is offline   Reply With Quote
Old 8th May 2020, 22:41   #36  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
what is SafeMotionMask?

anyway, since fslg_fix_dc_lowpass use Dither_resize16 with fv paramter this function can't be ported to HBD, just like https://forum.doom9.org/showpost.php...postcount=1125
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 9th May 2020, 00:58   #37  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Guess I forgot to upload at the time. It's a function I used to work with masks, specially to mask out problematic motion artifacts like smearing. It's not pretty but it wasn't for release.


https://github.com/Dogway/Avisynth-S...otionMask.avsi
Dogway is offline   Reply With Quote
Old 9th May 2020, 03:14   #38  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by real.finder View Post
maybe later, but IIRC Didée did Degraining source like this before (I remember the video sample was of a man drinking with glass) but I don't know where the link for the post now , anyway IIRC it's done by mdegrain with some strong prefilter
ok, I find it https://forum.doom9.org/showthread.p...64#post1512464

so I did some update https://raw.githubusercontent.com/re...SMDegrain.avsi

Code:
Spresso(10,30).STpresso(10,30,4,22,8,49,1,mc=true) #last updates
o   = last
ox  = o.width
oy  = o.height
ox1 = 1280
oy1 =  704
ox2 =  640
oy2 =  360

sm1 = o.bicubicresize(ox1,oy1)   # medium scale
sm2 = sm1.bicubicresize(ox2,oy2) # small scale

D12 = mt_makediff(sm2.bicubicresize(ox1,oy1),sm1,U=3,V=3) # residual of (small)<>(medium)
D1o = mt_makediff(sm1.bicubicresize(ox,oy),o,U=3,V=3)     # residual of (medium)<>(original)

lev2 = sm2.MCDegrainMod(3,soft=true,TV_range=false) # filter on smalle scale
up1 = lev2.bicubicresize(ox1,oy1)
up2 = up1.bicubicresize(ox,oy)

D12.MCDegrainMod(3,up1,soft=false,thSAD=480,TV_range=false) # filter on medium scale
lev1 = up1.mt_makediff(last,U=3,V=3)
up3 = lev1.bicubicresize(ox,oy)

D1o.MCDegrainMod(6,up2,soft=true,thSAD=480)  # filter on original scale
up3.mt_makediff(last,U=3,V=3)
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 9th May 2020, 05:20   #39  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by SlowDelivery View Post
I don't have much experience but recently I've tried a lot of different denoising filters and found MCTemporalDenoise to be good.
This is really slow but gave good results:
Code:
MCTemporalDenoise(settings="very high",thSAD=800,sharp=false,stabilize=false)
SMDegrain(tr=2,thSAD=800)
RemoveDirtMC(5,false)
Picture: https://ibb.co/rMCbMfS

If the above is too slow, perhaps you can try
Code:
MCTemporalDenoise(settings="high",thSAD=800,sharp=false,stabilize=false)
SMDegrain(tr=1,thSAD=800)
RemoveDirtMC(10,false)
Picture: https://ibb.co/K04YKYr
yes, seems MCTemporalDenoise is very good!
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 9th May 2020, 09:38   #40  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by real.finder View Post
so I did some update
Shouldn't be better fitted in the generic zswhatever.avsi?

Anyway what srfilter does, what are the possible values and consequences?

Could you explain please once for all the parameters not covered by smdegrain.html from Dogway too?

Anyway 3 level of resize degrain is insane
__________________
@turment on Telegram

Last edited by tormento; 9th May 2020 at 09:43.
tormento is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.