VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 33
Thread
  1. I had a video that had dropouts which caused white lines to appear on the video and I used a script to remove the lines which basically just guessed the pixels that should be replaced. Can someone please suggest a similar script which can remove TV logos? I've attached a source clip. Also attached are 3 videos. The Challenge Logo video is the video logo sample used to remove the logo. One of the videos is the encoded result when using a video as a sample and the other video is the encoded result when using an image as a sample. I've done cleanup on the encoded videos. Cleanup was done after the logo script.

    Tried this script:
    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LoadPluginEx2.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LogoTools.dll")
    
    B=ImageSource("logo.bmp").ConvertToYUY2(Interlaced=true)
    
    A=MPEG2Source("E:\Bullseye Video Source to Encode.d2v").ConvertToYUY2(Interlaced=true)
    
    NoLogoAuto(A,B,1)
    It works but the frame number is actually for the image and it doesn't matter what frame number you use as the image is not a video so it only has 1 frame. Regardless the script works but it leaves a visible mark behind on black scenes.

    I tried the below which gets better results. It looks for a frame in a video sample which is all black apart from the logo.

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LoadPluginEx2.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Logo Removal\LogoTools\LogoTools.dll")
    
    clip=MPEG2Source("E:\Bullseye Video Source to Encode.d2v").ConvertToYUY2(Interlaced=True)  
    
    logoclip=MPEG2Source("E:\Challenge Logo.d2v").ConvertToYUY2(Interlaced=True)  
    
    NoLogoAuto(clip,logoclip,80)
    ConvertToYV12(Interlaced=True)
    Frame 80 is from logoclip which contains the logo sample.

    This video looks better than the image version but it still has some frames where the logo remains are still visible. On dark scenes or complex pattern scenes you can't see the logo but on lighter scenes you can see it. Is there anything else I can do to remove the remains of the logo?
    Image Attached Files
    Last edited by VideoFanatic; 12th Feb 2015 at 10:51.
    Quote Quote  
  2. There's dedicated plugins. Rm logo appears to be clever, but I've never used it.

    I don't do logo removal much myself but when I do I use ffdshow. You can use ffdshow filters in a script without using it to decode the video if you included the Avisynth plugin when installing ffdshow. To load ffdshow in a script you'd do it something like this:

    Load_Stdcall_Plugin("C:\Program Files\AviSynth 2.5\plugins\ffavisynth.dll")
    ffdshow(preset="default")

    Alternatively you could open a video with DirectShowSource() and use ffdshow for decoding.

    If you're familiar with ffdshow you might know you can create various presets. The above just uses the default. You'd enable the ffdshow "logoaway" filter and you're in business.
    In order to set it up, I open the source video with MPC-HC and get ffdshow to decode. That way it's easy to get the placement correct and see how it'll work before using it in a script (if you crop or resize you'd need to add ffdshow to the script first or it won't be in the same position as it is when viewing the source video with MPC-HC).
    There's a few different logo removal methods. One involves creating a bitmap image of the logo being removed which I'd assume should give the best result. I'd imagine it's the same method as described here. I just use the XY mode myself.

    Click image for larger version

Name:	ffdshow logo removal.gif
Views:	1276
Size:	17.1 KB
ID:	30133

    Very roughly, left 52, top 38, width 92, height 30, XY mode (ugly blob mode ).

    Click image for larger version

Name:	logoaway.jpg
Views:	1169
Size:	66.8 KB
ID:	30134
    Last edited by hello_hello; 9th Feb 2015 at 19:46.
    Quote Quote  
  3. Thanks but that screenshot has a blurry mark where the logo was which is just as bad as the logo! I'm looking for a script that guesses the pixels that would be in place of the logo if the logo wasn't there.
    Quote Quote  
  4. Here's a quick job using LogoTools. A better job can be done with the fine tuning scripts below the quick 'automatic' job I did. Those other scripts have nothing to do with your video, but are settings I used on other videos with logos. And you can also smooth out the noise you might see remaining in other parts of the video. It's explained in the included Doc. The '150' is the frame number used for the mask. I'll enclose the mask as well. The idea is to find the logo somewhere with black all around it (which you provided).

    LoadPlugin("F:\AVISynth\dlls\DGDecode.dll")

    LoadPlugin("F:\AVISynth\dlls\LoadPluginEx2.dll")
    LoadPlugin("F:\AVISynth\dlls\LogoTools.dll")

    B=ImageSource("logo.bmp").ConvertToYUY2()
    A=MPEG2Source("test.d2v").ConvertToYUY2(Interlaced =True)

    NoLogoAuto(A,B,150)
    #NoLogo(A,B,150,2,72,44,168,28)
    #NoLogoM(A,B,150,1,496,398,140,28,1.05,210,0)
    #B=Blur(1,1).Blur(1,1)#.Tweak(Sat=0,Coring=False)
    #Mask=ImageSource("Logo2.bmp")
    #Overlay(A,B,0,0,Mask)
    #ConvertToYV12(Interlaced=True)#I kept it YUY2 for the reencode using CCE
    Image Attached Thumbnails Click image for larger version

