VideoHelp Forum
+ Reply to Thread
Results 1 to 23 of 23
Thread
  1. Hello,

    I have been going through the threads in this forum such as these and I ran into an issue. I have a series of videos with "Fashion" logo in the middle [file: Lagerfeld FW10 - odd logo in the middle.mp4], but it seems to be multiple shades so I am not certain to what I should set the reference to, please. Is it possible to remove this or is this hopeless case? For this particular video, i was able to find another video without logo (if that can help create a reference watermark) [file: Lagerfeld FW10 - no logo but LQ.mp4], but for other videos i have, i only have watermarked versions and would love to remove them, please.

    Thank you
    Image Attached Files
    Quote Quote  
  2. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JadHC View Post
    Is it possible to remove this or is this hopeless case?
    Should be possible, find video where logo is in the black background, then I'll look at it.
    Quote Quote  
  3. Technically you can perform temporal average of long sequence (ideally whole length) so if logo is static then it can be extracted (you can decompose video with some wavelet plugin similar to https://docs.gimp.org/2.10/en/plug-in-wavelet-decompose.html or use some high pass filter or even manually unify it with some image editor) - after extracting logo you can try to invert it so it should be canceled.
    Quote Quote  
  4. Originally Posted by VoodooFX View Post
    Originally Posted by JadHC View Post
    Is it possible to remove this or is this hopeless case?
    Should be possible, find video where logo is in the black background, then I'll look at it.
    I was able to find two frames. First frame is from the middle of the video so it has brighter logo. Second frame is from the end of another video so the watermark is slightly faded. Would these work? Thank you very much in advance
    Image Attached Thumbnails Click image for larger version

Name:	jpg1.jpg
Views:	13
Size:	11.4 KB
ID:	75814  

    Click image for larger version

Name:	jpg2.jpg
Views:	12
Size:	10.4 KB
ID:	75815  

    Quote Quote  
  5. Originally Posted by pandy View Post
    Technically you can perform temporal average of long sequence (ideally whole length) so if logo is static then it can be extracted (you can decompose video with some wavelet plugin similar to https://docs.gimp.org/2.10/en/plug-in-wavelet-decompose.html or use some high pass filter or even manually unify it with some image editor) - after extracting logo you can try to invert it so it should be canceled.
    As usual, i gave it a go and something horrible came out.. I was thinking that since i have one video with watermark and another one without watermark, I could have just subtracted them but instead i have created something horrible...

    Code:
    Overlay(file1, file2, x=0, mode="difference", opacity=1)
    Image Attached Files
    Quote Quote  
  6. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JadHC View Post
    Would these work?
    Screenshots not good. Post the video and the time to find those frames.
    Quote Quote  
  7. Originally Posted by VoodooFX View Post
    Originally Posted by JadHC View Post
    Would these work?
    Screenshots not good. Post the video and the time to find those frames.
    in this attached video, it is frame 4453 (mid-video) and last couple frames 16243-16245
    Quote Quote  
  8. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Video quality is too bad, like most youtube videos. Even in those black frames image is missing pieces...
    Quote Quote  
  9. Originally Posted by VoodooFX View Post
    Video quality is too bad, like most youtube videos. Even in those black frames image is missing pieces...
    thank you, Voodoo. I will try to do temporal thingy as per pandy's comment and maybe that could enable the removal of watermark.

    Meanwhile, there are 3 other videos with different (and easier) semi-transparent watermark. I installed inpaint_delogo plus all the plugins, but i get following error that it doesnt recognize DistanceFunction. Do you know which plugin am I missing? Nothing comes up when i look it up, please.

    I think i should get those done by myself, i just need to get the script running, please.
    Image Attached Thumbnails Click image for larger version

Name:	1.jpg
Views:	8
Size:	38.9 KB
ID:	75952  

    Click image for larger version

Name:	2.jpg
Views:	10
Size:	191.9 KB
ID:	75953  

    Quote Quote  
  10. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JadHC View Post
    I will try to do temporal thingy as per pandy's comment and maybe that could enable the removal of watermark.
    No, it won't.

    Originally Posted by JadHC View Post
    ...but i get following error that it doesnt recognize DistanceFunction.
    Look at "Core requirements" again.
    Quote Quote  
  11. Originally Posted by VoodooFX View Post
    No, it won't.
    So it's a hopeless case?

    Originally Posted by VoodooFX View Post

    Look at "Core requirements" again.
    I think i found the issue at the link below.. i installed AvsInPaint.dll and now working on debugging the mask... Is this looking better?

    http://forum.doom9.net/showthread.php?p=1893934
    Image Attached Thumbnails Click image for larger version

Name:	3.jpg
Views:	112
Size:	69.2 KB
ID:	75958  

    Quote Quote  
  12. Originally Posted by VoodooFX View Post

    Look at "Core requirements" again.
    oh my, face palm... yes indeed, Core requirements do list AvsInPaint... duh... I need to have my morning coffee... thanks for spotting this...
    Quote Quote  
  13. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JadHC View Post
    So it's a hopeless case?
    Yes.

    Originally Posted by JadHC View Post
    Most likely that you are doing something wrong.
    I can't tell what without the full avs script and video/mask samples.
    Quote Quote  
  14. Originally Posted by VoodooFX View Post
    Originally Posted by JadHC View Post
    I will try to do temporal thingy as per pandy's comment and maybe that could enable the removal of watermark.
    No, it won't.
    ?!? this is basic math - video (all changes) is noise from static perspective - averaging motion improve signal (static logo) to noise (motion video) ratio

    Code:
    @setlocal
    
    @set FFMPG=%CD%
    @set PATH=%FFMPG%;%PATH%
    
    @set filename=%1
    @echo "%filename%"
    
    @set fa=256
    @set /a fb=%fa%/2
    
    @ffplay -loop 0 -hide_banner -v 32 -stats -an -sn -i %filename% -vf scale=iw/2:-1:sws_flags=spline,tblend=all_mode=average,decimate=cycle=2,tmix=frames=%fa%:weights="1",select='not(mod(n\,%fb%))',tblend=all_mode=average,format=pix_fmts=gray
    
    @endlocal
    @pause
    Seem there is issue with ffmpeg and average kernel larger than 256 (i.e. 8 bit) - perhaps issue with limited accuracy or some issues with automatic conversion from higher bitdepth to lower bitdepth - ideally average shall be ALL frames so in this particular case 5525 frames (ffmpeg tmix limit is 1024).
    Quote Quote  
  15. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by pandy View Post
    ?!? this is basic math.
    Basic math doesn't account that the watermark is damaged by compression and it's not "a transparent watermark" anymore.

    Now it's a ~transparent animated watermark.
    Quote Quote  

  16. Most likely that you are doing something wrong.
    I can't tell what without the full avs script and video/mask samples.
    Hello,

    yes, i was aware that I didnt share any info. I was trying to go through your manual, learn how it works and debug it myself so i dont post every step on the forum and spam people. I had a lovely evening going through your manual last night (doesn't mean I'm much smarter youre definitely smarterer). But at least i gave it a try

    This different watermark is from website video (not youtube), so good news, its not compressed.
    I was able to do Loc function:

    Code:
    InpaintLoc(file1,loc = "180,240,-180,-240")
    I did two versions of watermark, one was screenshot of frame with no video (end frame) and second version when i whitened the watermark.
    It seems i dont understand the Inpaint function properly (still studying).
    It does quite okay inpainting when i do "Inpaint" mode. But my watermark is transparent, not opaque. So when i switch to "Deblend", i just get no removal and odd squares on edges... I must do something wrong.

    Code:
    InpaintDelogo(mask="C:\0 Temp\Download\Watermark Pond5.bmp", Automask=0, aMix=0, Loc="180,240,-180,-240", Mode="Inpaint")
    Code:
    InpaintDelogo(mask="C:\0 Temp\Download\Watermark Pond5.bmp", Automask=0, aMix=0, Loc="180,240,-180,-240", Mode="Deblend")
    Image Attached Files
    Quote Quote  
  17. Originally Posted by pandy View Post
    Originally Posted by VoodooFX View Post
    Originally Posted by JadHC View Post
    I will try to do temporal thingy as per pandy's comment and maybe that could enable the removal of watermark.
    No, it won't.
    ?!? this is basic math - video (all changes) is noise from static perspective - averaging motion improve signal (static logo) to noise (motion video) ratio

    Code:
    @setlocal
    
    @set FFMPG=%CD%
    @set PATH=%FFMPG%;%PATH%
    
    @set filename=%1
    @echo "%filename%"
    
    @set fa=256
    @set /a fb=%fa%/2
    
    @ffplay -loop 0 -hide_banner -v 32 -stats -an -sn -i %filename% -vf scale=iw/2:-1:sws_flags=spline,tblend=all_mode=average,decimate=cycle=2,tmix=frames=%fa%:weights="1",select='not(mod(n\,%fb%))',tblend=all_mode=average,format=pix_fmts=gray
    
    @endlocal
    @pause
    Seem there is issue with ffmpeg and average kernel larger than 256 (i.e. 8 bit) - perhaps issue with limited accuracy or some issues with automatic conversion from higher bitdepth to lower bitdepth - ideally average shall be ALL frames so in this particular case 5525 frames (ffmpeg tmix limit is 1024).
    oh, this is very intriguing.. I never used gimp but if i can do it via avisynth/ffmpeg, i could try to export it based on your code provided. to be honest, i have nothing to lose and even partial removal can help. I'll go through the code when i have time and apply it (this weekend/next week). thank you for your help
    Quote Quote  
  18. Originally Posted by VoodooFX View Post
    Basic math doesn't account that the watermark is damaged by compression and it's not "a transparent watermark" anymore.

    Now it's a ~transparent animated watermark.
    But compression errors are averaged 512 times or more i.e. minuscule when compared to video signal.
    And no, it is not animated as it is static and ALL motion is averaged. ideally if all frames are counted in and averaged then it will provide lowest possible error.
    Later you can extract static part from residual background using 'wavelet decomposition' plugin in GIMP so you will get close to perfect static watermark so it can be subtracted from video.
    It would be nice if ffmpeg could be equipped with such decomposition so layers laid in various frequency scales can be processed independently.

    ffmpeg offer possibility to mix (filter 'blend') two videos - using averaged version of video and subtracting it with itself can be quick workaround.
    Quote Quote  
  19. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by pandy View Post
    And no, it is not animated as it is static
    Strongly disagree.

    Originally Posted by pandy View Post
    it will provide lowest possible error.
    Wrong semantics... I would use "close to highest possible". Did you actually check that watermark? Try your theory on it.

    Originally Posted by pandy View Post
    Later you can extract static part from residual background using 'wavelet decomposition' plugin in GIMP so you will get close to perfect static watermark so it can be subtracted from video.
    Sounds simple in theory, not so simple in practice. Why you don't make a script on your method?

    EDIT:
    I don't need to reinvent the wheel, I already wrote a humongous script with over 120 parameters to cover ~every logo possible...
    If you think that you can improve anything on deblending then write a script with your method instead on theorizing on it.
    Quote Quote  
  20. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by JadHC View Post
    This different watermark is from website video (not youtube), so good news, its not compressed.
    Of course it's compressed and re-re-recompressed... Don't waste your time on such crap.
    Why do you even want to delogo this?

    Originally Posted by JadHC View Post
    I must do something wrong.
    For a start you didn't left at least 10 pixels around logo.
    Quote Quote  
  21. Originally Posted by VoodooFX View Post
    Strongly disagree.
    If watermark logo is NOT blurred then it is STATIC.

    Originally Posted by VoodooFX View Post
    Wrong semantics... I would use "close to highest possible". Did you actually check that watermark? Try your theory on it.
    In terms of signal processing this is lowest possible error as error is anyway unavoidable but averaging minimize it to lowest possible level.

    https://4nsi.com/optimizing-image-signal-to-noise-ratio-using-frame-averaging/

    And yes, I actually checked this watermark and discovered error in 'tmix' filter (if more than 256 frames is averaged then internal bitdepth [my assumption 8 bit] is not enough and error is obviously visible - possible problem with autoscale - have no time to raise this in ffmpeg bug tracker - for maximum 1024 frames allowed by 'tmix' filter at least 2 bits more are required than currently implemented). Of course using more frames produce lower error (for 256 frames error is approx 6.25% where for 1024 it will be 3.125% - if ALL frames could be used and averaged then error will be approx 1.34%).

    Originally Posted by VoodooFX View Post
    Sounds simple in theory, not so simple in practice. Why you don't make a script on your method?
    I don't need such functionality and this method is useful only for case with static logo. Separation logo from low freq residual is additional step - mentioned GIMP 'wavelet decompose' filter as i use this filter frequently to separate residual error from for example photographed documents where illumination of page is not linear and not regular - works quite well so this step is verified.

    Originally Posted by VoodooFX View Post
    EDIT:
    I don't need to reinvent the wheel, I already wrote a humongous script with over 120 parameters to cover ~every logo possible...
    If you think that you can improve anything on deblending then write a script with your method instead on theorizing on it.
    Good for you but no need to be mean - as i've wrote previously - averaging can be used to extract static from dynamic part - there is no magic there and i don't pretend to be some inventor of new magical method - coherent sampling is very similar principle.
    Quote Quote  
  22. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by pandy View Post
    If watermark logo is NOT blurred then it is STATIC.
    Obviously that and the other uTube videos are "blurred".


    Originally Posted by pandy View Post
    as i've wrote previously - averaging can be used to extract static from dynamic part
    Yes, it can be used, but as I wrote previously - it won't remove the watermark.
    Quote Quote  
  23. Originally Posted by VoodooFX View Post
    Obviously that and the other uTube videos are "blurred".
    On sample provided by OP watermark logo is not blurred after average operation i.e. it is STATIC.

    Originally Posted by VoodooFX View Post
    Yes, it can be used, but as I wrote previously - it won't remove the watermark.
    Yes, i never claimed that average remove watermark logo - purpose of averaging is STATIC watermark logo EXTRACTION (as a series of steps) so STATIC watermark logo can be used with for example inpainting technique - in case where logo can't be extracted traditionally average may help.
    Hope this is clear now - apologies for my english if you had different impression.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!