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 11th May 2012, 21:17   #81  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Donetsk
Posts: 58
Mounir
Code:
SVSuper( "{ gpu:0, pel:2, scale:{up:0} }")

Last edited by Tempter57; 11th May 2012 at 21:21.
Tempter57 is offline   Reply With Quote
Old 12th May 2012, 09:32   #82  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Tempter57
if it was so easy
Quote:
error: i don't know what "clean1" means
chainik_svp is offline   Reply With Quote
Old 12th May 2012, 10:31   #83  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Donetsk
Posts: 58
Quote:
Originally Posted by chainik_svp View Post
Tempter57
if it was so easy

Well, preset DVD MDegrain2_SVP mask4 DLS
Code:
#RemoveGrainSSE2.dll
#RepairSSE2.dll
#mvtools2SVP.dll
#svpflow1.dll
#svpflow2.dll
#fft3dgpu.dll
#WarpSharp.dll
#mt_masktools-26.dll
#average.dll
#AddGrainC.dll
#GradFun2DB.dll
#VagueDenoiser.dll
#flash3kyuu_deband.dll
#Gradfun2dbmod.avs
#Ylevels.avs
#LimitedSharpenFaster Mod.avs


setmemorymax(768)

# ColorYUV(gain_y=0,cont_y=0,cont_u=0,cont_v=0,gain_v=0,gain_u=-0,off_y=0,off_u=-0,off_v=-0)

source = last
preNR = source.fft3dgpu(wintype=1,degrid=1,bw=16,bh=16,ow=8,oh=8,bt=4,sigma=1.0,sigma2=1.2,sigma3=2.0,sigma4=1.0,plane=4).GradFun2DB(1.01)

setmtmode(2)
sup1 = preNR.SVSuper( "{ gpu:0, pel:2, scale:{up:2, down:2} }")

search_params = "gpu:0, vectors:3, block:{w:16,overlap:3}" 
v21 = sup1.SVAnalyse("{"+search_params+"}")
v22 = sup1.SVAnalyse("{"+search_params+",special:{delta:2}}")

bv22 = v22.SVConvert(isb=true)
bv21 = v21.SVConvert(isb=true)
fv21 = v21.SVConvert(isb=false)
fv22 = v22.SVConvert(isb=false)

mask1 = source.mmask(bv22, ml=100, kind = 1, Ysc = 255, gamma=0.999)
mask2 = source.mmask(bv21, ml=100, kind = 1, Ysc = 255, gamma=0.999)
mask3 = source.mmask(fv21, ml=100, kind = 1, Ysc = 255, gamma=0.999)
mask4 = source.mmask(fv22, ml=100, kind = 1, Ysc = 255, gamma=0.999)
maskb = mt_lutxy(mask1,mask2,"x 255 < y 255 < x y + 2 / x ? y ?")
maskf = mt_lutxy(mask3,mask4,"x 255 < y 255 < x y + 2 / x ? y ?")
tmask = mt_lutxy(maskb,maskf,"x 255 < y 255 < x y + 2 / x ? y ? 32 - 255 * 223 /")# комбинированная маска оценки движения SAD

source2 = mt_merge(source,preNR,tmask,Y=3,U=3,V=3)
sup2 = source.msuper(pel=2, levels=1, sharp=2)
den = source2.MDegrain2(sup2,bv21,fv21,bv22,fv22,thSAD=300,thSCD1=400,thSCD2=102)
Diff1 = mt_makediff(source,den,U=3,V=3)

NR = den.VagueDenoiser(method=4, nsteps=8, wavelet=2, Wiener=true, auxclip=preNR, percent=95, chromaT=0.8, wratio=0.75, threshold=0.4)
Diff2 = mt_makediff(source,NR,U=3,V=3)

lutxy = mt_lutxy(Diff1,Diff2,"x 128 - abs y 128 - abs < x y ?")
smB = source.mt_makediff(lutxy,U=3,V=3)

# MASKING
mE = mt_edge(smB,"prewitt",0,255,0,0,V=1,U=1).mt_lut(expr="x 1.8 ^",U=1,V=1).removegrain(4,-1).mt_inflate(U=1,V=1) 
mL = mt_logic(tmask.invert(),mE,"min",U=1,V=1).removegrain(20,-1) 
mF = mt_logic(tmask,mE,"max",U=1,V=1).removegrain(20,-1)

# SHARPENING
b1c = source.MCompensate(sup2, bv21)
f1c = source.MCompensate(sup2, fv21)
Sclp = smB.LSFmod(defaults="slow", preblur="ON", strength=100)
# Sclp = ContraHD(smB,source,b1c,f1c,0)
Tmax = source.mt_logic(f1c,"max",U=1,V=1).mt_logic(b1c,"max",U=1,V=1)
Tmin = source.mt_logic(f1c,"min",U=1,V=1).mt_logic(b1c,"min",U=1,V=1)
shrp = Sclp.mt_clamp(Tmax, Tmin, 2, 2, U=1, V=1)
sL = mt_merge(smB,shrp,mL,U=2,V=2)

