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 5th October 2022, 17:00   #541  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
I was tried removed all logo from this video. I think this very good but can you suggest if this can better, VX? (If had other way). Thanks

example: https://drive.google.com/file/d/19xu...ew?usp=sharing

Applied Scripts: https://drive.google.com/file/d/1E4Z...ew?usp=sharing

Scripts:
Quote:
LWLibavVideoSource("C:\Users\ADMIN\Downloads\Gen Hoshino - Kigeki [1440x1080i MPEG2 M-ON! HD].ts", fpsnum=24000, fpsden=1001)

a0=trim(0,49)
b0=trim(50,5488).InpaintDelogo(mask="C:\mask5.bmp", Automask=0, aMix=0, Loc="50,40,-1186,-910", Mode="Inpaint")
c0=trim(5489,5563)
a0++b0++c0

a1=trim(0,53)
b1=trim(54,119).InpaintDelogo(mask="C:\mask1.bmp", Automask=0, aMix=0, Loc="60,880,-1094,-50", Mode="Inpaint", Analyze=3)
c1=trim(120,5477).InpaintDelogo(mask="C:\mask1.bmp", Automask=0, aMix=0, Loc="60,880,-1094,-50", Mode="Deblend")
d1=trim(5478,5491).InpaintDelogo(mask="C:\mask1.bmp", Automask=0, aMix=0, Loc="60,880,-1094,-50", Mode="Inpaint", Analyze=3)
e1=trim(5492,5563)
a1++b1++c1++d1++e1

a2=trim(0,25)
b2=trim(26,37).InpaintDelogo( mask="C:\mask2.bmp", Automask=0, aMix=0, Loc="1292,908,-60,-50", Mode="Inpaint", Analyze=3)
c2=trim(38,5526).InpaintDelogo( mask="C:\mask2.bmp", Automask=0, aMix=0, Loc="1292,908,-60,-50", Mode="Deblend")
d2=trim(5527,5538).InpaintDelogo( mask="C:\mask2.bmp", Automask=0, aMix=0, Loc="1292,908,-60,-50", Mode="Inpaint", Analyze=3)
e2=trim(5539,5563)
a2++b2++c2++d2++e2

propSet("_FieldBased",0)
deep_resize(1920,1080)

Last edited by kedautinh12; 5th October 2022 at 17:20.
kedautinh12 is offline   Reply With Quote
Old 5th October 2022, 20:02   #542  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,508
Video without logo: https://www.youtube.com/watch?v=D_Oyplmhhv0

Code:
v1 = DGSource("Gen Hoshino - Kigeki [1440x1080i MPEG2 M-ON! HD].dgi").TFM().Tdecimate().Trim(3,0).Spline36Resize(1920,1080)
v2 = DGSource("Gen Hoshino  Comedy.dgi")
msk = v1.ExtractY().Trim(5460,5460).mt_binarize(24).mt_expand().mt_expand().mt_expand().mt_expand().mt_expand()

mt_merge(v1, v2, msk, luma=true)
Result: https://imgsli.com/MTI4ODcw

The mask can be improved, should be really easy to draw it yourself.
Reel.Deel is offline   Reply With Quote
Old 5th October 2022, 21:36   #543  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,046
@kedautinh12: For live video opaque delogo is not very good, I think in this case InpaintDelogo just does a passthrough to AVSInpaint which is spatial only. I tried to improve it with temporal compensation, it does improve a little but needs more work.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 6th October 2022, 04:17   #544  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
Quote:
Originally Posted by Dogway View Post
@kedautinh12: For live video opaque delogo is not very good, I think in this case InpaintDelogo just does a passthrough to AVSInpaint which is spatial only. I tried to improve it with temporal compensation, it does improve a little but needs more work.
Hi, any suggestions scripts for temporal compensation?? Thanks

Last edited by kedautinh12; 6th October 2022 at 04:22.
kedautinh12 is offline   Reply With Quote
Old 6th October 2022, 05:22   #545  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,609
Quote:
Originally Posted by kedautinh12 View Post
Hi, any suggestions scripts for temporal compensation?? Thanks
Mcompensate, from MVTools2:

http://avisynth.org.ru/mvtools/mvtools2.html#functions
johnmeyer is offline   Reply With Quote
Old 6th October 2022, 13:52   #546  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
Quote:
Originally Posted by Reel.Deel View Post
Video without logo: https://www.youtube.com/watch?v=D_Oyplmhhv0

Code:
v1 = DGSource("Gen Hoshino - Kigeki [1440x1080i MPEG2 M-ON! HD].dgi").TFM().Tdecimate().Trim(3,0).Spline36Resize(1920,1080)
v2 = DGSource("Gen Hoshino  Comedy.dgi")
msk = v1.ExtractY().Trim(5460,5460).mt_binarize(24).mt_expand().mt_expand().mt_expand().mt_expand().mt_expand()

