Quantcast Avisynth: my Attempt on a New Script - digitalFAQ.com Forums [Archives]
  #1  
10-06-2003, 05:22 AM
ak47 ak47 is offline
Free Member
 
Join Date: Oct 2002
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
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
__________________
Later ak
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
10-06-2003, 05:37 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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.
Reply With Quote
  #3  
10-06-2003, 07:19 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #4  
10-06-2003, 09:36 PM
ak47 ak47 is offline
Free Member
 
Join Date: Oct 2002
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
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.
__________________
Later ak
Reply With Quote
  #5  
10-07-2003, 01:23 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Well, FOrder() may work for VOBs (IIRC they are 99% top field first) but I'd still do a manual double-check 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.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
KVCD: First attempt, first success! stevied20 Video Encoding and Conversion 9 12-06-2004 10:36 AM
KVCD: First Attempt with Script, What do you think? KunGFu-L33t Video Encoding and Conversion 3 11-16-2003 07:06 AM
Avisynth: First attempt with MA Optimal Script - colors all wrong! Icarus3000 Avisynth Scripting 19 10-02-2003 08:29 AM
Avisynth: Difference between MA script and optimal script? mistermickster Avisynth Scripting 2 08-01-2003 09:36 AM
KVCD: Fantastic first attempt Tiffy Video Encoding and Conversion 0 05-24-2002 05:27 AM

Thread Tools



 
All times are GMT -5. The time now is 08:33 PM  —  vBulletin © Jelsoft Enterprises Ltd