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
VoodooFX
2nd May 2023, 02:05
First got error that it was missing, then I added the plugin but I get this: https://i.imgur.com/SLn2f8h.png
That is Neo_FFT3D's dependency, and on its page clearly written what and how to install it.
Ok, now I can play the video with the changes, but it doesn't get exported.
You meant encode. There are numerous tools to encode. Create another thread, ask there how to encode avs scripts.
drunksunk
2nd May 2023, 02:14
That is Neo_FFT3D's dependency, and on its page clearly written what and how to install it.
You meant encode. There are numerous tools to encode. Create another thread, ask there how to encode avs scripts.
I don't get it. What's the point of InpaintDelogo if it doesn't export the result?
VoodooFX
2nd May 2023, 02:21
A bit late with this, but thank you VoodooFX!
You are welcome. I hope you redone the basemask you posted there, it was pretty bad.
Actually I still have those files, I didn't decided if it's worth to add that logo to the database. Did that company added that logo to all DVDs or just that one with trailers DVD?
VoodooFX
2nd May 2023, 02:52
I don't get it. What's the point of InpaintDelogo if it doesn't export the result?
What is the point of Notepad if you can't bake waffles with it? :)
StainlessS
2nd May 2023, 09:24
Which NotePad menu is the waffle maker on (or is it in NotePad++) ?
Does Notepad have a midge killer function ?
Man, I hate dat dem midge thingies, my forehead and back itchy like hell. :(
[been gettin' eaten alive, last couple of days].
lollo2
2nd May 2023, 13:11
I don't get it. What's the point of InpaintDelogo if it doesn't export the result?
You are more and more boring. Learn AviSynth, how to install filters and their dependencies, and then you can blame for something.
Master VoodooFX You was far too kind with you!
kedautinh12
2nd May 2023, 13:51
Yeah, VX very kine when explain him but he need learn avisynth basic :D
VoodooFX
2nd May 2023, 15:09
He needs time, wrapping your head around Avisynth is not a one day's task.
I remember my first time reading about Avisynth, my first impression was "WTF is this". :D
I think I started using it in early 2000s for VdubMod to import unsupported video formats.
..midge..
I had to google this word. :)
StainlessS
2nd May 2023, 23:53
I had to google this word
Sand fly, aka 'baby mosquito", oder, mosquito like, but smaller whotsit.
EDIT: Still not nice, but nobody died from midge bite, yet. (maybe Il'll be the 1st)
drunksunk
5th May 2023, 01:37
This is the result I obtained with HitPaw (it seems less noticeable): https://streamable.com/dexf0a
Regarding the tool, I don't know the installation procedure aside from having AviSynth installed on my computer. I don't know which paramaters of the command I would need to run then, how you get the square box pixel coordinates within your images, if you need to create a mask file of the part you want to remove and that's an alternative of using the pixel coordinates, etc.
I tried this but I get error "increase analyzeth" and i increase to 100 but nothing changed.
InpaintDelogo(Loc="3020,450,-460,-1430", mask="D:\mask.bmp", Automask=1, aMix=-2, AnalyzeTh=100, mode="Deblend", dPP=-5, Interp=3, Optimize2=2)
VoodooFX
5th May 2023, 02:32
I tried this but I get error "increase analyzeth" and i increase to 100 but nothing changed.
OK, thanks for letting me know.
drunksunk
7th May 2023, 01:25
Doesn't the same command work well for opaque logos?
VoodooFX
7th May 2023, 13:06
Doesn't the same command work well for opaque logos?
Those settings are for a transparent logo [for that another video]. Anyway, for an "automask" run most of them are not used.
That error could mean that coords are wrong or there are no suitable frames to analyze. Set Analyze=3 to analyze all frames.
You better share the video or you'll have thousand other questions and I don't have a crystal ball to answer them.
drunksunk
7th May 2023, 20:10
The video is this one: https://forum.doom9.org/showpost.php?p=1986243&postcount=707
VoodooFX
7th May 2023, 20:14
The video is this one: https://forum.doom9.org/showpost.php?p=1986243&postcount=707
There is no video.
drunksunk
10th May 2023, 01:36
There is no video.
It's actually a video you edited yourself. Anywhere it was archived on Streamable so I reuploaded it here (https://drive.google.com/file/d/1Lhu1QQVd1prGc95IHZFasGXpIqcQ0fy4/view?usp=sharing).
VoodooFX
11th May 2023, 01:13
It's actually a video you edited yourself.
I couldn't edit video you never shared. I edited your image!
Anyway this logo is not a logo but some special effect from game, whole area around those letters has some effects.
You better use DoomDelogo (https://forum.doom9.org/showthread.php?t=184881) for this.
drunksunk
11th May 2023, 09:57
I couldn't edit video you never shared. I edited your image!
Anyway this logo is not a logo but some special effect from game, whole area around those letters has some effects.
You better use DoomDelogo (https://forum.doom9.org/showthread.php?t=184881) for this.
I know for a fact that it's a logo added on top because I have another video which is identical but without the logo. The only issue is that it's lower quality.
poisondeathray
11th May 2023, 13:43
I know for a fact that it's a logo added on top because I have another video which is identical but without the logo. The only issue is that it's lower quality.
How much "lower quality" ? Did you try align & merging them with a mask ?
VoodooFX
11th May 2023, 15:35
I have another video which is identical but without the logo.
Then share this another video.
poisondeathray
11th May 2023, 16:42
Anyway this logo is not a logo but some special effect from game, whole area around those letters has some effects.
It looks like some of the artifacts are from motion interpolation. They correspond to the errors in other parts of the frame on the odd frames . The other artifacts around the logo are compression artifacts. The original video is 30fps .
VoodooFX
11th May 2023, 18:53
Whatever this is, for me it looks like there is some blend around area then inconsistent blur on to it. Nothing left to deblend, even if it was clean blend then clip is too short to build deblend mask.
Whole area needs to by treated as a one big hole, I don't even know what inpaint settings should be used on such, if found they probably would be very slow.
When I was thinking about "Turbo" argument I had idea to dowsample stuff then inpaint, maybe such approach would work here.
drunksunk
17th May 2023, 02:34
Is it better to use InpaintDelogo before or after an AI Upscaler like Topaz AI Video?
kedautinh12
17th May 2023, 02:37
I think before and if your video interlaced, you need deinterlaced before use InpaintDelogo
VoodooFX
17th May 2023, 10:46
Is it better to use InpaintDelogo before or after an AI Upscaler like Topaz AI Video?
Before. But better is to not use upscaler at all.
drunksunk
17th May 2023, 22:00
I thought that with higher resolution and crispier edges the result would be better? Anyway, can't get a good mask out of this: https://i.imgur.com/6MrRVZu.png
Mask: https://i.imgur.com/Yej7xi2.png
Maybe I should create it manually with Photoshop?
I'm using this:
InpaintDelogo(Loc="1570,910,-30,-60", mask="D:\mask.bmp", Automask=1, aMix=-2, AnalyzeTh=100, mode="Deblend", dPP=-5, Interp=3, Optimize2=2)
VoodooFX
17th May 2023, 23:01
You are using parameters from another logo, this is not how it works. Read the manual!
drunksunk
18th May 2023, 15:27
You are using parameters from another logo, this is not how it works. Read the manual!
Do I just need to lower AnalyzeTh to fix it?
katzenjoghurt
18th May 2023, 18:55
Do I just need to lower AnalyzeTh to fix it?
With AnalyzeTh=255 pretty much all frames should be analyzed.
Easier:
InpaintDelogo(Loc="1570,910,-30,-60", mask="D:\mask.bmp", mode="Deblend", Automask=1, Analyze=3)
Analyze=3 will also analyze all frames. Default is 2.
VoodooFX
18th May 2023, 21:42
Do I just need to lower AnalyzeTh to fix it?
There is no magic button to "fix it", there are many ways for many different videos, you need to understand what the arguments do to get desired result.
Without video you are on your own.
drunksunk
19th May 2023, 01:36
There is no magic button to "fix it", there are many ways for many different videos, you need to understand what the arguments do to get desired result.
Without video you are on your own.
HERE (https://drive.google.com/drive/folders/1AnXe4TYFfPYwJTW08DU4np30WI60y56W?usp=share_link) is the video.
Honestly I think the upscaled version would have been better but the AVS plugin can't seem to open that (maybe 12GB is too big) and always says it cannot find the find somehow.
I tried to create the mask manually by using the SVG version of the logo, dunno if you can get a better result automatically. https://i.imgur.com/PpdLlG1.png
I think it would be actually cool if there was a function where you can pass an svg logo as an rgument and it looks for the logo within the frame and automatically scale it perfectly to fit and then generates a mask.
katzenjoghurt
19th May 2023, 19:59
When I was thinking about "Turbo" argument I had idea to dowsample stuff then inpaint, maybe such approach would work here.
I think that would be cool.
I once tried to inpaint a UHD Video with a really big logo.
No way to get a good result with default settings - the noise in the inpainted corner was way too distracting.
But the result was ok when I downsized the video to 480p, and inpainted the logo with Sharpness=1.
It was superblurry of course but also calm so that it didn't distract and still way better than with the original logo.
But there was no way to reproduce the same thing directly in the UHD source.
In the UHD video Sharpness=1 didn't create anyway near the same amount of blur as it did in 480p.
dPP/oPP couldn't compensate for that.
drunksunk
21st May 2023, 03:05
So nobody knows how to fix?
drunksunk
27th May 2023, 17:44
Anybody still alive?
katzenjoghurt
29th May 2023, 10:17
Anybody still alive?
I'll chime in, even if I only have a mediocre solution for you.
1) Get a better version of that video from here:
https://assets14.ign.com/videos/zencoder/1920/211e97c678636e1461aa50b31714e8a4-5000000-1426343076-w.mp4
(It's a 817MB file with a 5000kbps encoding rather than your 3000kbps clip)
2) It's actually pretty tricky to create a proper mask due to (I guess)
a) encoding artifacts
b) very transparency parts of the logo
c) hard enbedded subtitles overlapping with the logo at times - InpaintDelogo will add them to the mask
So I selected only parts where the subtitles aren't overlapping with the logo.
Trim(0,340) + Trim(1235,3662) + Trim(4152,4684) + Trim(4982,6685) + Trim(7068,8111) + Trim(8344,8878) \
+ Trim(9325,9495) + Trim(10091,10560) + Trim(10815,11348) + Trim(11603,13157) + Trim(13328,14477) \
+ Trim(14605,16117) + Trim(16372,17713) + Trim(17884,18756) + Trim(18927,19991) + Trim(20779,22674) \
+ Trim(22993,25399) + Trim(25591,26293) + Trim(26655,27336) + Trim(27741,30147) + Trim(34852,35022)
InpaintDelogo(mask="V:\Logos\Test\IGN.bmp", Loc="1572, 906, -20, -60", Mode="Deblend", Automask=1, Analyze=3)
But still I had to overpaint some gaps manually afterwards with MS Paint.
Here's the resulting mask:
https://i.ibb.co/RSWVvc0/IGN.png
3)
The deblending analysis I did with these parameters:
InpaintDelogo(mask="V:\Logos\Test\IGN.bmp", Loc="1572, 906, -20, -60", Mode="Deblend", Automask=0, Analyze=-2, Deep=5, Optimize2=2, Interp=0)
Keep the the trims as the overlapping subtitles will also be a problem here.
Due to that overlapping, interpolation would also warp the subtitles in a pretty nasty way. So I disabled it with Interp=0.
But (also) due to that more remains of the logo are visible, especially whenever the background is rather bright.
We can't fight it with more blurring (by going to lover dPP levels) as that would also blur the subtitles.
https://i.ibb.co/pJgJnB4/Bild-2023-05-29-110840979.png (https://imgbb.com/)
https://i.ibb.co/x671g1Y/Bild-2023-05-29-111307449.png (https://imgbb.com/)
Check it out for yourself.
Download the mask (https://i.ibb.co/RSWVvc0/IGN.png) above, reconvert it to bmp and try these lines:
(edit: trims added)
Trim(0,340) + Trim(1235,3662) + Trim(4152,4684) + Trim(4982,6685) + Trim(7068,8111) + Trim(8344,8878) \
+ Trim(9325,9495) + Trim(10091,10560) + Trim(10815,11348) + Trim(11603,13157) + Trim(13328,14477) \
+ Trim(14605,16117) + Trim(16372,17713) + Trim(17884,18756) + Trim(18927,19991) + Trim(20779,22674) \
+ Trim(22993,25399) + Trim(25591,26293) + Trim(26655,27336) + Trim(27741,30147) + Trim(34852,35022)
InpaintDelogo(mask="V:\Logos\Test\IGN.bmp", Loc="1572, 906, -20, -60", Mode="Deblend", Automask=0, Analyze=-2, Deep=5, Optimize2=2, Interp=0)
Hope that helps.
VoodooFX
29th May 2023, 16:35
@katzenjoghurt Nice result!
I see you used negative Analyze, were results with positive worse?
katzenjoghurt
29th May 2023, 19:00
Hey VoodooFX,
I find Analyze=-2 (or -1), Deep=5 still useful in many cases.
Please never remove it. :)
Here it helps with the IGN icon.
Source:
https://i.ibb.co/34jGpQK/Bild-2023-05-29-195527365.png (https://imgbb.com/)
Analyze=3:
https://i.ibb.co/BnjQ7Jr/Bild-2023-05-29-195709425.png (https://imgbb.com/)
Analyze=2:
https://i.ibb.co/YjpXzMb/Bild-2023-05-29-195853815.png (https://imgbb.com/)
Analyze=-2:
https://i.ibb.co/tH5Kxbz/Bild-2023-05-29-200123099.png (https://imgbb.com/)
drunksunk
30th May 2023, 01:27
Thanks for the great work. Is it normal that you still get a sign on the bottom right corner? https://imgur.com/a/pCZfds7
My code looks like this:
LWLibAvVideoSource("D:\Z_DELOGO\IGN.mp4")
InpaintDelogo(mask="D:\Z_DELOGO\IGN.bmp", Loc="1572, 906, -20, -60", Mode="Deblend", Automask=0, Analyze=-2, Deep=5, Optimize2=2, Interp=0)
Also, what's the difference between using a bmp mask vs png?
katzenjoghurt
30th May 2023, 09:14
Thanks for the great work. Is it normal that you still get a sign on the bottom right corner? https://imgur.com/a/pCZfds7
Argh. My bad. I mentioned that you would need to keep the trims for deblend analysis but my "quick guide" at the end neglected it.
I edited it.
The "signs" are the result of InpaintDelogo analyzing frames where the subtitles overlap with the logo. With the Trims these frames will be skipped.
1) Add the Trims
2) delete the old created .ebmp deblend files or add ReAnalyze=1 for one run
3) The "signs" should be gone now.
4) Remove the Trims.
Also, what's the difference between using a bmp mask vs png?
Oh. I just wasn't aware that InpaintDelogo happily accepts pngs.
VoodooFX
30th May 2023, 13:14
Hey VoodooFX,
I find Analyze=-2 (or -1), Deep=5 still useful in many cases.
Please never remove it. :)
Strange, negative Analyze should be useful only in very rare cases like in some very short clips.
VoodooFX
30th May 2023, 16:17
Here are my results on that 480MB zzz.mp4 file.
Getting a basemask with Automask:
LWLibAvVideoSource("D:\zzz.mp4")
InpaintDelogo(mask="D:\mask.bmp", Loc="1570, 904, -28, -58", Analyze=-4, Automask=1, aMix=3)
Getting a deblend mask [no need for trims with Analyze 1/-1] and delogo:
LWLibAvVideoSource("D:\zzz.mp4")
InpaintDelogo(mask="D:\mask.bmp", Loc="1570, 904, -28, -58", Mode="Deblend", Analyze=1, dPP=-5)
1) Original [frame 6554]:
https://images2.imgbox.com/d9/4f/PxxMGG7N_o.png
2) Delogo Analyze=1
https://images2.imgbox.com/89/83/h7PKmynh_o.png
3) Delogo Analyze=-1, Deep=5:
https://images2.imgbox.com/31/2a/XD6TDulL_o.png
In #3 there are less artifacts on that circle at the left but rest looks a bit worse than 2.
Actually negative Analyze looks worse than positive, that artifacts reduction comes from deblend iteration aka Deep [which is not implemented for positive Analyze].
kedautinh12
30th May 2023, 16:57
Why you don't add deep for positive Analyze??
VoodooFX
30th May 2023, 22:15
Why you don't add deep for positive Analyze??
I didn't see it useful anywhere with positive Analyze and in general it's a nonsensical "hack".
EDIT:
Just tested now, AnalyzeTh=45 produced similar reduction on artifacts on that circle without making worse the rest of deblend like Deep:
LWLibAvVideoSource("D:\zzz.mp4")
InpaintDelogo(mask="D:\mask.bmp", Loc="1570, 904, -28, -58", Mode="Deblend", Analyze=1, AnalyzeTh=45, dPP=-5)
https://images2.imgbox.com/26/e7/WGdHdQZ8_o.png
drunksunk
4th June 2023, 14:40
So, using the higher quality 817MB video, which of all proposed solutions gives the best results?
VoodooFX
4th June 2023, 18:36
So, using the higher quality 817MB video, which of all proposed solutions gives the best results?
But that's what YOU should tell us.
drunksunk
10th June 2023, 22:21
Why do you want to remove logos from some youtube gaming videos?
Yes:
# Here you import your video:
LWLibAvVideoSource("D:\test4k.mp4")
# Here we crop black borders from video:
Crop(0,250,0,-250)
# Here I located logo coords [+20 pixels from logo edges]:
# Crop(3300,0,-240,-1466)
# Here we do delogo [first run with Automask=1 to get a basemask automatically, then set it to 0 to do analyze and delogo]
InpaintDelogo(Loc="3300,0,-240,-1466", mask="D:\mask.bmp", Automask=0, aMix=-2, NoBorderAt="top", AnalyzeTh=30, mode="Deblend", dPP=-5, Interp=3, Optimize2=2)
Before:
https://thumbs2.imgbox.com/41/86/U5e2foxL_t.png (https://images2.imgbox.com/41/86/U5e2foxL_o.png)
After:
https://thumbs2.imgbox.com/d8/4c/QUsBWdu0_t.png (https://images2.imgbox.com/d8/4c/QUsBWdu0_o.png)
I used the same rule you used here, just different coordinates but I get a poor result with this video (https://www.youtube.com/watch?v=QUjf9DbLxtk).
The logo is basically the same, just a bit smaller, so I thought the same rules would work fine.
VoodooFX
11th June 2023, 14:32
I used the same rule you used here, just different coordinates but I get a poor result with this video (https://www.youtube.com/watch?v=QUjf9DbLxtk).
The logo is basically the same, just a bit smaller, so I thought the same rules would work fine.
Post your full avs script.
drunksunk
12th June 2023, 00:05
Post your full avs script.
# Here you import your video:
LWLibAvVideoSource("D:\Z_DELOGO\b\copy.mp4")
# Here I located logo coords [+20 pixels from logo edges]:
#Crop(1650,50,190,180)
# Here we do delogo [first run with Automask=1 to get a basemask automatically, then set it to 0 to do analyze and delogo]
InpaintDelogo(Loc="1650,50,190,180", mask="D:\mask.bmp", Automask=1, aMix=-2, NoBorderAt="top", AnalyzeTh=30, mode="Deblend", dPP=-5, Interp=3, Optimize2=2)
VoodooFX
12th June 2023, 15:38
You don't need NoBorderAt on this video. And you are analyzing frames without logo and frames with logo fade in/out animations, exclude those parts of video with Trim().
On frames with logo animation use mode=Inpaint.
drunksunk
12th June 2023, 22:45
You don't need NoBorderAt on this video. And you are analyzing frames without logo and frames with logo fade in/out animations, exclude those parts of video with Trim().
On frames with logo animation use mode=Inpaint.
You need to duplicate the InpaintDelogo command for some frames with mode=Inpaint? Not sure I understood that well.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.