mt_merge(v1, v2, msk, luma=true)
Result: https://imgsli.com/MTI4ODcw

The mask can be improved, should be really easy to draw it yourself.
sr for noob answer, why msk use trim(5460,5460) and why use many mt_expand()??
kedautinh12 is offline   Reply With Quote
Old 7th October 2022, 06:10   #547  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,508
Trim(5460,5460) because that frame is all black with just the logo and text, perfect for creating a mask. mt_expand() is used to grow the mask outward. The text on the bottom left has a black outline and since frame #5460 is all black there no way to get the outline. Like I said, the mask can be improved but it took me just a few minutes to do that and the result was very good.
Reel.Deel is offline   Reply With Quote
Old 7th October 2022, 06:20   #548  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
Quote:
Originally Posted by Reel.Deel View Post
Trim(5460,5460) because that frame is all black with just the logo and text, perfect for creating a mask. mt_expand() is used to grow the mask outward. The text on the bottom left has a black outline and since frame #5460 is all black there no way to get the outline. Like I said, the mask can be improved but it took me just a few minutes to do that and the result was very good.
Ok, thanks. Got it

Last edited by kedautinh12; 7th October 2022 at 06:30.
kedautinh12 is offline   Reply With Quote
Old 8th October 2022, 02:58   #549  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 729
Code:
# Version 3.00 :  Fixed: A frame selection scan result wasn't saved properly when "Automask=1" and "Inpaint" mode,
#                        now the deblending masks generation is up to twice faster in this scenario.
#                 New feature: Easy use of the ebmp masks on other videos, you can input them directly with "Mask" parameter.
#                              Ebmp format is changed, the masks from older versions are not compatible.
#                 New feature: Twice faster subtitles extraction with auto intermediate file.
#                              It's activated by negative "Extract" values.
#                              Requirements: LSMASH, TWriteAVI, x264vfw.
#                              New params: "ReExtract", "FourCC".
#                 New feature: Adjustable subs detection window, useful if video has non-middle subs alignment.
#                              New params: "DetWinPercW", "DetWinPercH", "DetWinHoPos".
#                              With "Show=12" you can see the subs detection window and correlation coefficient [CorrTh/Corr].
#                 New: "Turbo=-1", it activates an inpainting preset more suitable for UHD - HD resolutions.
#                 New: "IntSpd=4", similar as above.
#                 Basemask change: Background should be less than full white, logo - full white.
#                 Swapped "Turbo" 1 & 3.
#                 Removed "rSize" parameter.
#                 Reworked "Show=2", alternative to "Show=1" for positive Analyze.
#                 New feature: Various parameters to manipulate the deblending masks from positive analyze [for the experts only]:
#                              "YAlphaTweak", "UAlphaTweak", "VAlphaTweak",
#                              "YAlphaSolidIns", "UAlphaSolidIns", "VAlphaSolidIns",
#                              "YAlphaSolidOuts", "UAlphaSolidOuts", "VAlphaSolidOuts",
#                              "YColorSolid", "UColorSolid", "VColorSolid",
#                              "YColorSolidOuts", "UColorSolidOuts", "VColorSolidOuts",
#                              "YColorSolidIns", "UColorSolidIns", "VColorSolidIns",
#                              "YOffsetIns", "YOffsetOuts", "UVOffsetIns", "UVOffsetOuts", "ShiftMasksVe", "ShiftMasksHo",
#                              "YAlphaExternal", "WholeDeblend", "TriggerDynamic", "DumpMasks".
#                 Various other tweaks.
#                 Avisynth+ v3.7.2 or later is required.
Have fun.


Quote:
Originally Posted by Dogway View Post
I tried to improve it with temporal compensation, it does improve a little but needs more work.
I would be interested in your compensation script if it improves anything.

Last edited by VoodooFX; 8th October 2022 at 03:10.
VoodooFX is offline   Reply With Quote
Old 8th October 2022, 04:27   #550  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
Lol, many new parameters to remember

Last edited by kedautinh12; 8th October 2022 at 04:58.
kedautinh12 is offline   Reply With Quote
Old 8th October 2022, 12:44   #551  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 729
Quote:
Originally Posted by Zetti View Post
Thank you very much.

I will test the temp script and im happy to see that i came with something you can use to get the script better for everyone.
Now you can adjust detection position with DetWinHoPos and use Show=12 for preview.
Code:
InpaintDelogo(Loc="60,566,-120,-30", Show=12, DynLocUp=2, DynMask=4, DynTune=170, DynMask4H=150, KillBlobs=-7, KillNoise=5, DetWinHoPos=0.8)



Comparison of Extract=1 vs Extract=-1 vs ReExtract=1 [read help about how to setup negative Extract]:

