VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 36
Thread
  1. Member
    Join Date
    Feb 2015
    Location
    Brazil
    Search PM
    I'm Brazilian, so sorry for my English.

    I want to remove a watermark from a video. I have two sources. The first one has the watermark on the right, the second one has the watermark on the left, as shown below:

    Click image for larger version

Name:	source1_000000.jpeg
Views:	414
Size:	72.5 KB
ID:	30462

    Click image for larger version

Name:	source2_000000.jpeg
Views:	459
Size:	66.4 KB
ID:	30463

    In Sony Vegas, I have merged the two videos, using the second one as the main source, trying to remove the watermark using the first one. That's what I get:

    Click image for larger version

Name:	merge1_000000.jpeg
Views:	383
Size:	66.5 KB
ID:	30464

    Nothing complex here. Of course I have to correct brightness, color, etc, in order to have a better result. But even doing so, the result is not as smooth as I expect. Does anyone have any suggestion to balance the two sourcer in terms of brightness, contrast, color, etc? Thanks!
    Quote Quote  
  2. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Look for the "Bezier Masking" tool. It's inside the "Pan/Crop" tool. You simply draw a mask where you want it. You also have to color match the images.

    This example clearly illustrates the logo removed. But the images are not color matched so you can see the work area as a brighter rectangle.

    Last edited by budwzr; 27th Feb 2015 at 01:26.
    Quote Quote  
  3. You have other problems than color and levels matching - the aspect ratio and field of view is different . So in some other frames the "patch" won't match even if you matched the color & levels, because the frames aren't aligned



    And are you sure you want to do it that way ?

    Source 1 looks better in terms of quality & detail, but Source 2 has a larger field of view. Source 2 looks like a bad upscale or poorly resized

    I would probably try to align them (it's going to be a non centered, non linear resize), and take Source 1 as the main source (since it looks better in terms of details), and fill in the periphery and cover the right logo with Source 2
    Quote Quote  
  4. Member
    Join Date
    Feb 2015
    Location
    Brazil
    Search PM
    Agreed. No problem in using Source 1 as the main source, since both sources are already aligned.

    But is there any automatic tool that could match the colour of the two sources? I have tried to do this manually, and I can get a good result, but one always can notice that annoying rectangle if looks closer.
    Quote Quote  
  5. Yes there are automatical tools that match color. eg. RE:Vision Effects Re:Match. It's also available for Vegas
    http://www.revisionfx.com/products/rematch/

    A free method would be colourlike() in avisynth

    You don't want to match 1 to 2 either, in terms of color or levels, because they are wrong (low contrast, wrong levels)

    But as mentioned above, you have more problems than just color and levels. They might be temporally aligned (same frames), but they are not spatially aligned

    Do you have a short sample video of both ?
    Quote Quote  
  6. preferably a non re-encoded sample . Cut directly from source. Youtube will re-encode it. You can upload directly here (push the upload files button)
    Quote Quote  
  7. Even if you line them up perfectly and match color, source 1 has a cropped image and won't cover. (As poisondeathray said.)

    Click image for larger version

Name:	source2_00141.png
Views:	839
Size:	141.5 KB
ID:	30472
    Click image for larger version

Name:	source2b_00141.png
Views:	899
Size:	122.3 KB
ID:	30473

    And FWIW, I saw no color differences loading your YouTube samples into After Effects.
    Last edited by smrpix; 27th Feb 2015 at 10:31.
    Quote Quote  
  8. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Is that The Beatles before they came to America? Or the Monkees?
    Quote Quote  
  9. Originally Posted by budwzr View Post
    Is that The Beatles before they came to America? Or the Monkees?
    Must be the Monkees before Davy Jones came to America.
    Quote Quote  
  10. Member
    Join Date
    Feb 2015
    Location
    Brazil
    Search PM
    Here are the samples, sources 1 and 2, without re-encoding.
    Image Attached Files
    Quote Quote  
  11. <edit>
    Note that I used the videos downloaded from youtube because I did this before virguloso provided his mpg sources.
    </edit>

    Just feather the edges or the overlay mask. I didn't even bother to match levels and colors but you can barely see the overlay most of the time. Note that the clear image did not extend all the way to the edge of the frame so a little bit of the logo is still visible at the far left.

    Code:
    v1 = ffVideoSource("source1.mp4").BilinearResize(456,342).ConvertToRGB().AddBorders(82,9,102,9).ConvertToYV12()
    v2 = ffVideoSource("source2.mp4") 
    omask = ImageSource("mask.png").ConvertToYV12(matrix="pc.601")
    
    Overlay(v2,v1,mask=omask)
    Crop(74,0,-86,-0)
    mask.png:
    Click image for larger version

Name:	mask.png
Views:	992
Size:	676.5 KB
ID:	30479
    Image Attached Files
    Last edited by jagabo; 27th Feb 2015 at 12:26.
    Quote Quote  
  12. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    EDIT: Here we go, I got it. Just needs Pan/Crop adjustment to line up. Here's the project file. http://files.videohelp.com/u/135518/Untitled.veg. Use the samples you posted as the missing media.

    First get the Pan/Crop correct, then adjust the timing, then adjust Brightness/Contrast, and voila?

    Last edited by budwzr; 27th Feb 2015 at 12:33.
    Quote Quote  
  13. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    I have it very close now. Here's the updated Vegas File http://files.videohelp.com/u/135518/Untitled_2.veg. You should be all set. Just fine tune the Brightness/Contrast I already set up. You might have to keyframe a little.

    Last edited by budwzr; 27th Feb 2015 at 12:53.
    Quote Quote  
  14. I got the MPG 2 files and adjusted my script:

    Code:
    v1 = Mpeg2Source("source1.d2v").Trim(7,0)
    v2 = Mpeg2Source("source2.d2v").BicubicResize(720,576, 0.33, 0.33, 95,15, 514, 546).ColorYUV(gain_y=67, off_y=-2, cont_u=-50, cont_v=20).ColorYUV(off_y=27).ColorYUV(off_y=-27)
    omask = ImageSource("omask.png").ConvertToYV12(matrix="pc.601").Blur(1.0).Blur(1.0).Blur(1.0)
    
    Overlay(v2,v1,mask=omask)
    omask.png:
    Click image for larger version

Name:	omask.png
Views:	757
Size:	2.4 KB
ID:	30482

    The patch is nearly invisible now.
    Image Attached Files
    Quote Quote  
  15. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Nice work jagabo. Very clean. I was unable to get a clean box using Vegas. So you fuzzed the edge of the box and used a resize filter during rerender to clean it up?

    Can you lay it out in NLE terms? For us that don't code?
    Last edited by budwzr; 27th Feb 2015 at 14:03.
    Quote Quote  
  16. Originally Posted by budwzr View Post
    I was unable to get a clean box using Vegas.
    One problem is that sourc1.mpg has crushed brights. After otherwise matching the levels I used ColorYUV(off_y=27).ColorYUV(off_y=-27) to crush the brights of source2.mpg to match.
    Last edited by jagabo; 27th Feb 2015 at 14:09.
    Quote Quote  
  17. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    I overlaid the two videos, scaled appropriately, changed the contrast, gamma and pedestal values, masked the left logo and cropped the crap. Here is the first song, with legal levels and I removed the color noise.

    vid.mp4

    I am not really a Pink Floyd fan but I like this song:



    Quote Quote  
  18. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by budwzr View Post
    I was unable to get a clean box using Vegas.
    One problem is that sourc1.mpg has crushed brights. After otherwise matching the levels I used ColorYUV(off_y=27).ColorYUV(off_y=-27) to crush the brights of source2.mpg to match.
    Genius.

    That's why no amount of contrast/brightness adjustment in Vegas would ever match.

    Hey man, I'm always learning something from you, and just so you know, I really pay attention to your posts. PDR too. You guys have taught me a lot in the last few years.

    Last edited by budwzr; 27th Feb 2015 at 14:49.
    Quote Quote  
  19. Member
    Join Date
    Feb 2015
    Location
    Brazil
    Search PM
    Very impressive jagabo! Unfortunately, I can't run your script. I got the message: "I don't know what "omask" means". Do you know how to fix this? It is not a problem with the omask.png file, I've already checked that.
    Quote Quote  
  20. Member
    Join Date
    Feb 2015
    Location
    Brazil
    Search PM
    Very nice work newpball. It is not clear to me if you used Sony Vegas. Would you mind writing down the settings? Thanks!
    Quote Quote  
  21. Originally Posted by virguloso View Post
    Very impressive jagabo! Unfortunately, I can't run your script. I got the message: "I don't know what "omask" means". Do you know how to fix this? It is not a problem with the omask.png file, I've already checked that.
    I just checked the script in post #15. Just copied from the post and pasted into a new script. It worked just fine. You can add "return(omask)" just before the overlay to verify that omask loaded ok. Also make sure that v1 and v2 loaded ok using the same technique.
    Quote Quote  
  22. Member
    Join Date
    Feb 2015
    Location
    Brazil
    Search PM
    Originally Posted by jagabo View Post
    I just checked the script in post #15. Just copied from the post and pasted into a new script. It worked just fine. You can add "return(omask)" just before the overlay to verify that omask loaded ok. Also make sure that v1 and v2 loaded ok using the same technique.
    I still can't run it. I'm new with avisynth. Seems that v1 and v2 are correctly loaded. The problem is with omask. Is that what are you suggesting me to do?:

    Code:
    v1 = Mpeg2Source("source1.d2v").Trim(7,0)
    v2 = Mpeg2Source("source2.d2v").BicubicResize(720,576, 0.33, 0.33, 95,15, 514, 546).ColorYUV(gain_y=67, off_y=-2, cont_u=-50, cont_v=20).ColorYUV(off_y=27).ColorYUV(off_y=-27)
    return(omask)
    omask = ImageSource("omask.png").ConvertToYV12(matrix="pc.601").Blur(1.0).Blur(1.0).Blur(1.01,mask=omask)
    Quote Quote  
  23. nice work jagabo



    It looks like the part of the script is cut off, at least in firefox. There is a bug with the code boxes and displaying text on this message board, at least on some versions of browsers

    It looks like this to me for jagabo's last line

    omask = ImageSource("omask.png").ConvertToYV12(matrix="pc. 601").Blur(1.0).Blur(1.0).Blur(1.01,mask=omask)
    And your version looks like this (missing that last parenthesis)
    omask = ImageSource("omask.png").ConvertToYV12(matrix="pc. 601").Blur(1.0).Blur(1.0).Blur(1.01,mask=omask
    Do you see how that last part of the line is cut off, and there isn't even an Overlay() command

    But I think it should be


    omask = ImageSource("omask.png").ConvertToYV12(matrix="pc. 601").Blur(1.0).Blur(1.0).Blur(1.0)

    overlay(v2,v1,mask=omask)
    Or maybe jagabo can upload a text file as an attachment



    Not to take anything away from jagabo, but you should be able to get similar results in vegas (or any NLE) by aligning the frame and matching the waveform and RGB histogram


    EDIT: even when I refresh the browser, the text in the quote or code boxes get mashed up. Even the matrix is abbreviated, missing letters
    Last edited by poisondeathray; 27th Feb 2015 at 20:51.
    Quote Quote  
  24. Banned
    Join Date
    Oct 2014
    Location
    Northern California
    Search PM
    Originally Posted by virguloso View Post
    Very nice work newpball. It is not clear to me if you used Sony Vegas. Would you mind writing down the settings? Thanks!
    Thank you, I used Premiere for it, sorry don't have Vegas.
    Quote Quote  
  25. Originally Posted by poisondeathray View Post
    Or maybe jagabo can upload a text file as an attachment
    Here's the script in a ZIP file.
    Image Attached Files
    Quote Quote  
  26. And source 2 isn't as "bad" quality wise as your initial screenshot suggested
    Quote Quote  
  27. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Not to take anything away from jagabo, but you should be able to get similar results in vegas (or any NLE) by aligning the frame and matching the waveform and RGB histogram
    Yeah, good call chief.

    I should have won the prize on this project, but I had a brainfart that blew me off course.
    Last edited by budwzr; 27th Feb 2015 at 22:42.
    Quote Quote  
  28. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    [Deleted]
    Last edited by budwzr; 27th Feb 2015 at 22:40.
    Quote Quote  
  29. Originally Posted by poisondeathray View Post
    Not to take anything away from jagabo, but you should be able to get similar results in vegas (or any NLE) by aligning the frame and matching the waveform and RGB histogram
    Yes, I though it was in interesting little project. I posted the script to show it could be done fairly well with these clips. I hoped it would provide hints that be useful in Vegas.

    Note that the color/levels adjustments I made were adequate for removing the logo because of the limited colors that appeared in that area. If a wider range of colors had appeared there the match wouldn't have been close enough:

    Click image for larger version

Name:	comp.jpg
Views:	783
Size:	23.3 KB
ID:	30497

    The left 2/3 of that image has the original colors of sourc1.mpg. The right 1/3 has the colors of source2.mpg after my adjustments.
    Last edited by jagabo; 28th Feb 2015 at 09:40.
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!