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 13th August 2022, 03:24   #421  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Quote:
Originally Posted by VoodooFX View Post
If you understand then I don't understand what you are asking.
You said: "join parts with no logo, and delogo and join the animated parts". And i ask my scripts above correct with "delogo part" as you said
kedautinh12 is offline   Reply With Quote
Old 13th August 2022, 03:36   #422  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by kedautinh12 View Post
You said: "join parts with no logo, and delogo and join the animated parts". And i ask my scripts above correct with "delogo part" as you said
Sorry, I don't understand what you write.

Last edited by VoodooFX; 13th August 2022 at 03:38.
VoodooFX is offline   Reply With Quote
Old 13th August 2022, 03:46   #423  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Quote:
Originally Posted by VoodooFX View Post
Sorry, I don't understand what you write.
Lol, just forget about it
kedautinh12 is offline   Reply With Quote
Old 15th August 2022, 20:56   #424  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 115
If anyone is interested I created a small script that can extract forced cues from a full subtitle based on the folder that SubsMask2Img created:
https://github.com/pcroland/substoforced
Code:
❯ ./stf.py -h
substoforced 1.0.0

USAGE: stf.py [-h] [-v] [-s SUB] [-f FOLDER]

FLAGS:
  -h, --help                  show this help message.
  -v, --version               show version.
  -s, --sub SUB               specifies srt input
  -f, --folder FOLDER         specifies a folder where SubsMask2Img generated timecodes (optional)
                              you should remove the junk from there manually
pcroland is offline   Reply With Quote
Old 16th August 2022, 17:57   #425  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by pcroland View Post
If anyone is interested I created a small script that can extract forced cues from a full subtitle based on the folder that SubsMask2Img created:
https://github.com/pcroland/substoforced
Could you describe more specifically what it does?
VoodooFX is offline   Reply With Quote
Old 16th August 2022, 18:04   #426  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 115
It keeps the cues from the full subtitle that overlaps with any of the timecodes generated by SubsMask2Img. Lets say you have an English movie with French parts that are hardsubbed and you have a dub in another language where French parts aren't translated and you only have a full subtitle for it. You can generate the forced automatically for it.
Another use case would be to have a video with hardsubs that are also present in the full subtitle. You could create a subtitle based on your full subtitle without OCRing image (so it has less errors).
pcroland is offline   Reply With Quote
Old 16th August 2022, 18:16   #427  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Now it's clear. I was thinking what you are extracting there when you have srt already.
VoodooFX is offline   Reply With Quote
Old 19th August 2022, 23:26   #428  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
First off, many thanks to you, VoodooFX for building and maintaining that huge and useful script.

A suggestion: While having to handle plain white text logo with black borders (subtitle style) I came across the need to give expand=3.
expand=2 would still leave inpainting artifacts, which postprocessing could mend only a bit.
Going into script version 2.17 line 1178 it was well possible to change the assert line to acommodate expand up to 5 without breaking the underlying function balloonPX.
Quote:
buginflate = (inflate < 0 || inflate > 2) ? true : false
changed to
Quote:
buginflate = (inflate < 0 || inflate > 5) ? true : false
Maybe worth a suggestion to have that in the coming version.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 20th August 2022, 03:00   #429  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
@Emulgator

Thing is that I never saw a practical case where I would need it more than 2...
You would need to share your logo case so I can see it with my own dead eyes to change my mind on that option.

Btw, you are not the first one asking this, and all of them were doing something wrong and wanted to "expand" stuff more to cover mistakes.

Last edited by VoodooFX; 20th August 2022 at 03:05.
VoodooFX is offline   Reply With Quote
Old 20th August 2022, 22:15   #430  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
It was a subtitle style logo. White body, plus black borders, plus a bit halo.
Photosobbing -> Curves -> Isolating the white body left my mask without the black borders, let alone the faint halo, so too thin
To get that inpainted properly it would either take photosobbing again to pad up the lost borders and halo, or take the borders into account first.

Well, more work...or simply hand that padding job over to Inpaint Delogo, which did work nicely.

I guess the old fat bordered Sony Handycam style time code rendering would benefit from that too, still got to capture a case to publish.
Badly needed for stabilising such footage, because stabilising alone leaves you with shaky timecode, so timecode got to be removed first before stabilising.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 20th August 2022 at 22:37.
Emulgator is offline   Reply With Quote
Old 21st August 2022, 17:56   #431  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by Emulgator View Post
Photosobbing -> Curves -> Isolating the white body left my mask without the black borders
So it's problem of you not making a proper basemask with Photozhop. If logo has black borders then select a frame with a bright background for edits. Use Magic Wand [there is Contiguous option] and Paint Bucket.
Or just use Automask.

Quote:
Originally Posted by Emulgator View Post
I guess the old fat bordered Sony Handycam style time code rendering would benefit from that too
Inflate is only for static logos, for a dynamic mask there is DynInflate, it's limited to "4".

Last edited by VoodooFX; 21st August 2022 at 20:19.
VoodooFX is offline   Reply With Quote
Old 21st August 2022, 21:19   #432  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
Good, I will try that.
Automask got it wrong, no pure logo on black to be had, so I would have liked to tune thresholds and such, but at the moment I am only a Delogo beginner...
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 21st August 2022 at 21:23.
Emulgator is offline   Reply With Quote
Old 21st August 2022, 22:01   #433  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Did you tried to use aMix option with Automask? Are you sure logo is not transparent?
Without video I can't tell you much, share it by PM if you want.