Code:
InpaintDelogo(Loc="60,566,-120,-30", Show=4, DynLocUp=2, DynMask=4, DynTune=170, DynMask4H=150, KillBlobs=-7, KillNoise=5,
\  Extract=1, ImgDir="D:\Subs", ImgInflate=1, CorrTh=0.7, DetWinHoPos=0.8)
Code:
InpaintDelogo(Loc="60,566,-120,-30", Show=4, DynLocUp=2, DynMask=4, DynTune=170, DynMask4H=150, KillBlobs=-7, KillNoise=5,
\  Extract=-1, ImgDir="D:\Subs", ImgInflate=1, CorrTh=0.7, DetWinHoPos=0.8)
Code:
InpaintDelogo(Loc="60,566,-120,-30", Show=4, DynLocUp=2, DynMask=4, DynTune=170, DynMask4H=150, KillBlobs=-7, KillNoise=5,
\  Extract=-1, ReExtract=1, ImgDir="D:\Subs", ImgInflate=1, CorrTh=0.7, DetWinHoPos=0.8)



Test.mkv file: https://drive.google.com/file/d/1Wi-...ew?usp=sharing
VoodooFX is offline   Reply With Quote
Old 8th October 2022, 12:59   #552  |  Link
Zetti
Registered User
 
Join Date: Dec 2015
Posts: 270
Thank you i will look into it.
Zetti is offline   Reply With Quote
Old 8th October 2022, 14:08   #553  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 729
Quote:
Originally Posted by kedautinh12 View Post
Lol, many new parameters to remember
There at the manual's bottom is filter() with all parameters and defaults, I copy/paste from there sometimes.
Anyway, "for the experts only", so you don't need to know them.

Btw, I think that v3 crossed some threshold, because avs v3.7.1 just ignores InpaintDelogo filter like it's commented out.


Quote:
Originally Posted by katzenjoghurt View Post
Still looking forward to it.
(Not so much on trying to figure out what they do exactly... but some means to tweak deblending... mhh... looks super-delicous.)
Here is a good sample to practice on hard to delogo video -> https://www.youtube.com/watch?v=hSXo5EMY-vA
There is a good quality 2K VP9 stream [not 1080p!], not all download tools can see that 2K stream [use 4KVideoDownloader].


Logo:


Delogo:
VoodooFX is offline   Reply With Quote
Old 8th October 2022, 14:16   #554  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
Btw, can new parameters fix my problem??
https://forum.doom9.org/showthread.p...72#post1975972
kedautinh12 is offline   Reply With Quote
Old 8th October 2022, 15:54   #555  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
I meet new problem with circle logo
can anyone had suggest when use with InpaintDelogo??
https://imgur.com/gallery/9G8g3Bv
Source: https://drive.google.com/file/d/1tes...ew?usp=sharing
Scripts:
Quote:
ex_bob(nnedi3=true).SelectEven()
trim(38,6996)
InpaintDelogo(mask="C:\mask2.bmp", Automask=1, aMix=-10, Loc="84,44,-1260,-910", Mode="Inpaint")

Last edited by kedautinh12; 8th October 2022 at 16:20.
kedautinh12 is offline   Reply With Quote
Old 8th October 2022, 16:20   #556  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
same error with left-bottom
https://imgur.com/gallery/HrQ3Vvg
Script:
Quote:
ex_bob(nnedi3=true).SelectEven()
trim(224,6871)
InpaintDelogo(mask="C:\mask1.bmp", Automask=1, aMix=-50, Loc="78,916,-1180,-48", Mode="Inpaint")
kedautinh12 is offline   Reply With Quote
Old 8th October 2022, 18:20   #557  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 729
Quote:
Originally Posted by kedautinh12 View Post
same error with left-bottom
https://imgur.com/gallery/HrQ3Vvg
What error? I see expected result of what you are doing.
Logo has shadow, so you are inpainting that shadow over letters.
VoodooFX is offline   Reply With Quote
Old 8th October 2022, 19:06   #558  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 729
Quote:
Originally Posted by kedautinh12 View Post
Btw, can new parameters fix my problem??
https://forum.doom9.org/showthread.p...72#post1975972
Split logo at the left and delogo separately.
To delogo at the right you can use ebmp from another video: https://drive.google.com/drive/folde...Vl?usp=sharing
VoodooFX is offline   Reply With Quote
Old 9th October 2022, 01:26   #559  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
Quote:
Originally Posted by VoodooFX View Post
What error? I see expected result of what you are doing.
Logo has shadow, so you are inpainting that shadow over letters.
But how i can erase that remain of black color??
kedautinh12 is offline   Reply With Quote
Old 9th October 2022, 01:28   #560  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,473
And can you have other ways to delogo with circle logo??
kedautinh12 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 10:52.


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