digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Adding scene change blur to static script? (http://www.digitalfaq.com/archives/avisynth/6488-avisynth-adding-scene.html)

audioslave 11-02-2003 09:35 PM

Avisynth: Adding scene change blur to static script?
 
Is it possible and if so - how do I do it? It would reduce the filesize, right?

kwag 11-02-2003 10:09 PM

Re: Adding the MA "scene change blur" to static sc
 
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

audioslave 11-02-2003 10:12 PM

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?

kwag 11-02-2003 10:35 PM

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 :lol:
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

audioslave 11-02-2003 10:42 PM

Thanks kwag! :D I think the fault was mine - not you reading too fast. I gave the topic a confusing name... :oops: But I changed it as fast as I could.
I will try your suggestion at once! :wink:

audioslave 11-02-2003 10:50 PM

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.

kwag 11-02-2003 11:17 PM

Quote:

Originally Posted by audioslave
Is there a way of blurring the frame after too?

Of course :D
Everything is possible :cool:
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

audioslave 11-02-2003 11:23 PM

Thanks a lot!!! :D


All times are GMT -5. The time now is 06:10 PM  —  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.