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 Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th September 2021, 08:35   #21  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by Flash_Bang View Post
I looked at the lgd and it does not look exactly the same as in your video. The video logo looks like it's a bit stretched. Aside from learning how to making a lgd file or trying to resize the video and adjusting the placement of the logo so that the two logos are more or less identical, I suggest just finding a frame were the logo is over something dark and then using InpaintDelogo.

Edit:

So, I got curious and learned how to make an ldg file. Downloaded the English version of aviutl (v1.14), loaded the avs script into it, selected the "logo analysis" tool, set start/end markers for a set of frames that I thought would be good to analyze (~1500 frames). Then drew a rectangle around the logo with a few extra pixels for padding, set the threshold to 128 and started to analyze the logo. Saved the ldg file and loaded it into AviSynth+.



Not bad .... Here's the ldg file: test 1280x720-128.lgd

And script used was:
Code:
LSMASHVideoSource("899.mp4")
DelogoHD(logofile="test 1280x720-128.lgd")

Last edited by Reel.Deel; 15th September 2021 at 08:40.
Reel.Deel is offline   Reply With Quote
Old 15th September 2021, 08:55   #22  |  Link
Flash_Bang
Registered User
 
Join Date: Aug 2021
Posts: 10
thank you but when I run THE SCRIPT I get this error : System exception - Illegal Instruction

Last edited by Flash_Bang; 15th September 2021 at 09:10.
Flash_Bang is offline   Reply With Quote
Old 15th September 2021, 09:15   #23  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by Flash_Bang View Post
thank you but when I run THE SCRIPT I get this error : System exception - Illegal Instruction
Didn't you already try using DelogoHD when you tried upscaling to 1440x1080?
Reel.Deel is offline   Reply With Quote
Old 15th September 2021, 13:32   #24  |  Link
Flash_Bang
Registered User
 
Join Date: Aug 2021
Posts: 10
When I tried it just played video with logo
Flash_Bang is offline   Reply With Quote
Old 16th September 2021, 05:35   #25  |  Link
Flash_Bang
Registered User
 
Join Date: Aug 2021
Posts: 10
My cpu does not support sse4.1 so, I used delogo instead of delogo hd and i got same results
Flash_Bang is offline   Reply With Quote
Old 16th September 2021, 05:45   #26  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by Flash_Bang View Post
My cpu does not support sse4.1 so, I used delogo instead of delogo hd and i got same results
I was wondering why it didn't work since you said you had tried it. Did you get the same results as the picture I posted?

Edit:
Quote:
Originally Posted by Flash_Bang View Post
yes I got same results and how do i export the video
You may want to look at different threads here on how to that. There are various options, for example you can use ffmpeg/x264 directly as they accept an avs script. Or you can use VirtualDub2 to export your video. But that is outside of the scope of this thread, if you wish you can open a thread in the newbies section or the AviSynth usage section and we'll help you out

Last edited by Reel.Deel; 16th September 2021 at 06:33. Reason: reply to post below
Reel.Deel is offline   Reply With Quote
Old 16th September 2021, 06:13   #27  |  Link
Flash_Bang
Registered User
 
Join Date: Aug 2021
Posts: 10
yes I got same results and how do i export the video
Flash_Bang is offline   Reply With Quote
Old 17th September 2021, 00:34   #28  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 990
Quote:
Originally Posted by Reel.Deel View Post
So, I got curious and learned how to make an ldg file. Downloaded the English version of aviutl (v1.14), loaded the avs script into it, selected the "logo analysis" tool, set start/end markers for a set of frames that I thought would be good to analyze (~1500 frames). Then drew a rectangle around the logo with a few extra pixels for padding, set the threshold to 128 and started to analyze the logo.
That's nice lgd, bit better than what AvsInpaint produced with 2 frames (dark and white). Do you remember what range you set, because I can't produce an useful lgd? I don't see a way to set multiple ranges there too. It wasn't loading avs file (just hanged taking cpu).

Last edited by VoodooFX; 17th September 2021 at 00:37.
VoodooFX is offline   Reply With Quote
Old 17th September 2021, 03:23   #29  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by VoodooFX View Post
That's nice lgd, bit better than what AvsInpaint produced with 2 frames (dark and white). Do you remember what range you set, because I can't produce an useful lgd? I don't see a way to set multiple ranges there too. It wasn't loading avs file (just hanged taking cpu).
I don't remember the exact range I used but I went by MeteorRain's suggestion: Blue sky and solid color wall are good background for making those samples.

