VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Member TeNSoR's Avatar
    Join Date
    Mar 2014
    Location
    Hungary, Debrecen
    Search PM
    Hello!

    Is there's any possibility to load virtualdub plugins like for example "Logo away" or "Film dirt cleaner" in AvsPmod and save it as avs file
    to encode it with avisynth? Thanks in advance!
    Quote Quote  
  2. Member TeNSoR's Avatar
    Join Date
    Mar 2014
    Location
    Hungary, Debrecen
    Search PM
    The problem Avisynth crashes with this filter "InpaintFunc".
    Quote Quote  
  3. 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.
    Quote Quote  
  4. Originally Posted by TeNSoR View Post
    The problem Avisynth crashes with this filter "InpaintFunc".
    Crashes or freezes? When I have a logo throughout an entire movie, it might take the length of the movie or even more just for it to open. And make sure not to use any other filters besides InPaintFunc in the script, so it doesn't slow down even more.
    Quote Quote  
  5. While we're on the subject (given I've been using InpaintFunc a bit more lately)......

    manono,
    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(0,49)\
    ++Trim(50,499).InpaintFunc(mask="D:\logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20, ppmode=3, pp=75)\
    ++Trim(500,549)\
    ++Trim(550,999).InpaintFunc(mask="D:\logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20, ppmode=3, pp=75)\
    ++Trim(1000,0)

    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(0,49)\
    ++Trim(50,499).InpaintFunc(mask="D:\Copy 1 logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20)\
    ++Trim(500,549)\
    ++Trim(550,999).InpaintFunc(mask="D:\Copy 2 logo.bmp", loc="1012,612,-84,-48", mode="both", speed=20)\
    ++Trim(1000,0)

    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.

    Cheers.
    Quote Quote  
  6. Member TeNSoR's Avatar
    Join Date
    Mar 2014
    Location
    Hungary, Debrecen
    Search PM
    Thanks guys, I will try to install another version of avisynth.
    Quote Quote  
  7. Originally Posted by hello_hello View Post
    manono,
    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,
    Yeah, there's no point in having it work where there's no logo. In fact, it'll mess up the video by 'delogoing' where's there's no logo. I often do it that way myself - use trims to section off where I want it to work.
    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 don't know whether or not it makes a difference, but I always specify coordinates. One kind of logo that definitely needs coordinates is scrolling banners taking up the entire screen left to right near the bottom. I see that with some regularity. And other times logos might span two different areas and won't be entirely removed if you specify a single area (BR, for example).

    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.
    Quote Quote  
  8. Cheers.
    I have a feeling I've asked before... a long time ago.... but what do you use for the "see through" logos?
    Quote Quote  
  9. Originally Posted by hello_hello View Post
    I have a feeling I've asked before... a long time ago.... but what do you use for the "see through" logos?
    I use LogoTools. XLogo can also do the job but I often can't get it set up properly and gave up on it. I'll enclose everything you might need for LogoTools.
    Image Attached Files
    Quote Quote  
  10. Awesome! Thank you.
    Quote Quote  
  11. manono,
    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.

    Thanks.

    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?

    LoadPlugin("C:\Program Files\AviSynth\LogoTools\LoadPluginEx2.dll")
    LoadPlugin("C:\Program Files\AviSynth\LogoTools\LogoTools.dll")
    LoadPlugin("C:\Program Files\AviSynth\LogoTools\medianblur.dll")

    A=FFVideoSource("E:\video.mkv", threads=1).ConvertToYUY2()
    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
    #D=NoLogoM(A,B,0,2,428,288,84,44,1.05,210,0)

    E=IfNoLogo(A,D,B,0,20,25,428,288,84,44)

    F=E.ConvertToYV12().MedianBlur(2,2,2).ConvertToYUY 2()

    LogoMask(E,F,C,0,5,428,288,84,44)

    ConvertToYV12()
    Quote Quote  
  12. 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:

    A=Last
    B=A.MedianBlur(2,2,2)
    Mask=ImageSource("Logo2.bmp")
    C=Overlay(A,B,0,0,Mask)
    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.
    You want to find a frame with the logo on a black background, or at least with black around the logo. So, yes, the frame used does make a difference. You might still find good settings to use but it's easier for the filter to 'see' the logo if there's black around it.
    Quote Quote  
  13. 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.

    Thanks.
    Quote Quote  
  14. 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.

    B=ImageSource("logo.bmp").ConvertToYUY2()
    AVISource("Movie.avi")
    ConvertToYUY2()

    A=Last

    NoLogoM(A,B,68071,1,80,220,128,42,0.8,380,1)
    ConvertToYV12
    #X=Last
    #ReplaceFramesSimple(A,X,Mappings="[2942 109829] ")#####this and the previous line when specifying which frames to delogo


    A=Last
    B=A.MedianBlur(3,3,3).AddGrain(7,0,0)
    Mask=ImageSource("LogoBlur.bmp")
    Overlay(A,B,0,0,Mask)
    #Y=Last
    #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:

    https://www.youtube.com/watch?v=kmjxa60gTLE
    Image Attached Thumbnails Click image for larger version

Name:	LogoBlur.jpg
Views:	155
Size:	7.3 KB
ID:	35968  

    Last edited by manono; 1st Mar 2016 at 18:30.
    Quote Quote  
  15. Originally Posted by manono View Post
    Sorry, but I didn't understand any of that.
    All I meant was.... you find frame number 648 has the logo on a black background in the original clip. You can specify that as the logo clip along with frame number 648. It's just a single image.
    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.

    Originally Posted by manono View Post
    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.
    I guess that's what I was trying to determine.... what a "feathering pic" actually is. I wasn't sure. ie the original logo, the original logo as 100% white, or something in between etc.

    Originally Posted by manono View Post
    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.
    Cheers.
    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.

    A=FFVideoSource("E:\video.mkv", threads=1).ConvertToYUY2()
    B=ImageSource("D:\logo.bmp").ConvertToYUY2() # image of original logo with black background
    C=NoLogo(A,B,0,5,428,288,84,44)
    D=C.ConvertToYV12().MedianBlur(2,2,2).ConvertToYUY 2()
    LogoMask(C,D,B,0,5,428,288,84,44)
    ConvertToYV12()
    I was keen on getting the IfNoLogo function to work because (tell me if I'm missing something) if you use this plugin to de-logo frames without a logo you end up with a dark outline where the logo would normally be, whereas InPaintFunc would just blur it, so I wanted to see if IfNoLogo would reduce the work involved specifying which frames to de-logo. For the record, I got it to work like this:

    A=FFVideoSource("E:\video.mkv", threads=1).ConvertToYUY2()
    B=ImageSource("D:\logo.bmp").ConvertToYUY2() # image of original logo with black background
    C=NoLogo(A,B,0,2,428,288,84,44)
    D=C.ConvertToYV12().MedianBlur(2,2,2).ConvertToYUY 2()
    E=LogoMask(C,D,B,0,5,428,288,84,44)
    IfNoLogo(E,A,B,0,20,25,428,288,84,44)
    ConvertToYV12()
    In theory, that'll leave frames without a logo untouched and only remove the logo and blur for frames containing the logo. In practice it's not perfect (although I'm testing with a logo that's not quite 100% transparent and it's still doing well). The detection seems to work according to a brightness difference. I still haven't quite got my head around it, but if a frame is very dark under the logo and the next frame is very bright, (or the other way around) it might fool the detection for a frame, and scenes where the logo itself fades-in or out can confuse it a little.

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



Similar Threads