VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    Jul 2008
    Location
    United States
    Search Comp PM
    So I am trying to remove the logo from this clip that I have. Luckily I have two different captures, each one with a logo in a different place.

    I am trying to remove it by using Mask/Layer, extracting a small part of the logo-less part of one video and stamping it on the other. This of course won't blend in perfectly, which gives me a few ideas:

    1. Use a mask that's not rectangular in shape. With an irregular shape it's harder to spot the difference.

    2. Blend the surrounding area where I performed this "surgery" with Mask/Layer

    3. Add noise/blur to the surrounding area, although this won't look very good because it's a 720p video.

    I am sure this has been attempt before, does anyone have ideas/pointers or links to threads discussing this?
    Quote Quote  
  2. If they are identical captures without frame drops, and clean signal (noiseless), then it should blend in perfectly

    What is causing it to "not blend in" ? is it noise? or something else ? Can you post a sample or screenshots ?

    You can feather a mask (which is basically your #2+3 combined), but if the limiting factor is noise, this won't help
    Quote Quote  
  3. I do this sort of thing with some frequency. For example, I recently had a video with a godawful logo smack dab in the middle:


    I wanted it for both YouTube and for a DVD project I was making. The logo remover could only blur it:


    So I found a video of the same song on YouTube, a video inferior in every way except it didn't have a logo. I cut out a small piece of it and overlaid it on top of mine:


    And here's the YouTube result.

    http://www.youtube.com/watch?v=PO_fvT3GlDs

    In spite of my best efforts to match the levels, brightness, and contrast of the 2 videos, I couldn't make it work quite right. I didn't (and still don't) know how to feather the edges, so you can sort of tell that the middle rectangle doesn't exactly match the rest of it. It's still way better than that horrible logo. pdr, how do you blend the edges? The AviSynth script goes something like:

    A=LogoVideo
    B=NoLogoVideo
    B=B.Crop(to the dimensions you want)
    Overlay(A,B,X=,Y=)#X and Y being the location where the logo is to go.

    Hmmm... I don't know how to put the pics where I want them. Top to bottom they're Original, Blurred Delogo, Final.
    Image Attached Thumbnails Click image for larger version

Name:	Main Bangali ChokraLogo.jpg
Views:	807
Size:	35.0 KB
ID:	5481  

    Click image for larger version

Name:	Main Bangali ChokraDeLogo.jpg
Views:	791
Size:	26.8 KB
ID:	5482  

    Click image for larger version

Name:	Main Bangali Chokra.jpg
Views:	819
Size:	23.6 KB
ID:	5483  

    Last edited by manono; 8th Feb 2011 at 03:37.
    Quote Quote  
  4. Nice work, manono! Surely there's a way to feather the edges of the mask with avisynth?

    (I don't like "Bollywood", to be honest, but I really enjoy Satyajit Ray films! He is brilliant Indian director! No singing and dancing in his films lol :P!)
    Quote Quote  
  5. Originally Posted by chowmein View Post
    (I don't like "Bollywood", to be honest, but I really enjoy Satyajit Ray films! He is brilliant Indian director! No singing and dancing in his films lol :P!)
    Hehe, you might be surprised. Here's an outstanding Kathak performance from Satyajit Ray's Jalsaghar (The Music Room):

    http://www.youtube.com/watch?v=UWXoX-gSiCo

    The dancing starts at about the 45 second mark.
    Quote Quote  
  6. Originally Posted by chowmein View Post
    Nice work, manono! Surely there's a way to feather the edges of the mask with avisynth?
    Yes, Overlay() accepts a grayscale alpha mask. Using manono's source your mask would look something like this (black is completely transparent, white is completely opaque, shades of gray in between):

    Click image for larger version

Name:	mask.png
Views:	884
Size:	333 Bytes
ID:	5487

    The mask should be the same size as the overlay clip.
    Last edited by jagabo; 8th Feb 2011 at 08:13.
    Quote Quote  
  7. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Wouldn't the mask be better with a white-to-black gradient on the side too?
    Otherwise you will still see an abrupt transition there (unless the strip is the entire clip width).

    The inner white rectangle should be the same size as the logo frame, so the overlay clip needs to be slightly bigger than the original attempt (ie include more of the non-logo clip).

    One way to construct such a mask in Avisynth is to create the black and white rectangles with BlankClip, overlay the inner white rectangle on top, then blur the result.
    Quote Quote  
  8. Thanks for your help, the both of you. And maybe pfxz will benefit. OK, I know how to create a black rectangle slightly larger than the original rectangle, and how to overlay a somewhat smaller white rectangle in the middle. I know how to blur the entire thing to blend between white and black. But I have next to no understanding of alpha blending. The Overlay page at the AviSynth site has an example I don't quite understand that goes something like this (edited to suit this example):

    Mask = C.ShowAlpha("RGB").ConvertToYUY2.
    \ ColorYUV(Levels="TV->PC")
    Overlay(A,B, Mask,X=,Y=)X and Y being the location coordinates

    And that's it?

    A=the 'original' video with the logo still there.
    B=the rectangle of new logoless video.
    C= the black and white somewhat larger rectangle.

    Somehow I have a feeling that's not quite right, if for no other reason than the Mask coordinates should be slightly different than the B coordinates.
    Last edited by manono; 8th Feb 2011 at 20:08.
    Quote Quote  
  9. If I can suggest a slightly different approach:

    I would generate a mask layer the same dimensions as your video in your image editor (photoshop, gimp, etc....) . White is "see-through" or the "cut out area".

    1) This way you don't have to worry about x,y positions, and you can adjust the amount of blur right in avisynth, using avsp to increase or decrease instead of having to go back & forth to your image editor.
    2) You don't have to use alpha channel either using this method; "white" in the mask becomes the alpha, and the blurred edges are % of transparency (so 50% white would be 50% transparent)
    3) You can use non "rectangle" shapes a lot easier

    a=original video
    b=mask layer, and you can blur this

    e.g.
    b=imagesource("mask.png").converttoyv12().gaussian blur(5)

    c=layer that you want to appear through the mask

    Overlay(a,c, mask=b)

    If you wanted to increase the blur, adjust it in the gaussianblur(x) , (or replace it with whatever blur algorithm you want)
    Last edited by poisondeathray; 8th Feb 2011 at 20:01.
    Quote Quote  
  10. Thanks! Sounds a bit easier for the clueless like me. Make the mask the same size as the source video. And it has to be a PNG, right? pfxz asked the same question at Doom9 and the first response is similar to yours, poisondeathray, except he reversed the black and white:

    http://forum.doom9.org/showthread.php?t=159416
    Quote Quote  
  11. actually it doesn't matter if it's png, but png is lossless so it's a good choice. I'm pretty sure white is "see through" , I'll double check - eitherway it's quite simple to invert a mask

    when you use the other method with alpha channel , then you need png with alpha (RGBA instead of just RGB)

    I'll post an example for the benefit of others that aren't too familiar with avisynth
    Quote Quote  
  12. Yes, white is "see through".

    So I heard purple lipstick is all the rage these days...

    Original Layer


    Mask Layer


    Layer to Show through


    Result1 without blur (notice the hard edge)


    Result2 with gaussianblur(1) (softer lips, yummier)


    a=ImageSource("1 original.png").converttoyv12()
    b1=ImageSource("2 mask.png").converttoyv12()
    b2=ImageSource("2 mask.png").converttoyv12().gaussianblur(1) #white is "see through"
    c=ImageSource("3 purple.png").converttoyv12()
    Overlay(a,c, mask=b2)

    For those unfamiliar with avisynth:

    b1 is the mask plain, b2 is the mask with the blur, if you wanted to feather the mask more, just increase the value

    In this example, converttoyv12() is only needed because the gaussianblur requires YUV colorspace ; Overlay will work with RGB as well ; you can mix & match actually




    I uploaded the files in a zip file in case the imagehost goes down, and people can play with the script


    Apparently there is a way to adjust the mask size using masktools in avisynth to increase/decrease , mt_expand or something like that.... I'm not sure how to do that, maybe jagabo or gavino knows
    Image Attached Files
    • File Type: zip 1.zip (1.44 MB, 30 views)
    Last edited by poisondeathray; 8th Feb 2011 at 20:40.
    Quote Quote  
  13. Cool, thanks for taking the time to do that.
    Quote Quote  
  14. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    I like the chick on the right.
    Quote Quote  



Similar Threads