View Single Post
Old 9th July 2008, 23:13   #4  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Ah, so IanB's earlier assumption was mistaken.

Quote:
Originally Posted by IanB View Post
From your frame numbers I have assumed you want the text to follow the animation, if you want them at the same time it is a simple matter to adjust the Goal function.
I think the adjustment you need is something like this:
Code:
Function Goal(clip src, clip sub, int start, string text1, string text2) {

  ol = 5 # Dissolve duration
  tl = 130 # Text duration
  ts = 30 # Text start relative to animation
  fc = tl+ts # Total animation duration

  v1 = src.trim(0, -start-ol)
  tc = src.trim(start, -fc-ol)
  v2 = src.trim(start+fc, 0)

  tc = tc.Overlay(sub, 165, 280, ShowAlpha(sub), 1.0, "blend")
  tc = tc.subtitle(text1, 230, 287, ts, fc-1, "Arial Narrow Cursiva", 16, $00ffffff, $ff000000, 7)
  tc = tc.subtitle(text2, 248, 307, ts, fc-1, "Arial Narrow Cursiva", 14, $00ffffff, $ff000000, 7)

  return dissolve(v1, tc, v2, ol)
}
Here I am assuming that the last (45th) frame of your .png sequence is simply repeated as a static background behind the text, which is what your original example suggests.
Gavino is offline   Reply With Quote