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 24th November 2005, 08:47   #41  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
I thought it was my source and choice of codec.
Pookie is offline   Reply With Quote
Old 1st February 2006, 05:00   #42  |  Link
iceborne
Registered User
 
iceborne's Avatar
 
Join Date: Aug 2003
Posts: 43
i keep on getting washed out color whenever i applied this script:
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\removegrainsse2.dll")
LoadPlugin("C:\Program Files\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")

mpeg2source("e:\dvd\divergence.d2v")

Telecide(guide=1).Decimate()

crop(4,60,-4,-60)

trim(5000,10000)


dull   = last
sharp  = dull.LimitedSharpenfaster( smode=4, dest_x=720, dest_y=368 )

Soothe( sharp, dull, 20 )

undot()
but if i leave out the resizing parameter
"dest_x=720, dest_y=368 ",
everything's good.

can anyone tell me what's wrong with my script?
iceborne is offline   Reply With Quote
Old 1st February 2006, 05:32   #43  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,420
Heh, I thought it was LSFaster for a few, until I noticed that you never resized dull. Pick a good scene with very sharply defined colors, and you'll notice the chroma will bleed horribly, since it gets copied from the second argument, not the first. Lesson: Always remember to resize both clips.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 1st February 2006, 05:48   #44  |  Link
iceborne
Registered User
 
iceborne's Avatar
 
Join Date: Aug 2003
Posts: 43
good man!

here's my new script
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\removegrainsse2.dll")
LoadPlugin("C:\Program Files\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")

mpeg2source("e:\dvd\divergence.d2v")

Telecide(guide=1).Decimate()

crop(4,60,-4,-60)

LanczosResize(720,368)



dull   = last
sharp  = dull.LimitedSharpenfaster( smode=4, dest_x=720, dest_y=368 )

Soothe( sharp, dull, 24 )

undot()

trim(5000,10000)
btw, does it matter where i put undot()?
iceborne is offline   Reply With Quote
Old 1st February 2006, 06:41   #45  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
try:
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\removegrainsse2.dll")
LoadPlugin("C:\Program Files\DGMPGDec\dgdecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")

mpeg2source("e:\dvd\divergence.d2v")

Telecide(guide=1).Decimate()

crop(4,60,-4,-60)



dull   = last.LanczosResize(720,368)
sharp  = dull.LimitedSharpenfaster( smode=4, dest_x=720, dest_y=368 )

Soothe( sharp, dull, 24 )

undot()

trim(5000,10000)
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 2nd February 2006, 04:39   #46  |  Link
iceborne
Registered User
 
iceborne's Avatar
 