# DEBANDING
# GFc = sL.f3kdb(sample_mode=2,dynamic_grain=false,keep_tv_range=false,dither_algo=3,y=64,cb=64,cr=64,grainY=48,grainC=48)
  GFc = sL.GradFun2DBmod(thr=1.21,thrC=1.5,mode=2,str=0.6,strC=0.0,temp=50,adapt=64)
Frs = mt_merge(GFc,sL,mF,luma=true,U=3,V=3)
Frs#.mergechroma(den)
YlevelsS(0,1.0,255,0,255,false)
 
# -- visualisations --
# stackvertical(source,last)
# interleave(source,last)
if SVSuper( " gpu:0, pel:2, scale:{up:2, down:2 } " ) => error " SVSuper: invalid "params" syntax"

Last edited by Tempter57; 12th May 2012 at 10:50.
Tempter57 is offline   Reply With Quote
Old 13th May 2012, 09:24   #84  |  Link
bmb
Registered User
 
Join Date: May 2009
Posts: 8
hey their, im currently using this script

super = MSuper(pel=2,chroma=false)
backward_vec1 = super.MAnalyse(isb = true, blksize=16, delta = 1, overlap=8,chroma=false,search=5,searchparam=4,temporal=true)
forward_vec1 = super.MAnalyse(isb = false, blksize=16, delta = 1, overlap=8,chroma=false,search=5,searchparam=4,temporal=true)
MDegrain1(super, backward_vec1,forward_vec1,thSAD=20,plane=0)

i use it to denoise and remove grain generated from sharpening, it works great (the best iv used so far) it keeps the detail of the picture sharp and still theirs no noise or blocks generated.. my sources are bluray content.. i sometimes get slight noise and blocks (depending on the compression) i was wondering if you could translate it or offer a script better with this SVP and il test it out and report back.. thanks ...
bmb is offline   Reply With Quote
Old 14th May 2012, 11:08   #85  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
One small question: is there any harm in using a super clip created by MSuper instead of SVSuper when the vectors are converted to MVTools2 format after SVAnalyse?
__________________
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 14th May 2012, 12:59   #86  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Boulder
There's no difference.

bmb
Code:
super = MSuper(pel=2,hpad=0,vpad=0)
vec = super.SVAnalyse("{block:{overlap:3}}")
backward_vec1 = vec.SVConvert(isb=true)
forward_vec1 = vec.SVConvert(isb=false)
MDegrain1(super, backward_vec1,forward_vec1,thSAD=20,plane=0)
didn't test it

Last edited by chainik_svp; 14th May 2012 at 13:05.
chainik_svp is offline   Reply With Quote
Old 5th June 2012, 04:10   #87  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
I tried to test your modded Avisynth build, but avs2pipemod keeps on crashing during launch so I cannot pipe the output to 64-bit x264. Opening the script in VDub has no issues.
__________________
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 5th June 2012, 09:15   #88  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Boulder
tried version from here, works for me (without x264): "avs2pipemod.exe -rawvideo test.avs > out"
__________________
SVPflow motion interpolation
chainik_svp is offline   Reply With Quote
Old 5th June 2012, 09:35   #89  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Hm, it's possible that I have an outdated piping client (although I have had no problems using Avisynth 2.5.8 or 2.6 earlier). I'll get the latest one and retry.
__________________
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 5th June 2012, 09:47   #90  |  Link
Boulotaur2024
Registered User
 
Join Date: May 2010
Location: France
Posts: 26
Quote:
Originally Posted by Mug Funky View Post
just dropping by to say thanks to all involved in the SVP project.

my canon workflow owes a lot to it

what i'm doing:

