Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd November 2021, 15:21   #261  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by Danette View Post
Vdubd DeLogo instructions are quite clear and easy to understand.
Yes they are, still you didn't understood that you are making a mask and that there are more colors than Red for it.

Quote:
Originally Posted by Danette View Post
I’d be very interested if you could point me to any part of the manual where it states what color to paint the logo.
That is in the first sentence about it:

Code:
# val "mask"        : File based mask:
#                     Full path to the base mask of the logo, a B/W picture (Logo -> white).
Quote:
Originally Posted by Danette View Post
Automask performs rather poorly on every video that I’ve thrown at it... black, but get blue...
Maybe you are doing something wrong, maybe there is a bug, maybe it can be improved, or not. Without examples I don't know.
VoodooFX is offline   Reply With Quote
Old 23rd November 2021, 23:48   #262  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
Thanks for the response. I wasn’t expecting it.

I did see the “B/W picture (Logo -> white)” in the manual, but didn’t realize that it was code for: “create a black base with the logo painted white.” I suggest changing that code to the plain-English version I just posted, or something similarly clear. When I read the manual, where it says “B/W picture” I assumed that a B/W picture (black and white as opposed to color) was to be used. Here is an example of a “B/W picture”: https://postimg.cc/jwQyP4gB. This is how I discovered that InpaintDelogo works using that as the “C:\mymask.bmp”. Where I had only a color image, I assumed that Greyscale() could be employed to create the “B/W picture.” I had no idea what “(Logo -> white)” meant. I do now.

I’m not worried about the Automask-generated black base showing as blue in my image editor. I now know that the base should be black if I use Automask and can deal with that. I’m also not worried about the Automask feature, since I won’t be using it. If you are asking, for your own benefit, for examples, to see how it fails on my videos, I’ll be happy to provide examples. However, it seems that Automask is an unreliable method for sufficiently covering a logo, from what I’ve read by other posters confirming my own experience with it. So, I’m happy just making my own manual masks.

What I had an interest in knowing, as per my previous post, is whether or not, in your opinion, using the base without any solid color, such as in the link posted above, presents any problem in your mind. I suspect that you may have been unaware that InpaintLogo does work on a video without needing a black base, much like VDubs DeLogo. As an example; when I take the image in that link, above, and paint the logo white, and then use that in the “C:\mymask.bmp”, it seems to perform exactly as compared to when I make a black base. My reason for doing this is to simply save time in mask creation.

Last edited by Danette; 23rd November 2021 at 23:52.
Danette is offline   Reply With Quote
Old 24th November 2021, 13:13   #263  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
That's a greyscale image in your example, if you have no idea what something means then you need to ask on forum. I'll change it in the manual to be more specific.

I'm fully aware how InpaintDelogo works, of course images with random colors supplied as masks can have problems. If something seems to work doing against instructions that's called a foolproof design. Looks like I need to change that too.

Can you generate and show a mask with Automask from video in that example you've posted, and one you made with editor?
VoodooFX is offline   Reply With Quote
Old 25th November 2021, 19:26   #264  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by Danette View Post
However, it seems that Automask is an unreliable method for sufficiently covering a logo, from what I’ve read by other posters confirming my own experience with it.
I've searched this whole thread and except yours I found only one feedback about Automask:

Quote:
Originally Posted by manolito View Post
First of all I must say that the Automask feature works well.
Then I tried Automask on one frame example you have shared. Works well for me:


Mask from Automask:

Delogo:

Last edited by VoodooFX; 6th December 2021 at 00:52.
VoodooFX is offline   Reply With Quote
Old 26th November 2021, 15:02   #265  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
Quote:
Originally Posted by VoodooFX View Post
I've searched this whole thread and except yours I found only one feedback about Automask
A quick search shows the same issue in post #125, where Automask apparently had the same problem. In post #126, you suggested that the poster edit the Automask image to improve it. I ran into the same issues and, rather than go through the Automask processing and subsequent editing, it made more sense, to me, to just create the mask manually.

No need to pursue this aspect further, as I think we are going in circles, needlessly, in doing so.


Quote:
Originally Posted by VoodooFX View Post
Can you generate and show a mask with Automask from video in that example you've posted, and one you made with editor?
I didn’t run Automask on one image/frame. I ran it on the entire video. There are three images in this link: https://postimg.cc/gallery/9TH71fG/627b6e3e

The script I used is this:

Quote:
#InpaintLoc(Loc="514,370,-28,-30")
InpaintDelogo(Loc="514,370,-28,-30",Automask=1,mask="C:\Users\Main\Desktop\Capture\MTS Logo Templates\TV Land.bmp")
#InpaintDelogo(mask="C:\Users\Main\Desktop\Capture\MTS Logo Templates\TV Land.bmp", Loc="514,370,-28,-30", Mode="InPaint")
Running Automask on the video generated the mask labeled “BW Automask Mask” and you can see that the upper left part of the main logo is not masked. However, there are large areas to the right of the logo and below the logo that are erroneously masked. The result of using this mask on the video can be seen in the image labeled “BW Automask Results” where the logo is showing through as a result of that missing section where the upper left part of the main logo is not masked. The false masking, to the right and below the logo, will then cover non-logo parts of other frames in the video.

