Log in

View Full Version : Masking a patch on one video with footage from another


samf88
13th November 2006, 19:06
Hi all - great help forum here. I've had a search around and I can't seem to find any answers to my question, so here it is...

I have a captured TV episode with a TV station bug on it in the corner. I also have the same episode from an official VHS, and I would like to basically use footage from the official VHS to 'mask' over the TV logo. I understand that it won't look perfect, but anywhere closer to a logoless yet high quality episode helps.

The problem is - I haven't a clue how to go about doing this. I've seen it done on other encodes and it clearly wasn't done with a delogo filter. I've had a look through MaskTools and XLogo but I can't work out how to do this. I can see how it is possible by cropping and stacking various blocks of footage around the logo, but I was hoping for a more clean approach.

Any help would be fantastic. Thanks!

pvann
13th November 2006, 22:02
I had a similar exercise where I filmed my kids sleeping in the car (ClipA) driving to a beach holiday and I wanted to show them “dreaming” of the beach & surf by inserting some beach footage (ClipB) into the ClipA.

I’m away from home now so can’t assess my script, but basically I
- resized ClipB
- then used Crop to cut the full screen clip, ClipA, into sections,
- which are placed around ClipB using StackHorizonal and StackVertical.
I also put a black boarder around ClipB after I resized it.

The key is getting the simple maths correct so that all the bits “add” up to the correct size and to assist that I suggest you specify the location of one corner of ClipB and the desired Height of Clip B (assuming no change in aspect ratio), and then calculate all the other numbers used in crop and resize. That way you only have 2 parameters to adjust to get the effect right.

This could all be placed into a function in an avsi file for ease of use with heaven forbid some error checking for invalid locations.

stickboy
14th November 2006, 00:40
I think it's simpler just to use Overlay.

samf88
14th November 2006, 01:39
Any idea how I would use Overlay in this situation? Like what blending method? I could ideally do with DeLogo that allows you to patch the designated area with another video... but that doesn't seem possible.

Thanks for your help anyway, people. If anyone else has anything to offer it would be much appreciated.

stickboy
14th November 2006, 02:07
Just use the default mode (which is "blend") with an opacity level of 1.0 (i.e., 100%, which is also the default).

I'd either crop the VHS clip down to just the portion that you want and then call
Overlay(base, vhsClip, x, y)with appropriate values of x and y to position it properly, or I'd create a rectangular mask in Photoshop, create a clip from that with ImageSource, and use that as the mask clip. (See my logo example (http://www.avisynth.org/stickboy/etc/logo-example.zip).)

The second way is more flexible (you're not limited to a rectangular area) but is more complicated.