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 7th May 2023, 08:05   #1  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
DeSubtitle with InpaintDelogo

I am trying to "inpaint" the subtitle from a film that was released with burned in subtitles. :/

I am using SubsMask2Img and extract the subtitles, however, it does miss "one word" mostly in few places.

1. How do I use this in the InpaintDelogo to inpaint?
2. How can I get the timecode (xml?) so I can run in ocr?

I'm running this to extract the subtitles.
Code:
SubsMask2Img( ImgDir="C:\Users\MyUserName\Downloads\subs", CorrTh=0.8, SubTune=200, DetWinPercW=10, DetWinPercH=60, DetWinHoPos=0, SubMinDur=12, SubSusDur=0,  SubMinLuma=0.05, SubSusLuma=0, ImgType="png", ImgInflate=0, ImgInvert=0, ImgSize=1, RawAvr=1 )
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 7th May 2023, 12:43   #2  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by color View Post
I am using SubsMask2Img and extract the subtitles, however, it does miss "one word" mostly in few places.
Your SubsMask2Img settings looks weird, cut and share ~10 mins of your video [including missed word]. And share your InpaintDelogo settings too.


Quote:
Originally Posted by color View Post
1. How do I use this in the InpaintDelogo to inpaint?
Disable a mask preview [Show=0] and it should do inpainting.


Quote:
Originally Posted by color View Post
2. How can I get the timecode (xml?) so I can run in ocr?
"Timecode" is already in the filenames of your extracted files.
VoodooFX is offline   Reply With Quote
Old 7th May 2023, 17:08   #3  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Quote:
Originally Posted by VoodooFX View Post
Your SubsMask2Img settings looks weird, cut and share ~10 mins of your video [including missed word]. And share your InpaintDelogo settings too.

Disable a mask preview [Show=0] and it should do inpainting.
I don't really know what I am doing, it ask for extension for mask, but don't know how I should formulate it.

I send you the video to your PM, I am not allowed to share this.

