View Full Version : Where to put resize and limited sharpen in this scripts?
Serbianboss
13th June 2006, 17:21
Where to put resize and limited sharpen in this scripts.
Does is better to put after noise reduction filter or no?
I always work with DV avi(interlaced) material.
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
ConvertToYuY2(interlaced=true)
degrainmedian(interlaced=true)
degrainmedian(interlaced=true)
crop(8,4,-8,-12)
AddBorders(8,8,8,8)
LoadPlugin("Convolution3d.dll")
avisource("C:\Documents and Setting\My Documents\Video 1.avi")
ConvertToYuY2(interlaced=true)
SeparateFields()
odd=SelectOdd.Convolution3D (1, 32, 128, 8, 32, 10, 0)
evn=SelectEven.Convolution3D (1, 32, 128, 8, 32, 10, 0)
Interleave(evn,odd)
Weave()
crop(8,4,-8,-12)
AddBorders(8,8,8,8)
thanx
unskinnyboy
13th June 2006, 17:45
Do the resizing before the denoising and LimitedSharpen after the denoising. That said, LimitedSharpen is not designed for interlaced material (until the much promised LS-EX gets ready at least), so if you must use LS, separate fields before and weave afterwards (for script #1).
Serbianboss
13th June 2006, 19:37
thanks, what is better: bilinear or bicubic resize.
Does resizing before denoising produce more noise than denoising and then resizing?
unskinnyboy
13th June 2006, 19:46
thanks, what is better: bilinear or bicubic resize.
Depends on what you want. Try them both and stick to the one you like.
Does resizing before denoising produce more noise than denoising and then resizing?Neither will "produce" any noise. In theory, if you denoise first, you have more information to work with and hence more details will be preserved (and maybe also noise hehe). If you resize first, you reduce the frame area with which the denoiser will work on, so it will be faster. Either way, I doubt you would see a lot of tangible difference, so it is debatable. I usually denoise after because if I want more details to be preserved, I would tweak the strength of the denoiser (or maybe not denoise at all) rather than putting it before the resizer. Try both!
Serbianboss
14th June 2006, 12:44
one more question, where to put some deinterlance filter. Because i want to make script whit deinterlance filter, resize, and noise reduction filter for VirtualDub to make divx
MrTroy
14th June 2006, 13:46
one more question, where to put some deinterlance filter. Because i want to make script whit deinterlance filter, resize, and noise reduction filter for VirtualDub to make divx
You don't have to deinterlace, as DivX can encode interlaced material (check "preserve interlacing" in DivX options).
If you do that, it's very important to use InterlacedResize (download here (http://www.trbarry.com/SimpleResize.zip)) instead of bilinear/bicubic.
Your final script (based on your first script) would look like:
LoadPlugin("SimpleResize.dll")
LoadPlugin("DegrainMedian.dll")
AviSource("C:\Documents and Settings\My Documents\Video 2.avi")
Crop(8,4,-8,-12)
AddBorders(8,8,8,8)
InterlacedResize(width,height)
ConvertToYUY2(interlaced=true).DegrainMedian(interlaced=true).DegrainMedian(interlaced=true)
SeparateFields().LimitedSharpen().Weave()
Serbianboss
14th June 2006, 13:51
My correction, i use Xvid not Divx. In that way, any change in script?
unskinnyboy
14th June 2006, 13:55
I think first you need to make up your mind about whether you need your output as interlaced or deinterlaced.
If interlaced, you needn't be using a deinterlacer. If deinterlaced, then you shouldn't be separating fields, selecting individual frames, weaving them back etc. If you do decide to deinterlace, place the deinterlacer before other filters like crop, denoiser & sharpener.
~bT~
14th June 2006, 13:57
This is a quote from a thread I created regarding filter set up.
Change the order, you must.
"Deinterlace before anything" part is correct, especially crop & resize. For the deinterlacing to work properly, the deinterlacer need the full vertical resolution, proper field order and the untouched video. If you crop before deinterlacing, you run the risk of changing the field-order, which means your deinterlacer won't work any more with the intended settings.
MrTroy
14th June 2006, 14:12
My correction, i use Xvid not Divx. In that way, any change in script?Xvid, too, can handle interlaced material. And that quote from another thread only said that IF you want to deinterlace you have to do that before anything else, it didn't say you always have to deinterlace.
~bT~
14th June 2006, 14:22
And that quote from another thread only said that IF you want to deinterlace you have to do that before anything else, it didn't say you always have to deinterlace.No, u got me wrong. I was replying to the original poster, not unskinnyboy. Guess he was too quick to respond.
Serbianboss
14th June 2006, 15:17
Yes, i want to deinterlance.Because i like that xvid files be deinterlaced.
So, can you help me to make script with some good deinterlaced filter, and with resize and with some noise reduction filter?
So,how can i make these script with Convolution 3d and degrainmedian noise filter(with script in my first post)
thanks
Serbianboss
14th June 2006, 23:15
To be more easyer:
Does this is write filter setup:
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
Some deinterlance filter
Some resize filter
ConvertToYuY2(interlaced=true)
degrainmedian(interlaced=true)
degrainmedian(interlaced=true)
Limited sharpen here
crop(8,4,-8,-12)
AddBorders(8,8,8,8)
LoadPlugin("Convolution3d.dll")
avisource("C:\Documents and Setting\My Documents\Video 1.avi")
Some deinterlance filter
Some resize filter
ConvertToYuY2(interlaced=true)
SeparateFields()
odd=SelectOdd.Convolution3D (1, 32, 128, 8, 32, 10, 0)
evn=SelectEven.Convolution3D (1, 32, 128, 8, 32, 10, 0)
Interleave(evn,odd)
Weave()
Limited sharpen here
crop(8,4,-8,-12)
AddBorders(8,8,8,8)
As i mentioned i work with DV avi material.
best regard
MrTroy
15th June 2006, 07:46
To be more easyer:
Does this is write filter setup:Of course you don't use the interlaced=true parameter with deinterlaced material. Also, cropping after resizing? Are you sure you don't want to do that before?
For the deinterlacer, it wouldn't be a bad idea to include AssumeBFF().
Serbianboss
15th June 2006, 10:00
Someone told me that if i deinterlance the source that i treat source like progressive.
Why i must crop and then resize?
Does is now better:
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
Some deinterlance filter
Some resize filter
ConvertToYuY2(interlaced=true)
degrainmedian() //here i deleted interlaced=true
degrainmedian()
Limited sharpen here
crop(8,4,-8,-12)
AddBorders(8,8,8,8)
LoadPlugin("Convolution3d.dll")
avisource("C:\Documents and Setting\My Documents\Video 1.avi")
Some deinterlance filter
Some resize filter
ConvertToYuY2(interlaced=true)
SeparateFields()
odd=SelectOdd.Convolution3D (1, 32, 128, 8, 32, 10, 0)
evn=SelectEven.Convolution3D (1, 32, 128, 8, 32, 10, 0)
Interleave(evn,odd)
Limited sharpen here
Weave()
crop(8,4,-8,-12)
AddBorders(8,8,8,8)
Wilbert
15th June 2006, 11:50
Your second script is for interlaced stuff. When you deinterlace it and pass it to the resizer, it's deinterlaced. So, your first script is correct:
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
Some deinterlance filter
Some resize filter
ConvertToYUY2(interlaced=false)
degrainmedian()
Limited sharpen here
crop(8,4,-8,-12)
Note i've set interlaced=false in ConvertToYUY2 since it receives progresssive content from the resizer.
Where you put Crop doesn't matter much (provided the values are correct), provided you apply it after deinterlacing (like you did). However when doing Crop before the denoising, the denoiser needs to process less pixels, making your script faster.
Serbianboss
15th June 2006, 17:27
So it's better to move crop like this(before denoiser):
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
Some deinterlance filter
Some resize filter
ConvertToYUY2(interlaced=false)
crop(8,4,-8,-12)
degrainmedian()
Limited sharpen here
AddBorders(8,8,8,8)
Is this OK,first deinterlance,than resize and than crop an at the end is limited sharpen?
And this script with convolution 3d is that ok or no:
LoadPlugin("Convolution3d.dll")
avisource("C:\Documents and Setting\My Documents\Video 1.avi")
Some deinterlance filter
Some resize filter
ConvertToYuY2(interlaced=false)
crop(8,4,-8,-12)
Convolution3D (1, 32, 128, 8, 32, 10, 0)
Limited sharpen here
AddBorders(8,8,8,8)
thanks
Wilbert
15th June 2006, 20:20
Is this OK,first deinterlance,than resize and than crop an at the end is limited sharpen?
And this script with convolution 3d is that ok or no:
Yes, both are ok.
Serbianboss
16th June 2006, 00:51
Ok, thats is finished for now.
Now I have questions for interlaced source. I want to add 2 filters: limited sharpen and HDRAGC filter. Where to put this two 2 filter on this interlaced scripts:
LoadPlugin("Convolution3d.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
crop(8,4,-8,-12)
ConvertToYuY2(interlaced=true)
SeparateFields()
odd=SelectOdd.Convolution3D (1, 32, 128, 8, 32, 10, 0)
evn=SelectEven.Convolution3D (1, 32, 128, 8, 32, 10, 0)
Interleave(evn,odd)
Weave()
AddBorders(8,8,8,8)
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
crop(8,4,-8,-12)
ConvertToYuY2(interlaced=true)
degrainmedian(interlaced=true)
AddBorders(8,8,8,8)
Boulder
16th June 2006, 08:01
Use the search. There are plenty of threads about treating interlaced material.
Serbianboss
16th June 2006, 09:43
i know to use with interlaced material, but i am interesting comments where is the best place to put limited sharpen and HDRAGC in this interlaced script.
Boulder
16th June 2006, 10:00
If you know how to treat interlaced material, then there are not that many places where to put the filters. Test and see what your eyes like the most. It's against the forum rules to ask what's best because everyone has his own opinion anyway :)
Serbianboss
16th June 2006, 11:47
Normaly that everyone has own opinion, but i want to hear what most people recommened for this filters.
Wilbert
16th June 2006, 13:02
Read 7.2.11 from the Analog capture guide (http://www.doom9.org/index.html?/capture/postprocessing_avisynth.html). For your purpose, LimitSharpen is a spatial filter, and HDRAGC is (probably; although i'm not sure) a spatio-temporal filter.
Boulder
16th June 2006, 13:11
HDRAGC is (probably; although i'm not sure) a spatio-temporal filter.
Yes, it uses a specified number of frames (the parameter avg_window) for averaging the gain value.
Serbianboss
16th June 2006, 16:49
Read 7.2.11 from the Analog capture guide (http://www.doom9.org/index.html?/capture/postprocessing_avisynth.html). For your purpose, LimitSharpen is a spatial filter, and HDRAGC is (probably; although i'm not sure) a spatio-temporal filter.
Excelent tutorial.
I have one question. I captured in Dv avi with canopus 110. And when make script in avisynth does is better to put converttoyuy2 or converttoyv12.
I dont now what is better. Today i first try with yv12 and it was 50% faster than yuy2. But picture is little more sharpen with yv12(more noise stay) and with yuy2 picture is more smooth(little sharper,little noise stay).
Serbianboss
17th June 2006, 15:00
I have one question about degrain median filter.
Because degrain median is spatial-temporal filter, does is correctly to use this script on DV avi files(i want to my film stay interlaced)
SCRIPT 1
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 1.avi")
ConvertToYuY2(interlaced=true)
SeparateFields()
odd=SelectOdd.DeGrainMedian (interlaced=true)
evn=SelectEven.DeGrainMedian (interlaced=true)
Interleave(evn,odd)
Weave()
But i ususally do this:
SCRIPT 2
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 2.avi")
ConvertToYUY2(interlaced=true)
degrainmedian(interlaced=true)
Boulder
17th June 2006, 15:04
The interlaced=true parameter in DegrainMedian probably does the same as the above script.
Serbianboss
17th June 2006, 15:12
when using degrain median with separate fields(script 1) does i need to write interlaced=true because i using odd=SelectOdd and evn=SelectEven ?
krieger2005
17th June 2006, 15:15
no. It is then field-wise, so not interlaced.
Serbianboss
17th June 2006, 15:39
ok,so its stay without interlaced=true
LoadPlugin("DeGrainMedian.dll")
avisource("C:\Documents and Settings\My Documents\Video 1.avi")
ConvertToYuY2(interlaced=true)
SeparateFields()
odd=SelectOdd.DeGrainMedian ()
evn=SelectEven.DeGrainMedian ()
Interleave(evn,odd)
Weave()
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.