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 8th November 2020, 05:53   #101  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by VoodooFX View Post
but how in the hell top/right corner mask is red, feathered and "12" visible when it goes through Greyscale.Levels(127,1,128,0,255)...
Dont see why it should make it red, however should for YUV use
Code:
Greyscale.Levels(127,1,128,0,255,coring=false)...
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 8th November 2020, 18:50   #102  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by StainlessS View Post
Dont see why it should make it red, however should for YUV use
Code:
Greyscale.Levels(127,1,128,0,255,coring=false)...
It's random/non-reproducible bugs, when using Prefetch(4). Masking and Levels(127,1,128,0,255) happens in RGB32.

Quote:
Originally Posted by poisondeathray View Post
WriteFileIf with a runtime function expression like lumadifference . But there was some bugs in avs+ 3.x with this. It works in 2.6 classic. There was some discussion about this somewhere IIRC. Not sure what changed or what the exact syntax change was

Something like this works in avs+ 2.6 classic
Code:
Subtract(clip1,clip2)
WriteFileIf (last,  "log.log",  "LumaDifference(clip1, clip2)>0", "current_frame", """ ":" """, "AverageLuma")
Thanks mate, that works perfectly. I edited it a bit so I can copy/paste log to SelectEvery:

Code:
Subtract(clip1,clip2)
WriteFileIf (last,  "log.log",  "LumaDifference(clip1, clip2)>0", "current_frame", """ ", \" """)
AvS 2.60(2.6.0.6) & AvS+ 3.5 (r3106) produced identical logs, AvS+ was 20% faster.

I run comparison on stacked output with 4 steps (like in screenshot in the previous page), so, Prefetch(4) vs no Prefetch:
Detected discrepancies in 157 frames from 134237 frames, almost all of them in the top/right mask, in 18 frames those mask are ok but discrepancies are in the final step(bottom/left, but no visible differences).

