View Full Version : InpaintDelogo - advanced logo removal & hardcoded subtitles extraction
Pages :
1
2
3
4
5
6
7
8
9
[
10]
11
12
13
14
15
16
17
18
19
20
21
22
banaguitar
18th September 2022, 18:26
Hi, is there any way to remove the logo in this video here?
https://drive.google.com/file/d/1Z-nNQpFm6Oko3RCizAPHM4mLPEp3LqGo/view?usp=sharing
VoodooFX
18th September 2022, 20:02
Hi, is there any way to remove the logo in this video here?
https://drive.google.com/file/d/1Z-nNQpFm6Oko3RCizAPHM4mLPEp3LqGo/view?usp=sharing
Try to remove it and you'll know, "zdf" part looks transparent, other part maybe opaque or has low transparency.
Deinterlace it first to the lossless file before doing anything, for example: "QTGMC(Sharpness=0.0)".
banaguitar
19th September 2022, 11:23
Try to remove it and you'll know, "zdf" part looks transparent, other part maybe opaque or has low transparency.
Deinterlace it first to the lossless file before doing anything, for example: "QTGMC(Sharpness=0.0)".
The mask looks horrible. I used this settings:
InpaintDelogo(Automask=1, Analyze=3, FrB=1,FrW=30,aMix=-3, Loc="52,42,-546,-508", mask="D:\mask.bmp")
https://i.postimg.cc/ZRtXwb5V/mask3.png
evafans
19th September 2022, 11:46
ConvertToYV12: only 8 bit sources allowed
I was try to extract hardsub, but met this error. What should I do, do I need to reencode the video?
VoodooFX
19th September 2022, 14:33
ConvertToYV12: only 8 bit sources allowed
What should I do?
Share script and sample.
evafans
19th September 2022, 15:15
https://wormhole.app/2L62b#_PL1ezf3Y5HY1eeOklw_KQ
The file is 10bit, is there a way to get around it as simple as possible?
VoodooFX
19th September 2022, 15:22
The mask looks horrible. I used this settings:
InpaintDelogo(Automask=1, Analyze=3, FrB=1,FrW=30,aMix=-3, Loc="52,42,-546,-508", mask="D:\mask.bmp")
Read the manual about parameters you are using.
For Loc you didn't left any borders.
FrB/FrW parameters are not for Analyze=3, FrW=30 is not even a white frame.
Try this to create the basemask:
InpaintDelogo( mask="D:\mask.bmp", Loc="40,30,-536,-498", Automask=1, Analyze=-4, aMix=-4)
After you got the basemask use:
InpaintDelogo( mask="D:\mask.bmp", Loc="40,30,-536,-498", Analyze=1, Mode="Deblend")
or
InpaintDelogo( mask="D:\mask.bmp", Loc="40,30,-536,-498", Analyze=2, Mode="Deblend")
EDIT:
Is your video 50 FPS after deinterlace?
VoodooFX
19th September 2022, 15:40
The file is 10bit, is there a way to get around it as simple as possible?
Add "ConvertBits(8)" after the source filter.
PS:
Looks like I've autoconversion to 8bits in my personal "dev" version, maybe later I'll dump some useful stuff from there to a public version.
banaguitar
19th September 2022, 18:16
Read the manual about parameters you are using.
Is your video 50 FPS after deinterlace?
Yes, 50 fps
This is the result. What are your thoughts about it? For me it looks ok.
https://drive.google.com/file/d/1Fq-v4Cashs622jp4imemh41jUoMy_1gz/view?usp=sharing
VoodooFX
19th September 2022, 18:57
Yes, 50 fps
This is the result. What are your thoughts about it? For me it looks ok.
Looks ugly for me.
Post your full script and share the ebmp/txt files created by the script.
EDIT:
I see, I forgot Mode="Deblend" in the previous post [corrected it now], run a corrected script then ebmp/txt files will be created and you can post them.
banaguitar
20th September 2022, 11:04
Now it looks much more better. I really don't know if it gets even better.
I used this script:
LWlibavVideoSource("D:\Disco.mkv")
SetFilterMTMode("QTGMC",2)
AssumeTFF()
QTGMC(preset="Slower",sharpness=0.0, EdiThreads=3)
Prefetch(10)
InpaintDelogo( mask="D:\mask.bmp", Loc="40,30,-536,-498", Analyze=1, Mode="Deblend")
BilinearResize(720,546)
Here is the result:
https://drive.google.com/file/d/17dNEtlwAWFHnooKZ6pcicHAqc46fuDeE/view?usp=sharing
Attached the txt/ebmp files
VoodooFX
20th September 2022, 11:53
Attached the txt/ebmp files
I can't see them, upload them to gdrive too.
I really don't know if it gets even better.
Try "Analyze=2", then you'll have more masks to compare what is better.
Did you deinterlaced to the lossless file?
banaguitar
20th September 2022, 15:57
I only used the script above and the mkv-file. That's all I have.
Here are all the files you need
https://drive.google.com/drive/folders/1zK4DV1WegvumvnW3reH7SCsKHB-RqXl0?usp=sharing
VoodooFX
20th September 2022, 16:13
The txt and ebmp are in the zip file
Where is gdrive link to them?
I only used the script above
Told you that before doing anything you need to deinterlace to the lossless file.
Or do you prefer to do empty deinterlacing ten times for no reason?
banaguitar
20th September 2022, 16:20
Where is gdrive link to them?
Told you that before doing anything you need to deinterlace to the lossless file.
Ok, I will do
VoodooFX
20th September 2022, 16:32
For some reason I can't download them from gdrive, upload to Wetransfer.
I see there some "RemoveWatermark Analyze=2.mkv" file, if you ran "Analyze=2" then you must have ebmp/txt files for it, upload them too.
I don't need your encoded files.
banaguitar
20th September 2022, 17:00
Please try again. It should work now.
There is no big difference between both.
VoodooFX
20th September 2022, 17:10
Managed to download them after I generated links for every file, strange that download on mkv files worked OK.
Why did you renamed them??? Post the real filenames of those files...
banaguitar
20th September 2022, 18:09
Added now the real filenames. Thanks for help.
If you habe problems with download on gdrive you can download the files here on wetransfer
https://we.tl/t-1zZbqarzNA
VoodooFX
20th September 2022, 19:06
Those mask are not from that script.
Share the proper masks or the proper script.
I just wonder how many times did you "deinterlaced" that clip... :D
banaguitar
20th September 2022, 21:54
Thats correct.
First I deinterlaced. Just one time. :)
LWlibavVideoSource("myclip.mkv")
SetFilterMTMode("QTGMC",2)
AssumeTFF()
QTGMC(preset="Slower",sharpness=0.0, EdiThreads=3)
Prefetch(10)
BilinearResize(720,546)
Then I saved it to an uncompressed file.
Second step is to create the basic mask from the lossless mkv
InpaintDelogo(mask="mask.bmp", Loc="40,20,150,60", Automask=1, Analyze=-4, aMix=-4)
Third step:
InpaintDelogo( mask="mask.bmp", Loc="40,20,150,60", Analyze=1, Mode="Deblend")
The same for Anaylze=2
That's all I did!
VoodooFX
21st September 2022, 00:30
1) Your ebmp masks looks like made on that 1 min sample, they are useless... Why would I need them?
2) Don't resize before delogo. Why resize with crappy filter or resize at all?
3) Your encodes looks blurred. If you didn't denoise then you need to investigate your setup.
banaguitar
21st September 2022, 05:02
1) Your ebmp masks looks like made on that 1 min sample, they are useless... Why would I need them?
2) Don't resize before delogo. Why resize with crappy filter or resize at all?
3) Your encodes looks blurred. If you didn't denoise then you need to investigate your setup.
1) That's correct. Sorry. I didn't know that. I uploaded all the files again for a similar complete clip, 10 min.
How can I open a ebmp-file?
2.) That's the reason
https://youtu.be/C4PyyQoz6eo?list=PLYVUzyF0TAYMC8USP0aIFe0XgPHdKfidt&t=3093
3.) The original video does not look blurry.
Please download the files here on wetransfer. The rendered video doesn't look perfect. You can still see some "leftovers" from the logo.
The Loc are "40,26,146,60"
----> https://we.tl/t-venRlwNWzk
doctorkhv
21st September 2022, 05:04
Hi,
I apply the logo as text in the bottom right corner using the multiply overlay https://youtu.be/gzhSOqUgA4E
What advise to apply for difficulty of a script DeLogo?
banaguitar
21st September 2022, 18:35
I can play a bit with the settings. Maybe I get better results. For now it is ok, but not perfect.
VoodooFX
21st September 2022, 18:48
@banaguitar
1.) Images you can open with ImageSource().
2.) Then better to do upscale.
3.) Nevermind, I used different QTGMC settings.
Again your masks don't fit any of your shared scripts... [EDIT: My bad, actually they are OK]
I apply the logo as text in the bottom right corner using the multiply overlay https://youtu.be/gzhSOqUgA4E
What advise to apply for difficulty of a script DeLogo?
My advice: Don't waste your time, anything you add there can be removed.
Dogway
21st September 2022, 19:47
VoodoFX, do you know a good way of removing the letters
http://i.imgur.com/qMBEiYCm.png (https://i.imgur.com/qMBEiYC.png)
I made the mask with (over a bright background):
InpaintDelogo( mask="Q:\Mask.bmp",
\ Automask=1, aMix=0, Loc="1376,64,-66,-874",
\ Mode="Inpaint",interp=0,
\ Analyze=3, FrB=18024, FrW=18024, FrS=2, GrainPP=3, turbo=3)
Output (Using Analyze=2 I got a black frame only):
http://i.imgur.com/mF92bMpt.png (https://i.imgur.com/mF92bMp.png)
http://i.imgur.com/T16vOK3m.png (https://i.imgur.com/T16vOK3.png)
Then I also got another mask called Mask_AutomaskTemp_A3:
http://i.imgur.com/1ffYPyBt.png (https://i.imgur.com/1ffYPyB.png)
I spent some time editing the mask by hand in Photoshop and got the next :/
http://i.imgur.com/c9IDBEWm.png (https://i.imgur.com/c9IDBEW.png)
VoodooFX
21st September 2022, 20:38
VoodoFX, do you know a good way of removing the letters
Your example script doesn't make sense, but if you got your mask then use:
InpaintDelogo( mask="Q:\Mask.bmp", Loc="1366,54,-56,-864")
or this can be a bit better:
InpaintDelogo( mask="Q:\Mask.bmp", Loc="1366,54,-56,-864", preBlur=4, postBlur=8, Radius=16)
Are those letters in whole video?
Dogway
21st September 2022, 20:52
"Are those letters in whole video?"
No, in a few places it's off.
The call is to create the mask, that's why automask=1 and analyze=3. But it doesn't fill the letters with white.
The letters are white with a 1px black border and a faint shadow towards right-bottom.
VoodooFX
21st September 2022, 21:18
But it doesn't fill the letters with white.
Because script is nonsense. ;)
Maybe you copied from some early examples in the thread, old Analyze is deprecated and now can be activated by adding "-", but anyway, your FrB/FrW are pointing to the same frame.
New Analyze=3 is analyzing whole clip, strange that you got that shadow in the mask.
The letters are white with a 1px black border and a faint shadow towards right-bottom.
I would try a mask with that shadow excluded .
EDIT:
And your [I]Loc has borders less than 10 pxs.
VoodooFX
22nd September 2022, 08:51
@banaguitar
Actually, the masks from your last post are OK, I didn't noticed that I ran them on WIP script...
Delogo result is not perfect but you can't do better on this video, maybe I would add more Gaussian blur to it with dPP=5.
Logo:
https://i.imgur.com/tLHELEn.png
Delogo [ InpaintDelogo( mask="D:\mask.bmp", Loc="40,26,146,60", Analyze=1, Mode="Deblend", dPP=5) ]:
https://i.imgur.com/Nxide1P.png
doctorkhv
23rd September 2022, 05:52
@doctorkhv
My advice: Don't waste your time, anything you add there can be removed.
Not a single logo can be erased with high quality even by specialized programs for removing objects (DaVinci Resolve and NUKE Studio)
The brain is arranged in such a way that it is easier for it not to notice a static object (logo) than a spot that changes in color and shape in place of a remote logo.
VoodooFX
23rd September 2022, 19:11
Not a single logo can be erased with high quality even by specialized programs for removing objects (DaVinci Resolve and NUKE Studio).
Fake news, you need to join VideoNonsense forums.
Top - your logo (https://forum.doom9.org/showpost.php?p=1975054) [Trim(5921,-260).Crop(3420,2000,-20,-60)], bottom - after InpaintDelogo:
https://i.imgur.com/9gyg5Gs.gif
Btw, good to know that those "even" programs are not good.
The brain is arranged in such a way that it is easier for it not to notice a static object (logo) than a spot that changes in color and shape in place of a remote logo.
Is this some kind of propaganda or it's self-hypnosis?
My brain definitely is choosing the bottom video.
johnmeyer
23rd September 2022, 19:20
VoodooFX: Great work. Not even worth replying to someone who doesn't know which end is up.
VoodooFX
23rd September 2022, 19:42
VoodooFX: Great work. Not even worth replying to someone who doesn't know which end is up.
Nonsense should be addressed, especially on Doom9 forums.
For reference: I'm still waiting for lordTroll's MS Paint skills there (https://forum.videohelp.com/threads/399360-so-where-s-all-the-Topaz-Video-Enhance-AI-discussion/page19#post2667474), the last news that the guy started to see ghosts on his TV, most likely it's a case for Ghostbusters. :D
doctorkhv
24th September 2022, 00:40
VoodooFX: Great work!
I remembered the film "Un homme et une femme" 1966 in which I could not remove the stains that can be considered logos)
Can anyone try to remove the stains? Humanity and I will be grateful)
Link to my google drive (2 minutes 21 seconds) https://drive.google.com/file/d/1mmNZu6PgSFEK4SIvfH8-OY-rVRjj5Y4b/view?usp=sharing
Thanks a lot!
VoodooFX
24th September 2022, 03:05
I remembered the film "Un homme et une femme" 1966 in which I could not remove the stains that can be considered logos)
Can anyone try to remove the stains? Humanity and I will be grateful)
Link to my google drive (2 minutes 21 seconds) https://drive.google.com/file/d/1mmNZu6PgSFEK4SIvfH8-OY-rVRjj5Y4b/view?usp=sharing
1) Save frame with the spots to image.
2) Open that image with some editor and mask/mark the spots then save it to lossless image.
3) Apply that mask to the selected frames with InpaintDelogo( mask="D:\spots.png", Loc="0,0,0,0", Inflate=0 )
Notes:
With current version you would need to paint the background in black.
If you don't want to bother with the background then get v3 InpaintDelogo.
Use full white to mask/mark the spots.
"Inflate" expands mask, its default is 1 px, so I disabled it here.
You can use fastest preset with "Turbo=3".
Original frame 800:
https://thumbs2.imgbox.com/ae/f6/6aojiYaq_t.png (https://images2.imgbox.com/ae/f6/6aojiYaq_o.png)
Mask with the spots to remove:
https://thumbs2.imgbox.com/d0/f1/DEO5MLEn_t.png (https://images2.imgbox.com/d0/f1/DEO5MLEn_o.png)
Result:
https://thumbs2.imgbox.com/3f/f7/WaCapB0d_t.png (https://images2.imgbox.com/3f/f7/WaCapB0d_o.png)
StainlessS
24th September 2022, 13:26
Voodoo indeed.
doctorkhv, see here [Postimages instructions]:- https://forum.doom9.org/showthread.php?p=1959414&highlight=postimage#post1959414
doctorkhv
26th September 2022, 00:15
doctorkhv, see here [Postimages instructions]:- https://forum.doom9.org/showthread.php?p=1959414&highlight=postimage#post1959414
Thank you so much StainlessS
Thank you so much VoodooFX
I never saw a video without spots.
I am unable to apply the InpaintDelogo-temp.avs script. , used XviD4PSP 5
Import("C:\Program Files (x86)\XviD4PSP 5\dlls\AviSynth\functions\AudioFunctions.avs")
Import("C:\Program Files (x86)\XviD4PSP 5\dlls\AviSynth\functions\VideoFunctions.avs")
LoadPlugin("C:\Program Files (x86)\XviD4PSP 5\dlls\AviSynth\plugins\FFMS2.dll")
Import("C:\Program Files (x86)\XviD4PSP 5\dlls\AviSynth\plugins\FFMS2.avsi")
LoadPlugin("C:\Program Files (x86)\XviD4PSP 5\dlls\AviSynth\plugins\SplineResize.dll")
FFmpegSource2("D:\Un.homme.et.une.femme.1966.mkv", rffmode=0, threads=1, cachefile="D:\Temp\Un.homme.et.une.femme.1966.mkv.ffindex")
ConvertToYV12()
###[FILTERING]###
XviD4PSPPluginsPath = "C:\Program Files (x86)\XviD4PSP 5\dlls\AviSynth\plugins\"
Import(XviD4PSPPluginsPath + "InpaintDelogo-temp.avs")
InpaintFunc(last,mask="D:\spots.png", Loc="0,0,0,0", Inflate=0)
VoodooFX
26th September 2022, 01:09
I am unable to apply
Are you sure?
doctorkhv
26th September 2022, 23:45
Yes, this is probably because XviD4PSP 5 only supports AviSynth + v3.5.1
I want to see how well the spots are removed in the 2 minute episode "Un homme et une femme" 1966 https://drive.google.com/file/d/1mmNZu6PgSFEK4SIvfH8-OY-rVRjj5Y4b/view?usp=sharing
VoodooFX
27th September 2022, 00:37
Yes
How do you know that you are sure?
doctorkhv
27th September 2022, 01:41
How do you know that you are sure?
1.
https://i.postimg.cc/9f2d0kxW/2022-09-27-03-33-04-D-Temp-Avs-P-7668-avs-Avs-Pmod.png (https://postimg.cc/xXsJF6D7)
2.
You didn't show me the video fragment with the stains already removed
VoodooFX
27th September 2022, 01:59
1. Finally you've posted something tangible... How you expect to see "video without spots" or "apply" if you couln't even import InpaintDelogo?
Probably InpaintDelogo is not there, check if your path, filename and extension is correct.
2. I posted a fragment as image "Result (https://forum.doom9.org/showpost.php?p=1975214)".
doctorkhv
27th September 2022, 02:23
1. It's very easy to remove spots from one image and show the result, but I asked you about the episode VIDEO
If you want to upload a sample there's lots of places.
https://workupload.com/
https://www.udrop.com/
https://ufile.io/
https://fileupload.win/
2. What AviSynth GUI are you using and what does the script look like for this case?
VoodooFX
27th September 2022, 02:53
1) Do it by yourself.
2) GUI is not important, it was posted already.
Zetti
28th September 2022, 00:29
I have a sample that i hope you will look at and help me with the settings and give me some tips how you have got them and what i can do on future projects.
Because I'm scratching on my head after trying to adjust for hours
Samlpe
https://file.io/HHeLlMlHF5EJ
Script
InpaintDelogo(Loc="58, 564, -98, -24", Show=4, DynLocUp=4, DynMask=4, DynTune=215, DynMask4H=200, KillBlobs=-7, Extract=1, ImgDir="D:\Test\Pics", ImgInflate=1, CorrTh=0.9)
VoodooFX
28th September 2022, 01:21
Samlpe
https://file.io/HHeLlMlHF5EJ
File is deleted. Maybe upload to Wetransfer.
Zetti
28th September 2022, 10:10
https://we.tl/t-NhbuVVmQGw
kedautinh12
28th September 2022, 14:37
Video is interlaced, so first deinterlace it to lossless file.
Logo is transparent = use Deblend mode.
Trim to exclude parts where there is no logo or logo is animated.
Run the script posted below with Automask=1 to create "bmp" basemask, then run with 0 to create deblending masks and delogo.
Animated parts you can delogo with Inpaint mode.
LWLibAvVideoSource("D:\EONIAN_deinterlaced.mkv")
Trim(61,10907)
InpaintDelogo( mask="D:\mask2.bmp", Automask=0, aMix=1, Loc="1252,878,-90,-64", Mode="Deblend")
Similarly you can remove logo at the left side too.
Logo:
https://i.imgur.com/eTxsNe4.jpeg
https://i.imgur.com/FOmKVDG.jpeg
Delogo:
https://i.imgur.com/HZNQF8f.jpeg
https://i.imgur.com/jBIxngM.jpeg
I tried with leftside but can't creat mask perfect like rightside
Trim(159,10954)
InpaintDelogo( mask="C:\mask3.bmp", Automask=1, aMix=1, Loc="98,874,-980,-64", Mode="Deblend")
sample:
https://drive.google.com/file/d/1-kkoFbzWZp3BIZ4pPfmKlfPGN3xa1SQU/view?usp=sharing
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.