+ Reply to Thread
Results 1 to 16 of 16
If you need a specific filter, there's probably an Avisynth equivalent.
Last edited by hello_hello; 23rd Feb 2016 at 13:34.
It shouldn't. I use it semi-regularly.
An error using InpaintFunc is more likely than a "crash". You might need to supply some more detail, such as the script you're using and confirming you have the InpaintFunc dependencies in the right places etc.
And don't forget.... the first time you run a script containing InpaintFunc, if you've created the necessary bitmap and it's all working correctly, it'll analyse the video and create an ebmp file. There's no "wait a minute" message, it just does it, and while it's doing so, which can take many minutes, it might appear everything's frozen. Check your CPU usage for activity. As soon as you try to play the script in AvsPMod you've probably committed to waiting.
I tend to create a script containing InPaintFunc, save it, and then open the script with another program..... usually MPC-HC (if you have Avisynth installed). That triggers the analysing of the video, MPC-HC can sit and wait 10 minutes for it to finish, and I can continue using MeGUI (in my case) rather than twiddle my thumbs.
While we're on the subject (given I've been using InpaintFunc a bit more lately)......
How vital do you think it is to analyse the whole video (where there's logo)? I ask, because several times I've re-encoded TV shows where the logo moves around for a few seconds after an ad break, then becomes static again, so I leave it alone where it's moving and remove it were it's static, resulting in a script like this (just making up frame numbers) so there's small sections after the ad-breaks that aren't touched.
++Trim(50,499).InpaintFunc(mask="D:\logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20, ppmode=3, pp=75)\
++Trim(550,999).InpaintFunc(mask="D:\logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20, ppmode=3, pp=75)\
When opening a script like that, the section between the opening credits and the first ad break is used for analysis, the ebmp file is created, and the next section between ad-breaks uses the same ebmp file, and so on. It makes for a quicker analysis because you're only analysing part of the video, and I'm not sure I've seen a better result for having analysed the whole thing instead. Have you tried any comparisons in that respect?
One way around it is to make copies of the logo bitmap and ensure each section uses a different copy, and therefore they're analysed individually, like this:
++Trim(50,499).InpaintFunc(mask="D:\Copy 1 logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20)\
++Trim(550,999).InpaintFunc(mask="D:\Copy 2 logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20)\
but so far I'm not sure how much extra benefit there is.
And one more question (sorry to sidetrack the thread a little TeNSoR). Do you find it's better to specify the exact logo co-ordinates as I did above, or does specifying a block of video (ie loc="BR") work just as well. Does it make any difference?
I assume at least part of the frame is converted to RGB and back, but I'm not sure exactly how that works either.
All of the above aside, in your experience does a lower value for the speed parameter (so less of the video is analysed) make a huge difference? The default is speed=5 which I assume means 25%. I've been using speed=20 which is 100% and fairly slow.
Okay..... just one more question..... is it best to leave the ppmode & pp paramters alone? Any tips? I haven't quite got my head around them.
Do you find it's better to specify the exact logo co-ordinates as I did above, or does specifying a block of video (ie loc="BR") work just as well.
I create a mask about 10 pixels out from the sides of the actual logo so that it 'feathers' or blends better back into the rest of the video.
I use Speed=10. I don't use much PP as I hate that wiggly stuff you get after the logo removal. I use a different blur and also add back some noise. I don't use it on 'see-through' logos, but only on the opaque ones.
I have a feeling I've asked before... a long time ago.... but what do you use for the "see through" logos?
Awesome! Thank you.
If you happen to return, I need help.........
Actually.... I think I've got my head around it now, except for the LogoMask function.
I tried the example script you included and everything's working (I discovered putting LogoTools.dll and LoadPluginEx2.dll in the Avisynth plugins folder was a recipe for unpleasantness very quickly) and I managed to add the IfNoLogo function so sections without a logo aren't de-logo-ed (although I do need to learn how to fine tune the detection a little), but I'm not able to get the LogoMask function working as I'd hoped.
I tried the method you suggested for creating a feathering mask and blurring the logo area a little, which of course works, but then I realised it blurs every frame, even where the IfNoLogo function decided there was no logo present. I thought using the LogoMask function would prevent that by just creating a mask and blurring for only the frames where the logo was actually removed, but if that's how it's supposed to work, I can't get it to work correctly. My script creating abilities aren't great though, so maybe I'm just not doing it properly.
Would you care to critique the script below? It seems to be working fine in that only the frames with the logo are being de-logo-ed, although if the background behind the logo is very bright, sometimes it thinks there's no logo present (hopefully I can fine tune that), but the mask and blurring is happening for every frame and if there's a way to prevent that, I'm too silly to work it out. I feel like I should be putting the LogoMask function before IfNoLogo, but I don't seem to be able to do it without something breaking.
PS. I've specified frame zero as the frame containing the logo in the source file each time as the saved bitmap is being used as the frame containing the logo. I assume it doesn't matter which frame number I specify, given they're all going to be exactly the same?
B=ImageSource("D:\logo1.bmp").ConvertToYUY2() # image of original logo with black background
C=ImageSource("D:\logo2.bmp").ConvertToYUY2() # logo1.bmp with the logo itself made pure white, intended for the mask
D=NoLogo(A,B,0,2,428,288,84,44) # or
You got the logo removed where you want but now you want to blur the remains slightly only on the frames where you used the logo? If so try something like this:
ReplaceFramesSimple(A,C,Mappings="[1000 2000] [9000 10000] [15000 16000]")###Frame numbers for doing the logo blurring
ReplaceFramesSimple is part of stickboy's RemapFrames. This might require some other editing of the original script. I've never used IfNoLogo and selectively remove the logo originally using something like the script above. And even that is a bit tricky because of going in and out of YUY2.
I've specified frame zero as the frame containing the logo in the source file each time as the saved bitmap is being used as the frame containing the logo.
Thanks. I'd assumed that because IfNoLogo could be used to de-logo only the frames with a logo, LogoMask could somehow be used to blur the logo area of just the de-logo-ed frames It seemed logical, but I guess that's not the case.
For the fame used for the logoclip..... I found a black frame with the logo and saved it as a bitmap. I assume normally that's the frame number you'd specify for the logoclip, but once it's saved as a bitmap and loaded with ImageSource, I assume every ImageSource frame will be the same and you can specify any frame number? I was just wondering if there's a reason why it has to be the same frame number as it was in the original clip.
Sorry, but I didn't understand any of that. Don't bother explaining. Your blurring and feathering BMP should be black and white with the only grey being where the feathering is to take place - where you blend them together. I'll enclose a pic of what I mean when I go to my encoding computer. You mentioned the white, but maybe you meant you left the rest of it as it was.
What follows is a script I used recently. The picture (converted to JPG because of its smaller size) is typically the kind of thing you could use for blurring, any Tweak needed and feathering.
#ReplaceFramesSimple(A,X,Mappings="[2942 109829] ")#####this and the previous line when specifying which frames to delogo
#ReplaceFramesSimple(A,Y,Mappings="[2942 243450]")#####this and the previous line when specifying which frames to blur and feather
Here's a partial result of this and a ton of other work done:
Last edited by manono; 1st Mar 2016 at 18:30.
In your sample script you appeared to have saved the frame as a bitmap, loaded it via ImageSource, then used it as the logo clip while specifying frame 648. All I was asking is, does the frame number matter because every frame will be exactly the same for the image loaded via ImageSource. I can't see why it would, so I've just been using frame zero.
I was just trying to see if I could use the internal functions and how different the result would be. According to the help file, you should use the same logo/clip/frame number for the LogoMask function as you're using for the logo removal. It seems to work pretty well, but I haven't tried creating the type of feathering mask you use yet. I'd be interested to learn how different the result is to the way you're doing it with OverLay(), but I can play around myself.
B=ImageSource("D:\logo.bmp").ConvertToYUY2() # image of original logo with black background
B=ImageSource("D:\logo.bmp").ConvertToYUY2() # image of original logo with black background
Anyway..... as I got it to work I thought you might want to try it. I'm not sure it's technically the best way to do it, but it's working. Doing it all "manually" the way you do will no doubt produce a better result, but for the times when I just want to de-logo without spending more time setting it up than I would watching it, the above method might do nicely. I'll play around a bit more.
Last edited by hello_hello; 1st Mar 2016 at 20:45.