Log in

View Full Version : Stupid question -- applying overlay only to a certain range of frames


sp219
7th January 2012, 05:20
This is probably a stupid question, but I'm really not that familiar with avisynth:

I have a hockey game recorded, and there's a ticker at the bottom that I want to get rid of, but it's only shown for a short period of time, so I only want the overlay to show up at that time.

How can I have it only apply to a certain range of frames?

a=AVCSource("E:\hockey\cut.dga")
b=BlankClip(width=100, height=100, color=$000000)
overlay(a,b,x=1200,y=600)

vampiredom
7th January 2012, 07:44
You can copy and trim, for example:
a=AVCSource("E:\hockey\cut.dga")
b=BlankClip(width=100, height=100, color=$000000)
c=overlay(a,b,x=1200,y=600)

a.trim(0,29) ++ c.trim(30,119) ++ a.trim(120,0)

mastrboy
7th January 2012, 14:00
Alternative would be applyrange: http://avisynth.org/mediawiki/ApplyRange

sp219
11th January 2012, 05:10
Thanks a lot guys, ApplyRange was a little easier for this use and it worked great. Thanks to both of you!

StainlessS
14th January 2012, 13:45
If the affected part were not already on a black background then the below might be preferable.

import("S_ExLogo.avs") # S_ExLogo() available from Mediafire via sig
a=AVCSource("E:\hockey\cut.dga")
X=1200
Y=600
W=100
H=100
ConvertToYUY2() # For S_ExLogo()
ApplyRange(30,119,"S_Exlogo",X,Y,W,H)
#ConvertToYV12() # If required

OR for only affected frames color converted

#import("S_ExLogo.avs") # S_ExLogo() available from Mediafire via sig
AVCSource("E:\hockey\cut.dga")
X=1200
Y=600
W=100
H=100
A.Trim(0,29)
B=Trim(30,119).ConvertToYUY2().S_ExLogo(X,Y,W,H).ConvertToYV12()
C=Trim(120,0)
A ++ B ++ C

OR if lots of places to fix (list in either ClipClop, SCmd, or Cmd)

#import("S_ExLogo.avs") # S_ExLogo() available from Mediafire via sig
AVCSource("E:\hockey\cut.dga")
X=1200
Y=600
W=100
H=100
B=ConvertToYUY2().S_ExLogo(X,Y,W,H).ConvertToYV12()
SCmd="1,30,119" # clip 1 (ie s_exlogo clip), start frame, end frame
ClipClop(B,scmd=SCmd) # ClipClop available from Mediafire via sig