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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

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

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st March 2009, 21:46   #41  |  Link
brainman
Registered User
 
Join Date: Feb 2009
Location: Lolland, Denmark
Posts: 8
The original video capture is 720x576 YUY2, however I do converttoYV12 right after trimming the clip and I stay in this color space through the whole script.

Sometimes I do some cropping if necessary, but due to restrictions in one or more of the other filters I use, I always crop so the resulting dimensions are multiples of 4.

I got the thought that my other filters were somehow interfering with SSSharpen but although I deactivated most of them (except for mcbob I think I can remember) I got the same error.

Btw my script looks like this:
Code:
AviSource("C:\VIDEO\Fuglekrigen.avi")
Trim(356, 94020)
converttoYV12
mcbob()
selecteven()
DeGrainMedian(limitY=2,limitUV=3,mode=0,interlaced=false)
DeGrainMedian(limitY=2,limitUV=3,mode=1,interlaced=false)
fft3dfilter(sigma=2.5, plane=4, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=1.0, dehalo=1.0, ncpu=2, interlaced=false)
Crop(12,44,-16,-40)
LimitedSharpenFaster(strength=150)
And I was trying to change the last line from Limitedsharpenfaster to SSSharpen, but until now without luck.

And yes, it's already so slow that SSSharpen is like a drop in the ocean . But I get some quite nice results. Though, I'm a complete Avisynth noob so there might exist more efficient and considerably faster scripts. I've got plenty of time, though, so I just want my old VHS video to look as nice as possible.

Last edited by brainman; 1st March 2009 at 21:58.
brainman is offline   Reply With Quote
Old 2nd March 2009, 04:21   #42  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Location: USA
Posts: 1,348
Try modifying your cropping so your video is mod16 in each dimension.
*.mp4 guy is offline   Reply With Quote
Old 2nd March 2009, 08:16   #43  |  Link
brainman
Registered User
 
Join Date: Feb 2009
Location: Lolland, Denmark
Posts: 8
I just put a # in front of the cropping line.
720=16*45 and 576=16*36 . That should do it, shouldn't it?
But unfortunately it didn't. I still get exactly the same error.
brainman is offline   Reply With Quote
Old 2nd March 2009, 08:29   #44  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,407
Too little system ressources. The script from another angle:

Code:
mcbob()       # (1) - an insane ressource muncher 
selecteven()  # (-) - doesn't matter here
temporal(r=1) # (2) - needs to have three frames from (1)
temporal(r=1) # (3) - needs to have three frames from (2), i.e. five frames from (1)
fft3d(bt=5)   # (4) - needs to have five frames from (3), i.e. nine(!) frames from (1)

SSSharpen()   # (5) - pretty computational expensive, too
You can only put so much pebbles on a paper boat until it sinks. SSSharpen was the final pebble. You probably didn't realize how much pebbles your script already had put.

Either reduce the number of pebbles, or increase the size of the boat.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 2nd March 2009, 08:51   #45  |  Link
brainman
Registered User
 
Join Date: Feb 2009
Location: Lolland, Denmark
Posts: 8
I know, I know.
The interesting thing here, though, is, that I have tried to deactivate all the lines in the script so I only have this little one, just as a proof of concept:

Code:
AviSource("C:\VIDEO\Fuglekrigen.avi")
Trim(356, 94020)
converttoYV12
LeakKernelDeint(order=0)
SSSharp()
Guess what happens?
The error message pops up

I both like and understand your pebble analogy but it seems that there's more than pebbles to this problem...
brainman is offline   Reply With Quote
Old 2nd March 2009, 09:08   #46  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,407
Okay ... a bit earlier you said you deactivated everything *but* MCBob, so I thought you're still running the two fat boys in chain.

Next step: closer pebble examination. - try if the filters from the offending line cause an error when called on ther own:

Code:
AviSource("C:\VIDEO\Fuglekrigen.avi")
Trim(356, 94020)
converttoYV12
bob()

# unsharp(vary=2,varc=1)   #  error, or not?

# halomaskM(hbias=-128,hthr=256,amgrad=4) # error, or not?
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 2nd March 2009, 09:20   #47  |  Link
brainman
Registered User
 
Join Date: Feb 2009
Location: Lolland, Denmark
Posts: 8
Regarding MCBob, you're right. I just tried it with that one deactivated also after I wrote the message.

I've tried what you said. Here are the results:

unsharp(vary=2,varc=1)
Evaluate: System Exception - Access violation

halomaskM(hbias=-128,hthr=256,amgrad=4)
Script error: HalomaskM does not have a named argument: amgrad
brainman is offline   Reply With Quote
Old 2nd March 2009, 10:03   #48  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,407
Oh, in the hurry I mistyped that halomaskM parameter - it's "agmrad", not "amgrad".

