digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: New Logo Removal filter (http://www.digitalfaq.com/archives/avisynth/6370-avisynth-logo-removal.html)

MrTibs 10-27-2003 06:15 PM

New Logo Removal filter
 
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

Dialhot 10-27-2003 06:52 PM

AddLogo ! Great ! A lot of people claimed for taht also.

Congratulation.

MrTibs 10-27-2003 07:03 PM

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.

Zyphon 10-28-2003 11:03 AM

Thanks for these logo removal tools Mr Tibs im off to download them now. :)

MrTibs 10-29-2003 09:50 PM

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)

nicksteel 10-30-2003 10:40 AM

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"?

:roll: 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'

MrTibs 10-30-2003 04:23 PM

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.

nicksteel 10-30-2003 05:17 PM

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()

MrTibs 10-30-2003 06:59 PM

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)

nicksteel 10-30-2003 09:29 PM

MrTibbs, I'm trying...................
 
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)

MrTibs 10-31-2003 02:17 AM

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()


EightBall 10-31-2003 02:31 AM

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?

dongxu 10-31-2003 03:26 AM

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.

nicksteel 10-31-2003 05:00 AM

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?

incredible 10-31-2003 07:42 AM

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 :wink:

MrTibs 10-31-2003 09:50 AM

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.

nicksteel 10-31-2003 10:25 AM

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

nicksteel 10-31-2003 11:07 AM

[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.

MrTibs 10-31-2003 12:52 PM

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)

nicksteel 10-31-2003 01:25 PM

Sorry, MrTibbs
 
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()

MrTibs 10-31-2003 05:00 PM

I re-created you script using a Mpeg2 source and confirmed the issue. (funny that it didn't come up with an Mjpeg source?) It was a problem with a error message that wan't comming up.

I have "fixed" the dll and re-posted it on to my site. Please download the new version and try again.


Sorry about that.

incredible 10-31-2003 07:28 PM

Quote:

Originally Posted by MrTibs
Sorry about that.

Take it easy! :wink:
Thats why we are here, ... to figure out and optimize.
Anyhow GREAT work MrTips!

digitall.doc 11-01-2003 11:40 AM

Hi Mr Tibs, hi Nicksteel, hi incredible:
I'm jumping here from VideoCapture forum. As I explained there I've been making use of Xlogo. But I'm now giving a try NoLogo filter.

I work also with mpeg2 captures, so my case is similar to Nicksteel'.
I managed to make the filter work. NoLogoAuto detected the logo, but it just "painted" it in black, and now I've got the same logo but in black 8) (I really don't know if this is the way the filter is supposed to work. Please Mr Tibs, make me know).

So I tried NoLogoM,... but I just donīt know what the parameters are supposed to do, and how to adjust them. These are my last adjustments:
Quote:

