## Typeset v0.2 by mf ## ## Overlays a masked image over your video. ## Can not be used with motion typesets (>1 frames), use MTypeset for that. ## ## Usage: ## For a 32-bit TGA file named "AVISynth Presents.tga", which will be placed on frame 1337 ## Typeset("AVISynth Presents", 1337, type="tga") ## For a flipped 32-bit BMP named "AVISynth Presents.bmp", which will be placed on frame 1337 ## Typeset("AVISynth Presents", 1337, type="bmp", flip=true) ## For two AVI files, named "AVISynth Presents.avi" and "AVISynth Presents_mask.avi" (any format/colorspace) ## Typeset("AVISynth Presents", 1337) ## ## Dependancies: ## JDL-Utils and RWClip() (RWClip is dependant on JDL-Utils) function Typeset(clip input, string filename, int start, int "end", string "type", bool "flip") { end = Default(end, start) type = Default(type, "avi") flip = Default(flip, true) type2 = (type != "avi") Try { AVISource(filename+".avi").ConvertToYV12() avioverlay = last AVISource(filename+"_mask.avi").ConvertToYV12().ColorYUV(levels="TV->PC").FitY2UV() avimask = last } Catch(err_msg) { Try { ImageReader(filename+"."+type) flip ? last : FlipVertical() image = last ConvertToYV12() imgoverlay = last image Levels(255, 1, 255, 255, 255) Layer(BlankClip(last), last) ConvertToYV12().ColorYUV(levels="TV->PC").FitY2UV() imgmask = last } Catch(err_msg2) { Assert(false, err_msg2) } } overlay = type2 ? imgoverlay : avioverlay mask = type2 ? imgmask : avimask MaskedMerge(input, overlay, mask, Y=3, U=3, V=3) input.RWClip(last, start, end) }