However, now it seems that it boils down to variableblur's unsharp() filter. If even this basice usage of unsharp() fails, then something is wrong ... but I've no clue what it is. It works for me (both the original and neuron2's fixed version), don't see why it breaks for you, sorry.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 2nd March 2009, 18:15   #49  |  Link
brainman
Registered User
 
Join Date: Feb 2009
Location: Lolland, Denmark
Posts: 8
Yes, somehow my Masktools choke in the video on my machine. I don't get it. Is there anything that has to be done in a different way when copying the masktools .dll to the plugins library? I've been reading around quite a bit but I can't find anything but I might have missed something.

Can it be a problem that I run a newer version of Avisynth than required by Masktools?

Last edited by brainman; 2nd March 2009 at 18:21.
brainman is offline   Reply With Quote
Old 2nd March 2009, 20:13   #50  |  Link
brainman
Registered User
 
Join Date: Feb 2009
Location: Lolland, Denmark
Posts: 8
I was getting stubborn and removed all plugins except for those that are needed for SSSharp.

I reran the script entries proposed by you, Didée, a few posts ago:

unsharp(vary=2,varc=1)
halomaskM(hbias=-128,hthr=256,amgrad=4)

The first one still gives the access violation error.
The second one actually runs without making any trouble.
brainman is offline   Reply With Quote
Old 2nd March 2009, 21:19   #51  |  Link
brainman
Registered User
 
Join Date: Feb 2009
Location: Lolland, Denmark
Posts: 8
HEUREKA! I've found the solution! (at least it seems so)
It was actually you, Didée who solved it, maybe even without knowing, sorta.
I went back and read the variableblur thread and there you, Didée, mention that if the FFTW3 dll is too new, variableblur doesn't like it, and the one hosted on warpenterprises is working.
So i tried it out, and voila!
Thanks a lot for help given a long time ago
brainman is offline   Reply With Quote
Old 6th March 2009, 17:14   #52  |  Link
Archimedes
Registered User
 
Join Date: Apr 2005
Posts: 213
I've got very strange results with SSSharp (default settings). Look at the white points around the corner.



With denoise=0, i haven't any problems:



My plugin section:

Code:
LoadPlugin("plugins\LoadDLL\LoadDll.dll")
LoadDll("dll\fftw3.dll")

LoadPlugin("plugins\aWarpSharp\aWarpSharp.dll")
LoadPlugin("plugins\DCTFun4b\dctfun4b.dll")
LoadPlugin("plugins\DeGrainMedian\degrainmedian.dll")
LoadPlugin("plugins\MaskTools 2\mt_masktools.dll")
LoadPlugin("plugins\RemoveGrain 1.0\RemoveGrain.dll")
LoadPlugin("plugins\RemoveGrainHD\RemoveGrainHD.dll")
LoadPlugin("plugins\VariableBlur\VariableBlur.dll")
Archimedes is offline   Reply With Quote
Old 7th March 2009, 06:20   #53  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Location: USA
Posts: 1,348
Thats a known bug with mask creation. If you pad all of the borders of the image out a few pixels before sssharp, then crop them back, it should take care of the problem. The denoise parameter is mostly to keep the the noise level in check while undergoing multiple sharpening iterations; If you don't need to use it to keep sssharp from turning the picture to snow, you are probably better off using something else for denoising.

Last edited by *.mp4 guy; 24th April 2009 at 20:28.
*.mp4 guy is offline   Reply With Quote
Old 9th March 2009, 10:29   #54  |  Link
Archimedes
Registered User
 
Join Date: Apr 2005
Posts: 213
Thanks for the explanation. So i will go with an extra denoiser afterwards (if needed).

SSSharp seems to be a good alternative for sharpening very blur sources (e. g. upscaled images). Where LimitedSharpenFaster fails, die to it’s internal sharpening principle, SSSharp can "blow up" such kind of sources.

Original (upscaled image):



SuperSlowSharpen and dfttest:



Nearly the same effect can be achieved with SeeSaw, but you have to tweak more parameters.
Archimedes is offline   Reply With Quote
Old 11th March 2009, 04:28   #55  |  Link
whwhwhwh9
Registered User
 
Join Date: Jul 2005
Posts: 13
Hi,
I got VariableBlur040.zip as indicated in an eariler post, however, when I tried to load the script into VirtualDub, there's an error message saying "AVIsynth open failure: LoadPlugin: unable to load VariableBlur.dll". Could someone explain a little bit?

#version 0.1, optimizations by Didee

loadPlugin("variableBlur.dll")
loadPlugin("warpSharp.dll")

function halomaskM(clip c, int "hthr", int "hbias", int "agmrad"){

hthr = default(hthr, 256)
hbias = default(hbias, -128)
agmrad = default(agmrad, 1)

s = c
Mblur = (agmrad==1) ? s.removegrain(4,-1) : s.Quantile(radius_y=agmrad,radius_u=-1,radius_v=-1)
gblur = (agmrad<=5) ? s.binomialblur(vary=agmrad, varc=0) : s.gaussianblur(vary=agmrad, varc=0)
maskM = mt_lutxy(Mblur, Gblur, "y x - abs "+string(hthr)+" * "+string(hbias)+" +", U=1, V=1)

return(maskM)}

function halomaskMR(clip c, int "hthr", int "hbias"){

hthr = default(hthr, 256)
hbias = default(hbias, -128)

s = c
Ablur = s.removegrain(4)
gblur = s.gaussianblur(vary=1, varc=0)
mask3 = mt_lutxy(Ablur, Gblur, "y x - abs "+string(hthr)+" * "+string(hbias)+" +", U=1, V=1)

return(mask3)}


function SSW(clip c){
c#.unsharp()
w = width
h = height

spline36resize(w*3, h*3)

awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)

awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)