Join Date: Aug 2003
Posts: 43
thanhs guy. another question do you think sooth(sharp, dull, 24) is too low? or should i raise it to make the image sharper
iceborne is offline   Reply With Quote
Old 12th February 2006, 01:46   #47  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,420
In case anyone is feeling the burn and needs for speed, masktools 2:
Code:
function Soothe(clip sharp, clip orig, int "keep")
{
Assert(sharp.width == orig.width && sharp.height == orig.height,
 \  "Soothe: clip dimentions must match!")
keep  = default(keep, 24)
keep  = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP    = string(keep)
diff  = mt_makediff(orig,sharp)
diff2 = diff.temporalsoften(1,255,0,32,2)
diff3 = mt_lutxy(diff,diff2,  "x 128 - y 128 - * 0 < x 128 - 100 / "  + KP 
 \                           + " * 128 + x 128 - abs y 128 - abs > x " + KP 
 \                           + " * y 100 " + KP + " - * + 100 / x ? ?")
return( mt_makediff(orig,diff3,chroma="copy first") )
}
[edit: Added a check for dimentions, since that's the most common misuse. Also Didée TS suggestion.]
[edit2: Added both to wiki: http://www.avisynth.org/mediawiki/Soothe ]
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.

Last edited by foxyshadis; 25th January 2007 at 19:21.
foxyshadis is offline   Reply With Quote
Old 12th February 2006, 02:33   #48  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Even faster:

>> diff2 = diff.temporalsoften(1,255,0,32,2)

'cause here, chroma isn't interesting anyways, and TS runs faster when not having to also process the UV planes ...
__________________
- 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 12th February 2006, 06:03   #49  |  Link
iceborne
Registered User
 
iceborne's Avatar
 
Join Date: Aug 2003
Posts: 43
cool, will try on next encode.
iceborne is offline   Reply With Quote
Old 12th April 2006, 15:11   #50  |  Link
diazlaz
Registered User
 
Join Date: Oct 2003
Posts: 2
Is it possible to get the soothe function to work, when a frame is being resized by LS? Example, currently have a video that is sized at 352,480, and using LimitedSharpenFaster(ss_x=1.2,ss_y=1.2,dest_x=704,dest_y=480,Smode=4,soft=24) to resize it to 704x480, when soothe runs, it errors with:

YV12LUTxy: Clip size must be the same.

Code:
function Soothe(clip sharp, clip orig, int "keep")
{
keep  = default(keep, 24)
keep  = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP    = string(keep)
diff  = yv12lutxy(orig,sharp,"x y - 128 +", U=1,V=1)
diff2 = diff.temporalsoften(1,255,255,32,2)
diff3 = yv12lutxy(diff,diff2,  "x 128 - y 128 - * 0 < x 128 - 100 / "  + KP 
 \                           + " * 128 + x 128 - abs y 128 - abs > x " + KP 
 \                           + " * y 100 " + KP + " - * + 100 / x ? ?",  U=1,V=1)
return( yv12lutxy(orig,diff3,"x y 128 - -",U=2,V=2) )
}
Thanks,
Laz.
diazlaz is offline   Reply With Quote
Old 12th April 2006, 16:12   #51  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,420
See Mug Funky's last post, on this page. Also consider using the version I posted.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 16th April 2006, 00:37   #52  |  Link
Oline 61
Registered User
 
Join Date: Nov 2005
Posts: 327
The output of this script is awesome, but it is extraordinarily slow. Like running pixiedust on a 4096x1920 image. Huffyuv can encode it at ~1.5 fps. Can anyone recommend a way to speed it up?
Code:
MPEG2Source("VTS_06_1.d2v",cpu2="ooooxx")

Telecide(guide=1,post=1,back=1)

Decimate()

Crop(2,56,716,362)

LanczosResize(1280,544)
RemoveGrain(mode=1)
dull=fft3dfilter(sigma=1.5)

sharp=LimitedSharpen(dull,
	\	ss_x=1.5, 		ss_y=1.5,
	\	dest_x=1280, 		dest_y=544,
	\	Smode=3, 		strength=115,
	\	Lmode=3, 		edgemode=1)

Soothe(sharp,dull)
Oline 61 is offline   Reply With Quote
Old 16th April 2006, 20:46   #53  |  Link
krieger2005
Registered User
 
krieger2005's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 377
@Oline 61: Don't use fft3dfilter. If the speed-improvement is not enought don't use limitedsharpen... and so on
krieger2005 is offline   Reply With Quote
Old 16th April 2006, 21:59   #54  |  Link
Oline 61
Registered User
 
Join Date: Nov 2005
Posts: 327
Without fft3dfilter there is no denoising. The output looks horrible because half of what is being sharpened is film grain.
I have tried putting fft3dfilter before the resize, and I think it might just be fast enough that way.
Code:
height=1280
width=544

MPEG2Source("VTS_06_1.d2v",cpu2="ooooxx")

Telecide(guide=1,post=1,back=1)

Decimate()

Crop(2,56,716,362)

in=fft3dfilter(sigma=1.5)

dull=LanczosResize(in,height,width)

sharp=LimitedSharpen(in,
	\	ss_x=1.5, 		ss_y=1.5,
	\	dest_x=height, 		dest_y=width,
	\	Smode=3, 		strength=115,
	\	Lmode=1, 		edgemode=1)

Soothe(sharp,dull,32)
Oline 61 is offline   Reply With Quote
Old 17th April 2006, 03:53   #55  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,420
Well, ft3d isn't the only denoiser; for similar results you might try a degrainmedian (or two). Or possibly mipsmooth, but that's harder to control.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 17th April 2006, 05:58   #56  |  Link
Oline 61
Registered User
 
Join Date: Nov 2005
Posts: 327
DegrainMedian doesn't do all of the things I need. Removing grain is great, but it doesn't clean up the compression artifacts from the DVD like fft3dfilter does. I've got it up to about 2.6 fps for a turbo first pass. That is acceptable. Here is the script:
Code:
SetMemoryMax(768)
width=1280
height=544

MPEG2Source("VTS_06_1.d2v",cpu2="ooooxx")

Telecide(guide=1,post=1,back=1)

Decimate()

Crop(2,56,716,362)

in=fft3dfilter(sigma=1.5)

dull=BicubicResize(in,width,height)

sharp=LimitedSharpen(in,
	\	ss_x=1.5, 		ss_y=1.5,
	\	dest_x=width, 		dest_y=height,
	\	Smode=3, 		strength=100,
	\	Lmode=1, 		edgemode=1)

Soothe(sharp,dull)
EDIT: I'ma give LimitedSharpenFaster() a shot too.

Last edited by Oline 61; 17th April 2006 at 06:12.
Oline 61 is offline   Reply With Quote
Old 6th June 2006, 00:59   #57  |  Link
audioslave
Registered User
 
audioslave's Avatar
 
Join Date: Apr 2004
Location: Sweden
Posts: 35
I'm getting an error when using Soothe(). VDub says:

Script error: There is no function named "yv12lutxy".

What am I missing?

My script
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LimitedSupport_09Jan06B.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\LRemoveDust.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\plugins\Soothe.avsi")

Mpeg2Source("D:\Hea\Video\DVD\Temp\Temp.d2v")

LRemoveDust_YV12(17,2)
Crop(6,78,710,420)

dull  = last.LanczosResize(704,416)
sharp = dull.LimitedSharpenFaster(dest_x=704,dest_y=416)

Soothe(sharp,dull,20)

Addborders(0,80,0,80)
__________________
-AudioSlave
audioslave is offline   Reply With Quote
Old 6th June 2006, 01:12   #58  |  Link
audioslave
Registered User
 
audioslave's Avatar
 
Join Date: Apr 2004
Location: Sweden
Posts: 35
I solved it. I didn't have MaskTools in my plugin directory...
__________________
-AudioSlave
audioslave is offline   Reply With Quote
Old 20th January 2007, 06:47   #59  |  Link
HeadBangeR77
Registered User
 
HeadBangeR77's Avatar
 
Join Date: Dec 2006
Location: Heidelberg (DE), Kraków (PL)
Posts: 519
I'm just thinking while writing If we resize, we can't write like e.g.:

dull = last
sharp = dull.LimitedSharpenFaster(dest_x=720,dest_y=304)


provided we haven't resized (to our destination resolution) before. That's the mistake iceborne made above in his first script. Then the comparison clip /background (dull) would have a different resolution than the sharpened clip, and the whole function didn't make sense. However, if we write ...

dull = last.LanczosResize(720,304)

than we don't have to specify the resolution arguments in LSF, do we?! I mean sharp = dull + LSF, and dull has already been resized just one line above. So we can write afterwards ...

sharp = dull.LimitedSharpenFaster() ?

How blind & stupid have I been! (bangs his head against the wall ) If the above is right, then LSF has the destination resolution, instead of the source resolution, as an input. That changes the supersampling effect, though the function's arguments don't change, and thus the sharpening strength too. Could anyone confirm /deny the above?

If that's true, I've spent all my day just in vain, encoding samples I didn't actually want to encode. It would rather not matter, if I was downsizing a bit, like in the above examples, but I'm upsizing atm, and that changes a lot ...
__________________
"Only two things are infinite: the universe and human stupidity, and I'm not sure about the former."

Last edited by HeadBangeR77; 20th January 2007 at 06:50.
HeadBangeR77 is offline   Reply With Quote
Old 20th January 2007, 07:31   #60  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Code:
# how to soothe LimitedSharpen when LS is set up to change resolution

dx = your_target_width
dy = your_target_height

base = last.LanczosResize( dx, dy )
shrp = last.LimitedSharpen( dest_x = dx, dest_y = dy )

shrp.Soothe(base)
__________________
- 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
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 05:25.


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