View Single Post
Old 9th July 2008, 21:06   #3  |  Link
Alex-Kid
Antronio's DV ambassador
 
Alex-Kid's Avatar
 
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
After a lot of thinking about what the script does, I finally can write reply ...

I had some issues with sub/subs variable, but were easy to solve. The video was split in four parts, where the second one and third one contain the overlay and the subtitles repectively. Then the video is rejoined through Dissolve filter, but when showing subtitles, the overlay is gone and it's needed as a background for the subtitles. So my attempt is to add another image, make the overlay and add the text. Like this:
Code:
testcard = avisource("petazetas_vs_mamaestapresa.avi")

sub = ImmaRead("gol%02d.png", start=1, end=45)
sub0 = ImmaRead("gol45.png")

Goal(testcard, sub,  8587, "JUAN CASTILLO", "MIN. 51")
Goal(testcard, sub, 17007, "JOSE FANGIO", "MIN. 101")
...

Function Goal(clip src, clip sub, int start, string text1, string text2) {

  ol = 5 # Dissolve duration
  fc = FrameCount(sub) # Animation duration
  tl = 130 # Text duration

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

  tc = tc.Overlay(sub, 165, 280, ShowAlpha(sub), 1.0, "blend")

  tx = tx.Overlay(sub0, 165, 280, ShowAlpha(sub), 1.0, "blend")
  tx = tx.subtitle(text1, 230, 287, 0, tl, "Arial Narrow Cursiva", 16, $00ffffff, $ff000000, 7)
  tx = tx.subtitle(text2, 248, 307, 0, tl, "Arial Narrow Cursiva", 14, $00ffffff, $ff000000, 7)

  return dissolve(v1, tc, tx, v2, ol)
}
It doesn't seem too elegant (to me). Any improvements are welcome.
But this script only works for the last Goal function specified, I don't know how to make it work for each goal scored.

Help is needed again.

Saludos

By ALEX-KID
Alex-Kid is offline   Reply With Quote