The image labeled “BW Editor Manual Mask” is the mask I created with my image editor and it works perfectly when used in InpaintDelogo processing. Note that this image is not a black base. It is what I would do with VDubs DeLogo, but using a white mask instead of red.

Again, don’t make adjustments for my sake. I am content making manual masks (it’s faster and better). However, if you want additional tests from me, I’ll be happy to help.

Last edited by Danette; 26th November 2021 at 15:05.
Danette is offline   Reply With Quote
Old 26th November 2021, 16:30   #266  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by Danette View Post
A quick search shows the same issue in post #125, where Automask apparently had the same problem.
Automask is to create a mask for a logo not to some upscaled artifacts like there.

Quote:
Originally Posted by Danette View Post
I ran it on the entire video.
So you have selected the wrong method for your task.
Are words from the manual not clear about this: "doesn't produce good results"?

Btw, in v2.0[WIP] there are new smart auto Analyze modes, actually I deleted all old Analyze code, the manual analysis modes too.
Dunno, maybe I need to return manual modes, hard to decide without checking stuff in practice.

EDIT:
OK, I decided to return them.
But as old manual and new auto Analysis stuff is not intercompatible then dunno when it will be released...

Last edited by VoodooFX; 5th December 2021 at 15:11.
VoodooFX is offline   Reply With Quote
Old 26th November 2021, 17:34   #267  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 346
Quote:
Originally Posted by VoodooFX View Post
So you have selected the wrong method for your task.
Are words from the manual not clear about this: "doesn't produce good results"?

Btw, in v2.0[WIP] there are new smart auto Analyze modes, actually I deleted all old Analyze code, the manual analysis modes too.
Dunno, maybe I need to return manual modes, hard to decide without checking stuff in practice.

EDIT:
OK, I decided to return them.
But as old manual and new auto Analysis stuff is not intercompatible then dunno when it will be released...
Don’t do this simply because of my comments. As I said, I won’t be using Automask and others may prefer it as it is.

Yes, "doesn't produce good results" does mean something. It means it may or may not work. From my viewpoint, why spend the time with Automask when I can just make a manual mask, in a fraction of the time, that is guaranteed to work. Who knows, maybe the new smart auto Analyze modes would not be prone to this variability, but I just don’t see the value in it.

You have a great code, overall. By being able to get a good, simple, delogo function in Avisynth script, you've given us a great time savings over having to run it through Vdub. My suggestion is to not get hung-up on the Automask issue. I much prefer your earlier comments regarding the idea to incorporate all masks into one file or, maybe, incorporating what wonkey_monkey may be on the verge of delivering.
Danette is offline   Reply With Quote
Old 4th December 2021, 22:16   #268  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Harder, Better, Faster, Stronger v2.0:

Code:
# Version 2.0  : 2021/12/04.  AviSynth+ v3.7.1 or later & FrameSel plugin is required.
#                             New: Old Deblend delogo is superceded by the new superior one.
#                             New: Smart frames selection for analyze using "AnalyzeTh" & "NoBorderAt" parameters.
#                             New: "Automask" adapted to the new stuff and it doesn't reanalyze when "aMix" is adjusted.
#                             New: "Show" 7/8/9.
#                             Note: Old Deblend is saved as negative "Analyze",
#                                   -3/-4 should be same as old, -1/-2 were augmented by the smart frames selection.
Advantages of new delogo will be mostly noticeable on damaged logos (E.g. overcompressed, re-re-re-encoded videos).
So here are some comparisons on such one. x3 upsized, no PP (except last one):

Top row: Original logo & rm_logo/InpaintFunc
Bottom row: InpaintDelogo old, InpaintDelogo v2.0 & InpaintDelogo v2.0 with default dPP=3, Interp=2




As there are less artifacts then maybe I'll lower PP defaults (btw, for anime Interp shouldn't be used, maybe maximum 1).

Some other before/after frames (no PP):




Old Automask & new Automask:


And benchmarks (video: 720p , H264, 00:18:25):
Code:
Automask (old)  - 00:01:50
Automask (v2.0) - 00:01:37

Analyze old     - 00:03:36
Analyze (v2.0)  - 00:02:52

Deblend old     - 196 FPS
Deblend (v2.0)  - 352 FPS
Happy delogo!
VoodooFX is offline   Reply With Quote
Old 6th December 2021, 01:43   #269  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
I was asked to make comparison to "lgd", so here it's: Left InpaintDelogo & right Makki's lgd:





Code:
Good frames found (Threshold 30) & analysis time:
ID v2.0: 10643 frames - 00:02:52
LGD:      7647 frames - 00:05:02

Benchmark:
Deblend ID v2.0 - 352 FPS
Deblend LGD     - 380 FPS
Looks almost same, InpaintDelogo has more precise the good frames search so it found more frames.

But, it's simple logo and Makki's delogo can do only simple logos, enough to move logo to the frame's border or letterbox and it fails to do proper analysis:



Forget about color and variable transparency logos with lgd. Here is InpaintDelogo v2.01 on my delogotest sample:



