View Single Post
Old 29th November 2011, 04:19   #5  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Quote:
Originally Posted by cretindesalpes View Post
Another solution (single pass):

Code:
# Your source here
h = Height ()
m = ImageSource("mask.png", end=FrameCount()-1).ShowRed ("YV12")
c = mt_merge (last, m, m, luma=true)
StackVertical (c, last)
TFM (y0=h, y1=h*2-1)
Crop (0, h, 0, 0)
You'll have to define a mask file where the masked parts are pure white, and valid parts pure black.
This worked well. I am impressed by your guru like knowledge of how to work magic with AVIsynth.

I modified it a little bit to further what I was after.

Code:
inputvid=MPEG2Source("videoclip.d2v", idct=5, moderate_h=40, moderate_v=80, cpu2="xxoooo")
h = inputvid.Height()
m = ImageSource("frame_mask.png", end=FrameCount(inputvid)-1).ShowRed("YV12")
c = mt_merge(inputvid, m, m, luma=true)
composite=StackVertical(c1, inputvid).TFM(d2v="videoclip.d2v", y0=h, y1=h*2-1,mode=5, PP=0)

full=composite.crop(0, h, -0, -0)
masked=composite.crop(0, 0, -0, -h)
output=masked.tdecimate(mode=0, clip2=full)
output
Thanks for the help!

Last edited by Stereodude; 29th November 2011 at 04:21.
Stereodude is offline   Reply With Quote