Last edited by VoodooFX; 9th September 2022 at 11:41.
VoodooFX is offline   Reply With Quote
Old 8th September 2022, 09:34   #434  |  Link
Guilbert
Registered User
 
Join Date: Apr 2022
Posts: 11
Hi, @VoodooFX.

Can you please take a look to the video I send you?
I can't get a good result with InpaintDelogo to OCR these hardcoded subtitles.

I tried with these parameters, with no luck:
Code:
InpaintDelogo(Loc="280,560,-280,-40", Show=4, DynMask=4, DynTune=210, DynMask4H=60, DynMaskUp=2)
Thank you for your help!
Guilbert is offline   Reply With Quote
Old 8th September 2022, 13:21   #435  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by Guilbert View Post
I tried with these parameters, with no luck:
Code:
InpaintDelogo(Loc="280,560,-280,-40", Show=4, DynMask=4, DynTune=210, DynMask4H=60, DynMaskUp=2)
Did you read the manual how to set those parameters? In this video a text brightness is way over "210" and a halo brightness as "60" is way too low.

DynTune aka text brightness - set high as possible [till text doesn't disappear].
DynMask4H aka halo brightness - set low as possible [till letters doesn't disappear].
KillBlobs - set low [ignore "-"] as possible [till letters doesn't disappear, good indicator are capital "M" and "W" letters].

Code:
v=LWLibAvVideoSource("D:\video.1080p.mkv")
x=v.crop(360,820,-360,-80)

o1=v.InpaintDelogo(Loc="360,820,-360,-80", Show=4, DynMask=4, DynTune=210, DynMask4H=60)
o2=v.InpaintDelogo(Loc="360,820,-360,-80", Show=4, DynMask=6, DynTune=240)
o3=v.InpaintDelogo(Loc="360,820,-360,-80", Show=4, DynMask=4, DynTune=240, DynMask4H=140)
o4=v.InpaintDelogo(Loc="360,820,-360,-80", Show=4, DynMask=4, DynTune=240, DynMask4H=140, KillBlobs=-4, KillNoise=-5)

Stackvertical(
\ x,
\ o1.ConvertToYV12().AddBorders(0,2,0,0,$F0F080).Subtitle("1: your settings"),
\ o2.ConvertToYV12().AddBorders(0,2,0,0,$F0F080).Subtitle("2: only DynTune"),
\ o3.ConvertToYV12().AddBorders(0,2,0,0,$F0F080).Subtitle("3: DynMask=4"),
\ o4.ConvertToYV12().AddBorders(0,2,0,0,$F0F080).Subtitle("4: DynMask=4 + KillBlobs & KillNoise"))
Frame 12270:




Here is the extracted result ["00_08_09_640__00_08_12_360.png"]:
Code:
InpaintDelogo(Loc="360,820,-360,-80", Show=4, DynMask=4, DynTune=240, DynMask4H=140, KillBlobs=-4, KillNoise=-5, DynMaskUp=2, Extract=1, ImgDir="D:\Images", ImgInflate=1)


ImgInflate=1 because DynTune=240 is a bit too high for some sub lines [there are some small "holes" in text], so ImgInflate=1 fills them in.

Last edited by VoodooFX; 8th September 2022 at 13:38.
VoodooFX is offline   Reply With Quote
Old 8th September 2022, 14:42   #436  |  Link
Guilbert
Registered User
 
Join Date: Apr 2022
Posts: 11
No, I didn't read the manual yet, but I will, thank you for the advice.
Thank you as well for the explanations and those parameters, it looks amazing!

Do you know if Google Cloud Vision is able to detect italics, by any chance, please?
(The API was added recently in Subtitle Edit. )
Guilbert is offline   Reply With Quote
Old 8th September 2022, 14:57   #437  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by Guilbert View Post
Do you know if Google Cloud Vision is able to detect italics, by any chance, please?
(The API was added recently in Subtitle Edit. )
I dunno. You can ask at Subtitle Edit's thread.
VoodooFX is offline   Reply With Quote
Old 9th September 2022, 03:01   #438  |  Link
Zetti
Registered User
 
Join Date: Dec 2015
Posts: 309
I have tested the subtitle extraction function with your settings from post 435 like this:

Code:
LoadPlugin("C:\MeGUI-x64\tools\ffms\ffms2.dll")
FFVideoSource("D:\Test\Test.mp4", threads=1)
InpaintDelogo(Loc="164, 362, -150, -38", Show=4, DynMask=4, DynTune=240, DynMask4H=140, KillBlobs=-4, KillNoise=-5, DynMaskUp=2, Extract=1, ImgDir="D:\Test", ImgInflate=1)
So i can see what it is doing with my video test, but i got this result out of it:



What can i have done wrong?
Zetti is offline   Reply With Quote
Old 9th September 2022, 12:03   #439  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 989
Quote:
Originally Posted by Zetti View Post
I have tested the subtitle extraction function with your settings from post 435 like this:
...
What can i have done wrong?
Most likely - subtitles in your video are not the same type as subtitles in Guilbert's video, you need to set parameters fitting your subtitles.
Cut [no re-encode] and post a short few mins sample of video if you want advice [or a whole video by PM].
VoodooFX is offline   Reply With Quote
Old 9th September 2022, 17:33   #440  |  Link
Zetti
Registered User
 
Join Date: Dec 2015
Posts: 309
Here is small sample: https://www.file.io/9gdT/download/Xm0V7j2kmDMc
Zetti 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 04:18.


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