Log in

View Full Version : goto frame number / overlay question


wuziq
1st March 2006, 23:32
Is there a function/filter which allows you to go to a specific frame number and then apply another filter to that frame (and onward)?

Here's why I ask, and maybe it'll refine my question:

I have a full-length movie. At regular intervals, I want a little animation (which is a separate clip) to appear in the upper right corner, play back, then disappear... like how you see a TV channel logo appear and disappear while you're watching a show. I figured I could just use overlay(), but overlay() would just make the animation play once. How do I get it so that it plays multiple times throughout the movie? I figured "well maybe I could just loop the animation over and over again and then use conditionalreader() to specify overlay opacity to display or hide the animation when I want.. but that'd be a pain. It'd be much easier to be able to do this:


movie = mpeg2source(...)
animation = avisource(...)
go to frame number 100 in movie
overlay animation starting at frame 100
go to frame number 300 in movie
overlay animation starting at frame 300
go to frame number 500 in movie
overlay animation starting at frame 500
etc.


How would I do this? Any help appreciated!

hanfrunz
2nd March 2006, 10:44
You could use something like this:


video=avisource("movie.avi")
animation=avisource("animation.avi")
black=blankclip(**yoursettings**)

animation=animation+black
animation=animation+animation
animation=animation+animation
animation=animation+animation
... #do this until the lenght of animation is big enough
animation=animation.trim(**yoursettings**)
overlay(...)


or you trim your movie into parts first:

movie=avisource("movie.avi")
part1=trim(...)
part2=trim(...)
part3=trim(...)
part4=trim(...)
... #and so on
#the add your animation to the parts you want
part2=part2.overlay(...)
#return movie
return part1+part2+part3+part4+...


hanfrunz

stickboy
3rd March 2006, 20:42
[QUOTE=hanfrunz]You could use something like this:
video=avisource("movie.avi")
animation=avisource("animation.avi")
black=blankclip(**yoursettings**)

animation=animation+black
animation=animation+animation
animation=animation+animation
animation=animation+animation
... #do this until the lenght of animation is big enough
animation=animation.trim(**yoursettings**)
overlay(...)
Better:video=avisource("movie.avi")
animation=avisource("animation.avi")
black=blankclip(**yoursettings**)

animation=animation+black
animation.animation.Loop()
overlay(...)Or you could try my ApplyEvery plugin (http://www.avisynth.org/stickboy/), in which case you could do something like:
c = AVISource("video.avi")
bug = AVISouce("animation.avi")
ApplyEvery(c, 1000, "Overlay(bug)")