Here is some examples of the bugged masks (it should be B/W with white numbers, last two digits shouldn't be visible), stacked original clip & one mask:









Now I need to run more tests to isolate the problem.
VoodooFX is offline   Reply With Quote
Old 8th November 2020, 20:20   #103  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
What format was source video ? Did you try threads=1 for LSmash ? Or other source filters to rule out some issue upstream ?

To be clear, was the issue only with Prefetch(4) ? Is no prefetch ok ? Or other values ?

I recall some discussion about source filter threads and seeking accuracy issues vs. host CPU threads , but I think that was for ffms2
poisondeathray is offline   Reply With Quote
Old 9th November 2020, 13:28   #104  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Like I suspected it's something with Overlay, tested and same on AvS+ 3.4, 3.5.1, 3.6.0, 3.6.1.
Here is minimized and ready to run test scripts (extract to C:\) or preview included test results https://anonfiles.com/F7E0hdo2p0 or https://we.tl/t-J95N1CsfUz (7 days)

Quote:
Originally Posted by poisondeathray View Post
What format was source video ? Did you try threads=1 for LSmash ? Or other source filters to rule out some issue upstream ?

To be clear, was the issue only with Prefetch(4) ? Is no prefetch ok ?
Isn't "threads=1" parameter for ffms2!? No-Prefetch is ok. I dunno working alternatives for LSMASH, and whatever source filter outputs it shouldn't bypass binarization of the frames.

Last edited by VoodooFX; 11th November 2020 at 19:49.
VoodooFX is offline   Reply With Quote
Old 11th November 2020, 19:03   #105  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by VoodooFX View Post
Like I suspected it's something with Overlay, tested and same on AvS+ 3.4, 3.5.1, 3.6.0, 3.6.1.
Here is minimized and ready to run test scripts (extract to C:\) or preview included test results https://anonfiles.com/F7E0hdo2p0
"Bad gateway", expired perhaps?
pinterf is offline   Reply With Quote
Old 11th November 2020, 19:10   #106  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Same here, 502 Bad gateway. nginx.
Maybe that nginx thing is the block on your location for download, (cant remember what its called).
Can anybody launch successful download ?

EDIT: The Bad Gateway page is showing as Sweden in FlagFox. [dont know if relevant]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 11th November 2020 at 19:13.
StainlessS is offline   Reply With Quote
Old 11th November 2020, 19:48   #107  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by pinterf View Post
"Bad gateway", expired perhaps?
Still works on my side. Here is another link: https://we.tl/t-J95N1CsfUz
VoodooFX is offline   Reply With Quote
Old 11th November 2020, 20:08   #108  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
Quote:
Originally Posted by VoodooFX View Post
Isn't "threads=1" parameter for ffms2!? No-Prefetch is ok. I dunno working alternatives for LSMASH, and whatever source filter outputs it shouldn't bypass binarization of the frames.
LSmash has threads=blah parameter too. But non frame accurate runs will account for differences between repeated tests, when prefetch is used


I repeated test with x64 version - I think the problem is lsmash threads=auto vs. threads=1 for x64. I think it' s similar to the aforementioned ffms2 threads bug with prefetch


EDIT - multiple consec runs can result in different results, even with source filter threads=1 . One run can show PSNR inf, but another something lower. Something else is going on...

It even occurs when source is encoded to I-frame UTVideo, and using AVISource instead; multiple runs can show different results when prefetch is used. So not source filter related

Last edited by poisondeathray; 11th November 2020 at 20:46.
poisondeathray is offline   Reply With Quote
Old 11th November 2020, 20:46   #109  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by poisondeathray View Post
I repeated test with x64 version - I think the problem is lsmash threads=auto vs. threads=1 for x64.
I tested threads=1 like you did, only with 32bit and got one frame bugged, so bug is there with threads=1 too. It makes less chance for bug to occur, 5mins is too short test for this condition.

Looking at those bugged masks I think it's something with buffer/memory, just a guess, I'm not into lower level programming.

Last edited by VoodooFX; 11th November 2020 at 20:56.
VoodooFX is offline   Reply With Quote
Old 11th November 2020, 20:48   #110  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
Quote:
Originally Posted by VoodooFX View Post
I tested threads=1 like you did, only with 32bit and got one frame bugged, so bug is there with threads=1 too.
Yes, it's almost "random", see my edits above . One run can be perfect, but the next a few frames off, the next perfect again. It's not source filter related
poisondeathray is offline   Reply With Quote
Old 11th November 2020, 21:05   #111  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
If you change the script to use mt_merge (and full range YUV masks , PC matrix if converting from RGB), 10/10 runs are the same with prefetch=4. So that suggests it is something with overlay and prefetch
poisondeathray is offline   Reply With Quote
Old 11th November 2020, 21:51   #112  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by poisondeathray View Post
Yes, it's almost "random", see my edits above . One run can be perfect, but the next a few frames off, the next perfect again. It's not source filter related
Here is my minimalized script.
Code:
# Load VirtualDub, Press F2, go to frame 2-3-4 and back, refresh, step between frames left and right
# suddenly a garbage is seen
DynamicMask = BlankClip(1000, 128, 128, pixel_type="RGB32")
WhiteClip   = BlankClip(DynamicMask,color=$FFFFFF)
BlackClip   = BlankClip(DynamicMask,color=$000000)
BlackClip.Overlay(WhiteClip, Mask=BlackClip)
Prefetch(4)
Thank you for giving me the opportunity to work on it
pinterf is offline   Reply With Quote
Old 12th November 2020, 11:09   #113  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by pinterf View Post
Here is my minimalized script.

Thank you for giving me the opportunity to work on it
Yep, Vdub2 reveals this bug on the first frames. Have fun with it.

Last edited by VoodooFX; 12th November 2020 at 11:11.
VoodooFX is offline   Reply With Quote
Old 12th November 2020, 12:24   #114  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Please check a (hopefully) fixed Avisynth build
pinterf is offline   Reply With Quote
Old 26th November 2020, 18:43   #115  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
There is some bug with high resolutions like 1920x1080 and AvsInpaint, if a mask is close to the left/right side then AvsInpaint hangs at start (no error).

Here is the bug simulator:

Code:
x=BlankClip(length=1000, width=1920, height=1080, color=$000000, pixel_type="YV12")

mask = BlankClip(x, length=1).Subtitle("Sample", text_color=$FFFFFF, x=8).Levels(180,1,181,0,255, coring=false)
# mask = BlankClip(x, length=1).Subtitle("Sample", text_color=$FFFFFF, x=519).Levels(180,1,181,0,255, coring=false) # Working position, moving the mask 1px to left("x=518") - hangs.

# x.InpaintLogo(mask, PreBlurSize=0.9, PostBlurSize=0.9)  # Droping the blur kernels to 0.9 - no hangs.
x.InpaintLogo(mask)
EDIT:
Bug should be fixed in AvsInpaint v1.3

Last edited by VoodooFX; 25th October 2021 at 20:16.
VoodooFX is offline   Reply With Quote
Old 28th November 2020, 18:05   #116  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
New version released (updated the first post):

Code:
# Version 1.11 : 2019/08/31.  First public release.
# Version 1.12 : 2019/09/06.  Various tweaks. New parameters. "Inflate" and "Deep" changed.
# Version 1.13 : 2019/12/08.  Allow -ve LogoX,LogoY, and +ve LogoW,LogoH in Loc string (by StainlessS).
# Version 1.14 : [non public] "Fr1"/"Fr2" are renamed to "FrB"/"FrW". "GrainPP" is off by default.
# Version 1.15 : [non public] New mode for "InterpM", (-1) takes mask from new "iTune" parameter.
# Version 1.16 : [non public] New "diPP" & "diPPm" parameters.
# Version 1.17 : [non public] New "iTinflate" & "oTinflate" parameters. Interp/iTune mask to "mShow".
# Version 1.18 : [non public] New "EdgePP", "EdgePos" & "EdgeWide" parameters. EdgeMask to "mShow".
# Version 1.19 : [non public] New "IntSpd" parameter for "Interp" & the slow modes for "EdgePP".
# Version 1.20 : [non public] "Turbo" presets moved from soft to hard. iTune & Edge masks to "Show".
# Version 1.21 : [non public] Added support for the mask clips and a dynamic mask. 
#                             Added basic auto generation of a dynamic mask (aka "DynMask=2").
#                             New parameters: "DynMask", "DynInflate", "DynTune", "KillNoise", "maskPatch".
# Version 1.22 : [non public] Optimized speed for a dynamic mask, MaskTools2 required.
# Version 1.23 : [non public] Added auto generation of a dynamic mask with ClipBlend (aka "DynMask=3").
#                             New parameters: "Dyn3Seq", "ClpBlend", "DynPostTune", "Dyn3buffer".  
# Version 1.24 : 2020/11/28.  Various tweaks. "Show" 3 & 4. Updated the manual with the new stuff.
One example of the dynamic logo/delogo is in the thread there -> Detect Position of Watermark in movie and remove with logo inpaint

Quote:
Originally Posted by real.finder View Post
maybe your script will help if it work with mask clip
Check if it helps anything.

Last edited by VoodooFX; 28th November 2020 at 18:19.
VoodooFX is offline   Reply With Quote
Old 28th November 2020, 18:34   #117  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by VoodooFX View Post
New version released (updated the first post)
Check if it helps anything.
thanks! but it's still in "Attachments Pending Approval", can you upload it else where?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 28th November 2020, 19:53   #118  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Here are screens for another dynamic logo removal:




12s GIF sample (stacked: original, dynamic mask, delogo output):


Last edited by VoodooFX; 28th November 2020 at 22:36.
VoodooFX is offline   Reply With Quote
Old 28th November 2020, 22:11   #119  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
It's approved now. As I don't read every post in every forum, if you have something needing approval, you can PM me if you like.
manono is offline   Reply With Quote
Old 29th November 2020, 01:47   #120  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
In your [@ VoodooFX] post #118 attachment [12s GIF sample], I earlier saw a white flash in bottom image part, it is now gone.
[maybe at end of repeated loop]
EDIT: attachment update, ? EDIT: your shit, is "The Shit" (well good man)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 29th November 2020 at 02:56.
StainlessS 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 17:39.


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