Quantcast Avisynth: New Logo Removal Filter - digitalFAQ.com Forums [Archives]
  #1  
10-27-2003, 06:15 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
I just posted my LogoTools plugin. It replaces LogoBlend as well as adds a number of other helper filters.

New Filters:

NoLogo - replaces LogoBlend
NoLogoM - like NoLogo but with better control over the removal - great for problem logos.
AddLogo - add a logo
IfLogo - logo detection
IfNoLogo - logo overcorrection detection (what if I removed the logo when it wasn't there?)
LogoMask - mix two frames based using the logo as a mask.

You can get the filter at:

http://www.geocities.com/mrtibsvideo/Logotools.html
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
10-27-2003, 06:52 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
AddLogo ! Great ! A lot of people claimed for taht also.

Congratulation.
Reply With Quote
  #3  
10-27-2003, 07:03 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
I admit that it seems stupid but perhaps someone may need it. I included it because the code was already there and one way to remove a logo is to cover it up with another logo.


Uses for AddLogo include:

1. Add the logo where it is missing to make removal easier.
2. Add a second logo and remove both for situations where multiple logos appear at different times.
3. Create a "inverted" logo and add it to the frame to help with removal.
4. Cover up a Kafka removal with a logo to hide the errors.
Reply With Quote
  #4  
10-28-2003, 11:03 AM
Zyphon Zyphon is offline
Free Member
 
Join Date: Oct 2003
Location: London, England (UK)
Posts: 1,035
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for these logo removal tools Mr Tibs im off to download them now.
__________________
Regards.

Michael.
Reply With Quote
  #5  
10-29-2003, 09:50 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
One more filter added to the DLL:

NoLogoAuto - same as NoLogo with no fiddling - requires the logo to be on a completely black frame.

Example:

NoLogoAuto(clip,logoclip,framenumber)
Reply With Quote
  #6  
10-30-2003, 10:40 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MrTibs
One more filter added to the DLL:

NoLogoAuto - same as NoLogo with no fiddling - requires the logo to be on a completely black frame.

Example:

NoLogoAuto(clip,logoclip,framenumber)
What specifically replaces "clip"?
What specifically replaces "logoclip"?

I know these must seem like dumb questions.

I have a sample of 10 frames.
The name of the sample film is "tenframes.avi".
The 5th frame is white logo on black.


LoadPlugin("C:\aa\MPEG2Dec3.dll")
LoadPlugin("C:\aa\old\loadpluginex2.dll")
LoadPlugin("C:\aa\old\LogoTools.dll")
avisource("c:\aa\tenframes.avi")
#NoLogoAuto(clip,logoclip, logo frame number)

NoLogoAuto(clip,"C:\aa\tenframes.avi", 5)

I get TMPGEnc error: 'I don't know what "clip" means'
Reply With Quote
  #7  
10-30-2003, 04:23 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Clip is the default video clip.

I.E.

Quote:
clip=Avisource("C:\aa\tenframes.avi")
NoLogoAuto(clip,clip,5)

Personally, I usually trim my original video capture and make short video sample with the logo on a black frame then save it as a huffy clip like "abc_logo.avi". My logo script would look something like this:

Quote:
Avisource("c:\capture.avi")
Trim(100,110)
#noise removal
TemporalSmoother(3)
I would then use Vdub to save that file as "abc_logo.avi".

Then to filter out the logo:

Quote:
clip=Avisouce("c:\Capture.avi")
logoclip=Avisource("C:\abc_logo.avi")
NoLogoAuto(clip,logoclip,5)
I generally, keep video sequences for each logo I encounter.
Reply With Quote
  #8  
10-30-2003, 05:17 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MrTibs
Clip is the default video clip.

I.E.

Quote:
clip=Avisource("C:\aa\tenframes.avi")
NoLogoAuto(clip,clip,5)

Personally, I usually trim my original video capture and make short video sample with the logo on a black frame then save it as a huffy clip like "abc_logo.avi". My logo script would look something like this:

Quote:
Avisource("c:\capture.avi")
Trim(100,110)
#noise removal
TemporalSmoother(3)
I would then use Vdub to save that file as "abc_logo.avi".

Then to filter out the logo:

Quote:
clip=Avisouce("c:\Capture.avi")
logoclip=Avisource("C:\abc_logo.avi")
NoLogoAuto(clip,logoclip,5)
I generally, keep video sequences for each logo I encounter.
Given the sample code below, how would NoLogoAuto() fit in? My captures are MPEG2's with d2v from DVD2AVI.

MPEG2Source("C:\My Documents\noisy.d2v")
Trim(33333,44444)
Undot()
Limiter()
converttoYUY2(interlaced=true)
video = SeparateFields().BicubicResize(480, 240)
evenfield = SelectEven(video).TemporalSoften(1,5,8,5,2).peachs moother().Unfilter(60,0)
oddfield = SelectOdd(video).TemporalSoften(1,5,8,5,2).peachsm oother().Unfilter(60,0)
Interleave(evenfield,oddfield)
Weave()
Letterbox(16,16,16,16)
Limiter()
Reply With Quote
  #9  
10-30-2003, 06:59 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Here is the modifed script:
Quote:
clip=MPEG2Source("C:\My Documents\noisy.d2v").converttoYUY2(interlaced=tru e)
logoclip=Trim(clip,100,101)
clip=Trim(clip,33333,44444)

Undot()
Limiter()

NoLogoAuto(clip,logoclip,1)
video = SeparateFields().BicubicResize(480, 240)
evenfield = SelectEven(video).TemporalSoften(1,5,8,5,2).peachs moother().Unfilter(60,0)
oddfield = SelectOdd(video).TemporalSoften(1,5,8,5,2).peachsm oother().Unfilter(60,0)
Interleave(evenfield,oddfield)
Weave()
Letterbox(16,16,16,16)
Limiter()
The line "logoclip=Trim(clip,100,101)" is to create a separate clip from the original source that contains the logo on a black frame (this assumes that the logo is at frame 100). When I call NoLogoAuto, the logo frame number is 1 since the logoclip is only 1 frame long.

You could try this, but I don't know if it will work:
Quote:
MPEG2Source("C:\My Documents\noisy.d2v").converttoYUY2(interlaced=tru e)
clip=Trim(33333,44444)
#logo on a black frame is at frame number:100
NoLogoAuto(clip,clip,100)
Reply With Quote
  #10  
10-30-2003, 09:29 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
My actual script is below. It does run, but does not remove logo. The logo is on a black frame #20070. I had to put "clip" in several statements [undot(clip), etc] to get it to run. I tried both NoLogoAuto statements and even included frame 20070 within clip itself.


LoadPlugin("c:\video\dlls\MPEG2DEC3.dll")
LoadPlugin("C:\video\dlls\old\loadpluginex2.dll")
LoadPlugin("C:\video\dlls\old\LogoTools.dll")
LoadPlugin("c:\video\dlls\undot.dll")
LoadPlugin("c:\video\dlls\unfilter_2.5\unfilter.dl l")
LoadPlugin("c:\video\dlls\peachsmoother.dll")

clip=Mpeg2source("H:\fut16\fut16.d2v").converttoYU Y2(interlaced=true)
logoclip=Trim(clip,20070,20071)
clip=trim(clip,3067,20056)+Trim(clip,25940,49383)+ Trim(clip,20070,20071)

Undot(clip)
Limiter(clip)
#NoLogoAuto(clip,clip,20070)
NoLogoAuto(clip,logoclip,1)
video = SeparateFields(clip).BicubicResize(352, 239)
evenfield = SelectEven(video).TemporalSoften(1,5,8,5,2).peachs moother().Unfilter(60,0)
oddfield = SelectOdd(video).TemporalSoften(1,5,8,5,2).peachsm oother().Unfilter(60,0)
Interleave(evenfield,oddfield)
Weave(clip)
Letterbox(16,16,16,16)
Limiter(clip)
Reply With Quote
  #11  
10-31-2003, 02:17 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Your script will not only not remove the logo but would also not apply most of your filters. Here is what you script should look like:

Quote:
LoadPlugin("c:\video\dlls\MPEG2DEC3.dll")
LoadPlugin("C:\video\dlls\old\loadpluginex2.dll")
LoadPlugin("C:\video\dlls\old\LogoTools.dll")
LoadPlugin("c:\video\dlls\undot.dll")
LoadPlugin("c:\video\dlls\unfilter_2.5\unfilter.dl l")
LoadPlugin("c:\video\dlls\peachsmoother.dll")

clip=Mpeg2source("H:\fut16\fut16.d2v").converttoYU Y2(interlaced=true)
logoclip=Trim(clip,20070,20071)
clip=trim(clip,3067,20056)+Trim(clip,25940,49383)+ Trim(clip,20070,20071)

NoLogoAuto(clip,logoclip,1)
#we no longer need to specify our default clip.

Undot()
Limiter()
video = SeparateFields().BicubicResize(352, 239)
evenfield = SelectEven(video).TemporalSoften(1,5,8,5,2).peachs moother().Unfilter(60,0)
oddfield = SelectOdd(video).TemporalSoften(1,5,8,5,2).peachsm oother().Unfilter(60,0)
Interleave(evenfield,oddfield)
Weave()
Letterbox(16,16,16,16)
Limiter()
Reply With Quote
  #12  
10-31-2003, 02:31 AM
EightBall EightBall is offline
Free Member
 
Join Date: Apr 2002
Posts: 167
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry, I go to link but dont see how to get Avisynth 2.5 version. I see it says to use LoadPluginEx.dll, but where is that.

I click on how to and it takes me to a page which says see zip file.

Does that mean the zip file for avisynth 2.0 file?
Reply With Quote
  #13  
10-31-2003, 03:26 AM
dongxu dongxu is offline
Free Member
 
Join Date: Sep 2003
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
that means that there is no Avisynth 2.5 version. you have to use the 2.0 version for 2.5 through the plugin "LoadPluginEx.dll", which can be downloaded somewhere else.
Reply With Quote
  #14  
10-31-2003, 05:00 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MrTibs
Your script will not only not remove the logo but would also not apply most of your filters. Here is what you script should look like:

Quote:
LoadPlugin("c:\video\dlls\MPEG2DEC3.dll")
LoadPlugin("C:\video\dlls\old\loadpluginex2.dll")
LoadPlugin("C:\video\dlls\old\LogoTools.dll")
LoadPlugin("c:\video\dlls\undot.dll")
LoadPlugin("c:\video\dlls\unfilter_2.5\unfilter.dl l")
LoadPlugin("c:\video\dlls\peachsmoother.dll")

clip=Mpeg2source("H:\fut16\fut16.d2v").converttoYU Y2(interlaced=true)
logoclip=Trim(clip,20070,20071)
clip=trim(clip,3067,20056)+Trim(clip,25940,49383)+ Trim(clip,20070,20071)

NoLogoAuto(clip,logoclip,1)
#we no longer need to specify our default clip.

Undot()
Limiter()
video = SeparateFields().BicubicResize(352, 239)
evenfield = SelectEven(video).TemporalSoften(1,5,8,5,2).peachs moother().Unfilter(60,0)
oddfield = SelectOdd(video).TemporalSoften(1,5,8,5,2).peachsm oother().Unfilter(60,0)
Interleave(evenfield,oddfield)
Weave()
Letterbox(16,16,16,16)
Limiter()

Getting TMPGEnc error:

Evaluate: Unrecognized exception!
(H:\testtibb\testtibb16.AVS, line 17)


And a couple questions (please stay patient, I am learning and do appreciate your aid):

Is it possible to process in two steps? In other words, to produce a filtered mpg or m2v as I have been doing, then run again, without affecting compression, etc, and removing the logo in a second process.

I guess what I'm asking is whether you can process a previously encoded mpg and remove the logo without affecting anything else.

Or can you delogo process a capture without affecting the existing encoding, then encode with filters to produce the final mpg?
Reply With Quote
  #15  
10-31-2003, 07:42 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Well until now I didn't try my filtering routine in combination with MrTips Delogo routine ... so I can't give you a solution immideately.

But ...

Quote:
Evaluate: Unrecognized exception!
Sometimes can be solved if you just restart your PC

I had these Problems too when Avisynth got "too hot" (sound stupid but I don't know how to explain using other words *g*) during much tryings and changings.

What happens when you load this last script in Vdub???
Also same Error?


MOMENT!! STOP now I see!

Code:
LoadPlugin("c:\video\dlls\MPEG2DEC3.dll") 
LoadPlugin("C:\video\dlls\old\loadpluginex2.dll") 
LoadPlugin("C:\video\dlls\old\LogoTools.dll") 
LoadPlugin("c:\video\dlls\undot.dll") 
LoadPlugin("c:\video\dlls\unfilter_2.5\unfilter.dll") 
LoadPlugin("c:\video\dlls\peachsmoother.dll") 

clip=Mpeg2source("H:\fut16\fut16.d2v").converttoYUY2(interlaced=true) 
logoclip=Trim(clip,20070,20071) 
clip=trim(clip,3067,20056)+Trim(clip,25940,49383)+Trim(clip,20070,20071) 

NoLogoAuto(clip,logoclip,1) 
#we no longer need to specify our default clip. 

Undot() 
Limiter() 
video = SeparateFields().BicubicResize(352, 239) 
evenfield = SelectEven(video).TemporalSoften(1,5,8,5,2).peachsmoother().Unfilter(60,0) 
oddfield = SelectOdd(video).TemporalSoften(1,5,8,5,2).peachsmoother().Unfilter(60,0) 
Interleave(evenfield,oddfield) 
Weave() 
Letterbox(16,16,16,16) 
Limiter()
You only put the mpeg2source within a varaible "clip"... and this variable "clip" will only be called in the delogo routine!
So .... after this threre doesn't exist anymore a self based mpeg2source-line which provide the frames to the following filter routines!

Im thinking right !???
Maybe Im confused but this sounds logical ... I would like to attend, but at work (where I'm now) I'm working on a MAC
Reply With Quote
  #16  
10-31-2003, 09:50 AM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Hm...

Once NoLogo is called, it returns the filtered clip back to the default clip. Clearly, Undot and Limiter don't have trouble so I'm not sure why the problem.

Perhaps NoLogo isn't returning the clip properly.
You could try this:

Quote:
clip=NoLogoAuto(clip,logoclip,1)
#we no longer need to specify our default clip.

Undot(clip)
Edit: I tested your script with an MJpeg source in Avisynth 2.0 and it worked quite well. (Nice script by the way.) I'll test in 2.5 later today.
Reply With Quote
  #17  
10-31-2003, 10:25 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MrTibs
Hm...

Once NoLogo is called, it returns the filtered clip back to the default clip. Clearly, Undot and Limiter don't have trouble so I'm not sure why the problem.

Perhaps NoLogo isn't returning the clip properly.
You could try this:

Quote:
clip=NoLogoAuto(clip,logoclip,1)
#we no longer need to specify our default clip.

Undot(clip)
Edit: I tested your script with an MJpeg source in Avisynth 2.0 and it worked quite well. (Nice script by the way.) I'll test in 2.5 later today.
The script is by Incredible. It is the only script I've found that will make a smooth copy of Futurama. There is a scene in the one I use for test that is a takeoff of twilight zone and has a digital clock moving on a black space background. With his script, the motion is perfect, with all others, there are various degrees of small motion jerks.

Also, I have been testing requant with a mpg from this script and same source. Requant is fine up to 82.5% compression, so you might want to experiment with it some. It's fast and simple to use.

Is there any way to delogo an encoded mpg without affecting the size, bitrates, etc? Like things I've encoded in the past and didn't keep the large capture files?

Really appreciate everything - NickSteel
Reply With Quote
  #18  
10-31-2003, 11:07 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
[quote="MrTibs"]Hm...

Perhaps NoLogo isn't returning the clip properly.
You could try this:

Quote:
clip=NoLogoAuto(clip,logoclip,1)
#we no longer need to specify our default clip.

Undot(clip)
Just tried this. Script ran, but logo was unaffected.
Reply With Quote
  #19  
10-31-2003, 12:52 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
OK, now we are getting somewhere.

Change the frame number in NoLogoAuto to a negative. This will put NoLogoAuto into debug mode and show you where it thinks the logo is.

Quote:
clip=NoLogoAuto(clip,logoclip,-1)
Reply With Quote
  #20  
10-31-2003, 01:25 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MrTibs
OK, now we are getting somewhere.

Change the frame number in NoLogoAuto to a negative. This will put NoLogoAuto into debug mode and show you where it thinks the logo is.

Quote:
clip=NoLogoAuto(clip,logoclip,-1)
I didn't have the clip=NoLogoAuto(clip,logoclip,1) command in, only the Undot(clip) when I said the script ran without removing logo. When using both clip=NoLogoAuto(clip,logoclip,1) and Undot(clip),

TMPGEnc gives "Evaluate: Unrecognized exception! (H:\testtibb\testtibb16.AVS, line 17"

LoadPlugin("c:\video\dlls\MPEG2DEC3.dll")
LoadPlugin("C:\video\dlls\old\loadpluginex2.dll")
LoadPlugin("C:\video\dlls\old\LogoTools.dll")
LoadPlugin("c:\video\dlls\undot.dll")
LoadPlugin("c:\video\dlls\unfilter_2.5\unfilter.dl l")
LoadPlugin("c:\video\dlls\peachsmoother.dll")

clip=Mpeg2source("H:\fut16\fut16.d2v").converttoYU Y2(interlaced=true)
logoclip=Trim(clip,20070,20071)
clip=trim(clip,3067,20056)+Trim(clip,25940,49383)+ Trim(clip,20070,20071)

#NoLogoAuto(clip,logoclip,-1)
#we no longer need to specify our default clip.
clip=NoLogoAuto(clip,logoclip,-1)
Undot(clip)
Limiter()
video = SeparateFields().BicubicResize(352, 239)
evenfield = SelectEven(video).TemporalSoften(1,5,8,5,2).peachs moother().Unfilter(60,0)
oddfield = SelectOdd(video).TemporalSoften(1,5,8,5,2).peachsm oother().Unfilter(60,0)
Interleave(evenfield,oddfield)
Weave()
Letterbox(16,16,16,16)
Limiter()
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Light Noise removal filter supermule Avisynth Scripting 15 05-18-2006 09:03 AM
Recording Video: Logo Removal nicksteel Video Encoding and Conversion 3 11-24-2003 08:21 AM
KVCD: logo removal on previously encoded captures? nicksteel Video Encoding and Conversion 2 11-02-2003 05:22 AM
Avisynth: Dekafka Logo Removal (like on the SciFI channel) nicksteel Avisynth Scripting 17 10-29-2003 09:56 PM
Avisynth: New Logo removal filter (alpha) - comments welcome MrTibs Avisynth Scripting 1 08-08-2003 05:44 PM

Thread Tools



 
All times are GMT -5. The time now is 12:34 AM  —  vBulletin Jelsoft Enterprises Ltd