Code:
SubsMask2Img( ImgDir="C:\subs", CorrTh=0.8, SubTune=200, DetWinPercW=10, DetWinPercH=60, DetWinHoPos=0, SubMinDur=12, SubSusDur=0,  SubMinLuma=0.05, SubSusLuma=0, ImgType="png", ImgInflate=0, ImgInvert=0, ImgSize=1, RawAvr=1 )
InpaintDelogo(mask="C:\subs", Show=0, Automask=0, aMix=0, Loc="400,900,-400,-40", Mode="inpaint", Sharpness=60, preBlur=2.1, postBlur=12.6, Radius=16, oPP=-3, Optimize=0)
(added show but get a error:



Quote:
Originally Posted by VoodooFX View Post
"Timecode" is already in the filenames of your extracted files.
I noticed this, It is possible to create a text with the timecodes just through cmd or powershell when I think about it. I need to check a bit into this what software can handle this and maybe some does support them directly.
__________________
Automatic Colorization

Last edited by color; 7th May 2023 at 18:42.
color is offline   Reply With Quote
Old 7th May 2023, 17:52   #4  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Looks like you are doing random things there.
Did you used SubsMask2Img on original video? It extracts from a mask, so you need to create/set a mask first.

What are the crop settings used to crop that sample you sent me?
VoodooFX is offline   Reply With Quote
Old 7th May 2023, 17:58   #5  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Quote:
Originally Posted by VoodooFX View Post
Looks like you are doing random things there.
Did you used SubsMask2Img on original video? It extracts from a mask, so you need to create/set a mask first.

What are the crop settings used to crop that sample you sent me?
.Crop(400,900,-400,-40)

Yes, I don't know what I am doing.

Send new PM uncroped if that might help?
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 7th May 2023, 18:42   #6  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Here is command to inpaint subs on your video [tuned only to that short sample, no guaranty that it's good for the whole video]:

Quote:
InpaintDelogo(Loc="400,890,-400,-20", DynMask=4, DynInflate=4, Turbo=-1)
Before:


After:

Last edited by VoodooFX; 7th May 2023 at 19:12.
VoodooFX is offline   Reply With Quote
Old 7th May 2023, 19:05   #7  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Here is command to extract subs from your video [tuned only to that short sample, no guaranty that it's good for the whole video]:

Quote:
InpaintDelogo(Loc="400,890,-400,-20", Show=4, DynMask=4, Extract=1, ImgSize=2, ImgDir="D:\SubImages")
Result:


To OCR extracted images use Subtitle Edit and nOCR method there.

Last edited by VoodooFX; 7th May 2023 at 19:13.
VoodooFX is offline   Reply With Quote
Old 8th May 2023, 07:18   #8  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Quote:
Originally Posted by VoodooFX View Post
Here is command to inpaint subs on your video [tuned only to that short sample, no guaranty that it's good for the whole video]:



Before:


After:
I tried this but it only blury the text:

Code:
InpaintDelogo(Loc="400,890,-400,-20", DynMask=4, DynInflate=4, Turbo=-1)
EDIT: I thought I had to create the "extraction" with SubsMask2Img first then use the images created as a mask in InpaintDelogo. So yeah...I didn't know what I was doing. :P
__________________
Automatic Colorization

Last edited by color; 8th May 2023 at 07:23.
color is offline   Reply With Quote
Old 8th May 2023, 08:08   #9  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by color View Post
I tried this but it only blury the text
I've no idea what that means.
VoodooFX is offline   Reply With Quote
Old 8th May 2023, 08:14   #10  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Quote:
Originally Posted by VoodooFX View Post
I've no idea what that means.

Well my english is a bit bad, sorry, but it does blurry the text, it does not remove, only make it "out off fuccus". I also tried Mode=inpaint, but it does nothing.

__________________
Automatic Colorization
color is offline   Reply With Quote
Old 8th May 2023, 08:29   #11  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
That's why you should cut and share a sample of original video, instead of sending me God knows what.
Why you can't share a sample? It looks like consumer media, not some master.
VoodooFX is offline   Reply With Quote
Old 8th May 2023, 08:33   #12  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Quote:
Originally Posted by VoodooFX View Post
That's why you should cut and share a sample of original video, instead of sending me God knows what.
Why you can't share a sample? It looks like consumer media, not some master.

I did send you through PM.

I am using:

InpaintDelogo(Loc="400,890,-400,-20", DynMask=4, DynInflate=4, Turbo=-1)

but don't know what more to do, it just show up blurry, does it help to send the blurry exported file you mean? I did send you a print screen right now. Don't know why it removes the subtitle when you do it but when i use the same code it does not.
__________________
Automatic Colorization

Last edited by color; 8th May 2023 at 08:39.
color is offline   Reply With Quote
Old 8th May 2023, 08:49   #13  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by color View Post
I did send you through PM.
There is nothing received in my PM box.

Quote:
Originally Posted by color View Post
does it help to send the blurry exported file you mean?
No, I meant a sample of the original video. I can recreate same "export" on my end.

EDIT:
Share your full avs script too.

EDIT2:
Check if you are using latest InpaintDelogo version.

Last edited by VoodooFX; 8th May 2023 at 09:11.
VoodooFX is offline   Reply With Quote
Old 8th May 2023, 10:53   #14  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Quote:
Originally Posted by VoodooFX View Post
There is nothing received in my PM box.


No, I meant a sample of the original video. I can recreate same "export" on my end.

EDIT:
Share your full avs script too.

EDIT2:
Check if you are using latest InpaintDelogo version.
I did share the full script on your PM about one hour ago. I will send full file as well.
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 8th May 2023, 15:42   #15  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
I did update all plugins and now it works. Might have had one outdated.
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 8th May 2023, 16:04   #16  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
Quote:
Originally Posted by color View Post
I did share the full script on your PM about one hour ago. I will send full file as well.
Nothing from "one hour ago", but got one after your last post.
I'm not gonna download gigabytes of "full file" when a short sample is enough.

There you can learn how to cut videos: https://www.youtube.com/watch?v=4ior3zoZ7b0

Your script looks OK. What is your InpaintDelogo version?
VoodooFX is offline   Reply With Quote
Old 8th May 2023, 16:09   #17  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Quote:
Originally Posted by VoodooFX View Post
Nothing from "one hour ago", but got one after your last post.
I'm not gonna download gigabytes of "full file" when a short sample is enough.

There you can learn how to cut videos: https://www.youtube.com/watch?v=4ior3zoZ7b0

Your script looks OK. What is your InpaintDelogo version?
Don't know but I updated all.
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 8th May 2023, 20:44   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Don't know but I updated all.
From here:- https://github.com/Purfview/InpaintD...Delogo.avsi#L1

Code:
##================================================================================================##
#                                                                                                  #
#             ____                  _       __  ____       __                                      #
#            /  _/___  ____  ____ _(_)___  / /_/ __ \___  / /___  ____  ____                       #
#            / // __ \/ __ \/ __ `/ / __ \/ __/ / / / _ \/ / __ \/ __ `/ __ \                      #
#          _/ // / / / /_/ / /_/ / / / / / /_/ /_/ /  __/ / /_/ / /_/ / /_/ /                      #
#         /___/_/ /_/ .___/\__,_/_/_/ /_/\__/_____/\___/_/\____/\__, /\____/                       #
#                  /_/                                         /____/                              #
#                                                                                                  #
##================================================================================================##


#  InpaintDelogo is an advanced logo and watermark removal function using inpainting and deblending
# with an adjustable fine process to hide artifacts and get best delogo results.
# Can remove opaque, transparent, semi-transparent and some dynamic logos from video.
# Can be used to remove hardcoded subtitles or extract them to images for OCR.

#  Inpainting refers to the application of sophisticated algorithms to reconstruct of lost
# or deteriorated parts of images or videos.


##================================================================================================##
#   Version: 3.6       <<<===========                                                              #
##================================================================================================##
__________________
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; 8th May 2023 at 20:52.
StainlessS is offline   Reply With Quote
Old 18th June 2023, 15:16   #19  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
I have a new..similar problem. I got a old vhs-video that I don't manage, maybe this will not work?

https://we.tl/t-WIerLAfaHH

also there is a light grey background behind the text.

this is the best i get:
InpaintDelogo(Loc="60,450,-60,-30", DynMask=4, DynInflate=10, Turbo=-1)



EDIT: this is the full script:

LWLibavVideoSource("VHS.mkv")
QTGMC(Preset="Very Slow", Sharpness=1.0, InputType=0, FPSDivisor=1, ShowSettings=false)
BicubicResize(720, 576)
#.Crop(30,450,-30,-30)
InpaintDelogo(Loc="60,450,-60,-30", DynMask=4, DynInflate=10, Turbo=-1)
__________________
Automatic Colorization

Last edited by color; 18th June 2023 at 15:19.
color is offline   Reply With Quote
Old 18th June 2023, 20:22   #20  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 234
Looks as if the negative coordinates don't work like in Crop.
Frank62 is offline   Reply With Quote
Reply

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 18:57.


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