digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: My attempt on a new script (http://www.digitalfaq.com/archives/avisynth/5987-avisynth-attempt-script.html)

ak47 10-06-2003 05:22 AM

My attempt on a new script
 
I have been working on a new avs 2.5 script, and I came to a conclusion on this one, its a little slower, but it actually compresses it a lot more. I encoded a source that is animation and a littlie noisy, the clip is 24 mins long. The new filtering I used was strong and not motion adaptive so Kwag please take a look at this, so you can make it more suitable for speed/quality. This it the old script with little optimization for being an animation.
Code:

MaxTreshold = 1.50
nf =  0


Mpeg2Source("I:\GOD1\VIDEO_TS\kenshin E1.d2v")

b = DGBob(FOrder(),mode=1,thresh=255)
SeparateFields()
SmartDecimate(bob=b,noise=0.80,tel=0.25)
FieldDeinterlace()
Undot()
Limiter()
Asharp(1,4)
BicubicResize(496, 320, 0, 0.6, 2, 9, 716, 462)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.25))


SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")

AddBorders(24, 80, 24, 80)
Limiter()


function FOrder(clip c) {
fo= GetParity(c)? 1:0
return fo
}

function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}

It took 32:34 and was 202mbs and is the same CQ and quality level.
The one I created is a slower, simpler, but a lot more compressed.
Code:

MaxTreshold = 1.50
nf =  0


Mpeg2Source("I:\GOD1\VIDEO_TS\kenshin E1.d2v")

b = DGBob(FOrder(),mode=1,thresh=255)
SeparateFields()
SmartDecimate(bob=b,noise=0.80,tel=0.25)
FieldDeinterlace()
Limiter()
BicubicResize(496, 320, 0, 0.6, 2, 9, 716, 462)
VagueDenoiser(threshold=1.2,method=3,nsteps=6,chroma= true)
unfilter(-65,-65)
deen("a3d",3,13,20,5)

AddBorders(24, 80, 24, 80)
Limiter()


function FOrder(clip c) {
fo= GetParity(c)? 1:0
return fo
}

This clip took me 48:49 and was the size of 191mbs.
I need someone to take a look at these scripts cause I can't trust my eyes enough. Also beware of gripcrop, it will give you green/black lines in the outer boarder, because of VagueDenoiser.

P.S.I used a Athlon XP 2800+ processor
P.S.S.I most likely missed a lot of stuff I said and missed said a lot of stuff, but I wanted to give this script out so when I come back from school I maybe have some results

incredible 10-06-2003 05:37 AM

Shure you will get less filesize by using the second script.

The first script contains the MA routine which is not so agressive in its "over all" cleaning method. It hadles especially fast motion scenes ... thats why we call it "Motion adaptive".

Your second script is "static" and you use ver heavy methods/filters to clean the whole image.

Quote:

VagueDenoiser(threshold=1.2,method=3,nsteps=6,chro ma= true)
unfilter(-65,-65)
deen("a3d",3,13,20,5)
Is a heavy combination for a "little noisy" source, it plains too much of a still good looking source. Cause you will lost details like in peoples hair.
Also your "static" one does not contain a sharpen filter like in the "MA" Asharp().
By not sharpen the movie you will shurely get a file smaller size or on the other hand more CQ.

Well I know that Unfilter using negative values does soften the image!?
So if you put this one in front of deen(), deen() can't handle correctly the difference between noise and details. ... and by the way the noise should already be handled by VagueDenoiser .... in your "little" noisy source.
Its better to configure and choose one cleaning filter correctly than doing the cleaning job using 3.

Boulder 10-06-2003 07:19 AM

My thoughts:

You can't determine the field order automatically. Avisynth only makes a guess, just as Bitrate Viewer, TMPGEnc or any program does. You'll have to figure it out every time manually. So, GetParity does not help.

Why do you deinterlace twice (SmartDecimate versus FieldDeinterlace) ? If you plan to remove odd comb artifacts that may have slipped through SmartDecimate, use FieldDeinterlace(full=false).

Why do you separate the fields before deinterlacing?

You should never crop an odd number of pixels.

IMHO the second script will leave no details whatsoever, that's why it compresses so well :lol:

ak47 10-06-2003 09:36 PM

Sorry to respond so late. Well my attempt was to show the newer filters and show the strength of them so someone could pick it up and make new MA script. I am not a programmer just a student that wants to help the encoding community. But when I encoded that video with a lower bitrate the video that was made from the second script posted above, was cleaner and didn't seamed to have much or any loss in detail, but it was and animated video and its my eyes so I could be wrong.

P.S. The file sizes was 156mbs with mine and 165mbs with MA, also I am going to try to make a better script from what you guys suggested.
P.S.S. Boulder this is were I got my information on my decomb/deinterlace http://neuron2.net/ipw-web/bulletin/...=asc&start=100 Also I thought SmartDecimate was not a deinterlacer, but to allowed it to have integrated functions of doing that.

Boulder 10-07-2003 01:23 AM

Well, FOrder() may work for VOBs (IIRC they are 99% top field first) but I'd still do a manual double-check :wink: If you check the documentation it states that "it is very important that the field order is correct."

SmartDecimate is a deinterlacer, and that's why FieldDeinterlace(full=false) should be used to clean the remaining comb artifacts. If you put FieldDeinterlace(), the filter will deinterlace all frames no matter if they are combed or not! You can see the processing by entering FieldDeinterlace(full=false,show=true) and it will show you the analysis result for each frame. You can use it for tweaking the thresholds too.

This is what Bilu said in that thread about SeparateFields():

Quote:

A curious thing: I had to use SeparateFields() like in previous versions because the filter reported an error when I didn't.

But the manual says nothing about it!
The docs say now that the filter does a SeparateFields() when it is used so another SeparateFields() should not be needed.


All times are GMT -5. The time now is 04:39 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.