View Single Post
Old 2008-05-05, 12:36   Link #128
dj_tjerk
Ana-chan~
 
 
Join Date: May 2006
Location: Netherlands
Code:
function insertsign(clip mainclip, string filename, int startframe, int "endframe") {
	overlayclip = avisource(filename)
	endframe = default(endframe,startframe+overlayclip.framecount-1)

	begin	= (startframe == 1) ? mainclip.trim(0,-1) : mainclip.trim(0,startframe-1)
	middle	= mainclip.trim(startframe,endframe)
	end	= mainclip.trim(endframe+1,0) 
	
	middleoverlay = Overlay(middle, overlayclip, mask=overlayclip.showalpha())
	
	begin = (startframe == 0) ? BlankClip(mainclip, length=0) : begin
	end = (endframe == mainclip.framecount-1) ? BlankClip(mainclip, length=0) : end 
	
	return begin ++ middleoverlay ++ end
}
Usage: insertsign("blabla.avi", 400)

One extra line and fluff's script basically does the same. Making one big clip of signs hasnt proven useful for me, as I often need to upload v2's of specific signs (not that matters much.. it's more work for the encoder to remove and add some lines though with one big clip).. and I don't like working in one big composition. I also never use still images, i always make clips in AE, even if the scene is static.. Also, I don't like dragging and dropping, I prefer some weird .jar that i double click on and it generates the .avs script, and maybe even 7z's all the files.

In the end.. who cares.. pichu's script works, fluff's script works, and if I may believe avisynth's mediawiki:

Quote:
Input for overlay is any colorspace, and colorspaces of different clip doesn't matter! The input clips are internally converted to a general YUV (with no chroma subsampling) format, so it is possible for the filter to output another colorspace than the input. It is also possible to input video in different colorspaces, as they will be converted seamlessly. It is however not recommended to use overlay only for colorspace conversions, as it is both slower and with slightly worse quality.
the colorspace of your overlay clip doesnt even matter..
dj_tjerk is offline   Reply With Quote