Name:	NoLogo.jpg
Views:	921
Size:	51.3 KB
ID:	30137  

    Click image for larger version

Name:	Logo.bmp
Views:	151
Size:	918.1 KB
ID:	30138  

    Image Attached Files
    Last edited by manono; 9th Feb 2015 at 21:32.
    Quote Quote  
  5. Originally Posted by VideoFanatic View Post
    Thanks but that screenshot has a blurry mark where the logo was which is just as bad as the logo! I'm looking for a script that guesses the pixels that would be in place of the logo if the logo wasn't there.
    Yep, I said it was the "ugly blob" method. I posted a link to an alternative plugin/script and an example of how to create a mask image. Sorry for not doing all the work.
    Quote Quote  
  6. Originally Posted by manono View Post
    Here's a quick job using LogoTools. A better job can be done with the fine tuning scripts below the quick 'automatic' job I did. Those other scripts have nothing to do with your video, but are settings I used on other videos with logos. And you can also smooth out the noise you might see remaining in other parts of the video. It's explained in the included Doc. The '150' is the frame number used for the mask. I'll enclose the mask as well. The idea is to find the logo somewhere with black all around it (which you provided).

    LoadPlugin("F:\AVISynth\dlls\DGDecode.dll")

    LoadPlugin("F:\AVISynth\dlls\LoadPluginEx2.dll")
    LoadPlugin("F:\AVISynth\dlls\LogoTools.dll")

    B=ImageSource("logo.bmp").ConvertToYUY2()
    A=MPEG2Source("test.d2v").ConvertToYUY2(Interlaced =True)

    NoLogoAuto(A,B,150)
    #NoLogo(A,B,150,2,72,44,168,28)
    #NoLogoM(A,B,150,1,496,398,140,28,1.05,210,0)
    #B=Blur(1,1).Blur(1,1)#.Tweak(Sat=0,Coring=False)
    #Mask=ImageSource("Logo2.bmp")
    #Overlay(A,B,0,0,Mask)
    #ConvertToYV12(Interlaced=True)#I kept it YUY2 for the reencode using CCE
    Thanks. I copied the 3 dll files into my plugins folder. When I try to just load the video in AvsPmod without any script, AvsPmod won't load. I only have this line: Mpeg2Source("E:\2 = New\Bullseye Clip with Logo.d2v"). AvsPmod loads the video when those dll files aren't in the plugins folder but when they are AvsPmod won't load.

    Also is it just these lines I need to try the automatic job?
    Code:
    LoadPlugin("F:\AVISynth\dlls\LoadPluginEx2.dll")
    LoadPlugin("F:\AVISynth\dlls\LogoTools.dll")
    
    B=ImageSource("logo.bmp").ConvertToYUY2()
    A=MPEG2Source("test.d2v").ConvertToYUY2(Interlaced=True)
    NoLogoAuto(A,B,150)
    Where did you get that bmp file as the video didn't have a completely black frame.
    Quote Quote  
  7. Originally Posted by VideoFanatic View Post
    When I try to just load the video in AvsPmod without any script, AvsPmod won't load.
    Maybe it's your screwy syntax (if your code below that sentence is any indication). Try doing it as I did in the script - use LoadPlugin lines and Source filters but modified for your own names and paths. Maybe it's because of having both the LoadPluginEx.dll and the LoadPluginEx2.dll. I included them both although the LoadPluginEx2.dll is required for newer AviSynths.
    Also is it just these lines I need to try the automatic job?
    No. If you use LoadPlugin lines then:

    LoadPlugin("F:\AVISynth\dlls\DGDecode.dll")
    LoadPlugin("F:\AVISynth\dlls\LoadPluginEx2.dll")
    LoadPlugin("F:\AVISynth\dlls\LogoTools.dll")

    B=ImageSource("logo.bmp").ConvertToYUY2
    A=MPEG2Source("test.d2v").ConvertToYUY2(Interlaced =True)#Interlaced=True sometimes isn't showing properly

    NoLogoAuto(A,B,150)

    Where did you get that bmp file as the video didn't have a completely black frame.
    I made it from frame number 150 of the sample. The logo has to be surrounded by black. Then it's easy enough to make the rest of the frame black.
    Last edited by manono; 10th Feb 2015 at 18:52.
    Quote Quote  
  8. Thanks got it working now. However I need to convert my video to YUY2. Doesn't this lose quality as I also have to convert back to YV12 as the clip is to be played back on a Bluray player?

    Those plugins don't seem to be very stable as the encoding crashes for me at around 90% completion. Also when not using the plugins and the plugins are still in the plugins directory, Avisynth crashes as soon as I try to encode something.

    Is there another option to remove the logo without converting the colour space? Or is there a way to only convert the colour space for the area around the logo?
    Last edited by VideoFanatic; 10th Feb 2015 at 18:55.
    Quote Quote  
  9. If you want to use the filter then you have to convert to YUY2. I'm sure there's a way to crop just around the logo, convert the colorspace, delogo it, convert back to YV12 and then replace it into the main video. But since my videos are black and white I haven't had (or cared enough) to do it that way. This is what I use for translucent logos. There are, of course, other delogo filters:

    http://avisynth.nl/index.php/External_filters#Logo_Removal

    X-Logo works well, if you can get it to work. And then there are the VDub delogo filters, but they'll require you to convert to RGB.
    Those plugins don't seem to be very stable as the encoding crashes for me at around 90% completion.
    I've never had the problem. It's fast and doesn't crash on me. Maybe there are other things in your script contributing to the instability.
    Quote Quote  
  10. The NoLogoAuto script crashes for me. I've got the following files in the plugins folder: LogoTools.dll and LoadPluginEx2.dll

    When I start Simple x264 Launcher (encoder) I get the following message:

    Code:
    A critical error was encountered while checking your Avisynth version.
    This is most likely caused by an erroneous Avisynth Plugin, please try to clean your Plugins folder!
    We suggest to move all .dll and .avsi files out of your Avisynth Plugins folder and try again.
    I clicked on Ignore.

    When I try to load the AVS script I get this message:
    Code:
    An Avisynth script was selected as input, although Avisynth is not available!
    I clicked on Ignore (at your own risk!) and it encodes but crashes at 95%.

    This is my script which loads fine in AvsPmod but crashes when encoding:
    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\LoadPluginEx2.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\LogoTools.dll")
    
    B=ImageSource("E:\2 = New\z = Encode\logo.bmp").ConvertToYUY2
    A=MPEG2Source("E:\2 = New\z = Encode\Bullseye Clip with Logo.d2v").ConvertToYUY2(Interlaced=True)
    
    NoLogoAuto(A,B,150)
    Also while those dll files are in the plugins folder, even when using a script that doesn't use those files, Avisynth crashes straight away. When I delete those files I can use Avisynth and encode without problems.
    Quote Quote  
  11. You say it opens fine in AvsPMod. It does the same in VDub, right? What happens when you make a Lagarith or some other lossless AVI? Does it work? In any event, I think you've only shown a problem when using Simple x264 Launcher. Maybe try using something else, like VDub as I suggested.

    ConvertToYUY2EG2Source
    That's a forum screwup, right? Like the problem I have sometimes with 'Interlaced=True' showing correctly?
    ConvertToYUY2(Interlaced=TrueLogoAuto(A,B,150)
    Another forum screwup?

    And it crashes when doing the whole thing? That '150' refers to the frame number in the sample. It would, of course, be a different frame number when encoding the entire video.
    Quote Quote  
  12. Yes the forum screwed up the code.

    Tried MeGUI and it crashes. Tried Vdub and it seems to be working. Why does it work in Vdub and not anything else when they both use the same Avisynth installation files - I've never understood why?

    I've got so many files that I just use MeGUI as it automates the muxing, encoding and everything. It's too slow doing everything manually in Vdub and I have to encode twice - once to AVI and 2nd time to h264. So I don't think I'll be using the logo removal script because it only works in Vdub but it's good to know if I really need logos removed that I now have the tools to do it.

    Any idea how to get the script working in multi-threaded mode? Usually I would do this:

    Code:
    setmtmode(5,9)
    Mpeg2Source("E:\2 = New\Typical.d2v")
    setmtmode(2)
    I also tried using InPaintFunc. The instructions are easy but AvsPmod complains about the width needing to be divisable by 4 or something. I crop the video before the script runs but then it says the mask image isn't the same dimensions as the video even though I cropped the image to the same size as well. Can't get past the errors.

    Is X-Logo the only script that works in YV12? Does anyone have a script for it please?
    Last edited by VideoFanatic; 11th Feb 2015 at 14:55.
    Quote Quote  
  13. I just checked my template script for NoLogo and found a 'SetMTMode(2)' at the top, so I've used it multi-threaded successfully in the past. For the short sample, after transferring the necessary parts to a different script, I didn't use it multi-threaded. But for such a short sample I doubt it would crash anyway. I do have lots of problems with encodes crashing and often disable multi-threading, but NoLogo isn't one of the problem filters for me. And I always make Lagarith AVIs because delogoing is just an early stage of a multiple encode 'restoration' of the old films I work on.

    I don't know why NoLogo works for an AVI encoded through VDub and not with other encoders.

    I use InPaintFunc a lot - for all my opaque logos. It's slow as Christmas, even just for it to open, so I doubt you'll like it much. The mask has to be exactly the same size as the video to which it's being applied and at the time it's being applied. So, do your cropping and resizing before then saving out a BMP to be used for a mask.

    I've used X-Logo before but found it more trouble than it's worth. There's a guide for its use here:

    https://forum.videohelp.com/threads/273109-Remove-an-opaque-logo-using-Xlogo-in-Avisynth
    Quote Quote  
  14. Originally Posted by manono View Post
    ...But since my videos are black and white I haven't had (or cared enough) to do it that way. This is what I use for translucent logos. There are, of course, other delogo filters:

    http://avisynth.nl/index.php/External_filters#Logo_Removal
    Just a quick question:

    Can I use this external filters to remove logos on mp4's using Avisynth on AVStoDVD ?

    Thx. in advance.
    Quote Quote  
  15. Originally Posted by DJ_ValBec View Post
    Can I use this external filters to remove logos on mp4's using Avisynth on AVStoDVD ?
    Since AvsToDVD uses AviSynth scripts and allows you to edit those scripts, then I don't see why not. I don't use AvsToDVD myself so someone more knowledgeable about the program should probably answer. You can ask in the dedicated AvsToDVD thread.

    I would suggest, though, that after editing the script and before encoding for DVD you test it out in VDub to make sure it's a good script.
    Quote Quote  
  16. manono I've updated my 1st post. Please have a read and let me know if you can help. Thanks
    Quote Quote  
  17. As I said before, I've used NoLogo before with just a simple 'SetMTMode(2)' as the first line in the script.

    I mentioned in my first reply to your thread, "A better job can be done with the fine tuning scripts below the quick 'automatic' job I did." The easy to set up NoLogoAuto setting isn't the best. The best is NoLogoM, but it takes some work to set it up properly. How to do that is explained in the doc. Removing logos isn't easy. Good luck.
    Quote Quote  
  18. I had a look at NoLogoM before but I didn't know what settings to use. I was hoping someone could advise me:
    All the documentation says is the below, it doesn't say how to find those settings:

    NoLogoM(min brightness change for logo, xpos of logo area, ypos of logo area, logo area width, logo area height, Correction,Scale, Offset)
    Quote Quote  
  19. The reason any logo remover will leave some artifacts in your case is your source has noise and compression artifacts around the logo , especially in the brighter scenes

    eg
    Name:  155.png
Views: 1673
Size:  4.9 KB

    point resized x2
    Name:  155_x2.png
Views: 1605
Size:  5.9 KB


    You won't be able to get good results with any logo remover unless you address that in some way, or use the "ugly bob" or some similar method
    Quote Quote  
  20. I've now denoised the videos and it made no difference.
    Quote Quote  
  21. Originally Posted by VideoFanatic View Post
    I've now denoised the videos and it made no difference.
    Just denoise? But did you get rid of the artifacts ? You need to get rid of those artifacts beforehand. Or no delogo filter or approach with any program will give good results, short of photoshop

    You'd be left with ugly artifacts, probably worse than if the logo was still there
    Quote Quote  
  22. Yes I denoised before the logo script. Made no difference. Thanks everyone for your help but I give up.
    Quote Quote  
  23. Other quick question:

    I remove logos on black bars using VidCoder (Fast solution for me since I'm new on this: by cut them off)
    Example:
    mp4
    Original 1280/720
    to 1280/"588"

    There is a way to return the black bars to their original size 720 ?
    Kind like revers it with-out the logo.
    Last edited by DJ_ValBec; 13th Feb 2015 at 17:46.
    Quote Quote  
  24. Originally Posted by DJ_ValBec View Post
    Other quick question:

    I remove logos on black bars using VidCoder (Fast solution for me since I'm new on this: by cut them off)
    Example:
    mp4
    Original 1280/720
    to 1280/"588"

    There is a way to return the black bars to their original size 720 ?
    Not using Avisynth.
    Code:
    AddBorders(0,64,0,68) # 588 lines back up to 720 lines
    Quote Quote  
  25. You're using VidCoder, so no. Use something better that allows you to open a video and then to edit the AviSynth script it creates with the AddBorders command as jagabo suggested. RipBot, the 5.0 version of XviD4PSP, MeGUI, etc.
    Quote Quote  
  26. I'm reading this threat:
    https://forum.videohelp.com/threads/340509-Need-Help-with-HandBrake-regarding-manual-cr...ing-and-resize

    If I crop with RipBot264 it will pad (resize) the borders back automatically to their original size ?
    Post #5
    Last edited by DJ_ValBec; 13th Feb 2015 at 17:46.
    Quote Quote  
  27. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    @VideoFanatic, what is the method used to obtain the videos ? i mean, did you capture, or use a hardware mpeg, dvd recorder or ripped (grab the actual stream) from the source through OTA capture device ? you are using low bitrate during your captures ? if you are, i would suggest raising the bitrate as high as the capture device allows and configure the setting encoding to CBR instead of VBR. also, it most likely is the station's fault for these artifacts due to the very low bitrates. i can see a lot of macroblocks in these videos.

    my point is, the hardware capture devices are most likely adding additional noise / jibblets around the logo. can you obtain the actual content of those clips ? unless your only method is through one of the capture methods mentioned above.
    Quote Quote  
  28. Originally Posted by DJ_ValBec View Post
    If I crop with RipBot264 it will pad (resize) the borders back automatically to their original size ?
    No, and I was wrong about being able to edit the script to AddBorders. I just checked. You can only do things it has boxes for, including cropping and resizing, not adding back black. The 5.0 version of XviD4PSP does allow complete freedom to edit the AviSynth script. Maybe it would be better for you to learn enough AviSynth to be able to do the things you want.
    VidCoder have Avisynth ?
    I already said, 'no'.
    Quote Quote  
  29. Originally Posted by vhelp View Post
    @VideoFanatic, what is the method used to obtain the videos ? i mean, did you capture, or use a hardware mpeg, dvd recorder or ripped (grab the actual stream) from the source through OTA capture device ? you are using low bitrate during your captures ? if you are, i would suggest raising the bitrate as high as the capture device allows and configure the setting encoding to CBR instead of VBR. also, it most likely is the station's fault for these artifacts due to the very low bitrates. i can see a lot of macroblocks in these videos.

    my point is, the hardware capture devices are most likely adding additional noise / jibblets around the logo. can you obtain the actual content of those clips ? unless your only method is through one of the capture methods mentioned above.
    I didn't record it. It was copied directly from my satellite box without re-encoding it.
    Quote Quote  
  30. Originally Posted by manono View Post
    No, and I was wrong....
    I crop and resize with RipBot264 to eliminate Black-Bars-Logos. (very easy to use), so the mp4 files stay as the original 1080 or 720...No Logo(s).
    Also:
    I fix my cropped videos made by VidCoder with RipBot264, to return them back to 1080 or 720 ...No quality lost either.

    Originally Posted by manono View Post
    ....The 5.0 version of XviD4PSP does allow complete freedom to edit the AviSynth script. Maybe it would be better for you to learn enough AviSynth to be able to do the things you want.
    I'm learning to use AviSynth Script, to remove the logos inside the video itself.
    Last edited by DJ_ValBec; 13th Feb 2015 at 16:26.
    Quote Quote