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 18th January 2018, 06:27   #201  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 49
Sample: https://mega.nz/#!qNAC1YbB!LvoFf9Vdt...FozkQHQPgJIK6I

AviSynth script:
Code:
a=DirectShowSource("X:\DL\Super.Robot.Monkey.Team.Hyperforce.Go.S01.1080i.HDTV.DD5.1.H.264-NOGRP\S01E01 Chiro's Girl.ts")
a=a.ConvertToYV12()
a=a.GradFun3(thr=0.5)
b=a.xlogo("C:\Users\pcroland\Desktop\logo0.bmp",180,860,0)
a=a.Spline36ResizeMod(1280,720)
b=b.Spline36ResizeMod(1280,720)
Interleave(a,b)
With this script this is the result:
https://testfra.me/1e/

AviSynth script:
Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\LoadPluginEx.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\LogoTools.dll")
a=DirectShowSource("X:\DL\Super.Robot.Monkey.Team.Hyperforce.Go.S01.1080i.HDTV.DD5.1.H.264-NOGRP\S01E01 Chiro's Girl.ts")
a=a.ConvertToYV12()
a=a.GradFun3(thr=0.5)
#xlogo("C:\Users\pcroland\Desktop\logo0.bmp",180,860,0)
a=a.ConvertToYUY2()
b=ImageSource("C:\Users\pcroland\Desktop\nologo.png").ConvertToYUY2()
c=NoLogoAuto(a,b,0)
a=a.ConvertToYV12()
a=a.Spline36ResizeMod(1280,720)
c=c.ConvertToYV12()
c=c.Spline36ResizeMod(1280,720)
Interleave(a,c)
Mask: https://i.imgur.com/HV311oS.png

And with this script, this is the result:
https://testfra.me/1f/

It seems that NoLogoAuto() puts on another logo instead of removing it
pcroland is offline   Reply With Quote
Old 19th January 2018, 05:20   #202  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,139
When using XLogo you can vary the amount of blur. But, as I said, I don't use it so I haven't played with it.

Using LogoTools I mentioned you need the logo with a black background. You don't have one in your sample. Every mask I've ever made was black and white so I don't know for sure whether or not having the green part messes it up because I work with black and white films. From the LogoTools_help.rtf:

Quote:
Notes: The logo needs to be in a compelely black frame.
manono is offline   Reply With Quote
Old 19th January 2018, 17:41   #203  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 49
Quote:
Originally Posted by manono View Post
When using XLogo you can vary the amount of blur. But, as I said, I don't use it so I haven't played with it.

Using LogoTools I mentioned you need the logo with a black background. You don't have one in your sample. Every mask I've ever made was black and white so I don't know for sure whether or not having the green part messes it up because I work with black and white films. From the LogoTools_help.rtf:
I linked a black frame with the logo:
"Mask: https://i.imgur.com/HV311oS.png"
pcroland is offline   Reply With Quote
Old 19th January 2018, 19:28   #204  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,139
Quote:
Originally Posted by pcroland View Post
I linked a black frame with the logo:
Was it included as part of the sample video?
manono is offline   Reply With Quote
Old 19th January 2018, 23:47   #205  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 49
Quote:
Originally Posted by manono View Post
Was it included as part of the sample video?
Here's a sample with a black frame:
https://mega.nz/#!TBw1iRxJ!eoipHj4Tu...9oVMXKwrQY62sI

Script:
Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\LoadPluginEx.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\LogoTools.dll")
a=FFMS2("C:\Users\pcroland\Desktop\MEGA\sample2.mkv").ConvertToYUY2()
b=NoLogoAuto(a,a,768)
Interleave(a,b)
It does the same thing.
pcroland is offline   Reply With Quote
Old 20th January 2018, 08:52   #206  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,139
Your 'A' is your video and the 'B' is the logo. I also discovered the mask should be black and white, not black and green. Unfortunately, I didn't have much luck at all using LogoTools. Using the basic script:

B=ImageSource("Logo2.bmp").ConvertToYUY2()###BMP with logo and black background
FFVideoSource("Sample2.mkv").ConvertToYUY2()
A=Last

NoLogoAuto(A,B,531)


The logo was replaced with a dark grey something. Using the more complex versions (NoLogo and NoLogoM), the scripts either crashed or gave out with error messages. I don't know why.

So, I switched to using InPaintFunc. The link below is to the version I made. Parts of it look pretty good, other parts pretty bad:

LoadCPlugin("H:\AVISynth\Dlls\AVSInPaint.dll")
LoadPlugin("H:\AVISynth\Dlls\ExInpaint.dll")
LoadPlugin("H:\AVISynth\Dlls\AddGrainC.dll")
LoadPlugin("H:\AVISynth\Dlls\MedianBlur.dll")
Import("H:\AVISynth\plugins\INPaintFunc.avs")

AVISource("sample2.avi")#I had made a quick lossless Lagarith AVI

X=InpaintFunc(mask="logo3.bmp",loc="192,870,-1530,-78",AR=1.0/1.0,mode="DeBlend",speed=10, ppmode=1,pp=50,radius=5.0,preblur=8.0)

Y=X.MedianBlur(2,2,2).AddGrain(5,0,0)###Does most of the blurring
Mask=ImageSource("LogoBlur.bmp")
Overlay(X,Y,0,0,Mask)


Also enclosed are the Logo3.jpg and the LogoBlur.jpg, smaller versions of the BMPs I used. the LogoBlur was used to add more blurring and to feather the blurring to blend in better. If you don't want any of that, then just the basic script is fine:

InpaintFunc(mask="logo3.bmp",loc="192,870,-1530,-78",AR=1.0/1.0,mode="DeBlend",speed=10, ppmode=1,pp=50,radius=5.0,preblur=8.0)

Adjust the parameters as you wish. One thing to know; this thing is very slow, just to open. I suggest trimming off 500 or so frames to test. Only after getting it to work and the way you like should you open the complete video. It might take twice the length of the video just to open, or more. The encoding time isn't so bad. It might be better to use the Inpaint mode to completely recreate the inside of the logo from what's around it. Or, maybe try and get the StainlessS one going.

https://www.sendspace.com/file/wiop9v
Attached Images
  
manono is offline   Reply With Quote
Old 21st January 2018, 16:20   #207  |  Link
pcroland
Registered User
 
Join Date: Mar 2014
Location: Hungary
Posts: 49
Thanks for all the help, it works great
pcroland is offline   Reply With Quote
Old 22nd January 2018, 12:51   #208  |  Link
Yanak
Registered User
 
Join Date: Oct 2011
Posts: 200
@manono about the very slow part of InPaintFunc :

The speed parameter combined with the length ( number of frames) of the video can take some time for the analyze and generate the .ebmp file the first time yes,
speed=10 like in your example will analyze 50% of the video if i recall correctly, speed 20 is for analyzing 100% ( even slower ) , speed 1 analyze 5% of the frames, speed 2 = 10% etc.
Each step of speed parameter adds 5% for the video analyze, speed parameter allowed values goes from 1 to 20.

Depending the length of my videos i modify this parameter a bit, especially at the start during the settings adjustments, later when i fine tuned a bit my settings i can go with the reset parameter or simply delete the .ebmp file created and set analyze to a very high % and generate a new one before encoding

Last edited by Yanak; 22nd January 2018 at 12:53.
Yanak is offline   Reply With Quote
Old 23rd January 2018, 10:05   #209  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,139
Thank you for the suggestions.
manono 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 01:01.


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