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. |
|
|
Thread Tools | Search this Thread | Display Modes |
9th December 2019, 19:39 | #61 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,042
|
Any/all changes that you dont like, remove [or just miss them out all together in v1.14], I can easily make a stub to amend loc from outside of your script, not a problem at all.
The thing I'm currently doing (s_exlogo2) is not in anyway competition for your script, has different intent, I wanna be able to just splat any rectangular problem areas without having to do any analysis. Quote:
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
27th December 2019, 00:48 | #63 | Link |
Registered User
Join Date: Nov 2003
Posts: 416
|
I've tried to look over everything and absorb what I could. Your built-in two manuals leave out much. Here's where I'm stuck now:
> 2) Get frames numbers for manual "Analyze". What do I do with the range of frame numbers that I want the analysis to be based on? BTW, I will be replacing rm_logo logic. My scripts have commented out code which was used to do the analysis, then further down was my runtime code. |
27th December 2019, 11:16 | #64 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,042
|
@ TcMullet,
I'm off to bed in a minute, but will come back later. @ VoodooFX, I've removed the InPaintDelogo v1.13 pretender script from SendSpace, its gone 4E4. [forever] Have done a stub function just to manufacture InPaintDelogo style Loc string, add it to your script if your like it, if not then no sweat. Code:
Function MakeLoc(clip c,Int x, Int y, Int w, Int h) { # https://forum.doom9.org/showthread.php?p=1893966#post1893966 /* Make Loc string for VoodooFX InPaintDelogo. Input X and Y, where -ve, is relative to c.Width or c.Height, and are converted to +ve X and Y in result string. Input W and H, where 0 or -ve, is relative c.Width or c.Height [as in Crop()], Where +ve, are converted to -ve W and H in result string [as required by InPaintDelogo]. Allows to make Loc string programmatically using flexible coord system and not locked into hand editing Loc string. ColorBars # 640,480 S=MakeLoc( 0, 0, 0, 0) # "0,0,-0,-0" S=MakeLoc( 540, 380,-40,-40) # "540,380,-40,-40" S=MakeLoc(-100,-100, 60, 60) # "540,380,-40,-40" S=MakeLoc( 540, 380, 60, 60) # "540,380,-40,-40" S=MakeLoc(-100,-100,-40,-40) # "540,380,-40,-40" */ c # First, Ensure/Convert X,Y,W,H ALL +ve x = (x >= 0) ? x : Width + x y = (y >= 0) ? y : Height + y w = (w > 0) ? w : Width - x + w h = (h > 0) ? h : Height - y + h # Check validity Assert(0 <= x < Width ,String(x,"MakeLoc: 0 <= X(%.0f)") + String(Width ," < Width(%.0f)" )) Assert(0 <= y < Height ,String(y,"MakeLoc: 0 <= Y(%.0f)") + String(Height ," < Height(%.0f)")) Assert(1 <= w <= Width -x ,String(w,"MakeLoc: 1 <= W(%.0f)") + String(Width ," <= Width-X(%.0f") + String(x ," - %.0f)")) Assert(1 <= h <= Height-y ,String(h,"MakeLoc: 1 <= H(%.0f)") + String(Height ," <= Height-Y(%.0f") + String(y ," - %.0f)")) # Output string: +ve X,Y :: -ve W,H, Ensure all (even W=0 and H=0) flagged as -ve eg -0 return String(x,"%.0f") + String(y,",%.0f") + String(Abs(x+w-Width),",-%.0f") +String(Abs(y+h-Height),",-%.0f") } then please rename function to some other name, I dont want it to conflict with my stub. [you would likely want to edit the description too of course].
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 27th December 2019 at 11:48. |
28th December 2019, 00:51 | #65 | Link | |
Moderator
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
|
Quote:
InpaintDelogo( mask="G:\Jugnu\Logo.bmp", \ Automask=0, aMix=0, Loc="44,34,-524,-386", \ Mode="Inpaint", \ Analyze=1, Fr1=0, Fr2=0, FrS=0) Others such as manolito, VoodooX, or StainlessS might want to make suggestions. I'm not even sure I need all that, but it works quickly and it works well. Last edited by manono; 28th December 2019 at 00:54. |
|
28th December 2019, 08:11 | #66 | Link | ||
Banana User
Join Date: Sep 2008
Posts: 1,062
|
December is very busy... I don't have much time StainlessS.
Quote:
Quote:
|
||
29th December 2019, 00:01 | #67 | Link | ||||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,106
|
I agree that using InpaintDelogo can be a little bit confusing at first - I found it confusing even with a lot of experience from other delogo plugins...
In this post I will try to remove some of the confusion. To achieve this I will only refer to the "Inpaint" mode which is meant for opaque logos. The two other modes ("Deblend" and "Both") are meant for semi-transparent logos, they try to reconstruct the original pixels behind the semi-transparent logo. This makes these modes much more complex and slower, and I found that the result oftentimes does not justify the effort. For the "Inpaint" mode only one "base mask" is needed. The additional Alpha and Color masks are not needed at all. This is the basic work flow: 1. Create a "base mask". This is an image file with the identical size of the source clip where the logo itself is all white and the rest of the image is all black. Save it as a BMP file to your HDD. 2. Determine the coordinates for the "Loc" parameter. The dimensions need to be about 10 pixels larger than the logo, and the format is identical to the AviSynth Crop parameters. 3. Call the "InpaintDelogo" function for the logo removal. Use the parameters for the mask file location and the Loc parameter with the coordinates which you have determined. The InpaintDelogo plugin includes methods to do the #1 and #2 tasks, but it is in no way required to use these methods. For many users it may be much easier to perform these steps manually without using the plugin functions. Have a look at manono's script two posts above. He does steps #1 and #2 manually, and his final logo removal call can even be stripped down considerably. His original script can be reduced to: InpaintDelogo(mask="G:\Jugnu\Logo.bmp", Loc="44,34,-524,-386", Mode="Inpaint") Especially the "Analyze=1" should not be used here. When the mode is set to "Inpaint" then "Analyze=0" will be forced unconditionally. This is because the base mask is already there, and the "Inpaint" mode does not need additional masks which would need analyzing. For better speed you can play with the "Turbo" parameter, but this is basically it. If you are familiar with using a photo editor to create the mask then this will be your fastest method. If your are like me and do not feel comfortable with image editors like PhotoShop then it may be a good idea to use the InpaintDelogo plugin to create the required base mask automatically. The "InpaintDelogo" function needs to be called with the "AutoMask=1" parameter for this. With this parameter the function will ONLY CREATE A MASK, nothing else. To actually remove the logo the function has to be called for a second time without the "AutoMask" parameter. First you need to determine the "Loc" coordinates and enter them into the "Loc" parameter. Then you need to decide which "Analyze" method you want to use for the mask creation. The best and fastest method for the "Inpaint" mode is "Analyze=4". You need to find a source frame where the logo is surrounded by black. For real world movies such a frame can usually be found at the start of the movie or at the very end. The frame number of such a frame needs to be entered with the "Fr1" parameter. If you cannot find a source frame where the logo is surrounded by black then you need to use the "Analyze=1" method. With this method 3% of the source will be analyzed for the mask creation. This takes time, especially for HD sources. For longer sources you can use this hack to speed up the mask creation: Quote:
Quote:
Quote:
Quote:
Hint for better speed if you are downscaling your source: The logo removal will be much faster if you apply it after the resizer (when downscaling). Of course this also means that you need to use a downscaled image for creating the mask. Cheers manolito Last edited by manolito; 29th December 2019 at 01:25. |
||||
29th December 2019, 00:41 | #68 | Link | ||
Moderator
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
|
Quote:
Quote:
Last edited by manono; 29th December 2019 at 00:49. |
||
29th December 2019, 01:19 | #69 | Link | |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,106
|
Quote:
looks like we have similar preferences. I have been using PhotoFiltre exclusively for many years now. But I still am not an expert with layers and masks, I just don't do much photo editing... Happy New Year manolito |
|
29th December 2019, 03:02 | #70 | Link |
Moderator
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
|
Me neither. About all I use it for is mask creation for logos and for parts of frames where filters are to be applied, and then its Gaussian Blur filter for feathering when needed.
Oh, and for replacing parts of artifacted frames with bits from nearby good frames. All simple stuff. And all for use in AviSynth scripts. |
29th December 2019, 10:22 | #71 | Link |
Registered User
Join Date: Nov 2009
Posts: 59
|
i love this plugin!
my personal workflow (no need to create mask): -find logo area with InpaintLoc() -find 30+ frames with logo on black background (mostly at start or end of video) -find 30+ frames with logo on white(ish) background Code:
InpaintDelogo(mask="tmp.bmp",Automask=1,Loc="x,x,-x,-x", Mode="Both", Analyze=3,Fr1=x,Fr2=x,FrS=3) -loc parameter would be great to be used as "left,top,width,height" imo -whenever Automask is enabled, staxrip and probably avisynth doesn't generate a valid output, so i need to first analyze and then disable automask thanks dev for this great plugin, this really helps a lot! next improvement would be finding black/white frames on its own |
29th December 2019, 14:05 | #72 | Link | |||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,106
|
Quote:
https://forum.doom9.org/showthread.p...66#post1893966 It will convert your input to the required format for InpaintDelogo. Quote:
From the manual: Quote:
Cheers manolito |
|||
30th December 2019, 11:26 | #73 | Link | |
Registered User
Join Date: Nov 2009
Posts: 59
|
Quote:
|
|
31st August 2020, 00:37 | #75 | Link |
Registered User
Join Date: Aug 2015
Posts: 15
|
I have a film with a single color transparent text watermark, always at the same location. I also have the film in a lower resolution version without watermarks, but with a lower frame rate (and therefore missing frames). I don't want to remove the missing frames, otherwise the film will be more jerky.
I've built a script for myself, which picks out the best fitting frames with help of LumaDifference and use a black/white mask to blend the parts of the lowres movie to the higher res movie to remove the logo. So far so good. The problem now are the missing frames. I tried to remove the logo from this frames with deblending, which works more or less well. Unfortunately the logo is not very transparent. So i've seen some leftovers. The film has a black spot with the logo. Unfortunately not a bright spot. That's why i'm using Analyze = 4 instead of 3. Unfortunately now a slightly flickering is visible on change from the deblended to non deblended frames (caused by the leftovers) The question now is, if the deblending could be improved by better masks. Theoretically, I should be able to "somehow" calculate better masks because I have the film in a version without the logo (but how said in lower resolution and lower framerate), right? Unfortunately, I just lack the understanding a little. As far as I understand i need two masks. A transparent mask and a color mask?!? It is somehow a mystery to me how this calculated color mask, which is calculated from many frames, can work properly for much different frames. Maybe someone have a idea and can help me. Unfortunately, I can't give out my film. But I think it's relatively easy to build a small demo for the experts. The avs script i currently use i've attached here. Hope the "code" isn't that bad. I'm not yet an Avisynth expert. |
31st August 2020, 14:13 | #76 | Link |
Banana User
Join Date: Sep 2008
Posts: 1,062
|
How do you replace parts on same frames if two clips are not same frame rate?
About deblending: I hardly understand what you are doing, so without example I can't give you an advice. Mask creation and deblending should be done only using frames with logo. txt/avs you can post as text or on pastebin.com because attachments can take some time to get approved. |
31st August 2020, 21:07 | #77 | Link |
Registered User
Join Date: Aug 2015
Posts: 15
|
Okay.. here the avs script https://pastebin.com/Un9c19D0
My solution to the different frame rates is to convert both videos to a higher frame rate. In this case it is 150Fps .. because 150/25 is 6 and 150/30 is 5 :-) ... A little SelectEvery voodoo |
2nd September 2020, 00:16 | #78 | Link |
Banana User
Join Date: Sep 2008
Posts: 1,062
|
If you can't use Analyze=3, then try Analyze=1, it can be better than Analyze=4. Sometimes you can get better deblending masks from Analyze=1 if you limit locations to analyze with trims, similar stuff what is good for Analyze=3, like more solid different luminosity objects passing through logo area ect..
|
21st October 2020, 15:30 | #79 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,599
|
hi,
what about make the mask parameter as val? so user can feed it with any mask clip to allow moving logo mask also is ExInpaint instead of AvsInpaint will be better? from what I see ExInpaint is faster and give better output in some usages
__________________
See My Avisynth Stuff |
21st October 2020, 17:48 | #80 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,042
|
Not sure but I think that ExInpaint is less temporally stable than AvsInpaint, better for still image but not video.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
Tags |
delogo, hardsubs, ocr, remove, watermark |
Thread Tools | Search this Thread |
Display Modes | |
|
|