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 19th May 2023, 01:36   #781  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
Quote:
Originally Posted by VoodooFX View Post
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 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.
drunksunk is offline   Reply With Quote
Old 19th May 2023, 19:59   #782  |  Link
katzenjoghurt
Registered User
 
Join Date: Feb 2007
Posts: 119
Quote:
Originally Posted by VoodooFX View Post
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.

Last edited by katzenjoghurt; 19th May 2023 at 20:13.
katzenjoghurt is offline   Reply With Quote
Old 21st May 2023, 03:05   #783  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
So nobody knows how to fix?
drunksunk is offline   Reply With Quote
Old 27th May 2023, 17:44   #784  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
Anybody still alive?
drunksunk is offline   Reply With Quote
Old 29th May 2023, 10:17   #785  |  Link
katzenjoghurt
Registered User
 
Join Date: Feb 2007
Posts: 119
Quote:
Originally Posted by drunksunk View Post
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/zenc...26343076-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.

Code:
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:
Code:
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.








Check it out for yourself.
Download the mask above, reconvert it to bmp and try these lines:
(edit: trims added)

Code:
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.

Last edited by katzenjoghurt; 30th May 2023 at 09:15.
katzenjoghurt is offline   Reply With Quote
Old 29th May 2023, 16:35   #786  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 909
@katzenjoghurt Nice result!

I see you used negative Analyze, were results with positive worse?
VoodooFX is offline   Reply With Quote
Old 29th May 2023, 19:00   #787  |  Link
katzenjoghurt
Registered User
 
Join Date: Feb 2007
Posts: 119
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:


Analyze=3:


Analyze=2:


Analyze=-2:

Last edited by katzenjoghurt; 29th May 2023 at 20:51.
katzenjoghurt is offline   Reply With Quote
Old 30th May 2023, 01:27   #788  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
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:

Code:
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?
drunksunk is offline   Reply With Quote
Old 30th May 2023, 09:14   #789  |  Link
katzenjoghurt
Registered User
 
Join Date: Feb 2007
Posts: 119
Quote:
Originally Posted by drunksunk View Post
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.

Quote:
Originally Posted by drunksunk View Post
Also, what's the difference between using a bmp mask vs png?
Oh. I just wasn't aware that InpaintDelogo happily accepts pngs.

Last edited by katzenjoghurt; 30th May 2023 at 09:20.
katzenjoghurt is offline   Reply With Quote
Old 30th May 2023, 13:14   #790  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 909
Quote:
Originally Posted by katzenjoghurt View Post
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 is offline   Reply With Quote
Old 30th May 2023, 16:17   #791  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 909
Here are my results on that 480MB zzz.mp4 file.

Getting a basemask with Automask:
Code:
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:
Code:
LWLibAvVideoSource("D:\zzz.mp4")
InpaintDelogo(mask="D:\mask.bmp", Loc="1570, 904, -28, -58", Mode="Deblend", Analyze=1, dPP=-5)
1) Original [frame 6554]:


2) Delogo Analyze=1


3) Delogo Analyze=-1, Deep=5:


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].

Last edited by VoodooFX; 31st May 2023 at 05:23.
VoodooFX is offline   Reply With Quote
Old 30th May 2023, 16:57   #792  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 1,888
Why you don't add deep for positive Analyze??
kedautinh12 is offline   Reply With Quote
Old 30th May 2023, 22:15   #793  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 909
Quote:
Originally Posted by kedautinh12 View Post
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:

Code:
LWLibAvVideoSource("D:\zzz.mp4")
InpaintDelogo(mask="D:\mask.bmp", Loc="1570, 904, -28, -58", Mode="Deblend", Analyze=1, AnalyzeTh=45, dPP=-5)

Last edited by VoodooFX; 31st May 2023 at 01:09. Reason: Typo: was Analyze instead of AnalyzeTh
VoodooFX is offline   Reply With Quote
Old 4th June 2023, 14:40   #794  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
So, using the higher quality 817MB video, which of all proposed solutions gives the best results?
drunksunk is offline   Reply With Quote
Old 4th June 2023, 18:36   #795  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 909
Quote:
Originally Posted by drunksunk View Post
So, using the higher quality 817MB video, which of all proposed solutions gives the best results?
But that's what YOU should tell us.
VoodooFX is offline   Reply With Quote
Old 10th June 2023, 22:21   #796  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
Quote:
Originally Posted by VoodooFX View Post
Why do you want to remove logos from some youtube gaming videos?



Yes:

Code:
# 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:


After:
I used the same rule you used here, just different coordinates but I get a poor result with this video.

The logo is basically the same, just a bit smaller, so I thought the same rules would work fine.
drunksunk is offline   Reply With Quote
Old 11th June 2023, 14:32   #797  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 909
Quote:
Originally Posted by drunksunk View Post
I used the same rule you used here, just different coordinates but I get a poor result with this video.

The logo is basically the same, just a bit smaller, so I thought the same rules would work fine.
Post your full avs script.

Last edited by VoodooFX; 11th June 2023 at 14:36.
VoodooFX is offline   Reply With Quote
Old 12th June 2023, 00:05   #798  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
Quote:
Originally Posted by VoodooFX View Post
Post your full avs script.
Code:
# 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)
drunksunk is offline   Reply With Quote
Old 12th June 2023, 15:38   #799  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 909
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.
VoodooFX is offline   Reply With Quote
Old 12th June 2023, 22:45   #800  |  Link
drunksunk
Registered User
 
Join Date: Apr 2023
Posts: 60
Quote:
Originally Posted by VoodooFX View Post
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.
drunksunk 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:50.


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