spline36resize(w, h)}

function SSSharp(clip c, float "rad", bool "ssw", float "strength", int "iter", bool "ss", int "denoise"){

rad = default(rad, 0.25)
ssw = default(ssw, true)
strength = default(strength, 4)
iter = default(iter, 1)
ss = default(ss, true)
denoise = default(denoise, iter)

c
w = width(c)
h = height(c)


sswc = ssw ? c.ssw() : c
(iter >= 1) ? MT_Merge(unsharp(vary=rad, varc=1, strength=strength), sswc, spline36resize((ss ? w*4 : w), (ss ? h*4 : h)).halomaskM(hbias=-128, hthr=256, agmrad=(ss ? round(rad*4) : round(rad))).spline36resize(w, h)) : last
(denoise >=1) ? degrainmedian(mode=3).dctfun4b(2,2) : last
(iter >= 2) ? MT_Merge(unsharp(vary=rad, varc=1, strength=strength), sswc, spline36resize((ss ? w*4 : w), (ss ? h*4 : h)).halomaskM(hbias=-128, hthr=256, agmrad=(ss ? round(rad*4) : round(rad))).spline36resize(w, h)) : last
(denoise >=2) ? degrainmedian(mode=3).dctfun4b(2,2) : last
(iter >= 3) ? MT_Merge(unsharp(vary=rad, varc=1, strength=strength), sswc, spline36resize((ss ? w*4 : w), (ss ? h*4 : h)).halomaskM(hbias=-128, hthr=256, agmrad=(ss ? round(rad*4) : round(rad))).spline36resize(w, h)) : last
(denoise >=3) ? degrainmedian(mode=3).dctfun4b(2,2) : last
(iter >= 4) ? MT_Merge(unsharp(vary=rad, varc=1, strength=strength), sswc, spline36resize((ss ? w*4 : w), (ss ? h*4 : h)).halomaskM(hbias=-128, hthr=256, agmrad=(ss ? round(rad*4) : round(rad))).spline36resize(w, h)) : last
(denoise >=4) ? degrainmedian(mode=3).dctfun4b(2,2) : last
return(last)
}

source = ImageSource("Ch11_20090228_191748_ClipSmall_7.264_Frame_1755.bmp")
SSSharp(source, ssw=true, iter=1, strength=1, rad=1)
#SSSharp(ssw=true, iter=2, strength=3)
whwhwhwh9 is offline   Reply With Quote
Old 11th March 2009, 04:31   #56  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,754
Give it the actual path to your variableblur.

Ex:
LoadPlugin("C:/path/to/my/variablur.dll")
vs just
LoadPlugin("variableblur.dll")
Adub is offline   Reply With Quote
Old 11th March 2009, 04:34   #57  |  Link
whwhwhwh9
Registered User
 
Join Date: Jul 2005
Posts: 13
tried that, didn't work, either.

#version 0.1, optimizations by Didee

loadPlugin("j:\test\variableBlur.dll")

......
whwhwhwh9 is offline   Reply With Quote
Old 12th March 2009, 00:37   #58  |  Link
Archimedes
Registered User
 
Join Date: Apr 2005
Posts: 213
VariableBlur needs the fftw3 library.
Archimedes is offline   Reply With Quote
Old 7th September 2009, 09:11   #59  |  Link
sumawo13
Learning Avisynth user
 
sumawo13's Avatar
 
Join Date: Sep 2008
Posts: 79
Quote:
Originally Posted by Didée View Post
Okay ... a bit earlier you said you deactivated everything *but* MCBob, so I thought you're still running the two fat boys in chain.

Next step: closer pebble examination. - try if the filters from the offending line cause an error when called on ther own:

Code:
AviSource("C:\VIDEO\Fuglekrigen.avi")
Trim(356, 94020)
converttoYV12
bob()

# unsharp(vary=2,varc=1)   #  error, or not?

# halomaskM(hbias=-128,hthr=256,amgrad=4) # error, or not?
What do I do if both of these cause an error? I'm having the same access violation error.
sumawo13 is offline   Reply With Quote
Old 12th October 2009, 09:08   #60  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
i'm trying to modify this script to be compliant with SEt's new aWarpSharp2. here's what I have so far:

old:
Code:
...
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)

awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
awarpsharp(cm=0, depth=3, blurlevel=1, thresh=0.99)
...
new:
Code:
...
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)

awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
...
this should do it right?

Code:
Original aWarpSharp compatibility:
  Mapping from original aWarpSharp parameters:
    thresh = thresh*256
    blur   = blurlevel
    depth  = depth*blurlevel/2
    chroma = 0->2, 1->4, 2->3

Last edited by canuckerfan; 12th October 2009 at 09:13.
canuckerfan 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 12:34.


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