Log in

View Full Version : Masking a logo


beastbg8
11th September 2015, 22:34
Hello. I have two sources of the same video with logos on different places.

I'm trying to mask the logo from source 1 with the logoless region of source 2. Any ideas how to do it properly?

johnmeyer
12th September 2015, 03:54
My NLE is Vegas, and it is a snap to do what you want using that application. It has masking built in, and you can interactively build the mask, feather the edges, etc. You can also adjust the color and gamma of your two captures which, I assume, do not match. Your two captures also may not align, and may have a slightly different magnification, or maybe even a slightly different aspect ratio.

I would never, ever consider doing this in AVISynth because you are really going to need to have interactive feedback about all the things I just mentioned.

This is not idle speculation on my part. About a year ago I was given the task of taking a pristine Canadian film, which only had a French audio channel, and was unavailable with either English audio or English subtitles, and cut into that video hard-coded subtitles from an old VHS transfer of the same film. It was a labor of love for a sick next-door neighbor and took several hours of work, with a lot of hand-tweaking. But it worked, and worked well.

I've also done work for a sports film collector, combining several sources together, some of which have "bugs" (logos) and others of which do not. That's the exact same problem you are trying to solve.

colours
12th September 2015, 05:53
If the logos are static, you can draw a mask in your image editor of choice to cover the logo in the first source, give it a bit of blur to smoothen the transition, then use mt_merge to blend accordingly. However, as johnmeyer has also mentioned, you do need to make sure the sources align more or less perfectly and have the same colours.

manono
12th September 2015, 06:19
Not that hard although, as said, the two videos have to be aligned correctly. So some cropping and/or resizing might be needed. If they already align, then so much the better. If the colors/levels/brightness/contrast/saturation aren't identical then some tweaking there might be called for as well. Otherwise, make the mask, allowing for some feathering so they blend into each other better. If for example, the logo is in the upper right corner of Video1.avi, something like this (I am enclosing a JPG because of the smaller size):

A=AVISource("Video1.avi")
B=AVISource("Video2.avi")
Mask=ImageSource("Logo.bmp")
Overlay(A,B,0,0,Mask)