View Single Post
Old 10th November 2006, 00:07   #9  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
@Livesms, Learning AVS script is easy, just start with some rough house script thats does something a bit like what you want and start changing it. Start by changing the numbers that effect shape and size, then as confidence grows change the structure. After a while you realise hard code numbers are gross and you parameterise your scripts for quick adaption next time.

And yes dissolve will do the audio crossfade very nicely. Just do an AudioDub(Dissolve(.....)) to graft in the tweaked audio track.

@Wilbert, nice throw together from a very rough idea.

@All, Here's my rendering from half an hours tinkering.

Points of interest :-
  • Using crop to slide the mask was not granular enough, so I used the subpixel element of the resizers.
  • I needed some extra width for the higher order resizers. So I upped it to an 8 pixel prototype, then used a 2 pixel scan window. (Gunna have to fix up this for 2.6 Grrr)
  • I dropped the center grey pixel, it causes an unpleasant ledge in the middle of the slope.
  • I tried all the resizers. As an aside it is interesting to see the various ringing and artifacts with such a hugh upscale when you stack them together for relative viewing.
  • Changing the 2.0 scan window on the resizers has some interesting effects.
  • I found the Gauss resizer gave the nicest ramp for the effect. Adjusting P together with the scan window (2.0) gives many nice variations to the apperance of the effect.
  • For some reason the bilinear resizer generated mask sometimes gots a bright bump in the trailing plataue.
Code:
Global Hi=480
Global Wi=720

Global T=25

A=BlankClip(T+1, 4, Hi, pixel_type="RGB32", color=$000000)
C=BlankClip(T+1, 4, Hi, pixel_type="RGB32", color=$ffffff)

StackHorizontal(A, C)

Animate(0, T, "TryIt", 1.5, 4.5) # Dodge the edge conditions

Function TryIt(clip C, Float X) {
# A = C.PointResize(Wi, Hi, X, 0, 2.0, 0)
# B = C.BiLinearResize(Wi, Hi, X, 0, 1.0, 0)
# D = C.BiCubicResize(Wi, Hi, 1./3, 1./3, X, 0, 2.0, 0)
# E = C.Spline16Resize(Wi, Hi, X, 0, 2.0, 0)
# F = C.LanczosResize(Wi, Hi, X, 0, 2.0, 0)
# G = C.Spline36Resize(Wi, Hi, X, 0, 2.0, 0)
# H = C.Lanczos4Resize(Wi, Hi, X, 0, 2.0, 0)
# I = C.GaussResize(Wi, Hi, X, 0, 2.0, 0, P=10)
# J = C.GaussResize(Wi, Hi, X, 0, 2.0, 0, P=30)

  K = C.GaussResize(Wi, Hi, X, 0, 2.0, 0, P=50)
  Return K

# Return StackVertical(A, B, D, E, F, G, H, I, J, K)
}


X=BlankClip(300, Wi, Hi, pixel_type="RGB32", color=$E02020).\
  Subtitle("< < < Red. > > >", align=5, size=90, text_color=$00DF00)

Y=BlankClip(300, Wi, Hi, pixel_type="RGB32", color=$2020E0).\
  Subtitle("< < < Blue > > >", align=5, size=90, text_color=$DF00DF)

Fx=FrameCount(X)
Fy=FrameCount(Y)


Trim(X, 0, Fx-T-2) + \
Overlay(Trim(X, Fx-T-1, 0), Trim(Y, 0, T), mask=last, pc_range=True)
\ + Trim(Y, T+1, 0)
IanB is offline   Reply With Quote