- shoot at as high a framerate as i can manage (720p60), at as high a shutterspeed as i can get a good exposure on (i like to shoot wide open, so it's no problem to get 1/250 or so). also, high fps means less rolling-shutter effect than if i'd shot at my target frame rate. less jelly = better.

- depanstabilize. goes without saying if i'm not willing to give up coffee.

- SVPfps to my output framerate*samples. samples working in the same way as in a graphics package.

- temporalsoften to blend only frames that correspond to my desired shutter angle wrt the output frame rate

- selectevery(samples, 0)

i'm able to output 2400/1001 with motion blur as if it was shot that way at 180 degrees

the interpolation quality is such that when it fails, i don't see weird things. usually just a little ghosting.

me happy
Hi Mug Funky, could you please post your script ?

I currently use QTGMC for my motion blur needs but MVTools does produce weird artefacts *, I'd be curious to see how SVPflow performs in comparison

* these aren't exactly artefacts in my case but more the typical MvTools "morphing effect" between scene changes

Last edited by Boulotaur2024; 5th June 2012 at 18:05.
Boulotaur2024 is offline   Reply With Quote
Old 5th June 2012, 13:11   #91  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,845
+1 for the script
kolak is offline   Reply With Quote
Old 5th June 2012, 18:15   #92  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Quote:
Originally Posted by Boulder View Post
Hm, it's possible that I have an outdated piping client (although I have had no problems using Avisynth 2.5.8 or 2.6 earlier). I'll get the latest one and retry.
Yep, the latest version seems to work. Now some testing and if results are what I'd like them to be, I think I'm going to ask SEt if he could take a look at the modifications to put them in his 2.6 build
__________________
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 5th June 2012, 20:42   #93  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
The main idea is to limit each cache size (in frames), opposite to Avisynth approach when all caches uses one common "frames" pool somehow limited with SetMemoryMax value. This can easily lead to cache misses in general case BUT as far as I know that SVP's script is linear frame-by-frame only - it works.

So may be it's not a good idea to include such behavior in official Avisynth, but may be as an additional argument to SetMTMode()...
__________________
SVPflow motion interpolation
chainik_svp is offline   Reply With Quote
Old 6th June 2012, 16:43   #94  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
I have some results. In a regular case with "DGSource-Downsize to 720p-MVTools based denoise", your and SEt's Avisynth build are pretty much the same what comes to speed. Your build uses something like 200-250M less memory (svp_cache_fwd=4 vs SetMemoryMax(512)).

In an "MPEG2Source-TFM-TDecimate-MVTools based denoise", SEt's build is slightly faster. The amount is small, 1-2%, and the difference would be even smaller if x264 was set to a slower preset (I used ultrafast to remove the encoding bottleneck). The difference in memory usage is the same as in the first example

However, a script with SRestore doesn't seem to work with your build as it crashes upon script loading in VDub and avs2pipemod. I'm not that surprised since it's a mean piece of work and if I'm not entirely mistaken, multithreading is a bit of a no-no although I don't remember anybody really confirming that. But doesn't the same apply to TDecimate as well?
__________________
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 6th June 2012, 18:04   #95  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
Quote:
Originally Posted by Boulder View Post
Your build uses something like 200-250M less memory (svp_cache_fwd=4 vs SetMemoryMax(512)).
720p is too easy and 250M is nothing I'm talking about situations when official Avisynth can't work at all. For example "canonical" MVTools-based interpolation script can easily run out of memory with 1080p and pel=2 in MSuper regardless of SetMemoryMax value.
__________________
SVPflow motion interpolation

Last edited by chainik_svp; 6th June 2012 at 18:09.
chainik_svp is offline   Reply With Quote
Old 6th June 2012, 18:05   #96  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Hehe, that's true. I was afraid of trying to QTGMC 1080i as the tests would have a taken a veeery long time
__________________
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 6th June 2012, 18:46   #97  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
4k ?
__________________
SVPflow motion interpolation
chainik_svp is offline   Reply With Quote
Old 6th June 2012, 19:00   #98  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,799
Yeah ----- when the day comes that I can buy a reasonably priced TV that supports the format
__________________
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 June 2012, 06:39   #99  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
for the two people interested:

Code:
function frcblur( clip c, int "num", int "den", float "angle", int "samples" )
{

num = default(num,24000)
den = default(den,1001)
samples = default(samples,7) # anything more than 11 is way overkill.  internally this number is doubled by default.
angle = default(angle,0) # 0 disables motion blur.  180 is standard cine camera.
multiplier = angle==0? 1 : round( samples/(angle/360.) )
parmstring = "{rate:{num:" + string( multiplier * num ) + ",den:" + string(den) + ",abs:true},algo:21,cubic:1}}"

c

spr = svsuper("{pel:2,gpu:1}")
vec = svanalyse(spr,"""{block:{w:32,h:32},refine:[{thsad:200}]} """)
sorathread()

svsmoothfps(spr,vec,parmstring, url="www.svp-team.com")

sorathread()
angle==0? last : temporalsoften(multiplier/2 -1,255,255,255)
angle==0? last : selectevery(multiplier,0)

}
this requires sorathread, the very easy to use threading plugin. i'm running 2.6 so i don't have much MT stuff available.

here's a script example, with stabilization thrown in:
Code:
QTinput("x:\things\MVI_1402.MOV",audio=2)

assumetff()

assumetff()
converttoyv12()

sorathread()
mdata = DePanEstimate(last)
DePanStabilize(last, data=mdata,cutoff=0.333,initzoom=1.1,addzoom=true,zoommax=1.5,rotmax=10.,tzoom=3.0,pixaspect=1.0,prev=3,next=3)
sorathread()

frcblur(num=25,den=1,angle=180)
requires the latest (still old) depan+depanestimate

i'm using QTinput because of the luma levels issue with ffms2.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 7th June 2012, 14:01   #100  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,671
Thanks Mug Funky! The result looks very nice.

For Avisynth MT I had to add the mt=x argument to svsmoothfps.

Sorry for being a little off topic but what are the issues with FFMS2 and luma?

Last edited by Reel.Deel; 7th June 2012 at 14:24.
Reel.Deel is offline   Reply With Quote
Reply

Tags
frame doubling, frame rate conversion, mvtools, opencl

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 00:15.


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