07-07-2003, 05:59 PM
|
Free Member
|
|
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi kwag and all,
From what I understand the MA script is optimized for resolutions from 528x480/576 and up? What changes do I have to make to the script if I plan encodes at 352x240/288 or 480x480/576? Maybe a stupid question...
__________________
AudioSlave
|
Someday, 12:01 PM
|
|
Site Staff / Ad Manager
|
|
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
07-07-2003, 06:03 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi audioslave,
The only change needed should be the value for switching between blurring and Temporal filtering.
Look at the line: ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
And change the >= 2 to >=4
That should basically take care of 352x240(28  .
For 480x, I think that a value of 3 should be pretty close to ideal.
Give it a try
-kwag
|
07-07-2003, 06:09 PM
|
Free Member
|
|
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@kwag,
Thank you for your fast reply as always! What parameter am I tampering with if I'm changing the value you described? I mean, what does it do?
__________________
AudioSlave
|
07-07-2003, 06:14 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The value you are tampering with is the value to compare the returned value from the function "YDifferenceToNext()".
The less activity, the lower the value and vice versa. So it's really a "treshold" trigger point to switch between the blurring line "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) )" and the Temporal line "TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) ,1, 1)"
-kwag
|
07-07-2003, 06:21 PM
|
Free Member
|
|
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks again! I was just curious. So what will happen if I use the value for 528x480/576 if I'm encoding 352x240/288 for example?
__________________
AudioSlave
|
07-07-2003, 08:12 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by audioslave
Thanks again! I was just curious. So what will happen if I use the value for 528x480/576 if I'm encoding 352x240/288 for example?
|
The value returned by "YDifferenceToNext()" will be different for different resolutions, so you'll be switching filters at non-optimal activity values. You can easily see the value of "nf" variable (the treshold variable) if you insert this line at the end of your script:
Code:
ScriptClip("Subtitle(String(nf),1,30)")
This way you can tune the treshold point by loading your script in Vdub, and sliding to different parts of your movie. Try it
-kwag
|
07-08-2003, 12:37 AM
|
Free Member
|
|
Join Date: Sep 2002
Location: USA
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
So for fine tuning using a 1/2 DVD Rez, (352x480 ntsc) a value of >=3 or 4 sounds
about right, depending on the movie?
*******************************
The Devil`s always.....in the Details!
|
07-08-2003, 08:13 AM
|
Free Member
|
|
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Kwag,
Is it possible to use a formula to derive this threshold based on the width of the clip?
I have tried the following code and it assigns the threshold based on the current width of the clip.
Code:
DifferenceThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= DifferenceThreshold ? \
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) ")
The reason I do "<=" is that the overscan parameter of GripCrop will reduce the width so it may be less than 352 etc until GripBorders runs. I used your example (below) to view the value:
Code:
ScriptClip("Subtitle(String(DifferenceThreshold),1,30)")
and I can see the value changing for each resolution I choose. This way the script can be automated further or do you think this would impact performance?
Cheers,
Fiz.
__________________
Fizzy Wizzy Lets get Bizzy!
|
07-08-2003, 10:28 AM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Fiz
Kwag,
Is it possible to use a formula to derive this threshold based on the width of the clip?
|
Yes Quote:
I have tried the following code and it assigns the threshold based on the current width of the clip.
Code:
DifferenceThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= DifferenceThreshold ? \
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) ")
The reason I do "<=" is that the overscan parameter of GripCrop will reduce the width so it may be less than 352 etc until GripBorders runs. I used your example (below) to view the value:
|
That's's correct, and it must be done that way to consider overscan blocks Quote:
Code:
ScriptClip("Subtitle(String(DifferenceThreshold),1,30)")
and I can see the value changing for each resolution I choose. This way the script can be automated further or do you think this would impact performance?
Cheers,
Fiz.
|
Hi Fiz,
You just reminded me of what I did a long time ago to automate Blockbuster noise levels, depending on resolution 
Your lines are perfect, and just made it to the current script 
I'm updating it right now
Thanks,
-kwag
|
07-08-2003, 10:53 AM
|
Free Member
|
|
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by kwag
Your lines are perfect, and just made it to the current script
I'm updating it right now
|
Cool
__________________
Fizzy Wizzy Lets get Bizzy!
|
07-08-2003, 10:59 AM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Fiz,
Script posted 
I only changed the variable name "DifferenceThreshold" to " SwitchThreshold", because it seemed more appropiate for the description 
I just tried it on a one minute clip, and there are no speed penalties with or without the changes 
Probably because it's just comparing constants
-kwag
|
07-08-2003, 11:12 AM
|
Free Member
|
|
Join Date: Jan 2003
Location: London, UK
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks kwag, being the novice I am I've learnt so much from this forum, not to mention the high quality encodes I'm churning out these days! I'm just glad to be part of it!
__________________
Fizzy Wizzy Lets get Bizzy!
|
07-28-2003, 05:29 PM
|
Free Member
|
|
Join Date: Jan 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Code:
DifferenceThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
if i understand that right if its <=352 it assigns a 4 if <=480 a 3 and all else is assigned a 2 ?
|
07-28-2003, 05:41 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by TLTw
if i understand that right if its <=352 it assigns a 4 if <=480 a 3 and all else is assigned a 2 ?
|
Yep
-kwag
|
07-28-2003, 07:12 PM
|
Free Member
|
|
Join Date: May 2003
Location: Michigan
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have been using the current MA script with 352x240 resolution since it came out and it looks great on my tv. I didnt know I had to change any values for 352x240
David
|
07-28-2003, 08:40 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi DKruskie,
You should use the line above, because it does make a difference 
Check the curent script page, and update you script
-kwag
|
07-28-2003, 10:06 PM
|
Free Member
|
|
Join Date: May 2003
Location: Michigan
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I updated my script..do I need to change any values for 352x240 or are they already set?
David
|
07-28-2003, 10:22 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by DKruskie
I updated my script..do I need to change any values for 352x240 or are they already set?
David
|
They are automatically set
-kwag
|
07-28-2003, 10:26 PM
|
Free Member
|
|
Join Date: May 2003
Location: Michigan
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Cool, thanks Kwag
David
|
07-28-2003, 10:35 PM
|
Free Member
|
|
Join Date: Jan 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Kwag,
I just took a(brief) look through the avisynth manual its more than just frameserving its a language in its own right.
|
All times are GMT -5. The time now is 11:26 PM — vBulletin © Jelsoft Enterprises Ltd
|