I made another lgd using the range 985-12872 (which I believe was the range on the original ldg but not as long) and got the same results as first lgd. You mentioned that you used aviutl directly, when I tried that I also got bad results. Not sure If I did something wrong or what but when I loaded the avs script onto aviult I got the good results from the lgd.

Second lgd: test2 1280x720-30.lgd

Settings:


I read on a few sites that the threshold at default value (30) is a good value so I left it alone, on the first lgd I set it to 128.
Reel.Deel is offline   Reply With Quote
Old 17th September 2021, 09:06   #30  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 990
Quote:
Originally Posted by Reel.Deel View Post
I made another lgd using the range 985-12872 (which I believe was the range on the original ldg but not as long) and got the same results as first lgd. You mentioned that you used aviutl directly, when I tried that I also got bad results. Not sure If I did something wrong or what but when I loaded the avs script onto aviult I got the good results from the lgd.
It looks like those bad lgds are not because of loading mp4 directly nor range selection, there is some kind of bug in AviUtl/Logo analysis. It's unclear why it happens, but when it does then you can select different ranges, settings, area - resulting lgds always are not good. After AviUtl restart it usually starts producing good lgds.
Did you installed some filter for avs loading, I don't see anything for avs in the pack?

That threshold I imagine is max value between min-max luminance, or something similar, so you don't need to select the frame ranges manually. I think similar feature could be added to InpaintDelogo.

EDIT:

Found how to produce it: "Y" must be odd, if you set it to even then all good again.
Here how the bug looks (top right corner):


Last edited by VoodooFX; 17th September 2021 at 09:57.
VoodooFX is offline   Reply With Quote
Old 17th September 2021, 09:58   #31  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by VoodooFX View Post
Did you installed some filter for avs loading, I don't see anything for avs in the pack?
No, everything came in the pack that I linked to in post #21. I believe it uses L-SMASH Works File Reader to open an AviSynth script.

I did install an updated version of LogoScan but that was after I made the first successful lgd.

https://github.com/emako/Delogo-Aviutl

-----

One thing I wish DelogoHD had would be the ability to output just a black and white mask padded to the width and height of the input clip. DelogoHD seems to affect some areas just below below the logo. With a mask that can be easily fixed and even do some additional denoising just on the logo area. Although, there's already a script (LogoNR) that does denoising on the logo area by cropping, filtering and then overlaying the result onto the clip. Edit: Well scratch that idea, AddlogoHD can be used with the same lgd to add the logo onto a blankclip to create a logo mask. Cool stuff


Edit:

Quote:
Originally Posted by VoodooFX View Post
EDIT:

Found how to produce it: "Y" must be odd, if you set it to even then all good again.
Here how the bug looks (top right corner):

You know I was actually thinking the same. With the bad lgd I tried moving the mask in DelogoHD +/- 1 pixel and it would always off. I just did not try to find out what caused it. Nice find VoodooFX. Maybe I will write a small tutorial on how to create an lgd file since it's very simple to do and produces very nice results.

Last edited by Reel.Deel; 17th September 2021 at 10:21.
Reel.Deel is offline   Reply With Quote
Old 17th September 2021, 11:01   #32  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 990
Quote:
Originally Posted by Reel.Deel View Post
No, everything came in the pack that I linked to in post #21. I believe it uses L-SMASH Works File Reader to open an AviSynth script.
What is content of your avs script?

Quote:
Originally Posted by Reel.Deel View Post
One thing I wish DelogoHD had would be the ability to output just a black and white mask padded to the width and height of the input clip. DelogoHD seems to affect some areas just below below the logo.
It deblends that whole square area, not only logo.

Here InpaintDelogo for comparison:

InpaintDelogo( mask="d:\mask.bmp",
\ Automask=0, aMix=2, Loc="1124,24,-52,-636",
\ Mode="Deblend", Analyze=3, FrB=12369, FrW=8993, FrS=3,
\ Inflate=2, Deep=0, IntSpd=2, Interp=1, dPP=2)