NoLogoM(clip,logoclip,6,10,578,42,80,26,1,255,30)
But with these ones, all I get is a black logo (smaller than that with NoLogoAuto, but still visible in black) :( .

Can you help me with these parameters?. Because I still haven't compared it with Xlogo, but I believe it works faster, and maybe as the conversion is to YUY2 and back to YV12, we wonīt lose much quality.
Thanx for your filter, and for your help. As you see, several of us are interested in your work, Mr Tibs. :D

nicksteel 11-01-2003 03:02 PM

I'm getting same results.

MrTibs 11-01-2003 03:10 PM

@digitall.doc

To answer your question, no NoLogo is not supposed to turn the logo black. Infact, you should get very simular results from NoLogo and Xlogo even though they are not based on the same source code.

I suspect that when you get a black logo result, you are applying the filter to a frame where the logo wasn't present. This is what I created the IfLogo and IfNoLogo filters for.

The first thing I would try is put NoLogoAuto into debug mode (see higher in this thread). Next I would make a note of the frame number with a black logo and then comment out NoLogo and re-check the source frame to see if it is there. Finally, I would double check the frame I was using as my logo source frame to be sure the logo is there also.

Judging from your NoLogoM settings, the logo you are trying to remove is in the top right of the frame. The settings you choose are:

1=Use the full opacity of the logo. (If you find the logo is removed well in darker areas but too much in lighter areas, reduce this number to fractions of one.)
255=Change the scale for the removal from 222 to 255. You modify this if you find the the logo is under or over corrected in the darker or lighter ares but pretty good in the centre.
30=lighten the area under the logo by 30. If the logo is removed correctly but is leaving a dark "shadow" behind. (Use negative numbers to darken the area under the logo.)

If all that fails, send me a couple of screen shots of the problem frame before removal (and the logo on a black background). (mrtibsvideo@yahoo.com)

digitall.doc 11-03-2003 08:00 AM

Hi MrTibs:
sorry I didn't answer earlier: job. I tried putting NoLogoAuto in debug mode... what's supposed to have happend?. All I can see is the image with irregular white lines across the image, and the logo surrounded in white, and the logo white parts in black. When comment out NoLogoAuto, the logo is there, as you said. And my logoclip has the logo indeed. :roll:
So, I guess I'll try to make a couple of screenshots, and send then to you, to see what I'm doing wrong. :?

MrTibs 11-03-2003 02:11 PM

I suspect that the logo you are trying to remove is not transparent but opaque. Does the logo seem transparent when it is over lighter (not white) areas?

It is pretty easy to test this using LumaGraph. Download lumagraph from my site and set it so the the revesed line goes through the middle of the logo. Load the script into Vdub and watch the graph where the logo is. If the values of the logo area don't fluctuate, then you have a opaque logo. If they move up and down with the area around them, the his is probably a semi-transparent logo.

To explain what "may" be happening... If the brightness of the logo is always 238 or higher, then NoLogo is always going to remove at least 238 from the frame thus producing a black logo. With transparent logos, the difference between the area behind the logo and the logo is proportional to the value above the logo in LumaGraph. I know that sounds confusing but if you watch the video with LumaGraph running, you'll see what I mean.

Edit: is the logo you are trying to remove the space channel logo? Perhaps I can try capturing from a friend's house so that I can work on an actual sample.

digitall.doc 11-03-2003 05:18 PM

Mr Tibs:
Oh, you're right, my friend. I'm afraid it's an opaque one (you can see it in the screenshots I sent you). And now I can remember than your previous filter LogoBlend was intended to remove transparent logos, and I guess that is the same for NoLogo. :oops:
I'm sorry if this is the case, I made you lose your time. If not, and I can still remove my logo with your filter, make me know.
I'll wait for your news 8O 8O 8O

MrTibs 11-04-2003 12:22 AM

Your best bet is XLogo or DeKafka. Here is my version of DeKafka

Quote:

################################
logoframe=4
brightnesschange=20
xpos=273
ypos=374
width=34
height=65
xborder=352-xpos-width
yborder=480-ypos-height
#####################################

topline=clip.crop(xpos,ypos,width,1)
bottonline=clip.crop(xpos,ypos+height,width,1)
logosrc=StackVertical(topline,bottonline).blur(1.5 ,0).bilinearResize(34,height)
logosrc=Addborders(logosrc,xpos,ypos,xborder,ybord er)
LogoMask(clip,logosrc,logoclip,logoframe,brightnes schange,xpos,ypos,width,height)
This would work just like NoLogo. You could use Xlogo to get the dimensions. The advantage of using this DeKafka is you don't need to create a template.

digitall.doc 11-04-2003 03:09 AM

Hi Mr Tibs:
Hmmm... sorry... thank you... errr :cry:
Well, I will try Dekafka. But as I'm so lazy after so much testing :oops: , can you help me with a couple of things... else:
- In what colorspace does Dekafka work (I work in YV12)?
- Does it work with Avisynth 2.5.2?
- Do you know if it converts internally to another colorspace (slower,...)?
- And... where can I download it from?

Buf, thank you friend.

digitall.doc 11-04-2003 08:32 AM

Ok, Ok, I guess you think I shouldn't be so lazy :lol: so I looked for some information on Dekafka (Doom9 forum, avisynth,..) but not much.
In avisynth page I found a function, similar to your Dekafka version, but not the same. So, is your Dekafka version to be included directly in the script, or to be saved as a function (*.avsi)?. Is it supposed to substitute the Dekafka function?. And, last (by now), what function is LogoMask, do I have to load a .dll, or is included in avisynth?.
Sorry me for making so many questions, but you're very helpful and I'm learning a lot :wink: .

MrTibs 11-04-2003 09:35 AM

DeKafka is not realy a filter but rather a script function. It uses standard filters to do the job. The Dekafka script function and be downloaded from the avisynth site. It is designed for 2.5 and YV12. It doesn't do internal colour conversion.

My Dekafka will work for either 2.x or 2.5 and is designed for YUY2. You can use my DeKafka simply by pasting it into you script after de-interlacing. Then adjust the variables until it does the job.

nicksteel 11-04-2003 10:55 AM

MrTibbs, DeKafka
 
Can you change setting in your "DeKafka" that will highlight logo area, like 0 in NoLogo?

MrTibs 11-04-2003 11:14 AM

Yes, set brigthness change to 0 and it will show you the logo area:

Quote:

################################
logoframe=4
brightnesschange=0
xpos=273

nicksteel 11-04-2003 11:24 AM

Quote:

Originally Posted by MrTibs
Yes, set brigthness change to 0 and it will show you the logo area:

Quote:

################################
logoframe=4
brightnesschange=0
xpos=273

Actually, 0 removes the logo.

LoadPlugin("C:\aa\MPEG2Dec3.dll")
LoadPlugin("C:\aa\old\loadpluginex2.dll")
LoadPlugin("C:\aa\old\LogoTools.dll")
LoadPlugin("C:\aa\undot.dll")

logoclip=avisource("c:\aa\testsource.avi").convert toYUY2(interlaced=true)

clip0=avisource("c:\aa\testsource.avi").converttoY UY2(interlaced=true)

clip1=avisource("c:\aa\testsource.avi").converttoy uy2()
clip2=avisource("c:\aa\testsource.avi").converttoy uy2()
clip3=avisource("c:\aa\testsource.avi").converttoy uy2()
clip4=avisource("c:\aa\testsource.avi").converttoy uy2()
clip5=avisource("c:\aa\testsource.avi").converttoy uy2()
clip6=avisource("c:\aa\testsource.avi").converttoy uy2()
clip7=avisource("c:\aa\testsource.avi").converttoy uy2()
clip8=avisource("c:\aa\testsource.avi").converttoy uy2()
clip9=avisource("c:\aa\testsource.avi").converttoy uy2()
clip=clip0+clip1+clip2+clip3+clip4+clip5+clip6+cli p7+clip8+clip9

undot(clip)

################################
logoframe=4
brightnesschange=0
xpos=540
ypos=410
width=110
height=28
xborder=352-xpos-width
yborder=480-ypos-height
#####################################

topline=clip.crop(xpos,ypos,width,1)
bottonline=clip.crop(xpos,ypos+height,width,1)
logosrc=StackVertical(topline,bottonline).blur(1.5 ,0).bilinearResize(34,height)
logosrc=Addborders(logosrc,xpos,ypos,xborder,ybord er)
LogoMask(clip,logosrc,logoclip,logoframe,brightnes schange,xpos,ypos,width,height)

MrTibs 11-04-2003 02:15 PM

First, you are right, I had removed the debug mode from LogoMask and hadn't changed the documenatation. :oops:

Second, I went back to check DeKafka and it does convert to RGB so it may not work some some others. :oops: :oops:

Third, presently LogoMask only operates on the Luma so you may not get the results you desire. I did a quick hack to make it work in colour as well, but I can't post it until later today.


For now, here are the changes that should work for you. I tested it on my sample video so it should work for you.

Quote:

################################
logoframe=4
brightnesschange=5
xpos=540
ypos=410
width=110
height=28
xborder=Width(clip)-xpos-width
yborder=Height(clip)-ypos-height
#####################################

topline=clip.crop(xpos,ypos,width,1)
bottonline=clip.crop(xpos,ypos+height,width,1)
logosrc=StackVertical(topline,bottonline).blur(1.5 ,0).bilinearResize(34,height)
logosrc=Addborders(logosrc,xpos,ypos,xborder,ybord er)
# uncomment following line for debug mode
logosrc=logosrc.Levels(0,1,255,255,0)

LogoMask(clip,logosrc,logoclip,logoframe,brightnes schange,xpos,ypos,width,height)
On the otherhand, you could use the existing DeKafka before you do any colour conversion. I would suggest you either use the exising DeKafka or wait a day so that I can work on my DeKafka script a little bit. (I wrote it as an example rather than a ready-to-use function.)

nicksteel 11-04-2003 02:48 PM

I'll wait, as your functions are much easier to use. I tried xlogo until I gave up in frustration.

nicksteel 11-04-2003 03:15 PM

My captures are YV12, so I only do conversion if filters require it. How should I use "brightnesschange"? For instance, should I start at some value and increase/decrease until the logo disappears?

I like this version of DeKafka.

MrTibs 11-05-2003 09:29 AM

@nicksteel

I would start out at say 20 and increase as us suggest. The debug line I added in the last post should show you the logo area. I would uncomment the debug line and play with the brightness change until the logo is clearly outlined. I don't know how much noise there is in your source but I don't realy undersand why it wouldn't work with a brightnesschange of 5. (Perhaps I am still missing something.)

nicksteel 11-05-2003 10:42 AM

Quote:

Originally Posted by MrTibs
@nicksteel

I would start out at say 20 and increase as us suggest. The debug line I added in the last post should show you the logo area. I would uncomment the debug line and play with the brightness change until the logo is clearly outlined. I don't know how much noise there is in your source but I don't realy undersand why it wouldn't work with a brightnesschange of 5. (Perhaps I am still missing something.)

See what you mean. I would find it nice if a debug line could outline the xy borders around the logo so the mask area would be very obvious.


All times are GMT -5. The time now is 11:43 PM  —  vBulletin Đ Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.