Quantcast Avisynth: Adding Scene Change Blur to Static Script? - digitalFAQ.com Forums [Archives]
  #1  
11-02-2003, 09:35 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Is it possible and if so - how do I do it? It would reduce the filesize, right?
__________________
AudioSlave
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  
11-02-2003, 10:09 PM
kwag kwag is offline
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
Is it possible and if so - how do I do it? It would reduce the filesize, right?
Only if your movie is a very high action, you will see some reduction in file size.
The more active the movie and the more scene changes, then you'll take advantage of the MA portion of the script.

You need to add the following lines right after your "Mergeluma" line:
Code:
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) ")
-kwag
Reply With Quote
  #3  
11-02-2003, 10:12 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
What I'm looking for is to only blur the frames before and after a scene change. Not to motion adapt the bluring like in the MA script...
If I have two scenes of 100 frames each I want to blur frame 100 of the first scene and frame 1 of the second scene. That must be possible, right?
__________________
AudioSlave
Reply With Quote
  #4  
11-02-2003, 10:35 PM
kwag kwag is offline
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
What I'm looking for is to only blur the frames before and after a scene change. Not to motion adapt the bluring like in the MA script...
If I have two scenes of 100 frames each I want to blur frame 100 of the first scene and frame 1 of the second scene. That must be possible, right?
See, I'm reading too fast again
Ok, now I read your post again.
You can do it with a very high "nf" treshold.
Add the lines I gave you above, but like this:

Code:
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >=30 ? \ 
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \ 
unfilter( 0, 0 ) ")
I set the switch treshold to 30, where it reads: "nf >=30 ?
This is just a guess value, which I just picked up.
What you really need to do is add this line at the end of your script:
Code:
ScriptClip("Subtitle(String(nf),1,30)")
Then load your .avs in Vdub, and scroll throughout the movie, and look at the value you'll see in the upper left of your screen. Look at the highest value during scene changes, and use that value instead of the "30" I posted.
Please note that the value will be different, depending what resolution you are encoding.
What the MA part I just posted will do, is indeed blurr very heavyly only on scene changes, and "do nothing" ( unfilter (0, 0 ) ) below that treshold.
Give it a try, and let me know

-kwag
Reply With Quote
  #5  
11-02-2003, 10:42 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks kwag! I think the fault was mine - not you reading too fast. I gave the topic a confusing name... But I changed it as fast as I could.
I will try your suggestion at once!
__________________
AudioSlave
Reply With Quote
  #6  
11-02-2003, 10:50 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Looks like I will have to raise the value to 40... It looks as if only the frame before the scene change is blurred. Is there a way of blurring the frame after too? If it's useful I mean... The idea is to make it easier on TMPGEnc and to get smaller video files.
__________________
AudioSlave
Reply With Quote
  #7  
11-02-2003, 11:17 PM
kwag kwag is offline
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
Is there a way of blurring the frame after too?
Of course
Everything is possible
Then this is what you want:
Code:
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >=18 ? \ 
unfilter( -50, -50 ) : \ 
unfilter( 0, 0 ) ") 
ScriptClip("nf = YDifferenceFromPrevious()"+chr(13)+ "nf >=18 ? \ 
unfilter( -50, -50 ) : \ 
unfilter( 0, 0 ) ")
Edit: Change the "18" to whatever is more effective, depending on your resolution. I used -50, -50 for blurring value. The more negative, the more blurr. Play with that too, until you find the value you want. I consider -50 quite strong, but it does a great job on blurring before and after scene change frames.

-kwag
Reply With Quote
  #8  
11-02-2003, 11:23 PM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks a lot!!!
__________________
AudioSlave
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Scene Change Detection? Prodater64 Avisynth Scripting 1 02-29-2004 09:05 PM
Avisynth: How about an Optimal Static Script? audioslave Avisynth Scripting 7 11-03-2003 10:23 AM
Avisynth: Detect scene change and TemporalCleaner ? NismoSX Avisynth Scripting 4 07-19-2003 12:20 PM
Avisynth: Mod to NOT blur last frame prior to scene change? FredThompson Avisynth Scripting 20 07-16-2003 04:30 AM
Avisynth: I can see the blur on scene changes! audi2honda Avisynth Scripting 11 07-08-2003 09:46 PM

Thread Tools



 
All times are GMT -5. The time now is 10:02 AM  —  vBulletin Jelsoft Enterprises Ltd