Just the first frames I found, these are too bright and too dark frames I think, should be better with less bright/dark ones (mind FrS if you'll try other frames).

First run with Automask=1 to generate b/w mask, then set back to 0.
Set Interp and dPP to 0 to see pure deblending.

Last edited by VoodooFX; 17th September 2021 at 11:05.
VoodooFX is offline   Reply With Quote
Old 17th September 2021, 11:15   #33  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by VoodooFX View Post
What is content of your avs script?
Just a source filter for FlashBang's video in post #20.

Code:
LSMASHVideoSource("899.mp4")
And it worked in aviutl. I did have to comment out the LoadPlugin call in the first line though because the video would not load in aviutl.

Quote:
Originally Posted by VoodooFX View Post
It deblends that whole square area, not only logo.
I might of been mistaken, with my original lgd I saw that it affected slightly other areas below the logo. But looking at it again with the updated lgd I can't really spot it anymore. I compared against:
Code:
src = LSMASHVideoSource("899.mp4")
delogo = DelogoHD(src, logofile="test2 1280x720-30.lgd")
mask = Blankclip(src, color_yuv=$000000).AddlogoHD(logofile="test2 1280x720-30.lgd").mt_binarize(1)
mt_merge(src, delogo, mask, u=3, v=3, luma=true)
But the masked delogo video and the plain delogo video look identical around the logo area.

Quote:
Originally Posted by VoodooFX View Post
Here InpaintDelogo for comparison:
Will try it out tonight. It's 5am here and time to get some sleep
Reel.Deel is offline   Reply With Quote
Old 17th September 2021, 20:47   #34  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 990
Quote:
Originally Posted by Reel.Deel View Post
I did have to comment out the LoadPlugin call in the first line though because the video would not load in aviutl.
Oh, that's why.

Quote:
Originally Posted by Reel.Deel View Post
I might of been mistaken, with my original lgd I saw that it affected slightly other areas below the logo. But looking at it again with the updated lgd I can't really spot it anymore.
For your test you've used your second lgd, the first lgd was done with bad threshold, maybe you've seen that effect on the first one.

Btw, those "bad" lgds are actually good in AviUtl, but gets borked in DelogoHD.
VoodooFX is offline   Reply With Quote
Old 18th September 2021, 15:47   #35  |  Link
Flash_Bang
Registered User
 
Join Date: Aug 2021
Posts: 10
I found delogo filter for aviutl : https://github.com/emako/Delogo-Aviutl/releases/tag/r1
Flash_Bang is offline   Reply With Quote
Old 18th September 2021, 22:30   #36  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by VoodooFX View Post
For your test you've used your second lgd, the first lgd was done with bad threshold, maybe you've seen that effect on the first one.
Yes the threshold being set to 128 on the first lgd is what caused it.



Threshold parameter in LogoScan: Threshold value to determine if the background is a single color. The higher the value, the more lenient the judgment.

Quote:
Originally Posted by VoodooFX View Post
Btw, those "bad" lgds are actually good in AviUtl, but gets borked in DelogoHD.
The "bad" lgds are also good in MakKi's original Delogo plugin for AviSynth. I also checked putin's Delogo/Delogomod from 2014 and they're are also good. So DelogoHD is the culprit.

Quote:
Originally Posted by Flash_Bang View Post
Yes, I linked to it in post #31 ... it includes both ScanLogo and Delogo for aviutl but in English. An older version is already included in the aviutl English package.
Reel.Deel is offline   Reply With Quote
Old 19th September 2021, 22:43   #37  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Bugfix for lgds with odd "pos Y" values: https://github.com/HomeOfAviSynthPlu...ogoHD/releases

Last edited by Reel.Deel; 19th September 2021 at 22:46.
Reel.Deel is offline   Reply With Quote
Old 19th September 2021, 22:53   #38  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
A few tips.

1. Pick videos that have clean flat areas around logo positions.

2. Make sure you only include frames that have the logo. Don't include CMs that don't have logo on it.

3. Better use mod4 or at least mod2 (even numbers) for positions and sizes, for better compatibility.

4. Leave about 3 pixels around logo when choosing the boxed area.

5. Threshold, the lower the cleaner but you get fewer samples, the higher the worse but you get more samples. Pick wisely. For animes or clean source, 20 should be a good balanced number. For real life content, 30 is good. If the source has too few samples, increase to 40 or 50.

6. If you scanned a logo and would like to exhibit it on my website you can email to i(at)i.wtf and attach your lgd files.
__________________
Projects
x265 - Yuuki-Asuna-mod Download / GitHub
TS - ADTS AAC Splitter | LATM AAC Splitter | BS4K-ASS
Neo AviSynth+ filters - F3KDB | FFT3D | DFTTest | MiniDeen | Temporal Median
MeteorRain is offline   Reply With Quote
Old 20th September 2021, 10:58   #39  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
New ver r12:
https://github.com/HomeOfAviSynthPlu...ogoHD/releases
kedautinh12 is offline   Reply With Quote
Old 29th January 2022, 04:58   #40  |  Link
spiovente_iv
Registered User
 
Join Date: Mar 2008
Posts: 7
This might be a long shot, but does anyone have a working .lgd for MeTV sources? I found an .svg (below), but haven't quite figured out how to transform one format to the other. Thank you!

spiovente_iv is offline   Reply With Quote
Reply


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 23:38.


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