Download DelogoTest video for delogo tests, and ID v2.01 command:
Code:
InpaintDelogo( mask="D:\mask.bmp", Automask=0, aMix=-1, Loc="10,16,-6,-20", Mode="Both", Analyze=3, Interp=0, oTune=-10)

Last edited by VoodooFX; 6th December 2021 at 13:03.
VoodooFX is offline   Reply With Quote
Old 10th December 2021, 22:16   #270  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Code:
# Version 2.02 : 2021/12/10.  Fixed: "Analyze=1" bug.
#                             +11% deblend speed-up.
#                             Tweaked "aMix". "Analyze=2" is default. Adaptive "AnalyzeTh" default [16 or 30].
#                             Don't search frames for analyse if 'txt' file is present and ReAnalyze=0.
# Version 2.01 : 2021/12/05.  "Analyze" 3 option.

Last edited by VoodooFX; 10th December 2021 at 22:36.
VoodooFX is offline   Reply With Quote
Old 12th December 2021, 18:20   #271  |  Link
quochuyonnet
Registered User
 
Join Date: Oct 2021
Posts: 11
Could i have ver 1.48 link please? i'm using avisynth 2.60
quochuyonnet is offline   Reply With Quote
Old 12th December 2021, 18:31   #272  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by quochuyonnet View Post
Could i have ver 1.48 link please? i'm using avisynth 2.60
All versions from v1.24 are on GitHub:

https://github.com/Purfview/InpaintD...intDelogo.avsi

Two buttons at the right side there will bring you to "that" version.
VoodooFX is offline   Reply With Quote
Old 12th December 2021, 19:49   #273  |  Link
quochuyonnet
Registered User
 
Join Date: Oct 2021
Posts: 11
Thank you for answer i've downloaded v1.48 avsi file.

Edit: I've install Gimport, but still can not call InpaintDelogo Function inside AvsPmod
LoadCPlugin("C:\Program Files (x86)\AviSynth\plugins\AVSInpaint.dll")
GImport("C:\Program Files (x86)\AviSynth\plugins\InpaintDelogo.avs")

Update: I'm able to use function by typed it manually in AvsPmod, I saw it did good with static logo, could InpaintDelogo help delogo which is moving/ has faded away slowly effect?

Last edited by quochuyonnet; 12th December 2021 at 20:25.
quochuyonnet is offline   Reply With Quote
Old 12th December 2021, 20:38   #274  |  Link
quochuyonnet
Registered User
 
Join Date: Oct 2021
Posts: 11
Do you've any idea to deal with this moving logo?
https://youtu.be/5ZKuJJaqCDE
quochuyonnet is offline   Reply With Quote
Old 12th December 2021, 22:56   #275  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
For parts where logo is static but "fades away" use "Inpaint" mode. For moving parts you can try one of dynamic methods.
Share sample of original video.
VoodooFX is offline   Reply With Quote
Old 13th December 2021, 15:55   #276  |  Link
Inolga
Registered User
 
Join Date: Dec 2021
Posts: 6
Hi !

Thanks VoodooFX for you great work !

Version 1.48 was working good but every time I try to load the v2.02 with MeGUI, I have an error :



I have all the requirements, up to date :





I'm using ffms2 to load my source video

Thanks for your help

Last edited by Inolga; 13th December 2021 at 16:03.
Inolga is offline   Reply With Quote
Old 13th December 2021, 17:10   #277  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by Inolga View Post
Version 1.48 was working good but every time I try to load the v2.02 with MeGUI, I have an error :
I think that error is from v2.01.

Try AvS+ v3.7.1 test build 34 https://forum.doom9.org/showthread.p...25#post1958925

What is masktools2 version? Post your full script and the mask file.

Last edited by VoodooFX; 13th December 2021 at 17:16.
VoodooFX is offline   Reply With Quote
Old 13th December 2021, 17:21   #278  |  Link
quochuyonnet
Registered User
 
Join Date: Oct 2021
Posts: 11
this is original video which i've used for test delogo has moving and fades away effect.
https://youtu.be/sQvmLppMU_s
quochuyonnet is offline   Reply With Quote
Old 13th December 2021, 17:33   #279  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by quochuyonnet View Post
this is original video which i've used for test delogo has moving and fades away effect.
https://youtu.be/sQvmLppMU_s
Anything uploaded to youtube is not original anymore and it looks cropped.
VoodooFX is offline   Reply With Quote
Old 13th December 2021, 17:44   #280  |  Link
quochuyonnet
Registered User
 
Join Date: Oct 2021
Posts: 11
yes, it's only a small clip i've used for testing delogo has moving effect. Here is another host
https://ufile.io/ra46waxn
p/s: i've tried "dynamic mask" as a crop clip with resolution same as "Loc" area, but got "Crop: Destination width is 0 or less (C:\...Inpaintdelogo.avs, line 1296)" error.

Last edited by quochuyonnet; 13th December 2021 at 17:48.
quochuyonnet is offline   Reply With Quote
Reply

Tags
delogo, hardsubs, ocr, remove, watermark

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.